示例#1
0
    public void onLoginCancel()
    {
        Debug.Log("GamePotEventListener::onLoginCancel()");
        if (GamePotInterface != null)
        {
            GamePotInterface.onLoginCancel();
        }

        if (cbLogin != null)
        {
            cbLogin(NCommon.ResultLogin.CANCELLED);
            cbLogin = null;
        }
    }
示例#2
0
    public void onAppClose()
    {
        Debug.Log("GamePotEventListener::onAppClose()");


        if (cbLogin != null)
        {
            cbLogin(NCommon.ResultLogin.APP_CLOSE, null, null);
            cbLogin = null;
        }
        else
        {
            if (GamePotInterface != null)
            {
                GamePotInterface.onAppClose();
            }
        }
    }
示例#3
0
    public void onLoginFailure(string result)
    {
        Debug.Log("GamePotEventListener::onLoginFailure()-" + result);
        NError error = JsonMapper.ToObject <NError>(result);

        if (cbLogin != null)
        {
            cbLogin(NCommon.ResultLogin.FAILED, null, null, error);
            cbLogin = null;
        }
        else
        {
            if (GamePotInterface != null)
            {
                GamePotInterface.onLoginFailure(error);
            }
        }
    }
示例#4
0
    public void onLoginSuccess(string result)
    {
        Debug.Log("GamePotEventListener::onLoginSuccess-" + result);
        NUserInfo userInfo = JsonMapper.ToObject <NUserInfo>(result);

        if (cbLogin != null)
        {
            cbLogin(NCommon.ResultLogin.SUCCESS, userInfo);
            cbLogin = null;
        }
        else
        {
            if (GamePotInterface != null)
            {
                GamePotInterface.onLoginSuccess(userInfo);
            }
        }
    }
 /// <summary>
 /// Login (callback delegate)
 /// </summary>
 /// <param name="loginType">Login Type</param>
 /// <param name="callback"></param>
 public static void login(NCommon.LoginType loginType, GamePotCallbackDelegate.CB_Login cbLogin)
 {
     GamePotEventListener.cbLogin = cbLogin;
     login(loginType);
 }