Authored Unity primitive/object-model shim, VFX layer (control-flow-preserving, InstantVfx never invokes its action -- headless suppression), god-object stubs (GameMgr/EffectMgr/UIManager with faithfully-extracted nested enums), View/UI/Touch tree, LitJson+BetterList+Tuple copied, third-party stubs. Discovered Roslyn header-error masking: fixing class-header type errors unmasks body references, so the true copy closure is ~2570 files (was 782 under masking). Errors: masked-25720 -> 268; our shim files compile clean. Remaining: ~50 residual shim/external types, 24 NGUI UI-base overrides, static-type fixes, plus likely 1-2 more unmask waves.
78 lines
2.1 KiB
C#
78 lines
2.1 KiB
C#
using LitJson;
|
|
using Wizard;
|
|
|
|
namespace Cute;
|
|
|
|
public class GetiCloudUserDataTask : NetworkTask
|
|
{
|
|
private class iCloudUserParams : PostParams
|
|
{
|
|
public string icloud_data = "";
|
|
}
|
|
|
|
public class VerifiediCloudBackupUserData
|
|
{
|
|
public int iCloudViewerId { get; set; }
|
|
|
|
public string iCloudUserName { get; set; } = " - ";
|
|
|
|
public string UserRankRotation { get; set; }
|
|
|
|
public string UserRankUnlimited { get; set; }
|
|
|
|
public bool HasUserData()
|
|
{
|
|
return iCloudViewerId != 0;
|
|
}
|
|
|
|
public void Reset()
|
|
{
|
|
iCloudViewerId = 0;
|
|
iCloudUserName = " - ";
|
|
}
|
|
}
|
|
|
|
private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.CheckiCloudUser;
|
|
|
|
public static readonly VerifiediCloudBackupUserData VerifiediCloudUserData = new VerifiediCloudBackupUserData();
|
|
|
|
public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}";
|
|
|
|
public void SetParameter(string iCloudData)
|
|
{
|
|
iCloudUserParams iCloudUserParams = new iCloudUserParams();
|
|
iCloudUserParams.icloud_data = iCloudData;
|
|
base.Params = iCloudUserParams;
|
|
}
|
|
|
|
protected override int Parse()
|
|
{
|
|
if (resultCode != 1)
|
|
{
|
|
return resultCode;
|
|
}
|
|
JsonData jsonData = base.ResponseData["data"];
|
|
if (jsonData["icloud_data_verified"].ToBoolean())
|
|
{
|
|
VerifiediCloudUserData.iCloudViewerId = jsonData["icloud_viewer_id"].ToInt();
|
|
VerifiediCloudUserData.iCloudUserName = jsonData["icloud_name"].ToString();
|
|
string text = 1.ToString();
|
|
string text2 = 2.ToString();
|
|
SystemText systemText = Data.SystemText;
|
|
if (base.ResponseData["data"].Keys.Contains("rank") && base.ResponseData["data"]["rank"] != null)
|
|
{
|
|
JsonData jsonData2 = base.ResponseData["data"]["rank"];
|
|
if (jsonData2.Keys.Contains(text))
|
|
{
|
|
VerifiediCloudUserData.UserRankRotation = systemText.Get(jsonData2[text].ToString());
|
|
}
|
|
if (jsonData2.Keys.Contains(text2))
|
|
{
|
|
VerifiediCloudUserData.UserRankUnlimited = systemText.Get(jsonData2[text2].ToString());
|
|
}
|
|
}
|
|
}
|
|
return resultCode;
|
|
}
|
|
}
|