private static Packet UserRegistration(Packet p) { try { ClientAccountRegister packet = (ClientAccountRegister)p; Console.WriteLine(packet.ToString()); ServerAcknowledgementRegister response = new ServerAcknowledgementRegister(); response.login = packet.login; //Registration attempt if (User.Register(packet.login, packet.password)) { response.success = true; return(response); } else { response.success = false; return(response); } } catch (Exception e) { Console.WriteLine(e.ToString()); } return(null); }
private static Packet Register(Packet p) { ServerAcknowledgementRegister packet = (ServerAcknowledgementRegister)p; if (packet.success) { //Register logic + notification Console.WriteLine("User registered."); } return(null); }