public void onLoginCancel() { Debug.Log("GamePotEventListener::onLoginCancel()"); if (GamePotInterface != null) { GamePotInterface.onLoginCancel(); } if (cbLogin != null) { cbLogin(NCommon.ResultLogin.CANCELLED); cbLogin = null; } }
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(); } } }
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); } } }
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); }