Esempio n. 1
0
        /// <inheritdoc />
        public void RegisterNetworkHandler(INetworkHandler handler)
        {
            _log.Warn($"Plugin {handler.GetType().Assembly.FullName} registered a network handler. This system no longer works. Please alert the plugin author.");
            return;

            var handlerType = handler.GetType().FullName;
            var toRemove    = new List <INetworkHandler>();

            foreach (var item in _networkHandlers)
            {
                if (item.GetType().FullName == handlerType)
                {
                    //if (ExtenderOptions.IsDebugging)
                    _log.Error("Network handler already registered! " + handlerType);
                    toRemove.Add(item);
                }
            }

            foreach (var oldHandler in toRemove)
            {
                _networkHandlers.Remove(oldHandler);
            }

            _networkHandlers.Add(handler);
        }
Esempio n. 2
0
        /// <inheritdoc />
        public void RegisterNetworkHandler(INetworkHandler handler)
        {
            var handlerType = handler.GetType().FullName;
            var toRemove    = new List <INetworkHandler>();

            foreach (var item in _networkHandlers)
            {
                if (item.GetType().FullName == handlerType)
                {
                    //if (ExtenderOptions.IsDebugging)
                    _log.Error("Network handler already registered! " + handlerType);
                    toRemove.Add(item);
                }
            }

            foreach (var oldHandler in toRemove)
            {
                _networkHandlers.Remove(oldHandler);
            }

            _networkHandlers.Add(handler);
        }