public void RegisterButtonHandler() { if (!areFieldsEmpty()) { if (doPasswordMatch()) { if (isPasswordValid(_Password)) { if (IsValidEmail(_Email)) { string hash = Singleton.Instance.getHashFromString(_Password); MessagePacket packet = new MessagePacket(GameProtocol.CreateAccountPacketID(), _Username + "|" + hash + "|" + _Email); Singleton.Instance.Connection.SendPacket(packet.getData()); } else { _PopUpText.text = "Please anter a valid email!"; } } else { _PopUpText.text = "Password must have 6 characters or more!"; } } else { _PopUpText.text = "Both passwords must be same!"; } } else { _PopUpText.text = "Complete all fields please!"; } }