Exemplo n.º 1
0
        public void AddInnerServer(TcpClient tcpClient, bool autoConnect)
        {
            if (!tcpClient.Connected)
            {
                throw new ArgumentException("InnerServer not connected.");
            }
            InnerServer innerServer = null;

            for (int i = 0; i < this.serverList.Length; i++)
            {
                if (this.serverList[i] == null)
                {
                    this.serverList[i] = new InnerServer(this, tcpClient, i);
                    innerServer        = this.serverList[i];
                    break;
                }
            }
            if (innerServer == null)
            {
                throw new IndexOutOfRangeException("Server count limit exceed. Can't add more server.");
            }
            innerServer.Activate();
            if (autoConnect)
            {
                this.autoConnectServerList.Add(innerServer.ID);
            }
        }
Exemplo n.º 2
0
 internal void ProcessInnerServerDisconnect(InnerServer server)
 {
     for (int i = 0; i < 16384; i++)
     {
         this.clientList[i].CloseServer(server.ID);
     }
 }
Exemplo n.º 3
0
        internal void SendToServer(int id, Packet packet)
        {
            InnerServer innerServer = this.serverList[id];

            innerServer.Transmit(packet);
        }