// ------------------------------------------------------------------------------- // RequestConfirmUser // ------------------------------------------------------------------------------- public override bool RequestConfirmUser(NetworkConnection conn, string name, string password, int action = 1) { if (!base.RequestConfirmUser(conn, name, password)) { return(false); } UserConfirmRequestMessage message = new UserConfirmRequestMessage { username = name, password = GenerateHash(name, password) }; conn.Send(message); return(true); }
// ------------------------------------------------------------------------------- // OnUserConfirmRequestMessage // @Client -> @Server // ------------------------------------------------------------------------------- void OnUserConfirmRequestMessage(NetworkConnection conn, UserConfirmRequestMessage msg) { ServerResponseMessage message = new ServerResponseMessage { code = successCode, text = "", causesDisconnect = false }; if (DatabaseManager.singleton.TryUserConfirm(msg.username, msg.password)) { message.text = systemText.userConfirmSuccess; eventListener.onUserConfirm.Invoke(msg.username); } else { message.text = systemText.userConfirmFailure; message.code = errorCode; } conn.Send(message); }