static void server_OnDataReceived(eSClient client, byte[] buffer) { PacketReader pr = new PacketReader(buffer); Byte ID = pr.ReadByte(); if(ID == 1) { string message = pr.ReadString(); PacketWriter pw = new PacketWriter(); pw.WriteByte(ID); pw.WriteInt32(server.GetIDFromTcpClient(client.GetTcpClient())); pw.WriteString(message); server.SendToAll(pw.ToArray()); Console.WriteLine("Message received from " + client.GetID() + " : " + message); } }
private static void Server_OnClientDisconnected(eSClient client) { Log("Client disconnected with ID : " + client.GetID()); }
private static void Server_OnClientDisconnected(eSClient client) { Console.WriteLine("Client disconnected : " + client.GetID()); }
private static void Server_OnClientConnected(eSClient client) { Log("New client connected with ID : " + client.GetID()); }