private static void OnConnectionAccepted(ISocket client) { int num = Netplay.FindNextOpenClientSlot(); if (num != -1) { Netplay.Clients[num].Socket = client; Netplay.Clients[num].sendQueue.StartThread(); Console.WriteLine(client.GetRemoteAddress() + " is connecting to slot {0}...", num); } else { using (var stream = new MemoryStream()) { using (var writer = new BinaryWriter(stream)) { writer.Write((short)0); writer.Write((byte)2); writer.Write("Server is full."); short position = (short)writer.BaseStream.Position; writer.BaseStream.Position = 0L; writer.Write((short)position); byte[] data = stream.ToArray(); client.AsyncSend(data, 0, data.Length, delegate { }); } } client.Close(); } }
private static void OnConnectionAccepted(ISocket client) { int nextOpenClientSlot = Netplay.FindNextOpenClientSlot(); if (nextOpenClientSlot != -1) { Netplay.Clients[nextOpenClientSlot].Socket = client; Console.WriteLine((string)(object)client.GetRemoteAddress() + (object)" is connecting..."); } if (Netplay.FindNextOpenClientSlot() != -1) { return; } Netplay.StopListening(); }
// Token: 0x06000159 RID: 345 RVA: 0x0002AA6C File Offset: 0x00028C6C private static void OnConnectionAccepted(ISocket client) { int num = Netplay.FindNextOpenClientSlot(); if (num != -1) { Netplay.Clients[num].Reset(); Netplay.Clients[num].Socket = client; Console.WriteLine(Language.GetTextValue("Net.ClientConnecting", client.GetRemoteAddress())); } if (Netplay.FindNextOpenClientSlot() == -1) { Netplay.StopListening(); } }
private static void OnConnectionAccepted(ISocket client) { int num = Netplay.FindNextOpenClientSlot(); if (num != -1) { Netplay.Clients[num].Reset(); Netplay.Clients[num].Socket = client; Console.WriteLine(client.GetRemoteAddress() + " is connecting..."); } if (Netplay.FindNextOpenClientSlot() == -1) { Netplay.StopListening(); } }
private static void OnConnectionAccepted(ISocket client) { var nextOpenClientSlot = Netplay.FindNextOpenClientSlot(); if (nextOpenClientSlot != -1) { Netplay.Clients[nextOpenClientSlot].Reset(); Netplay.Clients[nextOpenClientSlot].Socket = client; Console.WriteLine(Language.GetTextValue("Net.ClientConnecting", (object)client.GetRemoteAddress())); } if (Netplay.FindNextOpenClientSlot() != -1) { return; } Netplay.StopListening(); }
private static void OnConnectionAccepted(ISocket client) { int nextOpenClientSlot = Netplay.FindNextOpenClientSlot(); if (nextOpenClientSlot != -1) { Netplay.Clients[nextOpenClientSlot].Reset(); Netplay.Clients[nextOpenClientSlot].Socket = client; } else { lock (Netplay.fullBuffer) Netplay.KickClient(client, NetworkText.FromKey("CLI.ServerIsFull")); } if (Netplay.FindNextOpenClientSlot() != -1) { return; } Netplay.StopListening(); Netplay.IsListening = false; }