private void dropClient(UserThread client) { client.Stop(); var disconnectPacket = new Packet(NetConstants.PacketTypes.UserLeft, client.GetBytes()); sendPacketToAllClients(disconnectPacket); }
public static Packet CreateServerToUserChatMessage(UserThread sender, string text) { var data = ConcatBytes(sender.GetBytes(), GetStringBytes(text)); return(new Packet(NetConstants.PacketTypes.ServerToUserChat, data)); }
public static Packet CreateUserLeftPacket(UserThread user) { return(new Packet(NetConstants.PacketTypes.UserLeft, user.GetBytes())); }