Пример #1
0
    /// <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;
 }
Пример #3
0
    /// <summary>
    /// 检测实名制状态(不触发实名制认证)
    /// </summary>
    private void TestRealNameStatus()
    {
        RealNameStatus = GetRealNameStatusFromSDK();

        isAdult = SDKManager.IsAdult();

        //上报服务器
        AskServerOnlineTime();
    }
Пример #4
0
    /// <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);
    }
Пример #5
0
    /// <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);
    }
Пример #6
0
 public static void RequestRealName(RealNameStatus l_realNameStatus, bool l_isAdult)
 {
     JsonMessageProcessingController.SendMessage(new RequestRealNameState2Server(l_realNameStatus, l_isAdult));
 }
Пример #7
0
 public RequestRealNameState2Server(RealNameStatus realNameStatus, bool isAdult)
 {
     this.realNameStatus = realNameStatus;
     this.isAdult        = isAdult;
 }
Пример #8
0
 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));
    }