Esempio n. 1
0
        public bool Remove(uint ip, ushort port)
        {
            CServer server = this[ip, port];

            if (server != null)
            {
                InnerList.Remove(server);
                CKernel.DeleteServer(ip, port);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Delete all servers where connection failed too often.
        /// </summary>
        private void m_DeleteFailedServers()
        {
            CServer server;
            int     deleted = 0;

            for (int i = 0; i != this.Count; i++)
            {
                server = (CServer)this[i];
                if (server.Fails >= CKernel.Preferences.GetShort("MaxServerFails"))
                {
                    if (server != ActiveServer)
                    {
                        this.RemoveAt(i);
                        CKernel.DeleteServer(server.IP, server.Port);
                        deleted++;
                    }
                }
            }
            CLog.Log(Constants.Log.Info, "SRV_DELETED", deleted);
        }