Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
 private static void Server_OnClientDisconnected(eSClient client)
 {
     Log("Client disconnected with ID : " + client.GetID());
 }
Beispiel #3
0
 private static void Server_OnClientDisconnected(eSClient client)
 {
     Console.WriteLine("Client disconnected : " + client.GetID());
 }
Beispiel #4
0
 private static void Server_OnClientConnected(eSClient client)
 {
     Log("New client connected with ID : " + client.GetID());
 }