/// <summary> /// SDK 实名制认证回调 /// </summary> /// <param name="info"></param> private void OnRealNameCallBack(RealNameData info) { Debug.Log("OnRealNameCallBack" + info.realNameStatus + " isAdult:" + info.isAdult); RealNameStatus = info.realNameStatus; isAdult = info.isAdult; }
public RealNameData(bool canPlay, RealNameStatus realNameStatus, bool isAdult, int onlineTime, bool isNight) { this.realNameStatus = realNameStatus; this.onlineTime = onlineTime; this.canPlay = canPlay; this.isNight = isNight; this.isAdult = isAdult; }
/// <summary> /// 检测实名制状态(不触发实名制认证) /// </summary> private void TestRealNameStatus() { RealNameStatus = GetRealNameStatusFromSDK(); isAdult = SDKManager.IsAdult(); //上报服务器 AskServerOnlineTime(); }
/// <summary> /// 询问服务器在线时间,触发检测 /// </summary> private void AskServerOnlineTime() { //未实名制,再询问一下sdk if (RealNameStatus != RealNameStatus.IsRealName || !isAdult) { RealNameStatus = GetRealNameStatusFromSDK(); isAdult = SDKManager.IsAdult(); } Debug.LogWarning("AskServerOnlineTime" + RealNameStatus + isAdult); RequestRealNameState2Server.RequestRealName(RealNameStatus, isAdult); }
/// <summary> /// 从SDK 获取实名制状态,并缓存 /// </summary> /// <returns></returns> private RealNameStatus GetRealNameStatusFromSDK() { if (!openRealName) { RealNameStatus = RealNameStatus.NotNeed; } else { RealNameStatus = SDKManager.GetRealNameType(); } Debug.Log("GetRealNameStatusFromSDK :openRealName " + openRealName + " realNameStatus:" + RealNameStatus); return(RealNameStatus); }
public static void RequestRealName(RealNameStatus l_realNameStatus, bool l_isAdult) { JsonMessageProcessingController.SendMessage(new RequestRealNameState2Server(l_realNameStatus, l_isAdult)); }
public RequestRealNameState2Server(RealNameStatus realNameStatus, bool isAdult) { this.realNameStatus = realNameStatus; this.isAdult = isAdult; }
private void OnLogoutEvent(UserLogout2Client t) { SDKManager.RealNameLogout(); RealNameStatus = RealNameStatus.NotNeed;//已经登出,停止检测 }
static public void Dispatch(int l_onlineTime, bool l_isNight, bool l_canPlay, RealNameStatus l_realNameStatus, bool l_isAdult) { RealNameData realNameData = new RealNameData(l_canPlay, l_realNameStatus, l_isAdult, l_onlineTime, l_isNight); GlobalEvent.DispatchTypeEvent(new RealNameLimitEvent(realNameData)); }