95 lines
2.3 KiB
C#
95 lines
2.3 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using BestHTTP;
|
|
using DragonLi.Core;
|
|
using Mirror;
|
|
using Unity.XR.PXR;
|
|
using UnityEngine;
|
|
using Valheim;
|
|
using XUI;
|
|
|
|
/// <summary>
|
|
/// 鉴权信息
|
|
/// </summary>
|
|
public class AuthInfo
|
|
{
|
|
public string deviceSn = "";
|
|
public int dur = 0;
|
|
public string endAt = "";
|
|
public int paid = 0;
|
|
public string startAt = "";
|
|
public int type = 0;
|
|
public string uuid = "";
|
|
}
|
|
|
|
public class ResponseInfo
|
|
{
|
|
public int status = 400;
|
|
public string message = "";
|
|
public string data = "";
|
|
}
|
|
|
|
public class ConfInfo
|
|
{
|
|
public string createdAt;
|
|
public string data;
|
|
}
|
|
|
|
public class ConfResponseInfo
|
|
{
|
|
public int status = 400;
|
|
public string message = "";
|
|
public ConfInfo data = new ConfInfo();
|
|
}
|
|
|
|
public class AuthorPanel : UIBehaviour
|
|
{
|
|
public Common.State PanelState;
|
|
|
|
public static void Show()
|
|
{
|
|
WorldUIManager.Ins.Cover("UI/AuthorPanel", false);
|
|
}
|
|
|
|
public void Start()
|
|
{
|
|
#if !UNITY_EDITOR && UNITY_ANDROID && PICO
|
|
PXR_Enterprise.InitEnterpriseService();
|
|
PXR_Enterprise.BindEnterpriseService();
|
|
#endif
|
|
// MonoSingleton<CoroutineTaskManager>.Instance.WaitSecondTodo(() =>
|
|
// {
|
|
// // 鉴权
|
|
// GameLocal.Ins.RequestAuth((req, response) =>
|
|
// {
|
|
// if (response == null)
|
|
// {
|
|
// Debug.Log("鉴权失败");
|
|
// PanelState.StateChange(1);
|
|
// return;
|
|
// }
|
|
// ResponseInfo info = JsonUtility.FromJson<ResponseInfo>(response.DataAsText);
|
|
// if (info.status < 200 || info.status >= 300)
|
|
// {
|
|
// Debug.Log("鉴权失败");
|
|
// PanelState.StateChange(1);
|
|
// return;
|
|
// }
|
|
// Debug.Log("鉴权成功");
|
|
// if (MRNetworkManager.Ins.mode == NetworkManagerMode.Host)
|
|
// {
|
|
// // GameManager.Ins.CreateMap();
|
|
// }
|
|
// else if (MRNetworkManager.Ins.mode == NetworkManagerMode.ClientOnly)
|
|
// {
|
|
// HUDPanel.Show();
|
|
// WorldUIManager.Ins.Back();
|
|
// }
|
|
WorldUIManager.Ins.Back();
|
|
// HUDPanel.Show();
|
|
// });
|
|
// }, 1);
|
|
}
|
|
}
|