/// <summary> /// 获取模拟登录态 /// </summary> /// <returns>The login data.</returns> /// <param name="channel">渠道</param> public static string GetLoginData(int methodId, string channel = "", string subChannel = "") { string filePath = dataFilePath + channel + subChannel + "LoginData.txt"; string data = GetData(filePath); if (!string.IsNullOrEmpty(channel) && !string.IsNullOrEmpty(data)) { WriteLoginData(data); } if (!string.IsNullOrEmpty(data)) { try { // 伪造登录,使用特殊Token,到后台校验,目前token是所有游戏一样,后续改造 MSDKLoginRet ret = new MSDKLoginRet(data); ret.MethodNameId = methodId; ret.Token = "MSDKLOGINMOCKER_51433213c2e72a6304fb805b10a2201d"; data = ret.ToString(); } catch (System.Exception e) { MSDKLog.Log("Wrong MSDKLoginRet data " + data); MSDKLog.Log(e.StackTrace); } } return(data); }
internal static void OnConnectRet(string json) { MSDKLog.Log("OnConnectRet json= " + json); if (ConnectRetEvent != null) { var ret = new MSDKLoginRet(json); try { ConnectRetEvent(ret); } catch (Exception e) { MSDKLog.LogError(e.StackTrace); } } else { MSDKLog.LogError("No callback for ConnectRetEvent !"); } }
public virtual void onConnectRetEvent(MSDKLoginRet ret) { ConnectRetEvent(ret); }
public virtual void onLoginRetEvent(MSDKLoginRet ret) { LoginRetEvent(ret); }