示例#1
0
    private void CreateAccount(int cnnId, int channelId, int recHostId, Net_CreateAccount ca)
    {
        Net_CreateAccountResponse resp = new Net_CreateAccountResponse();

        resp.success = db.CreateAccount(ca.Username, ca.Password, ca.Email);
        SendClient(recHostId, cnnId, channelId, resp);
    }
示例#2
0
    internal void receiveCreateAccountResponse(Net_CreateAccountResponse msg)
    {
        switch (msg.success)
        {
        case CreateAccountResponseCode.success:
            createAccountInfoText.text  = "Login successful";
            createAccountInfoText.color = Color.green;
            break;

        case CreateAccountResponseCode.emailAlreadyUsed:
            createAccountInfoText.text  = "This email already has an associated account";
            createAccountInfoText.color = Color.red;
            break;

        case CreateAccountResponseCode.invalidEmail:
            createAccountInfoText.text  = "Invalid email";
            createAccountInfoText.color = Color.red;
            break;

        case CreateAccountResponseCode.invalidUsername:
            createAccountInfoText.text  = "Invalid username";
            createAccountInfoText.color = Color.red;
            break;

        case CreateAccountResponseCode.overUsedUsername:
            createAccountInfoText.text  = "Popular username. Consider a different username";
            createAccountInfoText.color = Color.red;
            break;
        }
        unlockUI();
    }