예제 #1
0
        private void dropClient(UserThread client)
        {
            client.Stop();
            var disconnectPacket = new Packet(NetConstants.PacketTypes.UserLeft, client.GetBytes());

            sendPacketToAllClients(disconnectPacket);
        }
예제 #2
0
        public static Packet CreateServerToUserChatMessage(UserThread sender, string text)
        {
            var data = ConcatBytes(sender.GetBytes(), GetStringBytes(text));

            return(new Packet(NetConstants.PacketTypes.ServerToUserChat, data));
        }
예제 #3
0
 public static Packet CreateUserLeftPacket(UserThread user)
 {
     return(new Packet(NetConstants.PacketTypes.UserLeft, user.GetBytes()));
 }