// ------------------------------------------------------------------------------- // RequestUserConfirm // @Client // ------------------------------------------------------------------------------- protected override bool RequestUserConfirm(NetworkConnection conn, string name, string password, int action = 1) { if (!base.RequestUserConfirm(conn, name, password)) { return(false); } ClientMessageRequestUserConfirm message = new ClientMessageRequestUserConfirm { username = name, password = GenerateHash(name, password) }; conn.Send(message); return(true); }
// ------------------------------------------------------------------------------- // OnClientMessageRequestUserConfirm // @Client -> @Server // ------------------------------------------------------------------------------- void OnClientMessageRequestUserConfirm(NetworkConnection conn, ClientMessageRequestUserConfirm msg) { ServerMessageResponseUserConfirm message = new ServerMessageResponseUserConfirm { success = true, text = "", causesDisconnect = false }; if (DatabaseManager.singleton.TryUserConfirm(msg.username, msg.password)) { message.text = systemText.userConfirmSuccess; } else { message.text = systemText.userConfirmFailure; message.success = false; } conn.Send(message); }