Ejemplo n.º 1
0
    public void OnLoginFailed(UInt16 failedcode)
    {
        ServerErrorCodeCfg cfg = ConfigManager.Get <ServerErrorCodeLoader>().GetConfig((int)failedcode);

        if (cfg == null)
        {
            return;
        }

        EmitNumberManager.Emit(EmitNumberType.EmitNumberTypeServerErrorCode, cfg.Error);
    }
Ejemplo n.º 2
0
    private void OnLoginClick(EventContext ec)
    {
        string usename  = GetTextInput("user_name");
        string password = GetTextInput("pass_word");

        if (string.IsNullOrEmpty(usename) || string.IsNullOrEmpty(password))
        {
            EmitNumberManager.Emit(EmitNumberType.EmitNumberTypeServerErrorCode, "帐号密码为空,不能登录.");
            return;
        }

        PlayerPrefs.SetString(LoginState.PlayerPrefs_Account, usename);
        PlayerPrefs.SetString(LoginState.PlayerPrefs_Password, password);

        KBEngine.Event.fireIn("login", usename, password, System.Text.Encoding.UTF8.GetBytes("ChessWarrior"));
    }