public static string GetUserUniId() { if (GameDefines.OutputVerDefs == OutputVersionDefs.Nd91iPhone) { return(U3dNdSender.GetUserUniqId()); } else if (GameDefines.OutputVerDefs == OutputVersionDefs.Nd91Android) { return(NdSDKAgent.GetUserUniqId()); } else if (GameDefines.OutputVerDefs == OutputVersionDefs.GfanAndroid) { return(U3dGfanSender.GetUserUniqId()); } else { return(UserUniqId); } return(""); }
public void loginNotify(string args) { ParseReceiveParams(args); // result it 1 = success or 0 = fail string result = GetReceiveParam(KeyResult); string error = GetReceiveParam(KeyError); Debug.Log("[U3d2NdReceiver]: loginNotify------------------- the result is " + result); Debug.Log("[U3d2NdReceiver]: loginNotify------------------- the error is " + error); if (U3dNdSender.IsLogined()) { if (string.IsNullOrEmpty(ThirdPartyPlatform.CacheUserUniqId)) { // First login ThirdPartyPlatform.OnLogin(IsSuccess()); Debug.Log("first login id is " + ThirdPartyPlatform.CacheUserUniqId); } else if (!U3dNdSender.GetUserUniqId().Equals(ThirdPartyPlatform.CacheUserUniqId)) { // User switch account TalkingDataGA.Logout(); Globals.Instance.Restart(); Debug.Log("switch account login id is " + ThirdPartyPlatform.CacheUserUniqId); } else { ThirdPartyPlatform.OnLogin(IsSuccess()); } ThirdPartyPlatform.CacheUserUniqId = U3dNdSender.GetUserUniqId(); } else { if (!string.IsNullOrEmpty(ThirdPartyPlatform.CacheUserUniqId)) { // Logout event TalkingDataGA.Logout(); Globals.Instance.Restart(); Debug.Log("Log out id is " + ThirdPartyPlatform.CacheUserUniqId); } else { // Not login // if (Globals.Instance.MGUIManager) // { // string wordText = Globals.Instance.MDataTableManager.GetWordText(23200001); // "Confirm quit game"; // Globals.Instance.MGUIManager.CreateGUIDialog(delegate(GUIDialog gui) // { // gui.SetTextAnchor(ETextAnchor.MiddleCenter,false); // gui.SetDialogType(EDialogType.QUIT_GAME, wordText); // } // , EDialogStyle.DialogOkCancel // ); // } // Logout event TalkingDataGA.Logout(); Globals.Instance.Restart(); } ThirdPartyPlatform.CacheUserUniqId = ""; ThirdPartyPlatform.UserUniqId = ""; ThirdPartyPlatform.SessionId = ""; ThirdPartyPlatform.NickName = ""; } }