private void LoginRequest(int cnnId, int channelId, int recHostId, Net_LoginRequest msg) { string randomToken = AccountUtils.GenerateRandomString(256); Model_Account account = db.LoginAccount(msg.UsernameOrEmail, msg.Password, cnnId, randomToken); Net_LoginRequestResponse response = new Net_LoginRequestResponse(); if (account != null) { // login was successful response.success = 0; response.information = "Login was successful!"; response.connectionId = cnnId; response.token = randomToken; response.username = account.Username; response.discriminator = account.Discriminator; } else { // login was not successful response.success = 1; response.information = "Login attempt failed"; } SendClient(recHostId, cnnId, channelId, response); // let the client know if their login attempt was successful or not }
public void receiveLoginResponse(Net_LoginRequestResponse lrr) { Debug.Log("Server says " + lrr.information); Rect r = new Rect(1, 1, 100, 100); unlockUI(); throw new NotImplementedException(); }
private void LoginRequestResponse(Net_LoginRequestResponse lrr) { LoginScene.Instance.receiveLoginResponse(lrr); }