public static void HandlePacketNick(Client client, Net.Paket.NickPaket np) { var nickClient = client.Server.GetClientByNickname(np.Nickname.ToUpper()); if(nickClient != null) { client.SendPacket(new NickNameInUseResponse {NickName = np.Nickname}); return; } client.ClientInfo.Nickname = np.Nickname; client.Server.Nicknames.Add(np.Nickname.ToUpper(), client); RegisterUser(client); }
private static void RegisterUser(Client client) { if(client.ClientInfo.IsRegistered && client.ClientInfo.Nickname != null) client.SendPacket(new WelcomeResponse {Host = client.ClientInfo.Host, Nickname = client.ClientInfo.Nickname, Username = client.ClientInfo.Username}); }