internal void Open(int serverID, int clientID) { OuterClient outerClient = this.clientList[this.GetClientIndex(clientID)]; if (outerClient.ID == clientID) { outerClient.OpenServer(serverID); } }
public void AddOuterClient(TcpClient tcpClient) { if (!tcpClient.Connected) { throw new ArgumentException("OuterClient not connected."); } if (this.clientHeadIndex == -1) { throw new IndexOutOfRangeException("Client count limit exceed. Can't add more client."); } OuterClient outerClient = this.clientList[this.clientHeadIndex]; outerClient.Activate(tcpClient); this.clientCount++; for (int i = 0; i < this.autoConnectServerList.Count; i++) { outerClient.OpenServer(this.autoConnectServerList[i]); } this.clientHeadIndex = outerClient.NextIndex; if (this.clientHeadIndex == -1) { this.clientTailIndex = -1; } }