engine cleanup passes 4-7 + multi-instancing ambient rip
Squashes 146 commits from battle-engine-extraction. Net: 2,045 files changed, +11,896 / -158,687 lines. Ships engine passes 4-7 (dead-code cull, view-layer stub, receive-path shrink) plus the Phase-5 AsyncLocal ambient deletion that turns concurrent battles into a type-system property rather than a scope contract. ## What landed **Passes 4-7 (chunks 1-34):** Extended the Phase-4 const-false collapse into a cascading cull across the skill graph, view layer, and receive-path periphery. Six mode flags (IsWatchBattle/IsReplayBattle/IsAdmin/IsAdminWatch/IsPuzzleQuest/ IsAINetwork) became `const false`, every guarded block deleted. Field*.cs subclass ctors + BackGroundBase + ObjectChecker culled to no-ops. Mulligan family reworked to take a mgr param through IMulliganMgr.InitMulligan. Emotion/Recovery/Resource clusters null-stubbed. Prediction/OperationSimulator/ skill filters converted from static ambient reads to per-mgr reads via SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr / ins.BattleMgr / this.BattleMgr. **Phase-5 ambient rip (chunks 35-47):** Deleted BattleAmbient / BattleAmbient- Context / TestBattleScope in full. Every per-battle mutable slot now lives on the mgr instance itself: mgr.InstanceIsForecast / InstanceIsRandomDraw / InstanceRecoveryInfo / InstanceViewerId / InstanceNetworkAgent / GameMgr BattleManagerBase.GetIns() returns null unconditionally; the residual static flags + 3 façades (Certification.ViewerId, Data.BattleRecoveryInfo, ToolboxGame.RealTimeNetworkAgent) are null-tolerant defaults kept for the handful of engine-internal readers that still reference their types. Zero BattleAmbient references anywhere in engine + node + tests. Added pre-seeded GameMgr ctor overload threaded through the mgr chain (BattleManagerBase → SingleBattleMgr / NetworkBattleManagerBase → NetworkStandard- BattleMgr → HeadlessBattleMgr / HeadlessNetworkBattleMgr). Fixtures build a GameMgr, seed it via HeadlessEngineEnv.SeedCharaIds/SeedNetUser, and pass it to the mgr's ctor — no ambient reach. Node side (SVSim.BattleNode/SessionBattleEngine): _ctx replaced with a plain GameMgr field; 34 `using var _ambient = BattleAmbient.Enter(_ctx)` scope wraps ripped from every accessor and mutator; EngineGlobalInit.WirePerSessionGameMgr takes GameMgr as a param and runs from SessionBattleEngine.SetupInternal BEFORE mgr construction. Test side: TestBattleScope deleted; 18 fixture [SetUp]s migrated to `HeadlessEngineEnv.EnsureProcessGlobals()`; MultiInstanceEngineTests rewritten around per-mgr construction (GetIns() → null is the pinned invariant). ## Regression fixes - **chunk-48** (MulliganCtrl): chunk-35's `= null` stubs on card lookups broke the live receive-driven Deal path (BattlePlayerBase.DrawCard NRE'd downstream of NetworkPlayerMulliganCtrl.StartMulliganVfx). Restored the three lookups via `_battlePlayer.BattleMgr.GetBattleCardIdx`. Engine tests were satisfied by the WireMulliganPhase seam; unit tests exposed the live-path gap. ## Ship state - SVSim.BattleEngine.Tests: 56/56 pass, 2 skip - SVSim.UnitTests: 1554/1554 pass (was 1523/31-fail before chunk 48) - Solution build: 0 source warnings (40 pre-existing NU1902 MessagePack CVEs in SVSim.EmulatedEntrypoint, unrelated) - Sequential PVP smoke: verified live (two back-to-back battles, no regression on cleanup/spinup) - Concurrent PVP smoke: verified live Adds tools/engine-port/ClosureAnalyzer/ — the Roslyn transitive-type-closure analyzer needed to make future cascade cleanup safe (per feedback memory "Engine cleanup needs closure tool" from the 2026-06-28 pass-3 failure). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -27,35 +27,4 @@ public static class AchievementManager
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void ProceedAchievement(string id, float value)
|
||||
{
|
||||
Social.ReportProgress(id, value, delegate(bool success)
|
||||
{
|
||||
if (mCallback != null)
|
||||
{
|
||||
mCallback.OnProceedAchievement(success);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void ResetAchievements(Action<bool> callback)
|
||||
{
|
||||
}
|
||||
|
||||
public static void LoadAchievements()
|
||||
{
|
||||
if (mCallback != null)
|
||||
{
|
||||
Social.LoadAchievements(mCallback.OnLoadAchievements);
|
||||
}
|
||||
}
|
||||
|
||||
public static void LoadAchievementDescriptions()
|
||||
{
|
||||
if (mCallback != null)
|
||||
{
|
||||
Social.LoadAchievementDescriptions(mCallback.OnLoadAchievementDescriptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
namespace Cute;
|
||||
|
||||
public static class AdjustManager
|
||||
{
|
||||
private const string _viewerIDEventToken = "qxq65x";
|
||||
|
||||
private const string _tutorialEventToken = "wlojkf";
|
||||
|
||||
private const string _paymentEventToken = "sgqjsc";
|
||||
|
||||
public static void ViewerIDEvent()
|
||||
{
|
||||
}
|
||||
|
||||
public static void TutorialCompleteEvent()
|
||||
{
|
||||
}
|
||||
|
||||
public static void PaymentEvent(double price, string currencycode, string transactionId, string itemTitle, string productId)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -7,13 +7,9 @@ public class AssetErrorState
|
||||
public enum Code
|
||||
{
|
||||
NONE = 0,
|
||||
SERVER_TIMEOUT = 1,
|
||||
SERVER_UNDEFINED_ERROR = 2,
|
||||
LOCAL_CAPACITY_OVER = 4,
|
||||
CANCELED = 8,
|
||||
FILE_READ_ERROR = 0x10,
|
||||
SERVER_NOT_FOUND_ERROR = 0x20
|
||||
}
|
||||
FILE_READ_ERROR = 0x10 }
|
||||
|
||||
public enum DialogDecision
|
||||
{
|
||||
@@ -35,21 +31,11 @@ public class AssetErrorState
|
||||
return errorFlag != 0;
|
||||
}
|
||||
|
||||
public bool HasError(Code code)
|
||||
{
|
||||
return ((uint)errorFlag & (uint)code) != 0;
|
||||
}
|
||||
|
||||
public void SetCanceled()
|
||||
{
|
||||
canceled = true;
|
||||
}
|
||||
|
||||
public int ErrorCount()
|
||||
{
|
||||
return errors.Count;
|
||||
}
|
||||
|
||||
public AssetErrorState()
|
||||
{
|
||||
Reset();
|
||||
@@ -64,15 +50,6 @@ public class AssetErrorState
|
||||
}
|
||||
}
|
||||
|
||||
public Code Query(string filename)
|
||||
{
|
||||
if (!errors.TryGetValue(filename, out var value))
|
||||
{
|
||||
return Code.NONE;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
errorFlag = 0;
|
||||
|
||||
@@ -37,30 +37,12 @@ public class AssetHandle
|
||||
|
||||
private string _cryptFilename;
|
||||
|
||||
private const byte MultipleHandleIgnor = 2;
|
||||
|
||||
private const byte SubManifest = 4;
|
||||
|
||||
private byte _HandleAttribute;
|
||||
|
||||
private const float BACKGROUND_DOWNLOAD_WAIT_BEFORE_RETRY_SECONDS = 5f;
|
||||
|
||||
private Action phase;
|
||||
|
||||
private RequestType requestType;
|
||||
|
||||
public const int MANIFEST_INDEX_FILE_NAME = 0;
|
||||
|
||||
public const int MANIFEST_INDEX_DATA_HASH = 1;
|
||||
|
||||
private const int MANIFEST_INDEX_CATEGORY = 2;
|
||||
|
||||
private const int MANIFEST_INDEX_FILE_SIZE = 3;
|
||||
|
||||
private const int MANIFEST_INDEX_SMALL_HASH = 4;
|
||||
|
||||
private const int MANIFEST_INDEX_SMALL_SIZE = 5;
|
||||
|
||||
public string manifestDataHash { get; set; }
|
||||
|
||||
public string SmallDataHash { get; private set; }
|
||||
@@ -305,14 +287,6 @@ public class AssetHandle
|
||||
ManifestSmallDataSize = ((!flag2) ? 0.1f : result2);
|
||||
}
|
||||
|
||||
private void PhaseNone()
|
||||
{
|
||||
if (requestType != RequestType.None)
|
||||
{
|
||||
Debug.LogError("need initialize");
|
||||
}
|
||||
}
|
||||
|
||||
private void PhaseIdle()
|
||||
{
|
||||
if (requestType == RequestType.Download)
|
||||
@@ -514,7 +488,7 @@ public class AssetHandle
|
||||
dialogBase.SetReturnMsg(UIManager.GetInstance().gameObject, "CommonRetry", "CommonResetGame");
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_GrayBtn);
|
||||
dialogBase.SetButtonText(Data.SystemText.Get("Battle_0301"), Data.SystemText.Get("System_0006"));
|
||||
dialogBase.ClickSe_Btn2 = Se.TYPE.SYS_BTN_CANCEL_TRANS;
|
||||
dialogBase.ClickSe_Btn2 = 0;
|
||||
dialogBase.SetPanelDepth(6000);
|
||||
}
|
||||
UIManager.GetInstance().isNoAvailMemory = true;
|
||||
@@ -656,7 +630,7 @@ public class AssetHandle
|
||||
dialogBase2.SetReturnMsg(UIManager.GetInstance().gameObject, "CommonResetGame", "CommonResetGame", "CommonResetGame", "CommonResetGame");
|
||||
dialogBase2.SetButtonLayout(DialogBase.ButtonLayout.GrayBtn);
|
||||
dialogBase2.SetButtonText(Data.SystemText.Get("System_0006"));
|
||||
dialogBase2.ClickSe_Btn1 = Se.TYPE.SYS_BTN_CANCEL_TRANS;
|
||||
dialogBase2.ClickSe_Btn1 = 0;
|
||||
dialogBase2.SetPanelDepth(6000);
|
||||
}
|
||||
UIManager.GetInstance().isNoAvailMemory = true;
|
||||
@@ -711,11 +685,9 @@ public class AssetHandle
|
||||
case AssetType.TemporarySound:
|
||||
if (filename.Substring(filename.Length - 4).Equals(".awb"))
|
||||
{
|
||||
Toolbox.AudioManager.RemoveCueSheet(filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
Toolbox.AudioManager.AddCueSheet(filename, Path.GetFileName(filename), directory);
|
||||
}
|
||||
Toolbox.AssetManager.AddLoadingCurrentCount(filename);
|
||||
break;
|
||||
@@ -841,124 +813,6 @@ public class AssetHandle
|
||||
Fin();
|
||||
}
|
||||
|
||||
private IEnumerator _LoadStreamingAsset()
|
||||
{
|
||||
if (requestContext != null)
|
||||
{
|
||||
Utility.LeanSemaphore semaphore = requestContext.semaphore;
|
||||
if (semaphore != null)
|
||||
{
|
||||
AssetErrorState errorState = requestContext.errorState;
|
||||
while (!semaphore.TryWait())
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
if (errorState != null && errorState.canceled)
|
||||
{
|
||||
errorState.Report(filename, AssetErrorState.Code.CANCELED);
|
||||
Fin();
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (assetType == AssetType.Manifests)
|
||||
{
|
||||
_LoadPostProcess();
|
||||
Fin();
|
||||
yield break;
|
||||
}
|
||||
Toolbox.AssetManager.AddLoadingCurrentCount(filename);
|
||||
if (assetType == AssetType.AssetBundle && ++reference == 1)
|
||||
{
|
||||
int RetryCount = 0;
|
||||
while (true)
|
||||
{
|
||||
string errorMessage = "";
|
||||
string localCachePath = BuildLocalCachePath();
|
||||
using (UnityWebRequest www = UnityWebRequest.Get(localCachePath))
|
||||
{
|
||||
if (www == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
yield return www.SendWebRequest();
|
||||
bool isTimeOut = false;
|
||||
float noProgressTime = Time.realtimeSinceStartup;
|
||||
float oldProgress = 0f;
|
||||
float timeOut = 30f;
|
||||
while (!www.isDone)
|
||||
{
|
||||
float downloadProgress = www.downloadProgress;
|
||||
if (downloadProgress <= oldProgress)
|
||||
{
|
||||
if (Time.realtimeSinceStartup - noProgressTime > timeOut)
|
||||
{
|
||||
isTimeOut = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
oldProgress = downloadProgress;
|
||||
noProgressTime = Time.realtimeSinceStartup;
|
||||
}
|
||||
yield return null;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(www.error) || isTimeOut)
|
||||
{
|
||||
string text = errorMessage + " : " + localCachePath;
|
||||
Debug.LogError("_LoadStreamingAsset 01 load error:" + text);
|
||||
Toolbox.AssetManager.AddLoadingCurrentCount(filename);
|
||||
if (RetryCount > 5)
|
||||
{
|
||||
Fin();
|
||||
disposeWebRequest(www);
|
||||
yield break;
|
||||
}
|
||||
RetryCount++;
|
||||
disposeWebRequest(www);
|
||||
continue;
|
||||
}
|
||||
AssetBundle content = DownloadHandlerAssetBundle.GetContent(www);
|
||||
if (content == null)
|
||||
{
|
||||
string text2 = errorMessage + " : " + localCachePath;
|
||||
Debug.LogError("_LoadStreamingAsset02 load error:" + text2);
|
||||
Toolbox.AssetManager.AddLoadingCurrentCount(filename);
|
||||
Fin();
|
||||
disposeWebRequest(www);
|
||||
yield break;
|
||||
}
|
||||
Toolbox.AssetManager.SetAssetBundle(filename, content, isMultipleHandleIgnorAsset);
|
||||
AssetBundle assetBundle = Toolbox.AssetManager.GetAssetBundleObject(filename).assetBundle;
|
||||
string[] allAssetNames = assetBundle.GetAllAssetNames();
|
||||
UnityEngine.Object[] array = assetBundle.LoadAllAssets();
|
||||
int num = allAssetNames.Length;
|
||||
int num2 = array.Length;
|
||||
List<AssetObject> list = new List<AssetObject>();
|
||||
for (int i = 0; i < num2; i++)
|
||||
{
|
||||
for (int j = 0; j < num; j++)
|
||||
{
|
||||
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(allAssetNames[j]);
|
||||
if (array[i].name.ToLower().Equals(fileNameWithoutExtension.ToLower()))
|
||||
{
|
||||
string path = Path.ChangeExtension(allAssetNames[j], ".any");
|
||||
list.Add(new AssetObject(path, array[i]));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Toolbox.AssetManager.SetObjectList(filename, list);
|
||||
disposeWebRequest(www);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
_LoadPostProcess();
|
||||
Fin();
|
||||
}
|
||||
|
||||
private void _LoadCancel()
|
||||
{
|
||||
}
|
||||
@@ -986,60 +840,6 @@ public class AssetHandle
|
||||
}
|
||||
if (IsSound())
|
||||
{
|
||||
Toolbox.AudioManager.RemoveCueSheet(filename);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool _UnloadTemporary()
|
||||
{
|
||||
if (--reference == 0)
|
||||
{
|
||||
if (assetType == AssetType.AssetBundle)
|
||||
{
|
||||
if (unloadTemporary)
|
||||
{
|
||||
Toolbox.AssetManager.UnloadAssetBundle(filename);
|
||||
unloadTemporary = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int num = reference + 1;
|
||||
reference = num;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (reference < 0)
|
||||
{
|
||||
reference = 0;
|
||||
}
|
||||
if (IsSound())
|
||||
{
|
||||
Toolbox.AudioManager.RemoveCueSheet(filename);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool _UnloadCommon()
|
||||
{
|
||||
if (--reference == 0)
|
||||
{
|
||||
if (assetType == AssetType.AssetBundle)
|
||||
{
|
||||
if (unloadCommon)
|
||||
{
|
||||
Toolbox.AssetManager.UnloadAssetBundle(filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
int num = reference + 1;
|
||||
reference = num;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (reference < 0)
|
||||
{
|
||||
reference = 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -1057,19 +857,6 @@ public class AssetHandle
|
||||
action?.Invoke(this);
|
||||
}
|
||||
|
||||
public bool Download(AssetRequestContext requestContext)
|
||||
{
|
||||
requestType = RequestType.Download;
|
||||
this.requestContext = requestContext;
|
||||
phase();
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Download(Action<AssetHandle> callback)
|
||||
{
|
||||
return Download(new AssetRequestContext(callback));
|
||||
}
|
||||
|
||||
public void Unload()
|
||||
{
|
||||
if (_Unload())
|
||||
@@ -1079,24 +866,6 @@ public class AssetHandle
|
||||
requestType = RequestType.None;
|
||||
}
|
||||
|
||||
public void UnloadCommon()
|
||||
{
|
||||
if (_UnloadCommon())
|
||||
{
|
||||
phase = PhaseIdle;
|
||||
}
|
||||
requestType = RequestType.None;
|
||||
}
|
||||
|
||||
public void UnloadTemporary()
|
||||
{
|
||||
if (_UnloadTemporary())
|
||||
{
|
||||
phase = PhaseIdle;
|
||||
}
|
||||
requestType = RequestType.None;
|
||||
}
|
||||
|
||||
public bool Load(AssetRequestContext requestContext)
|
||||
{
|
||||
requestType = RequestType.Load;
|
||||
@@ -1105,11 +874,6 @@ public class AssetHandle
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Load(Action<AssetHandle> callback)
|
||||
{
|
||||
return Load(new AssetRequestContext(callback));
|
||||
}
|
||||
|
||||
public bool QuickLoadIfPossible()
|
||||
{
|
||||
if (phase != new Action(PhaseIdle))
|
||||
@@ -1151,24 +915,6 @@ public class AssetHandle
|
||||
return flag;
|
||||
}
|
||||
|
||||
public bool IsAssetBundle()
|
||||
{
|
||||
if (assetType != AssetType.AssetBundle)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool IsManifests()
|
||||
{
|
||||
if (assetType != AssetType.Manifests)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool IsSound()
|
||||
{
|
||||
if (assetType != AssetType.Sound && assetType != AssetType.TemporarySound)
|
||||
@@ -1178,24 +924,6 @@ public class AssetHandle
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool IsSoundVoice()
|
||||
{
|
||||
if (IsSound() && (filename.Substring(0, 1).Equals("v") || filename.Substring(0, 1).Equals("c")))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsMovie()
|
||||
{
|
||||
if (assetType != AssetType.Movie)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static string GenCryptoAssetFileName(string name)
|
||||
{
|
||||
if (sha1 == null)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -28,58 +28,17 @@ public class AsyncJob
|
||||
|
||||
private bool isCancel;
|
||||
|
||||
private int? _waitFramesBetweenJobs;
|
||||
|
||||
private int _waitFramesBetweenJobsMin;
|
||||
|
||||
private FramerateProfiler _framerateProfiler = new FramerateProfiler();
|
||||
|
||||
public int WAIT_FRAMES_INCREMENT = 5;
|
||||
|
||||
public int WAIT_FRAMES_DECREMENT = 1;
|
||||
|
||||
public bool IsIdle
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!isCancel)
|
||||
{
|
||||
return jobList.Count == 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public int? WantedWaitFramesBetweenJobs
|
||||
{
|
||||
set
|
||||
{
|
||||
_waitFramesBetweenJobs = value;
|
||||
_waitFramesBetweenJobsMin = value.GetValueOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
public AsyncJob(MonoBehaviour mono, int num)
|
||||
{
|
||||
this.mono = mono;
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public void Add(IEnumerator enumerator)
|
||||
{
|
||||
jobList.Add(new Unit(enumerator, null));
|
||||
}
|
||||
|
||||
public void Add(IEnumerator enumerator, Action calcelAction)
|
||||
{
|
||||
jobList.Add(new Unit(enumerator, calcelAction));
|
||||
}
|
||||
|
||||
public void Add(Action action)
|
||||
{
|
||||
jobList.Add(new Unit(action, null));
|
||||
}
|
||||
|
||||
public void Add(Action action, Action calcelAction)
|
||||
{
|
||||
jobList.Add(new Unit(action, calcelAction));
|
||||
@@ -98,85 +57,4 @@ public class AsyncJob
|
||||
{
|
||||
isCancel = false;
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
mono.StartCoroutine(MicroThread());
|
||||
}
|
||||
_framerateProfiler = new FramerateProfiler();
|
||||
mono.StartCoroutine(RunFpsProfiler());
|
||||
}
|
||||
|
||||
private IEnumerator RunFpsProfiler()
|
||||
{
|
||||
_framerateProfiler.Init();
|
||||
while (true)
|
||||
{
|
||||
_framerateProfiler.Update();
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator MicroThread()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
if (jobList.Count <= 0)
|
||||
{
|
||||
yield return null;
|
||||
continue;
|
||||
}
|
||||
Unit unit = jobList[0];
|
||||
jobList.RemoveAt(0);
|
||||
if (isCancel)
|
||||
{
|
||||
if (unit.cancelAction != null)
|
||||
{
|
||||
unit.cancelAction();
|
||||
}
|
||||
}
|
||||
else if (unit.action is IEnumerator)
|
||||
{
|
||||
yield return mono.StartCoroutine((IEnumerator)unit.action);
|
||||
if (!_waitFramesBetweenJobs.HasValue)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
float? fps = _framerateProfiler.Fps;
|
||||
if (fps.HasValue)
|
||||
{
|
||||
if (fps < 20f)
|
||||
{
|
||||
_waitFramesBetweenJobs += WAIT_FRAMES_INCREMENT;
|
||||
_framerateProfiler.Init();
|
||||
}
|
||||
else if (fps > 30f)
|
||||
{
|
||||
_waitFramesBetweenJobs -= WAIT_FRAMES_INCREMENT;
|
||||
if (_waitFramesBetweenJobs.Value < _waitFramesBetweenJobsMin)
|
||||
{
|
||||
_waitFramesBetweenJobs = _waitFramesBetweenJobsMin;
|
||||
}
|
||||
_framerateProfiler.Init();
|
||||
}
|
||||
}
|
||||
yield return WaitFrames(_waitFramesBetweenJobs.Value);
|
||||
}
|
||||
else if (unit.action is Action)
|
||||
{
|
||||
((Action)unit.action)();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static IEnumerator WaitFrames(int frameCount)
|
||||
{
|
||||
while (frameCount > 0)
|
||||
{
|
||||
frameCount--;
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,808 +0,0 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using CriWare;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class AudioManager : MonoBehaviour, IManager
|
||||
{
|
||||
[SerializeField]
|
||||
private GameObject _bgmParent;
|
||||
|
||||
[SerializeField]
|
||||
private CriAtomSource[] _bgm;
|
||||
|
||||
private int _bgmSourceCount;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _seParent;
|
||||
|
||||
[SerializeField]
|
||||
private CriAtomSource[] _se;
|
||||
|
||||
private int _seSourceCount;
|
||||
|
||||
private SoundData[] _playingSe;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _voiceParent;
|
||||
|
||||
[SerializeField]
|
||||
private CriAtomSource[] _voice;
|
||||
|
||||
private int _voiceSourceCount;
|
||||
|
||||
private bool _bgmPlaySuspend;
|
||||
|
||||
private const int BGM_FADEOUT_TIME = 500;
|
||||
|
||||
private const int SONG_PREVIEW_FADE_TIME = 500;
|
||||
|
||||
private const int SONG_PREVIEW_FADE_SPACE_TIME = 1500;
|
||||
|
||||
private const float SE_FADE_TIME = 0.5f;
|
||||
|
||||
public const int DELAY_TIME_OFFSET = -4;
|
||||
|
||||
private const float VOULMN_BOOST_FACTOR = 1.5f;
|
||||
|
||||
public const string ACB_EXTENSION_WITHPARAM = "{0}.acb";
|
||||
|
||||
public const string ACB_EXTENSION = ".acb";
|
||||
|
||||
public const string AWB_EXTENSION_WITHPARAM = "{0}.awb";
|
||||
|
||||
public const string AWB_EXTENSION = ".awb";
|
||||
|
||||
private const string STR_SUBFOLDER_BGM = "b/";
|
||||
|
||||
public const string STR_SUBFOLDER_SE = "s/";
|
||||
|
||||
private const string STR_SUBFOLDER_SONG = "l/";
|
||||
|
||||
private const string STR_SUBFOLDER_VOICE = "v/";
|
||||
|
||||
private const string STR_SUBFOLDER_STORY = "c/";
|
||||
|
||||
private const string STR_SUBFOLDER_ROOM = "r/";
|
||||
|
||||
public bool isDownloadVoiceUse = true;
|
||||
|
||||
protected bool _isRedy;
|
||||
|
||||
private bool _noSeMode;
|
||||
|
||||
private CriAtomExPlayback _playback;
|
||||
|
||||
private CriAtomExPlayback _bgmPlayback;
|
||||
|
||||
private float _sampleTime;
|
||||
|
||||
private int _delayTime;
|
||||
|
||||
private int _criDelayTime;
|
||||
|
||||
private int _criInitializeCount;
|
||||
|
||||
private const int CRI_RETRY_COUNT = 3;
|
||||
|
||||
private Dictionary<string, CriAtomExAcb> _acbDictionary = new Dictionary<string, CriAtomExAcb>();
|
||||
|
||||
private string[] STR_PREINSTALL_FILENAME = new string[1] { "preinstall" };
|
||||
|
||||
public const float VOICE_MASTER_VOLUME = 0.8f;
|
||||
|
||||
private Action _callbackVoiseEnd;
|
||||
|
||||
private string _bgmName = "";
|
||||
|
||||
private int _cueId = -1;
|
||||
|
||||
private string _bgmCue = "";
|
||||
|
||||
public bool isRedy => _isRedy;
|
||||
|
||||
public int delayTime
|
||||
{
|
||||
get
|
||||
{
|
||||
return _delayTime;
|
||||
}
|
||||
set
|
||||
{
|
||||
_delayTime = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string bgmName
|
||||
{
|
||||
get
|
||||
{
|
||||
return _bgmName;
|
||||
}
|
||||
set
|
||||
{
|
||||
_bgmName = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int cueId
|
||||
{
|
||||
get
|
||||
{
|
||||
return _cueId;
|
||||
}
|
||||
set
|
||||
{
|
||||
_cueId = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string bgmCue
|
||||
{
|
||||
get
|
||||
{
|
||||
return _bgmCue;
|
||||
}
|
||||
set
|
||||
{
|
||||
_bgmCue = value;
|
||||
}
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
}
|
||||
|
||||
private IEnumerator Start()
|
||||
{
|
||||
_bgm = _bgmParent.GetComponentsInChildren<CriAtomSource>();
|
||||
_bgmSourceCount = _bgm.Length;
|
||||
for (int i = 0; i < _bgmSourceCount; i++)
|
||||
{
|
||||
CriAtomExPlayer player = _bgm[i].player;
|
||||
player.AttachFader();
|
||||
player.ResetFaderParameters();
|
||||
player.SetFadeOutTime(500);
|
||||
}
|
||||
_se = _seParent.GetComponentsInChildren<CriAtomSource>();
|
||||
_seSourceCount = _se.Length;
|
||||
_playingSe = new SoundData[_seSourceCount];
|
||||
for (int j = 0; j < _seSourceCount; j++)
|
||||
{
|
||||
CriAtomExPlayer player2 = _se[j].player;
|
||||
player2.AttachFader();
|
||||
player2.ResetFaderParameters();
|
||||
}
|
||||
_voice = _voiceParent.GetComponentsInChildren<CriAtomSource>();
|
||||
_voiceSourceCount = _voice.Length;
|
||||
for (int k = 0; k < _voiceSourceCount; k++)
|
||||
{
|
||||
CriAtomExPlayer player3 = _voice[k].player;
|
||||
player3.AttachFader();
|
||||
player3.ResetFaderParameters();
|
||||
}
|
||||
Toolbox.AudioManager = this;
|
||||
yield break;
|
||||
}
|
||||
|
||||
public void ResetSoundMode()
|
||||
{
|
||||
_noSeMode = false;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
}
|
||||
|
||||
public void PauseAllBgm(bool pauseStatus)
|
||||
{
|
||||
if (pauseStatus)
|
||||
{
|
||||
_bgmPlaySuspend = false;
|
||||
for (int i = 0; i < _bgmSourceCount; i++)
|
||||
{
|
||||
if (_bgm[i].status == CriAtomSource.Status.Prep || _bgm[i].status == CriAtomSource.Status.Playing)
|
||||
{
|
||||
_bgm[i].Pause(sw: true);
|
||||
_bgmPlaySuspend = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (_bgmPlaySuspend)
|
||||
{
|
||||
for (int j = 0; j < _bgmSourceCount; j++)
|
||||
{
|
||||
_bgm[j].Pause(sw: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public long GetMusicLength(string acbName)
|
||||
{
|
||||
CriAtomExAcb acb = CriAtom.GetAcb(acbName);
|
||||
if (acb != null && acb.GetCueInfo(0, out var info))
|
||||
{
|
||||
return info.length;
|
||||
}
|
||||
return -1L;
|
||||
}
|
||||
|
||||
public bool IsAvailableCueSheet(string cueName)
|
||||
{
|
||||
CriAtomCueSheet cueSheet = CriAtom.GetCueSheet(cueName);
|
||||
if (cueSheet != null)
|
||||
{
|
||||
return cueSheet.acb != null;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool AddCueSheet(string _name, string acbFile, string subFolderPath, string awbname = "")
|
||||
{
|
||||
_name = _name.Replace(".acb", "");
|
||||
if (CriAtom.GetCueSheet(_name) != null || CriAtom.GetCueSheet(acbFile) != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool flag = false;
|
||||
int num = STR_PREINSTALL_FILENAME.Length;
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
if (string.Compare(_name, STR_PREINSTALL_FILENAME[i]) == 0)
|
||||
{
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
acbFile = $"{subFolderPath}{acbFile}";
|
||||
awbname = $"{subFolderPath}{awbname}";
|
||||
}
|
||||
else
|
||||
{
|
||||
acbFile = string.Format("{0}{1}{2}{3}", Application.persistentDataPath, "/", subFolderPath, acbFile);
|
||||
awbname = string.Format("{0}{1}{2}{3}", Application.persistentDataPath, "/", subFolderPath, awbname);
|
||||
}
|
||||
CriAtomCueSheet criAtomCueSheet = CriAtom.AddCueSheet(_name, acbFile, awbname);
|
||||
if (criAtomCueSheet == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (criAtomCueSheet.acb == null)
|
||||
{
|
||||
RemoveCueSheet(_name);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool AddCueSheetFromFileName(string _name, string acbFile, string awbname)
|
||||
{
|
||||
_name = _name.Replace(".acb", "");
|
||||
int num = STR_PREINSTALL_FILENAME.Length;
|
||||
for (int i = 0; i < num && string.Compare(_name, STR_PREINSTALL_FILENAME[i]) != 0; i++)
|
||||
{
|
||||
}
|
||||
if (CriAtom.GetCueSheet(_name) != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
CriAtomCueSheet criAtomCueSheet = CriAtom.AddCueSheet(_name, acbFile, awbname);
|
||||
if (criAtomCueSheet == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (criAtomCueSheet.acb == null)
|
||||
{
|
||||
RemoveCueSheet(_name);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void RemoveCueSheet(string name)
|
||||
{
|
||||
name = name.Replace(".awb", "");
|
||||
name = name.Replace(".acb", "");
|
||||
name = name.Replace("s/", "");
|
||||
name = name.Replace("b/", "");
|
||||
CriAtom.RemoveCueSheet(name);
|
||||
}
|
||||
|
||||
public void RemoveCueSheet(List<string> nameList)
|
||||
{
|
||||
for (int i = 0; i < nameList.Count; i++)
|
||||
{
|
||||
RemoveCueSheet(nameList[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public float GetSampleTime()
|
||||
{
|
||||
long numSamples = 0L;
|
||||
int samplingRate = 0;
|
||||
if (_playback.GetNumPlayedSamples(out numSamples, out samplingRate))
|
||||
{
|
||||
_sampleTime = (float)numSamples / (float)samplingRate;
|
||||
}
|
||||
return _sampleTime;
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
foreach (KeyValuePair<string, CriAtomExAcb> item in _acbDictionary)
|
||||
{
|
||||
item.Value.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public int GetDelayTimeFromCRI()
|
||||
{
|
||||
int result = 0;
|
||||
if (_criInitializeCount >= 3)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
return _criDelayTime / 10;
|
||||
}
|
||||
|
||||
public CriAtomSource GetBgmSource(int bgmId)
|
||||
{
|
||||
return _bgm[bgmId];
|
||||
}
|
||||
|
||||
public int GetBgmMaxCount()
|
||||
{
|
||||
return _bgmSourceCount;
|
||||
}
|
||||
|
||||
public void VolumeUpdate_Bgm(int level, bool mute, int bgmId = -1)
|
||||
{
|
||||
if (bgmId < 0)
|
||||
{
|
||||
int num = _bgm.Length;
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
Volume_Bgm((float)level * 0.1f, mute, i);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Volume_Bgm((float)level * 0.1f, mute, bgmId);
|
||||
}
|
||||
}
|
||||
|
||||
public void Volume_Bgm(float level, bool mute, int bgmId = -1)
|
||||
{
|
||||
if (mute)
|
||||
{
|
||||
level = 0f;
|
||||
}
|
||||
if (bgmId < 0)
|
||||
{
|
||||
int num = _bgm.Length;
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
_bgm[i].volume = level;
|
||||
_bgm[i].player.Update(_bgmPlayback);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_bgm[bgmId].volume = level;
|
||||
_bgm[bgmId].player.Update(_bgmPlayback);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsPlayBgm(int bgmId = 0)
|
||||
{
|
||||
if (_bgm[bgmId].status == CriAtomSource.Status.Prep || _bgm[bgmId].status == CriAtomSource.Status.Playing)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int PlayBgmFromName(string cueSheet, string cueName, string acbName, string awbName = "", int bgmId = 0, bool loop = true, float FadeInfime = 0f, float OffsetTime = 0f, long startTime = 0L)
|
||||
{
|
||||
if (_bgmName == cueName)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
string acbFile = "";
|
||||
string awbname = "";
|
||||
if (acbName.CompareTo("") != 0)
|
||||
{
|
||||
acbFile = acbName + ".acb";
|
||||
}
|
||||
if (awbName.CompareTo("") != 0)
|
||||
{
|
||||
awbname = awbName + ".awb";
|
||||
}
|
||||
if (AddCueSheet(cueSheet, acbFile, "b/", awbname))
|
||||
{
|
||||
StopBgm(bgmId);
|
||||
_bgm[bgmId].cueSheet = cueSheet;
|
||||
_bgm[bgmId].cueName = cueName;
|
||||
_bgm[bgmId].player.ResetFaderParameters();
|
||||
_bgm[bgmId].player.SetStartTime(startTime);
|
||||
_bgm[bgmId].player.SetFadeInTime((int)(FadeInfime * 1000f));
|
||||
_bgm[bgmId].player.SetFadeInStartOffset((int)(OffsetTime * 1000f));
|
||||
_bgm[bgmId].loop = loop;
|
||||
_bgmPlayback = _bgm[bgmId].Play();
|
||||
_bgmName = cueName;
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int PlayBgmFromId(string cueSheet, int cueId, int bgmId = 0, bool loop = true, float FadeInfime = 0f, float OffsetTime = 0f, long startTime = 0L)
|
||||
{
|
||||
if (_bgmCue == cueSheet && cueId == _cueId)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (CriAtom.GetCueSheet(cueSheet) != null)
|
||||
{
|
||||
StopBgm(bgmId);
|
||||
_bgm[bgmId].cueSheet = cueSheet;
|
||||
_bgm[bgmId].player.ResetFaderParameters();
|
||||
_bgm[bgmId].player.SetStartTime(startTime);
|
||||
_bgm[bgmId].player.SetFadeInTime((int)(FadeInfime * 1000f));
|
||||
_bgm[bgmId].player.SetFadeInStartOffset((int)(OffsetTime * 1000f));
|
||||
_bgm[bgmId].loop = loop;
|
||||
_bgmPlayback = _bgm[bgmId].Play(cueId);
|
||||
_cueId = cueId;
|
||||
_bgmCue = "";
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void StopBgm(int bgmId = 0)
|
||||
{
|
||||
_bgmName = "";
|
||||
_bgm[bgmId].Stop();
|
||||
}
|
||||
|
||||
public void PauseBgm(bool isPause, int bgmId = 0)
|
||||
{
|
||||
_bgm[bgmId].Pause(isPause);
|
||||
}
|
||||
|
||||
public void StopFadeBgm(int bgmId = 0, float time = 0.5f)
|
||||
{
|
||||
_bgm[bgmId].player.SetFadeOutTime((int)(time * 1000f));
|
||||
StopBgm(bgmId);
|
||||
}
|
||||
|
||||
public void SetBgmVolume(float volume)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().SetBgmVolume(volume);
|
||||
}
|
||||
|
||||
public void StartCoroutine_DelayMethod(float waitTime, Action process)
|
||||
{
|
||||
StartCoroutine(Timer.DelayMethod(waitTime, process));
|
||||
}
|
||||
|
||||
public void VolumeUpdate_Se(int level, bool mute)
|
||||
{
|
||||
Volume_Se((float)level * 0.1f, mute);
|
||||
}
|
||||
|
||||
public void Volume_Se(float level, bool mute)
|
||||
{
|
||||
if (mute)
|
||||
{
|
||||
level = 0f;
|
||||
}
|
||||
for (int i = 0; i < _seSourceCount; i++)
|
||||
{
|
||||
_se[i].volume = level;
|
||||
}
|
||||
}
|
||||
|
||||
public int PlaySeFromId(ref SoundData seData, bool loop = false)
|
||||
{
|
||||
int index = -1;
|
||||
CriAtomSource criAtomSource = FindSe(ref seData, out index);
|
||||
if (criAtomSource != null)
|
||||
{
|
||||
criAtomSource.cueSheet = seData._acbName;
|
||||
criAtomSource.loop = loop;
|
||||
CriAtomExPlayer player = criAtomSource.player;
|
||||
player.ResetFaderParameters();
|
||||
player.SetFadeOutTime(0);
|
||||
criAtomSource.Play(seData._cueName);
|
||||
return index;
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
public int PlaySeFromId(string cueName, int cueId, bool loop = false)
|
||||
{
|
||||
if (!IsAvailableCueSheet(cueName))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
for (int i = 0; i < _seSourceCount; i++)
|
||||
{
|
||||
if (_se[i].status == CriAtomSource.Status.PlayEnd)
|
||||
{
|
||||
_se[i].Stop();
|
||||
}
|
||||
if (_se[i].status == CriAtomSource.Status.Stop)
|
||||
{
|
||||
_se[i].cueSheet = cueName;
|
||||
_se[i].loop = loop;
|
||||
_se[i].Play(cueId);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
private CriAtomSource FindSe(ref SoundData seData, out int index)
|
||||
{
|
||||
index = -1;
|
||||
if (_noSeMode)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (!IsAvailableCueSheet(seData._acbName))
|
||||
{
|
||||
Debug.LogError($"No Include Acb!!!:{seData._acbName},{seData._cueName}");
|
||||
return null;
|
||||
}
|
||||
for (int i = 0; i < _seSourceCount; i++)
|
||||
{
|
||||
if (_se[i].status == CriAtomSource.Status.PlayEnd)
|
||||
{
|
||||
_se[i].Stop();
|
||||
}
|
||||
if (_se[i].status == CriAtomSource.Status.Stop)
|
||||
{
|
||||
index = i;
|
||||
return _se[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public int PlaySe(string cueName, int cueId, bool loop = false)
|
||||
{
|
||||
if (!IsAvailableCueSheet(cueName))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
for (int i = 0; i < _seSourceCount; i++)
|
||||
{
|
||||
if (_se[i].status == CriAtomSource.Status.PlayEnd)
|
||||
{
|
||||
_se[i].Stop();
|
||||
}
|
||||
if (_se[i].status == CriAtomSource.Status.Stop)
|
||||
{
|
||||
_se[i].cueSheet = cueName;
|
||||
_se[i].loop = loop;
|
||||
_se[i].Play(cueId);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public void StopSe(int index, float fadeout = 500f)
|
||||
{
|
||||
if (index >= 0 && index < _seSourceCount)
|
||||
{
|
||||
ResumeSe(index);
|
||||
_se[index].player.SetFadeOutTime((int)(fadeout * 1000f));
|
||||
_se[index].Stop();
|
||||
}
|
||||
}
|
||||
|
||||
public void StopSe(string cuename, float fadeout = 500f)
|
||||
{
|
||||
for (int i = 0; i < _se.Length; i++)
|
||||
{
|
||||
if (_se[i].cueName.CompareTo(cuename) == 0)
|
||||
{
|
||||
ResumeSe(i);
|
||||
_se[i].player.SetFadeOutTime((int)(fadeout * 1000f));
|
||||
_se[i].Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void StopSeAll(float fadeout = 500f)
|
||||
{
|
||||
for (int i = 0; i < _seSourceCount; i++)
|
||||
{
|
||||
StopSe(i, fadeout);
|
||||
}
|
||||
}
|
||||
|
||||
public void PauseSe(int index)
|
||||
{
|
||||
if (index >= 0 && index < _seSourceCount && (_se[index].status == CriAtomSource.Status.Playing || _se[index].status == CriAtomSource.Status.Prep))
|
||||
{
|
||||
_se[index].Pause(sw: true);
|
||||
}
|
||||
}
|
||||
|
||||
public void ResumeSe(int index)
|
||||
{
|
||||
if (index >= 0 && index < _seSourceCount && _se[index].status == CriAtomSource.Status.Playing)
|
||||
{
|
||||
_se[index].Pause(sw: false);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsPlaySe(string cueName, int cueId)
|
||||
{
|
||||
for (int i = 0; i < _seSourceCount; i++)
|
||||
{
|
||||
if (_playingSe[i]._cueName == cueName && _playingSe[i]._cueId == cueId && (_se[i].status == CriAtomSource.Status.Prep || _se[i].status == CriAtomSource.Status.Playing))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsPlaySe(string cueSheetName, string cueName, out int number)
|
||||
{
|
||||
number = 0;
|
||||
for (int i = 0; i < _seSourceCount; i++)
|
||||
{
|
||||
if (_playingSe[i]._acbName == cueSheetName && _playingSe[i]._cueName == cueName && _se[i].status == CriAtomSource.Status.Playing)
|
||||
{
|
||||
number++;
|
||||
}
|
||||
}
|
||||
if (number > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsPrepSe(string cueSheetName, string cueName, out int number)
|
||||
{
|
||||
number = 0;
|
||||
for (int i = 0; i < _seSourceCount; i++)
|
||||
{
|
||||
if (_playingSe[i]._acbName == cueSheetName && _playingSe[i]._cueName == cueName && _se[i].status == CriAtomSource.Status.Prep)
|
||||
{
|
||||
number++;
|
||||
}
|
||||
}
|
||||
if (number > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void ResetSe()
|
||||
{
|
||||
for (int i = 0; i < _seSourceCount; i++)
|
||||
{
|
||||
_se[i].Stop();
|
||||
_se[i].Pause(sw: false);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsPlaySe(int index)
|
||||
{
|
||||
if (_se[index].status == CriAtomSource.Status.Prep || _se[index].status == CriAtomSource.Status.Playing)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void SetAisac(string cuename, string param, float num)
|
||||
{
|
||||
for (int i = 0; i < _se.Length; i++)
|
||||
{
|
||||
if (_se[i].cueName.CompareTo(cuename) == 0)
|
||||
{
|
||||
_se[i].SetAisacControl(param, num);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int PlaySeFromName(string acbName, string seName, bool loop = false, float fadeInfime = 0f, long startTime = 0L)
|
||||
{
|
||||
if (!IsAvailableCueSheet(acbName))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
for (int i = 0; i < _seSourceCount; i++)
|
||||
{
|
||||
if (_se[i].status == CriAtomSource.Status.PlayEnd)
|
||||
{
|
||||
_se[i].Stop();
|
||||
}
|
||||
if (_se[i].status == CriAtomSource.Status.Stop)
|
||||
{
|
||||
_se[i].cueSheet = acbName;
|
||||
_se[i].cueName = seName;
|
||||
_se[i].loop = loop;
|
||||
_se[i].player.ResetFaderParameters();
|
||||
_se[i].player.SetStartTime(startTime);
|
||||
_se[i].player.SetFadeInTime((int)(fadeInfime * 1000f));
|
||||
_se[i].Play(seName);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int GetVoiceSourceCount()
|
||||
{
|
||||
return _voiceSourceCount;
|
||||
}
|
||||
|
||||
public void VolumeUpdate_Voice(int level, bool mute, int voiceId = -1)
|
||||
{
|
||||
Volume_Voice((float)level * 0.1f, mute, voiceId);
|
||||
}
|
||||
|
||||
public void Volume_Voice(float level, bool mute, int voiceId = -1)
|
||||
{
|
||||
if (mute)
|
||||
{
|
||||
level = 0f;
|
||||
}
|
||||
if (voiceId < 0)
|
||||
{
|
||||
int num = _voice.Length;
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
_voice[i].volume = level;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_voice[voiceId].volume = level;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsPlayVoice(int index)
|
||||
{
|
||||
if (_voice[index].status == CriAtomSource.Status.Prep || _voice[index].status == CriAtomSource.Status.Playing)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void PlayVoice(int voiceId, string acbFile, string cueSheet, string cueName)
|
||||
{
|
||||
AddCueSheet(cueSheet, acbFile, "v/");
|
||||
_voice[voiceId].Play(cueName);
|
||||
}
|
||||
|
||||
public void PlayVoice(int voiceId, string cueName)
|
||||
{
|
||||
_voice[voiceId].Play(cueName);
|
||||
}
|
||||
|
||||
public void StopVoice(int voiceId, float fadetout = 500f)
|
||||
{
|
||||
CriAtomSource criAtomSource = _voice[voiceId];
|
||||
if (criAtomSource != null && criAtomSource.player != null)
|
||||
{
|
||||
criAtomSource.player.SetFadeOutTime((int)(fadetout * 1000f));
|
||||
criAtomSource.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,67 +9,4 @@ namespace Cute;
|
||||
public class BootApp : MonoBehaviour
|
||||
{
|
||||
public static string BootScene;
|
||||
|
||||
private Coroutine _logCoroutine;
|
||||
|
||||
private string _logMsg = "";
|
||||
|
||||
private IEnumerator Start()
|
||||
{
|
||||
_logCoroutine = StartCoroutine(WaitToAccumulateTraceLog());
|
||||
_logMsg += "start";
|
||||
createMutex();
|
||||
restrainOSXProcess();
|
||||
startSteamClient();
|
||||
while (Toolbox.BootSystem == null)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
_logMsg += "start2";
|
||||
CultureInfo.DefaultThreadCurrentUICulture = (CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("ja-JP", useUserOverride: false));
|
||||
Toolbox.AssetManager.createSavePath();
|
||||
yield return StartCoroutine(FontChanger.FontTryChangePersistant(null));
|
||||
_logMsg += "start3";
|
||||
_logMsg += "start4";
|
||||
StopCoroutine(_logCoroutine);
|
||||
changeScene();
|
||||
}
|
||||
|
||||
private IEnumerator WaitToAccumulateTraceLog()
|
||||
{
|
||||
yield return new WaitForSeconds(5f);
|
||||
LocalLog.AccumulateTraceInquiryLog("BootApp " + _logMsg);
|
||||
}
|
||||
|
||||
private void createMutex()
|
||||
{
|
||||
Toolbox.mute = new Mutex(initiallyOwned: false, "Global\\ShadowversePcPlatformGlobalThread");
|
||||
if (Toolbox.mute != null && !Toolbox.mute.WaitOne(0, exitContext: false))
|
||||
{
|
||||
Toolbox.mute.Close();
|
||||
Toolbox.mute = null;
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
||||
|
||||
private void startSteamClient()
|
||||
{
|
||||
_ = SteamManager.Initialized;
|
||||
}
|
||||
|
||||
private void restrainOSXProcess()
|
||||
{
|
||||
}
|
||||
|
||||
private void changeScene()
|
||||
{
|
||||
if (BootScene != null)
|
||||
{
|
||||
Toolbox.SceneManager.ChangeScene(BootScene);
|
||||
}
|
||||
else
|
||||
{
|
||||
Toolbox.SceneManager.ChangeScene(SceneType._Splash);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,6 @@ namespace Cute;
|
||||
|
||||
public class BootNetwork : MonoBehaviour
|
||||
{
|
||||
public bool _autoSetup;
|
||||
|
||||
public static bool IsDoneLanguageSetting;
|
||||
|
||||
public bool IsDoneGameStartCheck { get; set; }
|
||||
|
||||
@@ -16,78 +13,4 @@ public class BootNetwork : MonoBehaviour
|
||||
{
|
||||
Object.DontDestroyOnLoad(base.gameObject);
|
||||
}
|
||||
|
||||
private IEnumerator Start()
|
||||
{
|
||||
while (Toolbox.BootSystem == null)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
while (Toolbox.NetworkManager == null)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
Toolbox.BootNetwork = this;
|
||||
if (_autoSetup)
|
||||
{
|
||||
SetupNetwork();
|
||||
}
|
||||
SetupNetworkLanguage();
|
||||
while (!IsDoneLanguageSetting)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
}
|
||||
|
||||
public void SetupNetwork()
|
||||
{
|
||||
if (!IsDoneGameStartCheck)
|
||||
{
|
||||
StartCoroutine(SetupNetworkCoroutine());
|
||||
}
|
||||
}
|
||||
|
||||
public void SetupNetworkLanguage()
|
||||
{
|
||||
string text = Toolbox.SavedataManager.GetString("LANG_SETTING");
|
||||
if (text == "Jpn")
|
||||
{
|
||||
Toolbox.SavedataManager.DeleteKey("LANG_SETTING");
|
||||
Toolbox.SavedataManager.DeleteKey("LANG_SOUND_SETTING");
|
||||
text = "";
|
||||
Toolbox.AssetManager.ClearAllAssetFile();
|
||||
Toolbox.AssetManager.ClearAssetCacheAssetBundle();
|
||||
}
|
||||
if (string.IsNullOrEmpty(text))
|
||||
{
|
||||
CustomPreference.SetScemeMode(CustomPreference.eSchemeType.Https);
|
||||
CustomPreference.SetApplicationServerURL("utoongaize.shadowverse.jp/shadowverse/");
|
||||
}
|
||||
else
|
||||
{
|
||||
IsDoneLanguageSetting = true;
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator SetupNetworkCoroutine()
|
||||
{
|
||||
if (!IsDoneGameStartCheck)
|
||||
{
|
||||
yield return StartCoroutine(Toolbox.NetworkManager._certification.Login());
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerator SetupNetworkCertification()
|
||||
{
|
||||
SetupNetwork();
|
||||
while (!IsDoneGameStartCheck)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
yield return StartCoroutine(Toolbox.AssetManager.InitializeManifest(null, Data.Load.data._userTutorial.tutorial_step != 100));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Diagnostics;
|
||||
using com.adjust.sdk;
|
||||
using RedShellUnity;
|
||||
using Steamworks;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
|
||||
@@ -12,18 +10,9 @@ namespace Cute;
|
||||
|
||||
public class BootSystem : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
[Tooltip("チェックするとMaxFramerateが有効")]
|
||||
private bool _dontVsync;
|
||||
|
||||
[SerializeField]
|
||||
[Range(0f, 60f)]
|
||||
private int _maxFramerate;
|
||||
|
||||
public static bool isRootBootCamera;
|
||||
|
||||
private Coroutine _logCoroutine;
|
||||
|
||||
private string _logMsg = "";
|
||||
|
||||
private void Awake()
|
||||
@@ -38,84 +27,6 @@ public class BootSystem : MonoBehaviour
|
||||
UnityEngine.Object.DontDestroyOnLoad(base.gameObject);
|
||||
}
|
||||
|
||||
private IEnumerator Start()
|
||||
{
|
||||
_logCoroutine = StartCoroutine(WaitToAccumulateTraceLog());
|
||||
_logMsg += " Start";
|
||||
while (Toolbox.DeviceManager == null)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
_logMsg += " DeviceManager";
|
||||
while (Toolbox.SavedataManager == null)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
_logMsg += " SavedataManager";
|
||||
while (Toolbox.QualityManager == null)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
_logMsg += " QualityManager";
|
||||
while (Toolbox.SceneManager == null)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
_logMsg += " SceneManager";
|
||||
while (Toolbox.ResourcesManager == null)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
_logMsg += " ResourcesManager";
|
||||
while (Toolbox.AssetManager == null)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
_logMsg += " AssetManager";
|
||||
while (Toolbox.AudioManager == null)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
_logMsg += " AudioManager";
|
||||
while (Toolbox.MovieManager == null)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
_logMsg += " MovieManager";
|
||||
SocialServiceUtility.CreateInstance();
|
||||
bootAdjust();
|
||||
setupRedShell();
|
||||
if (_dontVsync)
|
||||
{
|
||||
QualitySettings.vSyncCount = 0;
|
||||
Application.targetFrameRate = _maxFramerate;
|
||||
}
|
||||
StopCoroutine(_logCoroutine);
|
||||
Toolbox.BootSystem = this;
|
||||
}
|
||||
|
||||
private IEnumerator WaitToAccumulateTraceLog()
|
||||
{
|
||||
yield return new WaitForSeconds(5f);
|
||||
LocalLog.AccumulateTraceInquiryLog("BootSystem " + _logMsg);
|
||||
}
|
||||
|
||||
private void bootAdjust()
|
||||
{
|
||||
try
|
||||
{
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LocalLog.AccumulateTraceLog(ex.ToString());
|
||||
}
|
||||
Adjust.addSessionCallbackParameter("viewer_id", Certification.ViewerId.ToString());
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
}
|
||||
|
||||
public void VisibleBootCamera(bool enable)
|
||||
{
|
||||
GameObject gameObject = base.transform.Find("BootCamera").gameObject;
|
||||
@@ -124,22 +35,4 @@ public class BootSystem : MonoBehaviour
|
||||
gameObject.SetActive(enable);
|
||||
}
|
||||
}
|
||||
|
||||
[Conditional("STEAM")]
|
||||
private void setupRedShell()
|
||||
{
|
||||
RedShell.SetVerboseLogs(verboseLogs: true);
|
||||
RedShell.SetApiKey("04b8d4a58416140132fdcd680b17a0d8");
|
||||
try
|
||||
{
|
||||
RedShell.SetUserId(SteamUser.GetSteamID().m_SteamID.ToString());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError("<color=aqua>steam client が起動していない。steamの機能を使えません。</color>");
|
||||
Debug.LogError(ex.Message);
|
||||
Debug.LogError(ex.StackTrace);
|
||||
}
|
||||
RedShell.MarkConversion();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
using Steamworks;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
using Wizard.Title;
|
||||
// TODO(engine-cleanup-pass2): 43 of 45 methods unrun in baseline
|
||||
// Type: Cute.Certification
|
||||
// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt
|
||||
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class Certification : MonoBehaviour
|
||||
{
|
||||
public static bool CheckUrlScheme;
|
||||
|
||||
private const int ERROR_CODE_ACCOUNT_REMOVED = 5607;
|
||||
|
||||
private static string udid;
|
||||
|
||||
@@ -20,10 +20,6 @@ public class Certification : MonoBehaviour
|
||||
|
||||
private static string sessionId;
|
||||
|
||||
private const float DELAY_TIME = 0.02f;
|
||||
|
||||
protected Callback<GetAuthSessionTicketResponse_t> m_GetAuthSessionTicketResponse;
|
||||
|
||||
public static string Udid
|
||||
{
|
||||
get
|
||||
@@ -38,13 +34,11 @@ public class Certification : MonoBehaviour
|
||||
|
||||
public static int ViewerId
|
||||
{
|
||||
// Post-Task-8: strictly ambient. The historical SavedataManager-backed lazy decode was the
|
||||
// client process's single-viewer-id source; in the headless multi-instance world the viewer
|
||||
// id MUST come from the per-session ambient context. Setter is a no-op (BattleAmbientContext
|
||||
// .ViewerId is `init`-only — fixed at scope entry per design — and the historical caller
|
||||
// (SavedataManager.SetInt + Save) is dead in the server world).
|
||||
get => SVSim.BattleEngine.Ambient.BattleAmbient.Require().ViewerId;
|
||||
set { /* ambient ViewerId is init-only; SavedataManager path is dead headless */ }
|
||||
// Instance-backed via BattleManagerBase.InstanceViewerId (Phase 5, chunk 40 — ambient
|
||||
// fallback dropped; all consumers routed through mgr in chunks 38-39). Default 1001 matches
|
||||
// EngineGlobalInit.ThisViewerId. Setter no-op preserved from Phase-4 semantics.
|
||||
get => BattleManagerBase.GetIns()?.InstanceViewerId ?? 1001;
|
||||
set { /* no-op; SavedataManager path dead headless */ }
|
||||
}
|
||||
|
||||
public static int ShortUdid
|
||||
@@ -80,23 +74,10 @@ public class Certification : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public static string dmmViewerId { get; private set; }
|
||||
|
||||
public static string dmmOnetimeToken { get; private set; }
|
||||
|
||||
public static ulong SteamID { get; private set; }
|
||||
|
||||
public static string SteamSessionTicket { get; private set; }
|
||||
|
||||
public static bool IsExistsViewerId()
|
||||
{
|
||||
if (ViewerId != 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static string GetEncodedViewerId()
|
||||
{
|
||||
string s = CryptAES.encrypt(ViewerId.ToString());
|
||||
@@ -122,244 +103,4 @@ public class Certification : MonoBehaviour
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
public static void SetKeyChainViewerId(string viewerId)
|
||||
{
|
||||
}
|
||||
|
||||
public static void DeleteKeyChainViewerId()
|
||||
{
|
||||
}
|
||||
|
||||
public static void InitializeFileds()
|
||||
{
|
||||
sessionId = null;
|
||||
udid = null;
|
||||
short_udid = 0;
|
||||
Toolbox.SavedataManager.SetInt("VIEWER_ID", 0);
|
||||
Toolbox.SavedataManager.SetInt("SHORT_UDID", 0);
|
||||
Toolbox.SavedataManager.SetString("UDID", "");
|
||||
}
|
||||
|
||||
public IEnumerator Login()
|
||||
{
|
||||
if (ViewerId == 0)
|
||||
{
|
||||
GenerateUdid();
|
||||
SignUpTask signUpTask = new SignUpTask();
|
||||
signUpTask.SetParameter();
|
||||
yield return StartCoroutine(Toolbox.NetworkManager.Connect(signUpTask, delegate
|
||||
{
|
||||
StartCoroutine(GameStartCheckTaskExec());
|
||||
}, delegate
|
||||
{
|
||||
if (Toolbox.BootNetwork != null)
|
||||
{
|
||||
Toolbox.BootNetwork.IsDoneGameStartCheck = false;
|
||||
}
|
||||
OutOfService.ShowServiceEndedDialogIfNeeded();
|
||||
}, delegate
|
||||
{
|
||||
if (Toolbox.BootNetwork != null)
|
||||
{
|
||||
Toolbox.BootNetwork.IsDoneGameStartCheck = false;
|
||||
}
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
yield return StartCoroutine(GameStartCheckTaskExec());
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsiCloudAvailable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void SetiCloudUser()
|
||||
{
|
||||
}
|
||||
|
||||
public static void EraseiCloudUser()
|
||||
{
|
||||
}
|
||||
|
||||
public static string GetiCloudUser()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
public void CheckiCloudUserData(Action<NetworkTask.ResultCode> callback)
|
||||
{
|
||||
GetiCloudUserDataTask.VerifiediCloudUserData.Reset();
|
||||
string text = GetiCloudUser();
|
||||
if (string.IsNullOrEmpty(text))
|
||||
{
|
||||
callback(NetworkTask.ResultCode.Success);
|
||||
return;
|
||||
}
|
||||
GenerateUdid();
|
||||
GetiCloudUserDataTask getiCloudUserDataTask = new GetiCloudUserDataTask();
|
||||
getiCloudUserDataTask.SetParameter(text);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(getiCloudUserDataTask, callback));
|
||||
}
|
||||
|
||||
public void MigrateiCloudUserData(Action<NetworkTask.ResultCode> callback)
|
||||
{
|
||||
string parameter = GetiCloudUser();
|
||||
UpdateiCloudUserDataTask updateiCloudUserDataTask = new UpdateiCloudUserDataTask();
|
||||
updateiCloudUserDataTask.SetParameter(parameter);
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(updateiCloudUserDataTask, callback));
|
||||
}
|
||||
|
||||
public void FirstTimeSaveiCloudUserData()
|
||||
{
|
||||
if (IsiCloudAvailable() && string.IsNullOrEmpty(GetiCloudUser()))
|
||||
{
|
||||
SetiCloudUser();
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerator GameStartCheckTaskExec()
|
||||
{
|
||||
GameStartCheckTask gameStartCheckTask = new GameStartCheckTask();
|
||||
gameStartCheckTask.AddSkipCuteCheckResultCode(5607);
|
||||
gameStartCheckTask.SetParameter();
|
||||
bool isRemoveAccount = false;
|
||||
yield return StartCoroutine(Toolbox.NetworkManager.Connect(gameStartCheckTask, delegate
|
||||
{
|
||||
if (Toolbox.BootNetwork != null)
|
||||
{
|
||||
Toolbox.BootNetwork.IsDoneGameStartCheck = true;
|
||||
}
|
||||
URLScheme.ClearCampaignData();
|
||||
}, delegate
|
||||
{
|
||||
if (Toolbox.BootNetwork != null)
|
||||
{
|
||||
Toolbox.BootNetwork.IsDoneGameStartCheck = false;
|
||||
}
|
||||
OutOfService.ShowServiceEndedDialogIfNeeded();
|
||||
}, delegate(int resultCode)
|
||||
{
|
||||
if (Toolbox.BootNetwork != null)
|
||||
{
|
||||
Toolbox.BootNetwork.IsDoneGameStartCheck = false;
|
||||
}
|
||||
URLScheme.ClearCampaignData();
|
||||
if (resultCode == 5607)
|
||||
{
|
||||
isRemoveAccount = true;
|
||||
OnRemoveAccount();
|
||||
}
|
||||
}));
|
||||
if (isRemoveAccount)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRemoveAccount()
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("MyPage_0097"));
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("ErrorHeader_0001"));
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.OnClose = delegate
|
||||
{
|
||||
UserInfoRequest.DeleteUserData();
|
||||
};
|
||||
}
|
||||
|
||||
public void GenerateUdid()
|
||||
{
|
||||
udid = Cryptographer.decode(Toolbox.SavedataManager.GetString("UDID"));
|
||||
if (string.IsNullOrEmpty(udid))
|
||||
{
|
||||
Toolbox.SavedataManager.SetString("UDID", Cryptographer.encode(Guid.NewGuid().ToString()));
|
||||
Toolbox.SavedataManager.Save();
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsLogined()
|
||||
{
|
||||
return !string.IsNullOrEmpty(sessionId);
|
||||
}
|
||||
|
||||
private IEnumerator Start()
|
||||
{
|
||||
while (Toolbox.BootSystem == null)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
SessionId = "";
|
||||
setDmmPlatformData();
|
||||
setSTEAMPlatformData();
|
||||
URLSchemeStart();
|
||||
}
|
||||
|
||||
private void OnApplicationFocus(bool focus)
|
||||
{
|
||||
if (focus)
|
||||
{
|
||||
URLSchemeStart();
|
||||
}
|
||||
}
|
||||
|
||||
private void URLSchemeStart()
|
||||
{
|
||||
if (CheckUrlScheme)
|
||||
{
|
||||
StartCoroutine(Delay(0.02f, delegate
|
||||
{
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator Delay(float waitTime, Action action)
|
||||
{
|
||||
yield return new WaitForSeconds(waitTime);
|
||||
action();
|
||||
}
|
||||
|
||||
private void setSTEAMPlatformData()
|
||||
{
|
||||
try
|
||||
{
|
||||
SteamID = SteamUser.GetSteamID().m_SteamID;
|
||||
m_GetAuthSessionTicketResponse = Callback<GetAuthSessionTicketResponse_t>.Create(OnGetAuthSessionTicketResponse);
|
||||
byte[] array = new byte[1024];
|
||||
SteamNetworkingIdentity pSteamNetworkingIdentity = default(SteamNetworkingIdentity);
|
||||
SteamUser.GetAuthSessionTicket(array, array.Length, out var pcbTicket, ref pSteamNetworkingIdentity);
|
||||
Array.Resize(ref array, (int)pcbTicket);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (int i = 0; i < pcbTicket; i++)
|
||||
{
|
||||
stringBuilder.AppendFormat("{0:x2}", array[i]);
|
||||
}
|
||||
SteamSessionTicket = stringBuilder.ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError("<color=aqua>steam client が起動していない。steamの機能を使えません。</color>");
|
||||
Debug.LogError(ex.Message);
|
||||
Debug.LogError(ex.StackTrace);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnGetAuthSessionTicketResponse(GetAuthSessionTicketResponse_t pCallback)
|
||||
{
|
||||
}
|
||||
|
||||
private void setDmmPlatformData()
|
||||
{
|
||||
}
|
||||
|
||||
public void URLSchemeStartiOS(string message)
|
||||
{
|
||||
URLScheme.URLSchemeStartiOS(message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,37 +61,6 @@ public class CryptAES
|
||||
return array4;
|
||||
}
|
||||
|
||||
public static string EncryptRJ256(string prm_text_to_encrypt)
|
||||
{
|
||||
using RijndaelManaged rijndaelManaged = new RijndaelManaged();
|
||||
rijndaelManaged.Padding = PaddingMode.Zeros;
|
||||
rijndaelManaged.Mode = CipherMode.CBC;
|
||||
rijndaelManaged.KeySize = 256;
|
||||
rijndaelManaged.BlockSize = 256;
|
||||
byte[] array = new byte[0];
|
||||
byte[] array2 = new byte[0];
|
||||
string s = Cryptographer.generateKeyString();
|
||||
string s2 = Certification.Udid.Replace("-", "");
|
||||
array = Encoding.UTF8.GetBytes(s);
|
||||
array2 = Encoding.UTF8.GetBytes(s2);
|
||||
ICryptoTransform transform = rijndaelManaged.CreateEncryptor(array, array2);
|
||||
using MemoryStream memoryStream = new MemoryStream();
|
||||
using CryptoStream cryptoStream = new CryptoStream(memoryStream, transform, CryptoStreamMode.Write);
|
||||
byte[] bytes = Encoding.UTF8.GetBytes(prm_text_to_encrypt);
|
||||
cryptoStream.Write(bytes, 0, bytes.Length);
|
||||
cryptoStream.FlushFinalBlock();
|
||||
byte[] array3 = memoryStream.ToArray();
|
||||
byte[] array4 = new byte[array3.Length + array.Length];
|
||||
Array.Copy(array3, 0, array4, 0, array3.Length);
|
||||
Array.Copy(array, 0, array4, array3.Length, array.Length);
|
||||
rijndaelManaged.Clear();
|
||||
memoryStream.Flush();
|
||||
memoryStream.Close();
|
||||
cryptoStream.Flush();
|
||||
cryptoStream.Close();
|
||||
return Convert.ToBase64String(array4);
|
||||
}
|
||||
|
||||
public static string EncryptRJ256ForNode(string prm_text_to_encrypt)
|
||||
{
|
||||
using AesManaged aesManaged = new AesManaged();
|
||||
@@ -135,33 +104,6 @@ public class CryptAES
|
||||
return array4;
|
||||
}
|
||||
|
||||
public static string DecryptRJ256(string prm_text_to_decrypt)
|
||||
{
|
||||
byte[] array = Convert.FromBase64String(prm_text_to_decrypt);
|
||||
using RijndaelManaged rijndaelManaged = new RijndaelManaged();
|
||||
rijndaelManaged.Padding = PaddingMode.Zeros;
|
||||
rijndaelManaged.Mode = CipherMode.CBC;
|
||||
rijndaelManaged.KeySize = 256;
|
||||
rijndaelManaged.BlockSize = 256;
|
||||
byte[] array2 = new byte[32];
|
||||
byte[] array3 = new byte[32];
|
||||
byte[] array4 = new byte[array.Length - array2.Length];
|
||||
Array.Copy(array, 0, array4, 0, array4.Length);
|
||||
Array.Copy(array, array.Length - array2.Length, array2, 0, array2.Length);
|
||||
array3 = Encoding.UTF8.GetBytes(Certification.Udid.Replace("-", ""));
|
||||
ICryptoTransform transform = rijndaelManaged.CreateDecryptor(array2, array3);
|
||||
byte[] array5 = new byte[array4.Length];
|
||||
using MemoryStream memoryStream = new MemoryStream(array4);
|
||||
using CryptoStream cryptoStream = new CryptoStream(memoryStream, transform, CryptoStreamMode.Read);
|
||||
cryptoStream.Read(array5, 0, array5.Length);
|
||||
rijndaelManaged.Clear();
|
||||
cryptoStream.Flush();
|
||||
cryptoStream.Close();
|
||||
memoryStream.Flush();
|
||||
memoryStream.Close();
|
||||
return Encoding.UTF8.GetString(array5).TrimEnd(default(char));
|
||||
}
|
||||
|
||||
public static string DecryptRJ256ForNode(string prm_text_to_decrypt)
|
||||
{
|
||||
using AesManaged aesManaged = new AesManaged();
|
||||
@@ -181,68 +123,4 @@ public class CryptAES
|
||||
aesManaged.Clear();
|
||||
return result;
|
||||
}
|
||||
|
||||
public static byte[] EncryptRJ256(byte[] binData)
|
||||
{
|
||||
using RijndaelManaged rijndaelManaged = new RijndaelManaged();
|
||||
rijndaelManaged.Padding = PaddingMode.PKCS7;
|
||||
rijndaelManaged.Mode = CipherMode.CBC;
|
||||
rijndaelManaged.KeySize = 256;
|
||||
rijndaelManaged.BlockSize = 256;
|
||||
byte[] array = new byte[0];
|
||||
byte[] array2 = new byte[0];
|
||||
string s = Cryptographer.generateKeyString();
|
||||
string s2 = Certification.Udid.Replace("-", "");
|
||||
array = Encoding.UTF8.GetBytes(s);
|
||||
array2 = Encoding.UTF8.GetBytes(s2);
|
||||
ICryptoTransform transform = rijndaelManaged.CreateEncryptor(array, array2);
|
||||
using MemoryStream memoryStream = new MemoryStream();
|
||||
using CryptoStream cryptoStream = new CryptoStream(memoryStream, transform, CryptoStreamMode.Write);
|
||||
byte[] bytes = BitConverter.GetBytes(binData.Length);
|
||||
byte[] array3 = new byte[4 + binData.Length];
|
||||
Array.Copy(bytes, 0, array3, 0, 4);
|
||||
Array.Copy(binData, 0, array3, 4, binData.Length);
|
||||
cryptoStream.Write(array3, 0, array3.Length);
|
||||
cryptoStream.FlushFinalBlock();
|
||||
byte[] array4 = memoryStream.ToArray();
|
||||
byte[] array5 = new byte[array.Length + array4.Length];
|
||||
Array.Copy(array4, 0, array5, 0, array4.Length);
|
||||
Array.Copy(array, 0, array5, array4.Length, array.Length);
|
||||
rijndaelManaged.Clear();
|
||||
memoryStream.Flush();
|
||||
memoryStream.Close();
|
||||
cryptoStream.Flush();
|
||||
cryptoStream.Close();
|
||||
return array5;
|
||||
}
|
||||
|
||||
public static byte[] DecryptRJ256(byte[] binData)
|
||||
{
|
||||
using RijndaelManaged rijndaelManaged = new RijndaelManaged();
|
||||
rijndaelManaged.Padding = PaddingMode.PKCS7;
|
||||
rijndaelManaged.Mode = CipherMode.CBC;
|
||||
rijndaelManaged.KeySize = 256;
|
||||
rijndaelManaged.BlockSize = 256;
|
||||
byte[] array = new byte[32];
|
||||
byte[] array2 = new byte[32];
|
||||
byte[] array3 = new byte[binData.Length - array.Length];
|
||||
Array.Copy(binData, 0, array3, 0, array3.Length);
|
||||
Array.Copy(binData, binData.Length - array.Length, array, 0, array.Length);
|
||||
array2 = Encoding.UTF8.GetBytes(Certification.Udid.Replace("-", ""));
|
||||
ICryptoTransform transform = rijndaelManaged.CreateDecryptor(array, array2);
|
||||
byte[] array4 = new byte[array3.Length];
|
||||
using MemoryStream memoryStream = new MemoryStream(array3);
|
||||
using CryptoStream cryptoStream = new CryptoStream(memoryStream, transform, CryptoStreamMode.Read);
|
||||
cryptoStream.Read(array4, 0, array4.Length);
|
||||
byte[] array5 = new byte[4];
|
||||
Array.Copy(array4, 0, array5, 0, 4);
|
||||
byte[] array6 = new byte[BitConverter.ToInt32(array5, 0)];
|
||||
Array.Copy(array4, 4, array6, 0, array6.Length);
|
||||
rijndaelManaged.Clear();
|
||||
memoryStream.Flush();
|
||||
memoryStream.Close();
|
||||
cryptoStream.Flush();
|
||||
cryptoStream.Close();
|
||||
return array6;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,16 +7,11 @@ namespace Cute;
|
||||
|
||||
public class Cryptographer
|
||||
{
|
||||
public const int FBENCRYPT_BLOCK_SIZE = 32;
|
||||
|
||||
private static string encode_buf;
|
||||
|
||||
private static Random cRandom = new Random();
|
||||
|
||||
private static SHA1CryptoServiceProvider sha1 = null;
|
||||
|
||||
private static UTF8Encoding utf8 = null;
|
||||
|
||||
private static int random()
|
||||
{
|
||||
return cRandom.Next(1, 9);
|
||||
@@ -115,30 +110,4 @@ public class Cryptographer
|
||||
mD5CryptoServiceProvider.Clear();
|
||||
return text;
|
||||
}
|
||||
|
||||
public static string ComputeSHA1(string seed)
|
||||
{
|
||||
if (sha1 == null)
|
||||
{
|
||||
sha1 = new SHA1CryptoServiceProvider();
|
||||
}
|
||||
if (utf8 == null)
|
||||
{
|
||||
utf8 = new UTF8Encoding();
|
||||
}
|
||||
if (string.IsNullOrEmpty(seed))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
byte[] bytes = utf8.GetBytes(seed);
|
||||
byte[] array = sha1.ComputeHash(bytes);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
int num = array.Length;
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
stringBuilder.Append(Convert.ToString(array[i], 16).PadLeft(2, '0'));
|
||||
}
|
||||
sha1.Initialize();
|
||||
return stringBuilder.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
using Wizard;
|
||||
// TODO(engine-cleanup-pass2): 37 of 39 methods unrun in baseline
|
||||
// Type: Cute.CustomPreference
|
||||
// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt
|
||||
|
||||
|
||||
namespace Cute;
|
||||
|
||||
@@ -15,48 +19,24 @@ public class CustomPreference
|
||||
|
||||
public enum PlatformType
|
||||
{
|
||||
NONE,
|
||||
APPLE,
|
||||
GOOGLE,
|
||||
DMM,
|
||||
STEAM
|
||||
}
|
||||
NONE }
|
||||
|
||||
public enum SmallResourceStatus
|
||||
{
|
||||
NO_SELECT,
|
||||
USE_NORMAL,
|
||||
USE_SMALL
|
||||
}
|
||||
|
||||
private const string fileScheme = "file:///";
|
||||
|
||||
private const string httpScheme = "http://";
|
||||
|
||||
private const string httpsScheme = "https://";
|
||||
|
||||
private const string jarFileScheme = "jar:file://";
|
||||
|
||||
private static string nodeServerScheme = "ws://";
|
||||
|
||||
private const string directoryLowLevelResources = "Low/";
|
||||
|
||||
private const string directoryHighLevelResources = "High/";
|
||||
|
||||
private static string directoryRoot = "dl/";
|
||||
|
||||
private static string _applicationServerUrl = "";
|
||||
|
||||
private static string _resourceServerUrl = "";
|
||||
|
||||
private static string _nodeServerUrl = "";
|
||||
|
||||
private static string _deckBuilderServerUrl = "";
|
||||
|
||||
public static string _localePref = "Eng";
|
||||
|
||||
private static string _signaturePref = "";
|
||||
|
||||
private static string _languagePref = "Eng";
|
||||
|
||||
private static string _languageSoundPref = "Eng";
|
||||
@@ -75,34 +55,8 @@ public class CustomPreference
|
||||
|
||||
private static eSchemeType _schemeCDNType = eSchemeType.Http;
|
||||
|
||||
private static bool _isPreferenceComplete = false;
|
||||
|
||||
private static bool _isLocalAssetBundles = false;
|
||||
|
||||
public static bool isPreferenceComplete
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isPreferenceComplete;
|
||||
}
|
||||
set
|
||||
{
|
||||
_isPreferenceComplete = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool isLocalAssetBundles
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isLocalAssetBundles;
|
||||
}
|
||||
set
|
||||
{
|
||||
_isLocalAssetBundles = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsNormalResource => !IsSmallResource;
|
||||
|
||||
public static bool IsSmallResource => PlayerPrefsCache.Instance.GetValue(PlayerPrefsWrapper.SMALL_RESOURCE_STATUS) == 2;
|
||||
@@ -112,44 +66,16 @@ public class CustomPreference
|
||||
return GetScheme() + _applicationServerUrl;
|
||||
}
|
||||
|
||||
public static void SetApplicationServerURL(string strApplicationServer)
|
||||
{
|
||||
_applicationServerUrl = strApplicationServer;
|
||||
}
|
||||
|
||||
public static string GetResourceServerURL()
|
||||
{
|
||||
return GetCDNScheme() + _resourceServerUrl;
|
||||
}
|
||||
|
||||
public static void SetResourceServerURL(string strResourceServer)
|
||||
{
|
||||
_resourceServerUrl = strResourceServer;
|
||||
}
|
||||
|
||||
public static string GetNodeServerURL()
|
||||
{
|
||||
return nodeServerScheme + _nodeServerUrl;
|
||||
}
|
||||
|
||||
public static void SetNodeServerURL(string strNodeServer)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(strNodeServer))
|
||||
{
|
||||
_nodeServerUrl = strNodeServer;
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetDeckBuilderServerURL()
|
||||
{
|
||||
return GetScheme() + _deckBuilderServerUrl;
|
||||
}
|
||||
|
||||
public static void SetDeckBuilderServerURL(string strDeckBuilderServer)
|
||||
{
|
||||
_deckBuilderServerUrl = strDeckBuilderServer;
|
||||
}
|
||||
|
||||
public static int GetPlatform()
|
||||
{
|
||||
return 4;
|
||||
@@ -216,53 +142,6 @@ public class CustomPreference
|
||||
return Toolbox.SavedataManager.GetResourceVersion() + "/";
|
||||
}
|
||||
|
||||
public static void SetScemeMode(eSchemeType schemeType)
|
||||
{
|
||||
_schemeType = schemeType;
|
||||
}
|
||||
|
||||
public static void SetScemeModeCDN(eSchemeType schemeCDNType)
|
||||
{
|
||||
_schemeCDNType = schemeCDNType;
|
||||
}
|
||||
|
||||
public static void SetOptionalNodeSceme()
|
||||
{
|
||||
if (PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_SELECT_WSS))
|
||||
{
|
||||
SetNodeSceme("wss://");
|
||||
}
|
||||
else
|
||||
{
|
||||
SetNodeSceme("ws://");
|
||||
}
|
||||
}
|
||||
|
||||
private static void SetNodeSceme(string scheme)
|
||||
{
|
||||
nodeServerScheme = scheme;
|
||||
}
|
||||
|
||||
public static void SetRootFolderName(string strDir)
|
||||
{
|
||||
directoryRoot = strDir;
|
||||
}
|
||||
|
||||
public static void SetTextLanguage(string strLanguage)
|
||||
{
|
||||
_languagePref = strLanguage;
|
||||
}
|
||||
|
||||
public static void SetLocale(string strLocale)
|
||||
{
|
||||
_localePref = strLocale;
|
||||
}
|
||||
|
||||
public static string GetLanguageFolderName()
|
||||
{
|
||||
return _languagePref + "/";
|
||||
}
|
||||
|
||||
public static string GetTextLanguage()
|
||||
{
|
||||
return GetResourceLanguage();
|
||||
@@ -273,11 +152,6 @@ public class CustomPreference
|
||||
return _languagePref;
|
||||
}
|
||||
|
||||
public static void SetSoundLanguage(string strLanguage)
|
||||
{
|
||||
_languageSoundPref = strLanguage;
|
||||
}
|
||||
|
||||
public static string GetSoundMovieLanguageFolderName()
|
||||
{
|
||||
return _languageSoundPref + "/";
|
||||
@@ -287,32 +161,4 @@ public class CustomPreference
|
||||
{
|
||||
return _languageSoundPref;
|
||||
}
|
||||
|
||||
public static void SetSignature(string strSignature)
|
||||
{
|
||||
_signaturePref = strSignature;
|
||||
}
|
||||
|
||||
public static string GetSignaturePath()
|
||||
{
|
||||
return "/../" + _signaturePref;
|
||||
}
|
||||
|
||||
public static void createResourcePath()
|
||||
{
|
||||
if (_isLocalAssetBundles)
|
||||
{
|
||||
_assetbundleurl = GetResourceServerURL() + Utility.GetRuntimePlatform() + "/";
|
||||
_manifestsuburl = GetResourceServerURL() + Utility.GetRuntimePlatform() + "/";
|
||||
}
|
||||
else
|
||||
{
|
||||
_assetbundleurl = GetResourceServerURL() + directoryRoot + "Resource/" + GetLanguageFolderName() + Utility.GetRuntimePlatform() + "/";
|
||||
string text = "Manifest/";
|
||||
_manifestsuburl = GetResourceServerURL() + directoryRoot + text + GetVersionFolderName() + GetSoundMovieLanguageFolderName() + Utility.GetRuntimePlatform() + "/";
|
||||
_manifestUrl = GetResourceServerURL() + directoryRoot + text + GetVersionFolderName() + GetLanguageFolderName() + Utility.GetRuntimePlatform() + "/";
|
||||
}
|
||||
_soundurl = GetResourceServerURL() + directoryRoot + "Sound/" + GetSoundMovieLanguageFolderName();
|
||||
_movieurl = GetResourceServerURL() + directoryRoot + "Resource/" + GetSoundMovieLanguageFolderName() + Utility.GetRuntimePlatform() + "/";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,61 +37,13 @@ public static class CuteNetworkDefine
|
||||
GOOGLE_PLAY,
|
||||
GAME_CENTER,
|
||||
FACEBOOK,
|
||||
DMM,
|
||||
STEAM,
|
||||
APPLE_ID
|
||||
}
|
||||
|
||||
public enum CONNECT_TYPE
|
||||
{
|
||||
SOCIAL_ACCOUNT_CONNECT = 1,
|
||||
SOCIAL_ACCOUNT_DISCONNECT,
|
||||
SOCIAL_ACCOUNT_GAME_DATA_UPDATE,
|
||||
TRANS_CODE_GAME_DATA_UPDATE
|
||||
}
|
||||
|
||||
public const int API_RESULT_SUCCESS_CODE = 1;
|
||||
|
||||
public const int RESULT_CODE_DATABASE_ERROR = 100;
|
||||
|
||||
public const int RESULT_CODE_MAINTENANCE_COMMON = 101;
|
||||
|
||||
public const int RESULT_CODE_SERVER_ERROR = 102;
|
||||
|
||||
public const int API_RESULT_SESSION_ERROR = 201;
|
||||
|
||||
public const int RESULT_CODE_ACCOUNT_BLOCK_ERROR = 203;
|
||||
|
||||
public const int RESULT_CODE_ACCOUNT_LIMITED_BLOCK_ERROR = 217;
|
||||
|
||||
public const string ACCOUNT_LIMITED_BLOCK_END_TIME = "account_block_end_time";
|
||||
|
||||
public const int RESULT_CODE_NETEASE_ACCOUNT_BLOCK_ERROR = 330;
|
||||
|
||||
public const int API_RESULT_VERSION_ERROR = 204;
|
||||
|
||||
public const int RESULT_CODE_PROCESSED_ERROR = 213;
|
||||
|
||||
public const int RESULT_CODE_PAYMENT_VALIDATION_ERROR = 308;
|
||||
|
||||
public const int RESULT_CODE_DMM_ONETIMETOKEN_EXPIRED = 317;
|
||||
|
||||
public const int RESULT_CODE_SOLO_PLAY_ALREADY_FINISH = 1352;
|
||||
|
||||
public const int RESULT_CODE_MAINTENANCE_FROM = 2000;
|
||||
|
||||
public const int RESULT_CODE_MAINTENANCE_TO = 2999;
|
||||
|
||||
public const string MAINTENACE_END_TIME = "maintenance_end_time";
|
||||
|
||||
public const int RESULT_CODE_MAINTENANCE_CARD_TWO_PICK = 1710;
|
||||
|
||||
public const int RESULT_CODE_MAINTENANCE_CARD_OPEN_SIX = 5013;
|
||||
|
||||
public const int RESULT_CODE_ALREADY_BATTLE_RESULT = 3502;
|
||||
|
||||
public const int RC_OPEN_ROOM_SET_DECK_IN_BATTLE_PHASE = 1768;
|
||||
|
||||
public static Dictionary<ApiType, string> ApiUrlList = new Dictionary<ApiType, string>
|
||||
{
|
||||
{
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
using Wizard;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class DataMigration
|
||||
{
|
||||
public enum status
|
||||
{
|
||||
NONE,
|
||||
OVER,
|
||||
FAIL
|
||||
}
|
||||
|
||||
private static bool inProgress;
|
||||
|
||||
public static bool canCombine()
|
||||
{
|
||||
if (Certification.ViewerId != 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void CombineStart(string url)
|
||||
{
|
||||
BrowserURL.Open(url);
|
||||
inProgress = true;
|
||||
}
|
||||
|
||||
public static bool isCombineSucceed()
|
||||
{
|
||||
if (Toolbox.SavedataManager.GetInt("COMBINED") != 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool isProgressing()
|
||||
{
|
||||
return inProgress;
|
||||
}
|
||||
|
||||
public static void ProgressOver()
|
||||
{
|
||||
inProgress = false;
|
||||
URLScheme.Clear();
|
||||
}
|
||||
|
||||
public static void CombineSucceed()
|
||||
{
|
||||
Toolbox.SavedataManager.SetInt("COMBINED", 1);
|
||||
}
|
||||
|
||||
public static void CombineFailed()
|
||||
{
|
||||
}
|
||||
|
||||
public static void MigrationStart(string url)
|
||||
{
|
||||
BrowserURL.Open(url);
|
||||
inProgress = true;
|
||||
}
|
||||
|
||||
public static void MigrationSucceed()
|
||||
{
|
||||
CombineSucceed();
|
||||
}
|
||||
|
||||
public static void MigrationFailed()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -7,96 +7,6 @@ namespace Cute;
|
||||
public class DebugManager : MonoBehaviour
|
||||
{
|
||||
public enum LOG_LEVEL
|
||||
{
|
||||
NORMAL,
|
||||
HIGH,
|
||||
VERY_HIGH,
|
||||
VERY_HIGH2,
|
||||
VERY_HIGH3,
|
||||
VERY_HIGH4
|
||||
}
|
||||
|
||||
[Conditional("USE_DBGSYS")]
|
||||
public void Log(string text)
|
||||
{
|
||||
}
|
||||
|
||||
[Conditional("USE_DBGSYS")]
|
||||
public void LogWarning(string text)
|
||||
{
|
||||
}
|
||||
|
||||
[Conditional("USE_DBGSYS")]
|
||||
public void LogAppend(string text)
|
||||
{
|
||||
}
|
||||
|
||||
[Conditional("USE_DBGSYS")]
|
||||
public void LogAppendWarning(string text)
|
||||
{
|
||||
}
|
||||
|
||||
public void ClearLog()
|
||||
{
|
||||
}
|
||||
|
||||
[Conditional("USE_DBGSYS")]
|
||||
public void TextLog(string text)
|
||||
{
|
||||
}
|
||||
|
||||
[Conditional("USE_DBGSYS")]
|
||||
public void SoundLog(string text)
|
||||
{
|
||||
}
|
||||
|
||||
[Conditional("USE_DBGSYS")]
|
||||
public void SoundLogWarning(string text)
|
||||
{
|
||||
}
|
||||
|
||||
[Conditional("USE_DBGSYS")]
|
||||
public void SoundLogAppend(string text)
|
||||
{
|
||||
}
|
||||
|
||||
[Conditional("USE_DBGSYS")]
|
||||
public void SoundLogAppendWarning(string text)
|
||||
{
|
||||
}
|
||||
|
||||
[Conditional("USE_DBGSYS")]
|
||||
public void ClearSoundLog()
|
||||
{
|
||||
}
|
||||
|
||||
[Conditional("USE_DBGSYS")]
|
||||
public void BattleLogAppend(string text)
|
||||
{
|
||||
}
|
||||
|
||||
[Conditional("USE_DBGSYS")]
|
||||
public void BattleLogAppendWarning(string text)
|
||||
{
|
||||
}
|
||||
|
||||
[Conditional("USE_DBGSYS")]
|
||||
public void ClearBattleLog()
|
||||
{
|
||||
}
|
||||
|
||||
[Conditional("USE_DBGSYS")]
|
||||
public void Log(object log, LOG_LEVEL level)
|
||||
{
|
||||
}
|
||||
|
||||
[Conditional("USE_DBGSYS")]
|
||||
public void LogError(object log)
|
||||
{
|
||||
}
|
||||
|
||||
[Conditional("USE_DBGSYS")]
|
||||
public void LogException(Exception e)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,22 +15,11 @@ public class DeviceManager : MonoBehaviour, IManager
|
||||
{
|
||||
public enum TextureCompression
|
||||
{
|
||||
ETC,
|
||||
DXT,
|
||||
ATC,
|
||||
PVRTC
|
||||
}
|
||||
DXT }
|
||||
|
||||
public enum DeviceType
|
||||
{
|
||||
NONE,
|
||||
IPHONE,
|
||||
ANDROID,
|
||||
WINDOWS,
|
||||
OSX
|
||||
}
|
||||
|
||||
private const string BUILDPARAMFILE = "/CuteBuildParam.xml";
|
||||
NONE }
|
||||
|
||||
private string strBuildVersionName = "9.9.9";
|
||||
|
||||
@@ -40,8 +29,6 @@ public class DeviceManager : MonoBehaviour, IManager
|
||||
|
||||
private string _winOsVersion;
|
||||
|
||||
private bool tokenSent;
|
||||
|
||||
private string _getIpAddressWithFamilyTypeLog = "";
|
||||
|
||||
private void Awake()
|
||||
@@ -49,35 +36,11 @@ public class DeviceManager : MonoBehaviour, IManager
|
||||
CheckTextureCompression();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
SetBuildVersionName();
|
||||
Toolbox.DeviceManager = this;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
}
|
||||
|
||||
public TextureCompression GetTextureCompression()
|
||||
{
|
||||
return textureCommpression;
|
||||
}
|
||||
|
||||
private void CheckTextureCompression()
|
||||
{
|
||||
textureCommpression = TextureCompression.DXT;
|
||||
}
|
||||
|
||||
public string GetModelName()
|
||||
{
|
||||
return SystemInfo.deviceModel;
|
||||
}
|
||||
|
||||
public string GetOsVersion()
|
||||
{
|
||||
if (string.IsNullOrEmpty(_winOsVersion))
|
||||
@@ -115,16 +78,6 @@ public class DeviceManager : MonoBehaviour, IManager
|
||||
return CustomPreference._localePref;
|
||||
}
|
||||
|
||||
public string getSignature()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
public bool isRootUser()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public string GetDeviceUniqueIdentifier()
|
||||
{
|
||||
string text = "";
|
||||
@@ -246,39 +199,4 @@ public class DeviceManager : MonoBehaviour, IManager
|
||||
_ipAddress = null;
|
||||
LocalLog.AccumulateTraceInquiryLog("ClearIpAddress " + StackTraceUtility.ExtractStackTrace());
|
||||
}
|
||||
|
||||
public string GetCarrier()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
public void SetVersionName()
|
||||
{
|
||||
SetBuildVersionName();
|
||||
}
|
||||
|
||||
public void SetBuildVersionName()
|
||||
{
|
||||
string text = Application.streamingAssetsPath + "/CuteBuildParam.xml";
|
||||
if (!File.Exists(text))
|
||||
{
|
||||
return;
|
||||
}
|
||||
XmlDocument xmlDocument = new XmlDocument();
|
||||
xmlDocument.Load(text);
|
||||
if (xmlDocument.FirstChild == null || xmlDocument.FirstChild.NextSibling == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
IEnumerator enumerator = xmlDocument.FirstChild.NextSibling.GetEnumerator();
|
||||
while (enumerator.MoveNext())
|
||||
{
|
||||
XmlNode xmlNode = (XmlNode)enumerator.Current;
|
||||
if (xmlNode.Name.Equals("versionName"))
|
||||
{
|
||||
strBuildVersionName = xmlNode.InnerText;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
using System;
|
||||
// TODO(engine-cleanup-pass2): 20 of 21 methods unrun in baseline
|
||||
// Type: Cute.EventExtension
|
||||
// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt
|
||||
|
||||
|
||||
namespace Cute;
|
||||
|
||||
|
||||
@@ -9,13 +9,6 @@ public class GameStartCheckTask : NetworkTask
|
||||
{
|
||||
private class CheckParams : PostParams
|
||||
{
|
||||
public int app_type;
|
||||
|
||||
public string campaign_data = "";
|
||||
|
||||
public string campaign_sign = "";
|
||||
|
||||
public int campaign_user;
|
||||
}
|
||||
|
||||
private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.GameStartCheck;
|
||||
@@ -28,10 +21,6 @@ public class GameStartCheckTask : NetworkTask
|
||||
|
||||
public static bool IsSetTransitionPassword;
|
||||
|
||||
public static int _tosId;
|
||||
|
||||
public static int _privacyPolicyId;
|
||||
|
||||
public static bool HasAppliedForAccountDeletion { get; private set; } = false;
|
||||
|
||||
public static string RefundUrl { get; private set; } = string.Empty;
|
||||
@@ -47,27 +36,6 @@ public class GameStartCheckTask : NetworkTask
|
||||
IsSocialAccountDataTransSet = new List<CuteNetworkDefine.ACCOUNT_TYPE>();
|
||||
}
|
||||
|
||||
public void SetParameter()
|
||||
{
|
||||
CheckParams checkParams = new CheckParams();
|
||||
if (URLScheme.AppType != 0)
|
||||
{
|
||||
checkParams.campaign_data = URLScheme.CampaignData;
|
||||
checkParams.app_type = URLScheme.AppType;
|
||||
}
|
||||
checkParams.campaign_sign = Toolbox.DeviceManager.getSignature();
|
||||
int num = Random.Range(0, 100000);
|
||||
if (Toolbox.DeviceManager.isRootUser())
|
||||
{
|
||||
checkParams.campaign_user = 2 * num + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
checkParams.campaign_user = 2 * num;
|
||||
}
|
||||
base.Params = checkParams;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
@@ -112,7 +80,7 @@ public class GameStartCheckTask : NetworkTask
|
||||
}
|
||||
if (base.ResponseData["data"].Keys.Contains("rewrite_viewer_id"))
|
||||
{
|
||||
Certification.ViewerId = base.ResponseData["data"]["rewrite_viewer_id"].ToInt();
|
||||
/* Pre-Phase-5 chunk 39: rewrite_viewer_id is a client-only Cute path; dead headless */
|
||||
}
|
||||
if (base.ResponseData["data"].Keys.Contains("is_set_transition_password"))
|
||||
{
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
using LitJson;
|
||||
using Wizard;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class GetGameDataByTransitionCode : NetworkTask
|
||||
{
|
||||
public class ChainedPlayData
|
||||
{
|
||||
public string ChainedViewerId { get; set; }
|
||||
|
||||
public string Password { get; set; }
|
||||
|
||||
public string UserName { get; set; }
|
||||
|
||||
public string UserRankRotation { get; set; }
|
||||
|
||||
public string UserRankUnlimited { get; set; }
|
||||
}
|
||||
|
||||
private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.GetGameDataByTransitionCode;
|
||||
|
||||
public static ChainedPlayData ChainedPlayDatas { get; private set; }
|
||||
|
||||
public static string NowUserName { get; private set; }
|
||||
|
||||
public static string NowUserRankRotation { get; private set; }
|
||||
|
||||
public static string NowUserRankUnlimited { get; private set; }
|
||||
|
||||
public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}";
|
||||
|
||||
public GetGameDataByTransitionCode()
|
||||
{
|
||||
ChainedPlayDatas = new ChainedPlayData();
|
||||
}
|
||||
|
||||
public void SetParameter(string input_viewer_id, string password)
|
||||
{
|
||||
TransitionCodeParams transitionCodeParams = new TransitionCodeParams();
|
||||
transitionCodeParams.input_viewer_id = input_viewer_id;
|
||||
transitionCodeParams.password = password;
|
||||
base.Params = transitionCodeParams;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
ChainedPlayDatas.ChainedViewerId = "";
|
||||
ChainedPlayDatas.Password = "";
|
||||
ChainedPlayDatas.UserName = " - ";
|
||||
ChainedPlayDatas.UserRankRotation = " - ";
|
||||
ChainedPlayDatas.UserRankUnlimited = " - ";
|
||||
NowUserName = " - ";
|
||||
NowUserRankRotation = " - ";
|
||||
NowUserRankUnlimited = " - ";
|
||||
if (base.ResponseData["data"].Count > 0)
|
||||
{
|
||||
if (base.ResponseData["data"].Keys.Contains("chained_viewer_id") && base.ResponseData["data"]["chained_viewer_id"] != null && base.ResponseData["data"]["chained_viewer_id"].ToString() != "")
|
||||
{
|
||||
ChainedPlayDatas.ChainedViewerId = base.ResponseData["data"]["chained_viewer_id"].ToString();
|
||||
}
|
||||
if (base.ResponseData["data"].Keys.Contains("password") && base.ResponseData["data"]["password"] != null && base.ResponseData["data"]["password"].ToString() != "")
|
||||
{
|
||||
ChainedPlayDatas.Password = base.ResponseData["data"]["password"].ToString();
|
||||
}
|
||||
if (base.ResponseData["data"].Keys.Contains("name") && base.ResponseData["data"]["name"] != null && base.ResponseData["data"]["name"].ToString() != "")
|
||||
{
|
||||
ChainedPlayDatas.UserName = base.ResponseData["data"]["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 jsonData = base.ResponseData["data"]["rank"];
|
||||
if (jsonData.Keys.Contains(text))
|
||||
{
|
||||
ChainedPlayDatas.UserRankRotation = systemText.Get(jsonData[text].ToString());
|
||||
}
|
||||
if (jsonData.Keys.Contains(text2))
|
||||
{
|
||||
ChainedPlayDatas.UserRankUnlimited = systemText.Get(jsonData[text2].ToString());
|
||||
}
|
||||
}
|
||||
NowUserName = base.ResponseData["data"]["now_name"].ToString();
|
||||
JsonData jsonData2 = base.ResponseData["data"]["now_rank"];
|
||||
NowUserRankRotation = systemText.Get(jsonData2[text].ToString());
|
||||
NowUserRankUnlimited = systemText.Get(jsonData2[text2].ToString());
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -53,14 +53,6 @@ public static class HangulManager
|
||||
}
|
||||
}
|
||||
|
||||
private const int STRING_BUILDER_CAPACITY = 512;
|
||||
|
||||
private const char dHANGUL_START = '가';
|
||||
|
||||
private const char dHANGUL_END = '힣';
|
||||
|
||||
private const char JOSI_TYPE_IDENTIFIER = '@';
|
||||
|
||||
private static readonly char[] CHOSUNG_TABLE = new char[19]
|
||||
{
|
||||
'ㄱ', 'ㄲ', 'ㄴ', 'ㄷ', 'ㄸ', 'ㄹ', 'ㅁ', 'ㅂ', 'ㅃ', 'ㅅ',
|
||||
@@ -99,8 +91,6 @@ public static class HangulManager
|
||||
|
||||
private const string ENCLOSED = "ENCLOSED";
|
||||
|
||||
private const string NUMERAL_PATTERN = "(?<START_TAG>\\[num\\])(?<ENCLOSED>.*?)(?<END_TAG>\\[/num\\])";
|
||||
|
||||
private static readonly string[] NUMERAL_TABLE = new string[100]
|
||||
{
|
||||
"0", "하나", "둘", "셋", "넷", "다섯", "여섯", "일곱", "여덟", "아홉",
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
namespace Cute;
|
||||
|
||||
public interface INetworkUI
|
||||
{
|
||||
string GetText(string code);
|
||||
|
||||
void StartLoading(bool notEditor = false);
|
||||
|
||||
void StopLoading();
|
||||
|
||||
void GoToMypage();
|
||||
|
||||
void SoftwareRest();
|
||||
|
||||
bool IsKeepLastRequest();
|
||||
|
||||
void SetKeepLastRequest(bool flag);
|
||||
|
||||
void OpenRetryAndToTitleErrorPopUp(string title, string message, string code);
|
||||
|
||||
void OpenGoToMypageErrorPopUp(string title, string message, string code);
|
||||
|
||||
void OpenGoToTitleErrorPopUp(string title, string message, string code);
|
||||
|
||||
void OpenGotoStoreErrorPopup();
|
||||
|
||||
void OpenRetryFailErrorPopup();
|
||||
|
||||
void OpenTimeOutErrorPopUp();
|
||||
|
||||
void OpenHttpStatusErrorPopUp();
|
||||
|
||||
void OpenResourceVersionUpPopUp();
|
||||
|
||||
void OpenSessionErrorPopUp();
|
||||
|
||||
bool isCloseDialogGroupError(int resultCode);
|
||||
|
||||
void OpenCloseOnlyErrorPopUp(int resultCode);
|
||||
|
||||
void OpenStrictServerErrorPopUp(int resultCode);
|
||||
|
||||
void OpenAccountBlockErrorPopUp(int resultCode);
|
||||
|
||||
void OpenAccountLimitedBlockErrorPopUp(int resultCode, string endTimeText);
|
||||
|
||||
void OpenAllMaintenancePopUp(int resultCode, string endTime);
|
||||
|
||||
void OpenEachFunctionMaintenancePopUp(int resultCode);
|
||||
|
||||
void OpenOtherServerErrorPopUp(int resultCode);
|
||||
|
||||
void OpenSocialServiceNoResponseErrorPopup();
|
||||
}
|
||||
@@ -36,8 +36,6 @@ public class LeanThreadPool
|
||||
}
|
||||
}
|
||||
|
||||
public int ThreadsCount => _threads.Length;
|
||||
|
||||
private LeanThreadPool()
|
||||
{
|
||||
int processorCount = SystemInfo.processorCount;
|
||||
@@ -79,22 +77,6 @@ public class LeanThreadPool
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerator KillAll(Action callback = null)
|
||||
{
|
||||
_quit = true;
|
||||
_convergeCount = 0;
|
||||
lock (_jobsLock)
|
||||
{
|
||||
_jobs.Clear();
|
||||
}
|
||||
_semaphore.Release(_threads.Length);
|
||||
while (_convergeCount < _threads.Length)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
callback.Call();
|
||||
}
|
||||
|
||||
public void AddJob(ParallelJob job)
|
||||
{
|
||||
lock (_jobsLock)
|
||||
|
||||
@@ -81,11 +81,6 @@ public class LocalSqliteKVS : ILocalKVS, IDisposable
|
||||
return new LocalSqliteKVS(path, enableCache);
|
||||
}
|
||||
|
||||
~LocalSqliteKVS()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose()
|
||||
{
|
||||
if (_db != null)
|
||||
@@ -121,60 +116,6 @@ public class LocalSqliteKVS : ILocalKVS, IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
public List<string> FindLike(string pattern)
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
try
|
||||
{
|
||||
_likeQuery.BindText(1, pattern);
|
||||
while (_likeQuery.Step())
|
||||
{
|
||||
list.Add(_likeQuery.GetText(0));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_likeQuery.Reset();
|
||||
}
|
||||
}
|
||||
|
||||
public string EscapeLikePattern(string pattern)
|
||||
{
|
||||
return Regex.Replace(pattern, "[_%\\[!]", "!$0");
|
||||
}
|
||||
|
||||
public void DisableCache()
|
||||
{
|
||||
_enableCache = false;
|
||||
_tableCache = null;
|
||||
}
|
||||
|
||||
public List<string> GetAll()
|
||||
{
|
||||
List<string> list = new List<string>();
|
||||
try
|
||||
{
|
||||
while (_selectAllQuery.Step())
|
||||
{
|
||||
list.Add(_selectAllQuery.GetText(0));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_selectAllQuery.Reset();
|
||||
}
|
||||
}
|
||||
|
||||
public string Get(string key)
|
||||
{
|
||||
if (_enableCache)
|
||||
|
||||
@@ -14,11 +14,6 @@ public class ManifestDatahashKVS : ILocalKVS, IDisposable
|
||||
_kvs = LocalSqliteKVS.Open(path, enableCache: true);
|
||||
}
|
||||
|
||||
~ManifestDatahashKVS()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public virtual void Dispose()
|
||||
{
|
||||
if (_kvs != null)
|
||||
@@ -39,18 +34,6 @@ public class ManifestDatahashKVS : ILocalKVS, IDisposable
|
||||
_kvs.Set(name, hash);
|
||||
}
|
||||
|
||||
public void Set(Dictionary<string, string> _dictionary)
|
||||
{
|
||||
if (_dictionary.Count <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (KeyValuePair<string, string> item in _dictionary)
|
||||
{
|
||||
Set(item.Key, item.Value);
|
||||
}
|
||||
}
|
||||
|
||||
public void Delete(string name)
|
||||
{
|
||||
_kvs.Delete(name);
|
||||
@@ -62,55 +45,6 @@ public class ManifestDatahashKVS : ILocalKVS, IDisposable
|
||||
Optimize();
|
||||
}
|
||||
|
||||
public void DisableCache()
|
||||
{
|
||||
_kvs.DisableCache();
|
||||
}
|
||||
|
||||
public void DeleteByList(List<string> _deleteList)
|
||||
{
|
||||
if (_deleteList.Count > 0)
|
||||
{
|
||||
Transaction(delegate
|
||||
{
|
||||
_deleteList.ForEach(Delete);
|
||||
});
|
||||
Optimize();
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteByPrefix(string prefix)
|
||||
{
|
||||
List<string> deleteList = _kvs.FindLike(_kvs.EscapeLikePattern(prefix) + "%");
|
||||
if (deleteList.Count <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Transaction(delegate
|
||||
{
|
||||
foreach (string item in deleteList)
|
||||
{
|
||||
Delete(item);
|
||||
}
|
||||
});
|
||||
Optimize();
|
||||
}
|
||||
|
||||
public List<string> GetAll()
|
||||
{
|
||||
return _kvs.GetAll();
|
||||
}
|
||||
|
||||
public List<string> FindLike(string patternEscaped)
|
||||
{
|
||||
return _kvs.FindLike(patternEscaped);
|
||||
}
|
||||
|
||||
public string EscapeLikePattern(string patternNoEscape)
|
||||
{
|
||||
return _kvs.EscapeLikePattern(patternNoEscape);
|
||||
}
|
||||
|
||||
public void Optimize()
|
||||
{
|
||||
_kvs.Optimize();
|
||||
|
||||
@@ -1,217 +0,0 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class MovieManager : MonoBehaviour, IManager
|
||||
{
|
||||
private string fileRootPath;
|
||||
|
||||
private string streamingAssetfileRootPath;
|
||||
|
||||
private MoviePlayer _player;
|
||||
|
||||
private float _volume = 1f;
|
||||
|
||||
private MovieSubtitles _movieSubtitles;
|
||||
|
||||
private IEnumerator Start()
|
||||
{
|
||||
Toolbox.MovieManager = this;
|
||||
while (!CustomPreference.isPreferenceComplete)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
fileRootPath = "file:///" + Application.persistentDataPath + "/";
|
||||
streamingAssetfileRootPath = "file:///" + Application.streamingAssetsPath + "/";
|
||||
}
|
||||
|
||||
private void CreateMoviePlayer()
|
||||
{
|
||||
GameObject gameObject = UnityEngine.Object.Instantiate(Resources.Load("Prefab/Movie/MoviePlayer")) as GameObject;
|
||||
gameObject.transform.parent = base.transform;
|
||||
_player = gameObject.GetComponent<MoviePlayer>();
|
||||
_player.SetVolume(_volume);
|
||||
}
|
||||
|
||||
public void Load(string filename)
|
||||
{
|
||||
if (!_player)
|
||||
{
|
||||
CreateMoviePlayer();
|
||||
}
|
||||
_player.Load(fileRootPath + filename);
|
||||
}
|
||||
|
||||
public void Unload()
|
||||
{
|
||||
if ((bool)_player)
|
||||
{
|
||||
UnityEngine.Object.Destroy(_player.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
public void Play()
|
||||
{
|
||||
if (IsReady() || IsPaused() || IsStopped())
|
||||
{
|
||||
_player.Play();
|
||||
}
|
||||
}
|
||||
|
||||
public void PlayWithSubtitles(string subtitlesCSV)
|
||||
{
|
||||
GameObject prefab = (GameObject)Resources.Load("UI/MovieSubtitles");
|
||||
_movieSubtitles = NGUITools.AddChild(UIManager.GetInstance().UIManagerRoot.gameObject, prefab).GetComponent<MovieSubtitles>();
|
||||
SetCallbackStart(delegate
|
||||
{
|
||||
_movieSubtitles.PlaySubtitles(subtitlesCSV);
|
||||
});
|
||||
Play();
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
if (_movieSubtitles != null)
|
||||
{
|
||||
_movieSubtitles.Finish();
|
||||
_movieSubtitles = null;
|
||||
}
|
||||
if (IsPlaying() || IsPaused())
|
||||
{
|
||||
_player.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
public void Pause()
|
||||
{
|
||||
if (IsPlaying())
|
||||
{
|
||||
_player.Pause();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetVolume(float volume)
|
||||
{
|
||||
_volume = volume;
|
||||
if ((bool)_player)
|
||||
{
|
||||
_player.SetVolume(volume);
|
||||
}
|
||||
}
|
||||
|
||||
public int GetSeekPosition()
|
||||
{
|
||||
if (!_player)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return _player.GetSeekPosition();
|
||||
}
|
||||
|
||||
public int GetDuration()
|
||||
{
|
||||
if (!_player)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return _player.GetDuration();
|
||||
}
|
||||
|
||||
public int GetCurrentSeekPercent()
|
||||
{
|
||||
if (!_player)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return _player.GetCurrentSeekPercent();
|
||||
}
|
||||
|
||||
public void SeekTo(int seek)
|
||||
{
|
||||
if ((bool)_player)
|
||||
{
|
||||
_player.SeekTo(seek);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsReady()
|
||||
{
|
||||
if (!_player)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return _player.IsReady();
|
||||
}
|
||||
|
||||
public bool IsPlaying()
|
||||
{
|
||||
if (!_player)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return _player.IsPlaying();
|
||||
}
|
||||
|
||||
public bool IsPaused()
|
||||
{
|
||||
if (!_player)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return _player.IsPaused();
|
||||
}
|
||||
|
||||
public bool IsStopped()
|
||||
{
|
||||
if (!_player)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return _player.IsStopped();
|
||||
}
|
||||
|
||||
public bool IsFinished()
|
||||
{
|
||||
if (!_player)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return _player.IsFinished();
|
||||
}
|
||||
|
||||
public bool IsError()
|
||||
{
|
||||
if (!_player)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return _player.IsError();
|
||||
}
|
||||
|
||||
public void SetCallbackReady(Action callback)
|
||||
{
|
||||
if ((bool)_player)
|
||||
{
|
||||
_player.CallbackReady += callback;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetCallbackStart(Action callback)
|
||||
{
|
||||
if ((bool)_player)
|
||||
{
|
||||
_player.CallbackStart += callback;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetCallbackEnd(Action callback)
|
||||
{
|
||||
if ((bool)_player)
|
||||
{
|
||||
_player.CallbackEnd += callback;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,155 +0,0 @@
|
||||
using System;
|
||||
using CriWare;
|
||||
using CriWare.CriMana;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class MoviePlayer : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private CriManaMovieMaterial _movieController;
|
||||
|
||||
[SerializeField]
|
||||
private Camera _camera;
|
||||
|
||||
public event Action CallbackReady;
|
||||
|
||||
public event Action CallbackStart;
|
||||
|
||||
public event Action CallbackEnd;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (_movieController.player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
switch (_movieController.player.status)
|
||||
{
|
||||
case Player.Status.Playing:
|
||||
if (this.CallbackStart != null)
|
||||
{
|
||||
this.CallbackStart();
|
||||
this.CallbackStart = null;
|
||||
}
|
||||
break;
|
||||
case Player.Status.PlayEnd:
|
||||
Stop();
|
||||
if (this.CallbackEnd != null)
|
||||
{
|
||||
this.CallbackEnd();
|
||||
this.CallbackEnd = null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void Load(string filePath)
|
||||
{
|
||||
filePath = filePath.Replace("file:///", "");
|
||||
_movieController.maxFrameDrop = CriManaMovieMaterial.MaxFrameDrop.Ten;
|
||||
_movieController.player.Stop();
|
||||
_movieController.player.SetFile(null, filePath);
|
||||
_movieController.player.Prepare();
|
||||
if (this.CallbackReady != null)
|
||||
{
|
||||
this.CallbackReady();
|
||||
this.CallbackReady = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void Play()
|
||||
{
|
||||
_camera.enabled = true;
|
||||
if (IsPaused())
|
||||
{
|
||||
_movieController.player.Pause(sw: false);
|
||||
}
|
||||
else
|
||||
{
|
||||
_movieController.player.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
QualitySettings.vSyncCount = 0;
|
||||
_camera.enabled = false;
|
||||
_movieController.player.Stop();
|
||||
}
|
||||
|
||||
public void Pause()
|
||||
{
|
||||
_movieController.player.Pause(!_movieController.player.IsPaused());
|
||||
}
|
||||
|
||||
public void SetVolume(float volume)
|
||||
{
|
||||
_movieController.player.SetVolume(volume);
|
||||
}
|
||||
|
||||
public int GetSeekPosition()
|
||||
{
|
||||
return (int)(_movieController.player.GetTime() / 1000);
|
||||
}
|
||||
|
||||
public int GetDuration()
|
||||
{
|
||||
int totalFrames = (int)_movieController.player.movieInfo.totalFrames;
|
||||
int num = (int)(_movieController.player.movieInfo.framerateN / 1000);
|
||||
if (num == 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return totalFrames / num * 1000;
|
||||
}
|
||||
|
||||
public int GetCurrentSeekPercent()
|
||||
{
|
||||
return GetSeekPosition() / GetDuration() * 100;
|
||||
}
|
||||
|
||||
public void SeekTo(int seek)
|
||||
{
|
||||
int num = (int)(_movieController.player.movieInfo.framerateN / 1000);
|
||||
int seekPosition = seek * num / 1000;
|
||||
_movieController.player.Stop();
|
||||
_movieController.player.SetSeekPosition(seekPosition);
|
||||
_movieController.player.Start();
|
||||
}
|
||||
|
||||
public bool IsReady()
|
||||
{
|
||||
return _movieController.player.status == Player.Status.Ready;
|
||||
}
|
||||
|
||||
public bool IsPlaying()
|
||||
{
|
||||
if (_movieController.player.status == Player.Status.Playing)
|
||||
{
|
||||
return !IsPaused();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsPaused()
|
||||
{
|
||||
return _movieController.player.IsPaused();
|
||||
}
|
||||
|
||||
public bool IsStopped()
|
||||
{
|
||||
return _movieController.player.status == Player.Status.Stop;
|
||||
}
|
||||
|
||||
public bool IsFinished()
|
||||
{
|
||||
return _movieController.player.status == Player.Status.PlayEnd;
|
||||
}
|
||||
|
||||
public bool IsError()
|
||||
{
|
||||
return _movieController.player.status == Player.Status.Error;
|
||||
}
|
||||
}
|
||||
@@ -6,194 +6,14 @@ public static class NativePluginWrapper
|
||||
{
|
||||
public enum BatteryState
|
||||
{
|
||||
UNKNOWN,
|
||||
DISCHARGING,
|
||||
CHARGING,
|
||||
FULL
|
||||
}
|
||||
}
|
||||
|
||||
public enum NetworkMode
|
||||
{
|
||||
UNCONNECTED,
|
||||
WIFI,
|
||||
MOBILE
|
||||
}
|
||||
|
||||
public static void DeviceInit()
|
||||
{
|
||||
}
|
||||
|
||||
public static int GetUseResidentMemory()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetUseVirtualMemory()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetDeviceFreeMemory()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetVmUseMemory()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetVmFreeMemory()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetStringToClipboard(string copyText)
|
||||
{
|
||||
ClipboardHelper.Clipboard = copyText;
|
||||
}
|
||||
|
||||
public static int GetAccelerometerRotation()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public static void RequestAudioFocus()
|
||||
{
|
||||
}
|
||||
|
||||
public static void AbandonAudioFocus()
|
||||
{
|
||||
}
|
||||
|
||||
public static string GetMacAddressByName(string devicename)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void DispStatusBar(bool isDisp)
|
||||
{
|
||||
if (isDisp)
|
||||
{
|
||||
Screen.fullScreen = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Screen.fullScreen = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static void RegistPhoneStateListener()
|
||||
{
|
||||
}
|
||||
|
||||
public static void UnregistPhoneStateListener()
|
||||
{
|
||||
}
|
||||
|
||||
public static int GetBatteryLevel()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static BatteryState GetBatteryState()
|
||||
{
|
||||
return BatteryState.UNKNOWN;
|
||||
}
|
||||
|
||||
public static int GetWifiAntenaLevel()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static NetworkMode GetNetworkMode()
|
||||
{
|
||||
return NetworkMode.UNCONNECTED;
|
||||
}
|
||||
|
||||
public static bool IsAirplaneMode()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int GetCdmaDbm()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetCdmaEcio()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetEvdoDbm()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetEvdoEcio()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetDescriveContents()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static bool IsGsm()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int GetSignalHashCode()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetGsmSignalStrength()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetGsmBitErrorRate()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void ShowToast(string text)
|
||||
{
|
||||
}
|
||||
|
||||
public static void DumpWWWCache()
|
||||
{
|
||||
}
|
||||
|
||||
public static void SetCacheMemorySize(int nMemSize)
|
||||
{
|
||||
}
|
||||
|
||||
public static int GetCacheDiskUsage()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetCacheDiskCapacity()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetCacheCurrentMemoryUsage()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int GetCacheCurrentMemoryCapacity()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void ClearWWWCache()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,6 @@ public class NetworkManager : MonoBehaviour, IManager
|
||||
{
|
||||
public const float TimeOut = 30f;
|
||||
|
||||
public const float TimeOutShort = 2f;
|
||||
|
||||
protected NetworkTask lastRequestTask;
|
||||
|
||||
public bool isConnect;
|
||||
@@ -37,24 +35,6 @@ public class NetworkManager : MonoBehaviour, IManager
|
||||
|
||||
private IEnumerator connectCoroutine;
|
||||
|
||||
[SerializeField]
|
||||
public Certification _certification;
|
||||
|
||||
public INetworkUI NetworkUI { get; set; }
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Toolbox.NetworkManager = this;
|
||||
}
|
||||
|
||||
public bool IsReachability()
|
||||
{
|
||||
if (Application.internetReachability != NetworkReachability.NotReachable)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public IEnumerator Connect(NetworkTask task, Action<NetworkTask.ResultCode> callbackOnSuccess = null, Action<NetworkTask.ResultCode> callbackOnFailure = null, Action<int> callbackOnResultCodeError = null, bool encrypt = true, bool useJson = false, bool showLoadingIcon = true, bool showErrorDialog = true)
|
||||
{
|
||||
@@ -92,10 +72,6 @@ public class NetworkManager : MonoBehaviour, IManager
|
||||
isConnect = true;
|
||||
isTimeOut = false;
|
||||
isError = false;
|
||||
if (NetworkUI != null && _showLoadingIcon)
|
||||
{
|
||||
NetworkUI.StartLoading();
|
||||
}
|
||||
bool isLogTraceCheckUri = false;
|
||||
if (lastRequestTask is DoMatchingBase || lastRequestTask is FinishTaskBase)
|
||||
{
|
||||
@@ -126,10 +102,6 @@ public class NetworkManager : MonoBehaviour, IManager
|
||||
{
|
||||
LogTraceCheck("3");
|
||||
}
|
||||
if (NetworkUI != null)
|
||||
{
|
||||
NetworkUI.StopLoading();
|
||||
}
|
||||
if (!unityWebRequest.isDone)
|
||||
{
|
||||
isTimeOut = true;
|
||||
@@ -139,23 +111,16 @@ public class NetworkManager : MonoBehaviour, IManager
|
||||
{
|
||||
if (lastRequestTask.GetType().Equals(typeof(PackOpenTask)) || lastRequestTask.GetType().Equals(typeof(BuildDeckBuyTask)) || lastRequestTask.GetType().Equals(typeof(SleeveBuyTask)) || lastRequestTask.GetType().Equals(typeof(SkinBuyMultiRewardTask)) || lastRequestTask.GetType().Equals(typeof(SkinBuyMultiTask)) || lastRequestTask.GetType().Equals(typeof(SkinBuySingleTask)) || lastRequestTask.GetType().Equals(typeof(ItemPurchaseBuyTask)) || lastRequestTask.GetType().Equals(typeof(SpotCardExchangeTask)) || lastRequestTask.GetType().Equals(typeof(CardCreateTask)) || lastRequestTask.GetType().Equals(typeof(CardDestructTask)) || lastRequestTask.GetType().Equals(typeof(StoryFinishTask)) || lastRequestTask.GetType().Equals(typeof(PracticeFinishTask)) || lastRequestTask.GetType().Equals(typeof(BingoDrawTask)) || lastRequestTask.GetType().Equals(typeof(MypageTreasureBoxCpOpenTask)) || lastRequestTask.GetType().Equals(typeof(MypageReceiveSpecialTreasureTask)) || lastRequestTask.GetType().Equals(typeof(FreeCardPackCampaignFinishTask)))
|
||||
{
|
||||
NetworkUI.OpenGoToTitleErrorPopUp(Data.SystemText.Get("ErrorHeader_0012"), Data.SystemText.Get("Error_0012"), "");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
NetworkUI.OpenTimeOutErrorPopUp();
|
||||
|
||||
}
|
||||
}
|
||||
if (lastRequestTask.CallbackOnFailure != null)
|
||||
{
|
||||
if (lastRequestTask.GetType().Equals(typeof(PaymentPCFinishTask)))
|
||||
{
|
||||
NetworkUI.OpenGoToTitleErrorPopUp(Data.SystemText.Get("ErrorHeader_0012"), Data.SystemText.Get("Error_0012"), "");
|
||||
}
|
||||
else
|
||||
{
|
||||
lastRequestTask.CallbackOnFailure(NetworkTask.ResultCode.TimeOut);
|
||||
}
|
||||
lastRequestTask.CallbackOnFailure(NetworkTask.ResultCode.TimeOut);
|
||||
}
|
||||
Toolbox.DeviceManager.ClearIpAddress();
|
||||
}
|
||||
@@ -165,13 +130,13 @@ public class NetworkManager : MonoBehaviour, IManager
|
||||
isError = true;
|
||||
if (showErrorDialog && !lastRequestTask.isSkipCommonHttpStatusErrorPopUp())
|
||||
{
|
||||
if (lastRequestTask.GetType().Equals(typeof(PackOpenTask)) || lastRequestTask.GetType().Equals(typeof(PaymentPCFinishTask)))
|
||||
if (lastRequestTask.GetType().Equals(typeof(PackOpenTask)))
|
||||
{
|
||||
NetworkUI.OpenGoToTitleErrorPopUp(Data.SystemText.Get("ErrorHeader_0012"), Data.SystemText.Get("Error_0012"), "");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
NetworkUI.OpenHttpStatusErrorPopUp();
|
||||
|
||||
}
|
||||
}
|
||||
disposeUnityWebRequest(unityWebRequest);
|
||||
@@ -274,7 +239,7 @@ public class NetworkManager : MonoBehaviour, IManager
|
||||
|
||||
private bool IsBattle()
|
||||
{
|
||||
if (ToolboxGame.RealTimeNetworkAgent != null && BattleManagerBase.GetIns() != null && BattleManagerBase.GetIns().GetCurrentPhase() is MainPhase)
|
||||
if (false /* Pre-Phase-5b: RTA + MainPhase gate headless-false */)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -314,7 +279,7 @@ public class NetworkManager : MonoBehaviour, IManager
|
||||
|
||||
public void ClearLastRequestTask()
|
||||
{
|
||||
if ((NetworkUI != null && !NetworkUI.IsKeepLastRequest()) || lastRequestTask.isServerResultCodeOK())
|
||||
if (lastRequestTask.isServerResultCodeOK())
|
||||
{
|
||||
if (IsBattle())
|
||||
{
|
||||
@@ -328,7 +293,7 @@ public class NetworkManager : MonoBehaviour, IManager
|
||||
{
|
||||
if (lastRequestTask == null)
|
||||
{
|
||||
NetworkUI.OpenRetryFailErrorPopup();
|
||||
|
||||
yield break;
|
||||
}
|
||||
if (connectCoroutine != null)
|
||||
@@ -339,43 +304,12 @@ public class NetworkManager : MonoBehaviour, IManager
|
||||
yield return StartCoroutine(connectCoroutine);
|
||||
}
|
||||
|
||||
public void Certification()
|
||||
{
|
||||
_certification.GenerateUdid();
|
||||
}
|
||||
|
||||
public void ReturnToTitle()
|
||||
{
|
||||
NetworkUI.SetKeepLastRequest(flag: false);
|
||||
ClearLastRequestTask();
|
||||
NetworkUI.SoftwareRest();
|
||||
}
|
||||
|
||||
public void GoToMypage()
|
||||
{
|
||||
NetworkUI.SetKeepLastRequest(flag: false);
|
||||
ClearLastRequestTask();
|
||||
NetworkUI.GoToMypage();
|
||||
}
|
||||
|
||||
public void GoToStore()
|
||||
{
|
||||
lastRequestTask.GotoStore();
|
||||
NetworkUI.SetKeepLastRequest(flag: false);
|
||||
ClearLastRequestTask();
|
||||
NetworkUI.SoftwareRest();
|
||||
}
|
||||
|
||||
public void QuitApplication()
|
||||
{
|
||||
NetworkUI.SetKeepLastRequest(flag: false);
|
||||
ClearLastRequestTask();
|
||||
if (Toolbox.mute != null)
|
||||
{
|
||||
Toolbox.mute.Close();
|
||||
Toolbox.mute = null;
|
||||
}
|
||||
Application.Quit();
|
||||
|
||||
}
|
||||
|
||||
private void disposeUnityWebRequest(UnityWebRequest unityWebRequest)
|
||||
@@ -395,12 +329,4 @@ public class NetworkManager : MonoBehaviour, IManager
|
||||
isConnect = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (RealTimeNetworkAgent.IsNormalNetworkBattle())
|
||||
{
|
||||
LocalLog.AccumulateLastTraceLog("NetworkManager_Destroy");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,18 +111,12 @@ public class NetworkTask
|
||||
resultCode = getDataHeader()["result_code"].ToInt();
|
||||
}
|
||||
|
||||
public int GetResultCode()
|
||||
{
|
||||
return resultCode;
|
||||
}
|
||||
|
||||
public ERROR_CODE_STATUS CheckResultCodeToPopupCreate_ReturnStatus(int rc = 0)
|
||||
{
|
||||
INetworkUI networkUI = Toolbox.NetworkManager.NetworkUI;
|
||||
if (isAppVersionUP())
|
||||
{
|
||||
RecoveryRecordManagerBase.DeleteRecoveryFile();
|
||||
networkUI.OpenGotoStoreErrorPopup();
|
||||
|
||||
return ERROR_CODE_STATUS.ERROR;
|
||||
}
|
||||
if (isResourceVersionUp())
|
||||
@@ -132,25 +126,25 @@ public class NetworkTask
|
||||
if (!Url.Contains(CuteNetworkDefine.ApiUrlList[CuteNetworkDefine.ApiType.GameStartCheck]))
|
||||
{
|
||||
RecoveryRecordManagerBase.DeleteRecoveryFile();
|
||||
networkUI.OpenResourceVersionUpPopUp();
|
||||
|
||||
Parse();
|
||||
return ERROR_CODE_STATUS.ERROR;
|
||||
}
|
||||
}
|
||||
if (isSessionError())
|
||||
{
|
||||
networkUI.OpenSessionErrorPopUp();
|
||||
|
||||
return ERROR_CODE_STATUS.ERROR;
|
||||
}
|
||||
setSession();
|
||||
if (isUnknownServerError() || isServerProcessedError() || isServerDataBaseError())
|
||||
{
|
||||
networkUI.OpenStrictServerErrorPopUp(resultCode);
|
||||
|
||||
return ERROR_CODE_STATUS.ERROR;
|
||||
}
|
||||
if (isAccountBlockError())
|
||||
{
|
||||
networkUI.OpenAccountBlockErrorPopUp(resultCode);
|
||||
|
||||
return ERROR_CODE_STATUS.ERROR;
|
||||
}
|
||||
if (isNeteaseAccountBlockError())
|
||||
@@ -161,18 +155,18 @@ public class NetworkTask
|
||||
if (isAccountLimitedBlockError())
|
||||
{
|
||||
string accountLimitedBlockEndTime = getAccountLimitedBlockEndTime();
|
||||
networkUI.OpenAccountLimitedBlockErrorPopUp(resultCode, accountLimitedBlockEndTime);
|
||||
|
||||
return ERROR_CODE_STATUS.ERROR;
|
||||
}
|
||||
if (IsAllMaintenanceError())
|
||||
{
|
||||
string maintenanceEndTime = getMaintenanceEndTime();
|
||||
networkUI.OpenAllMaintenancePopUp(resultCode, maintenanceEndTime);
|
||||
|
||||
return ERROR_CODE_STATUS.ERROR_TO_MAINTENANCE_POPUP;
|
||||
}
|
||||
if (IsEachFunctionMaintenanceError())
|
||||
{
|
||||
networkUI.OpenEachFunctionMaintenancePopUp(resultCode);
|
||||
|
||||
return ERROR_CODE_STATUS.ERROR_TO_MAINTENANCE_POPUP;
|
||||
}
|
||||
if (IsCardMaintenanceError())
|
||||
@@ -206,15 +200,6 @@ public class NetworkTask
|
||||
|
||||
private void cuteCheckResultCode()
|
||||
{
|
||||
INetworkUI networkUI = Toolbox.NetworkManager.NetworkUI;
|
||||
if (networkUI.isCloseDialogGroupError(resultCode))
|
||||
{
|
||||
networkUI.OpenCloseOnlyErrorPopUp(resultCode);
|
||||
}
|
||||
else if (!isServerResultCodeOK())
|
||||
{
|
||||
networkUI.OpenOtherServerErrorPopUp(resultCode);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual string getAccountLimitedBlockEndTime()
|
||||
@@ -297,16 +282,16 @@ public class NetworkTask
|
||||
private void AddHeaderParam()
|
||||
{
|
||||
string udid = getUdid();
|
||||
string viewer_id = CryptAES.encrypt(Certification.ViewerId.ToString());
|
||||
string viewer_id = CryptAES.encrypt(0 /* Pre-Phase-5 chunk 39: Cute NetworkTask is client-only; dead headless */.ToString());
|
||||
Params.viewer_id = viewer_id;
|
||||
Params.steam_id = Certification.SteamID;
|
||||
Params.steam_session_ticket = Certification.SteamSessionTicket;
|
||||
string text = Convert.ToBase64String(MessagePackSerializer.FromJson(JsonMapper.ToJson(Params)));
|
||||
Uri uri = new Uri(Url.Trim());
|
||||
string text2 = udid + uri.AbsolutePath + text;
|
||||
if (Certification.ViewerId != 0)
|
||||
if (0 /* Pre-Phase-5 chunk 39: Cute NetworkTask is client-only; dead headless */ != 0)
|
||||
{
|
||||
text2 += Certification.ViewerId;
|
||||
text2 += 0 /* Pre-Phase-5 chunk 39: Cute NetworkTask is client-only; dead headless */;
|
||||
}
|
||||
string value = Cryptographer.ComputeHash(text2);
|
||||
header["PARAM"] = value;
|
||||
@@ -380,11 +365,6 @@ public class NetworkTask
|
||||
{
|
||||
}
|
||||
|
||||
private void AddHeaderCarrier()
|
||||
{
|
||||
header["CARRIER"] = Toolbox.DeviceManager.GetCarrier();
|
||||
}
|
||||
|
||||
private void AddHeaderKeyChain()
|
||||
{
|
||||
header["KEYCHAIN"] = Certification.GetKeyChainViewerId();
|
||||
@@ -521,16 +501,6 @@ public class NetworkTask
|
||||
Toolbox.SavedataManager.SetResourceVersion(resourceVersion);
|
||||
}
|
||||
|
||||
public void AddSkipCuteCheckResultCode(int resultCode)
|
||||
{
|
||||
skipCuteCheckResultCodes.Add(resultCode);
|
||||
}
|
||||
|
||||
public void AddSkipCuteCheckResultCode(List<int> resultCodes)
|
||||
{
|
||||
skipCuteCheckResultCodes.Add(resultCodes);
|
||||
}
|
||||
|
||||
public void SkipAllCuteResultCodeCheckErrorPopup()
|
||||
{
|
||||
skipCuteCheckResultCodes.setSkipAll(pSkipAll: true);
|
||||
@@ -555,16 +525,4 @@ public class NetworkTask
|
||||
{
|
||||
return skipCommonHttpStatusErrorPopUp;
|
||||
}
|
||||
|
||||
public void ClearSkipCuteCheckResultCode()
|
||||
{
|
||||
skipCuteCheckResultCodes.Clear();
|
||||
}
|
||||
|
||||
public void SkipAllNetworkChecks()
|
||||
{
|
||||
SkipAllCuteResultCodeCheckErrorPopup();
|
||||
SkipCuteTimeOutPopup();
|
||||
SkipCuteHttpStatusErrorPopup();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public abstract class PCPlatform
|
||||
{
|
||||
public abstract void Parse(JsonData response);
|
||||
|
||||
public abstract PaymentPCStartParams SetParameter(string productId, bool isAlertAgree, bool isAlertActive);
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class PCPlatformSTEAM : PCPlatform
|
||||
{
|
||||
protected PaymentPCStartParamsSTEAM _postParams = new PaymentPCStartParamsSTEAM();
|
||||
|
||||
public static string State { get; private set; }
|
||||
|
||||
public static string Country { get; private set; }
|
||||
|
||||
public static string Currency { get; private set; }
|
||||
|
||||
public static string Status { get; private set; }
|
||||
|
||||
public override PaymentPCStartParams SetParameter(string productId, bool isAlertAgree, bool isAlertActive)
|
||||
{
|
||||
_postParams.product_id = productId;
|
||||
_postParams.price = PaymentPC.GetInstance().ProductPriceList[productId];
|
||||
_postParams.ip_address = Toolbox.DeviceManager.GetIpAddress();
|
||||
_postParams.isalertagree = (isAlertAgree ? 1 : 0);
|
||||
_postParams.isalertactive = (isAlertActive ? 1 : 0);
|
||||
return _postParams;
|
||||
}
|
||||
|
||||
public override void Parse(JsonData response)
|
||||
{
|
||||
State = response["steam_user_info"]["state"].ToString();
|
||||
Country = response["steam_user_info"]["country"].ToString();
|
||||
Currency = response["steam_user_info"]["currency"].ToString();
|
||||
Status = response["steam_user_info"]["status"].ToString();
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
namespace Cute;
|
||||
|
||||
public class PaymentCancelTask : NetworkTask
|
||||
{
|
||||
private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.PaymentCancel;
|
||||
|
||||
public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}";
|
||||
|
||||
public void SetParameter(PaymentSkuInfo skuInfo, string errorMessage)
|
||||
{
|
||||
PaymentStartCancelParams paymentStartCancelParams = new PaymentStartCancelParams();
|
||||
paymentStartCancelParams.payment.product_id = skuInfo.productId;
|
||||
paymentStartCancelParams.payment.currency_code = skuInfo.currencyCode;
|
||||
paymentStartCancelParams.payment.price = skuInfo.price;
|
||||
paymentStartCancelParams.error.message = errorMessage;
|
||||
base.Params = paymentStartCancelParams;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
return base.Parse();
|
||||
}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class PaymentItemListTask : NetworkTask
|
||||
{
|
||||
private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.PaymentItemList;
|
||||
|
||||
public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}";
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
PaymentImpl instance = PaymentImpl.GetInstance();
|
||||
resultCode = (int)base.ResponseData["data_headers"]["result_code"];
|
||||
if (resultCode != 1)
|
||||
{
|
||||
return resultCode;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
instance.ProductIdList.Clear();
|
||||
instance.IdList.Clear();
|
||||
instance.ProductNameList.Clear();
|
||||
instance.ProductPriceList.Clear();
|
||||
instance.ProductTextList.Clear();
|
||||
instance.ProductPurchaseLimitList.Clear();
|
||||
instance.ProductPurchaseNumberList.Clear();
|
||||
instance.FormatProductPriceList.Clear();
|
||||
instance.ProductCsvIdList.Clear();
|
||||
instance.ProductImageNameList.Clear();
|
||||
instance.ProductIsSpecialShop.Clear();
|
||||
instance.ProductCurrentPurchaseCount.Clear();
|
||||
instance.ProductPurchaseLimitCount.Clear();
|
||||
instance.ProductEndTime.Clear();
|
||||
for (int i = 0; i < jsonData.Count; i++)
|
||||
{
|
||||
JsonData jsonData2 = jsonData[i];
|
||||
string text = jsonData2["store_product_id"].ToString();
|
||||
string value = jsonData2["name"].ToString().Replace("\\n", "\n");
|
||||
string value2 = jsonData2["text"].ToString();
|
||||
string text2 = jsonData2["purchase_limit"].ToString();
|
||||
string text3 = jsonData2["id"].ToString();
|
||||
string value3 = jsonData2["image_name"].ToString();
|
||||
string value4 = jsonData2["end_time"].ToString();
|
||||
bool value5 = ((jsonData2["special_shop_flag"].ToInt() != 0) ? true : false);
|
||||
instance.ProductIdList.Add(text);
|
||||
instance.IdList.Add(text3);
|
||||
instance.ProductNameList.Add(text, value);
|
||||
instance.ProductTextList.Add(text, value2);
|
||||
instance.ProductPurchaseLimitList.Add(text3, text2);
|
||||
instance.ProductPurchaseLimitCount.Add(text, int.Parse(text2));
|
||||
instance.ProductImageNameList.Add(text, value3);
|
||||
if (jsonData2.Keys.Contains("number_of_product_purchased") && jsonData2["number_of_product_purchased"] != null)
|
||||
{
|
||||
string text4 = jsonData2["number_of_product_purchased"].ToString();
|
||||
instance.ProductPurchaseNumberList.Add(text3, text4);
|
||||
instance.ProductCurrentPurchaseCount.Add(text, int.Parse(text4));
|
||||
}
|
||||
instance.ProductCsvIdList.Add(text, text3);
|
||||
instance.ProductIsSpecialShop.Add(text, value5);
|
||||
instance.ProductEndTime.Add(text, value4);
|
||||
}
|
||||
return resultCode;
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
using Wizard;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class PaymentPCFinishTask : NetworkTask
|
||||
{
|
||||
public class PaymentPCFinishParams : PostParams
|
||||
{
|
||||
public string product_id = "";
|
||||
|
||||
public string steam_app_id = "";
|
||||
|
||||
public string steam_order_id = "";
|
||||
|
||||
public string steam_user_country = "";
|
||||
}
|
||||
|
||||
private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.PaymentPCFinish;
|
||||
|
||||
public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}";
|
||||
|
||||
public void SetParameter(string ProductId, string StreamAppID = "", string SteamOrderId = "")
|
||||
{
|
||||
PaymentPCFinishParams paymentPCFinishParams = new PaymentPCFinishParams();
|
||||
paymentPCFinishParams.product_id = ProductId;
|
||||
paymentPCFinishParams.steam_app_id = StreamAppID;
|
||||
paymentPCFinishParams.steam_order_id = SteamOrderId;
|
||||
paymentPCFinishParams.steam_user_country = PCPlatformSTEAM.Country;
|
||||
base.Params = paymentPCFinishParams;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
if (base.ResponseData["data"].Count > 0)
|
||||
{
|
||||
if (base.ResponseData["data"]["purchased_times_data"] != null)
|
||||
{
|
||||
Data.Load.data._userCrystalCount._lastPaymentItemBuyNumber = base.ResponseData["data"]["purchased_times_data"]["number_of_product_purchased"].ToInt();
|
||||
if (base.ResponseData["data"]["purchased_times_data"].Keys.Contains("csv_data_id"))
|
||||
{
|
||||
Data.Load.data._userCrystalCount._lastPaymentId = base.ResponseData["data"]["purchased_times_data"]["csv_data_id"].ToString();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Data.Load.data._userCrystalCount._lastPaymentItemBuyNumber = 0;
|
||||
Data.Load.data._userCrystalCount._lastPaymentId = null;
|
||||
}
|
||||
Data.Load.data._userCrystalCount.total_crystal = base.ResponseData["data"]["after_free_crystal"].ToInt() + base.ResponseData["data"]["after_crystal"].ToInt();
|
||||
Data.Load.data._userCrystalCount.free_crystal = base.ResponseData["data"]["after_free_crystal"].ToInt();
|
||||
Data.Load.data._userCrystalCount.charge_crystal = base.ResponseData["data"]["after_crystal"].ToInt();
|
||||
MyPageMenu.Instance.UpdateCrystalCount();
|
||||
if (CreateItemList.GetInstance() != null)
|
||||
{
|
||||
CreateItemList.GetInstance().UpdateCrystalCount();
|
||||
}
|
||||
if (GachaUI.GetInstance() != null)
|
||||
{
|
||||
GachaUI.GetInstance().UpdateUserItemCount();
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class PaymentPCItemListTask : NetworkTask
|
||||
{
|
||||
private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.PaymentPCItemList;
|
||||
|
||||
public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}";
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
PaymentPC instance = PaymentPC.GetInstance();
|
||||
resultCode = (int)base.ResponseData["data_headers"]["result_code"];
|
||||
if (resultCode != 1)
|
||||
{
|
||||
return resultCode;
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
instance.ProductIdList.Clear();
|
||||
instance.IdList.Clear();
|
||||
instance.ProductNameList.Clear();
|
||||
instance.ProductPriceList.Clear();
|
||||
instance.ProductTextList.Clear();
|
||||
instance.ProductPurchaseLimitList.Clear();
|
||||
instance.FormatProductPriceList.Clear();
|
||||
instance.ProductCsvIdList.Clear();
|
||||
instance.ProductImageNameList.Clear();
|
||||
instance.ProductIsSpecialShop.Clear();
|
||||
instance.ProductCurrentPurchaseCount.Clear();
|
||||
instance.ProductEndTime.Clear();
|
||||
for (int i = 0; i < jsonData.Count; i++)
|
||||
{
|
||||
JsonData jsonData2 = jsonData[i];
|
||||
string text = jsonData2["store_product_id"].ToString();
|
||||
string value = jsonData2["name"].ToString().Replace("\\n", "\n");
|
||||
string value2 = jsonData2["text"].ToString();
|
||||
string value3 = jsonData2["price"].ToString();
|
||||
string text2 = jsonData2["purchase_limit"].ToString();
|
||||
string text3 = jsonData2["id"].ToString();
|
||||
string value4 = jsonData2["image_name"].ToString();
|
||||
string value5 = jsonData2["end_time"].ToString();
|
||||
bool value6 = ((jsonData2["special_shop_flag"].ToInt() != 0) ? true : false);
|
||||
int value7 = jsonData2["purchase_num_current"].ToInt();
|
||||
instance.ProductIdList.Add(text);
|
||||
instance.IdList.Add(text3);
|
||||
instance.ProductNameList.Add(text, value);
|
||||
instance.ProductPriceList.Add(text, value3);
|
||||
instance.FormatProductPriceList.Add(text, value3);
|
||||
instance.ProductTextList.Add(text, value2);
|
||||
instance.ProductPurchaseLimitList.Add(text3, text2);
|
||||
instance.ProductCsvIdList.Add(text, text3);
|
||||
instance.ProductImageNameList.Add(text, value4);
|
||||
instance.ProductIsSpecialShop.Add(text, value6);
|
||||
instance.ProductCurrentPurchaseCount.Add(text, value7);
|
||||
instance.ProductPurchaseLimitCount.Add(text, int.Parse(text2));
|
||||
instance.ProductEndTime.Add(text, value5);
|
||||
}
|
||||
return resultCode;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
namespace Cute;
|
||||
|
||||
public class PaymentPCStartParams : PostParams
|
||||
{
|
||||
public string product_id = "";
|
||||
|
||||
public string price = "";
|
||||
|
||||
public int isalertagree;
|
||||
|
||||
public int isalertactive;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Cute;
|
||||
|
||||
public class PaymentPCStartParamsSTEAM : PaymentPCStartParams
|
||||
{
|
||||
public string ip_address = "";
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
namespace Cute;
|
||||
|
||||
public class PaymentPCStartTask : NetworkTask
|
||||
{
|
||||
protected PCPlatform _platform;
|
||||
|
||||
protected CuteNetworkDefine.ApiType _apiType = CuteNetworkDefine.ApiType.PaymentPCStart;
|
||||
|
||||
public PaymentBase.RefundWarningType NeedRefundWarningType { get; private set; }
|
||||
|
||||
public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[_apiType]}";
|
||||
|
||||
public PaymentPCStartTask()
|
||||
{
|
||||
_platform = new PCPlatformSTEAM();
|
||||
}
|
||||
|
||||
public void SetParameter(string ProductId, bool isAlertAgree, bool isAlertActive)
|
||||
{
|
||||
base.Params = _platform.SetParameter(ProductId, isAlertAgree, isAlertActive);
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
if (base.ResponseData["data"].Count > 0)
|
||||
{
|
||||
_platform.Parse(base.ResponseData["data"]);
|
||||
NeedRefundWarningType = (PaymentBase.RefundWarningType)base.ResponseData["data"]["refund_penalty_type"].ToInt();
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
public PCPlatform getPCPlatform()
|
||||
{
|
||||
return _platform;
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
namespace Cute;
|
||||
|
||||
public class PaymentStartCancelParams : PostParams
|
||||
{
|
||||
public class PaymentError
|
||||
{
|
||||
public string message = "";
|
||||
}
|
||||
|
||||
public class Payment
|
||||
{
|
||||
public string product_id = "";
|
||||
|
||||
public string price = "";
|
||||
|
||||
public string currency_code = "";
|
||||
|
||||
public int isalertagree;
|
||||
|
||||
public int isalertactive;
|
||||
}
|
||||
|
||||
public Payment payment = new Payment();
|
||||
|
||||
public PaymentError error = new PaymentError();
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
namespace Cute;
|
||||
|
||||
public class PaymentStartTask : NetworkTask
|
||||
{
|
||||
private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.PaymentStart;
|
||||
|
||||
public PaymentBase.RefundWarningType NeedRefundWarningType { get; private set; }
|
||||
|
||||
public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}";
|
||||
|
||||
public void SetParameter(PaymentSkuInfo skuInfo, bool isAlertAgree, bool isAlertActive)
|
||||
{
|
||||
PaymentStartCancelParams paymentStartCancelParams = new PaymentStartCancelParams();
|
||||
paymentStartCancelParams.payment.product_id = skuInfo.productId;
|
||||
paymentStartCancelParams.payment.currency_code = skuInfo.currencyCode;
|
||||
paymentStartCancelParams.payment.price = skuInfo.price;
|
||||
paymentStartCancelParams.payment.isalertagree = (isAlertAgree ? 1 : 0);
|
||||
paymentStartCancelParams.payment.isalertactive = (isAlertActive ? 1 : 0);
|
||||
base.Params = paymentStartCancelParams;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
NeedRefundWarningType = (PaymentBase.RefundWarningType)base.ResponseData["data"]["refund_penalty_type"].ToInt();
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
namespace Cute;
|
||||
|
||||
public class PublistTransitionCode : NetworkTask
|
||||
{
|
||||
public class Email : PostParams
|
||||
{
|
||||
public string password { get; set; }
|
||||
}
|
||||
|
||||
private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.GetTransitionCode;
|
||||
|
||||
public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}";
|
||||
|
||||
public void SetParameter(string password)
|
||||
{
|
||||
Email email = new Email();
|
||||
email.password = password;
|
||||
base.Params = email;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
return base.Parse();
|
||||
}
|
||||
}
|
||||
@@ -7,331 +7,48 @@ public class QualityManager : MonoBehaviour, IManager
|
||||
{
|
||||
public enum GPUQualityLevel
|
||||
{
|
||||
Level_1,
|
||||
Level_2,
|
||||
Level_3,
|
||||
Level_4
|
||||
}
|
||||
|
||||
public enum AssetQualityLevel
|
||||
{
|
||||
None,
|
||||
Level_1,
|
||||
Level_2,
|
||||
Max
|
||||
}
|
||||
None}
|
||||
|
||||
public enum SoundQualityLevel
|
||||
{
|
||||
None,
|
||||
Level_1,
|
||||
Level_2,
|
||||
Max
|
||||
}
|
||||
None}
|
||||
|
||||
public enum MovieQualityLevel
|
||||
{
|
||||
None,
|
||||
Level_1,
|
||||
Level_2,
|
||||
Max
|
||||
}
|
||||
None}
|
||||
|
||||
public enum MemoryQualityLevel
|
||||
{
|
||||
Level_1,
|
||||
Level_2
|
||||
}
|
||||
|
||||
public enum GameQualityLevel
|
||||
{
|
||||
Level_1,
|
||||
Level_2,
|
||||
Level_3,
|
||||
Level_4
|
||||
}
|
||||
|
||||
public enum OutLineLevel
|
||||
{
|
||||
OutLine_On,
|
||||
OutLine_Off
|
||||
}
|
||||
|
||||
private GPUQualityLevel _gpuQualityLevel;
|
||||
|
||||
private AssetQualityLevel _assetQualityLevel;
|
||||
|
||||
private SoundQualityLevel _soundQualityLevel;
|
||||
|
||||
private MovieQualityLevel _movieQualityLevel;
|
||||
|
||||
private MemoryQualityLevel _memoryQualityLevel;
|
||||
|
||||
private Vector2 _deviceResolution = Vector2.zero;
|
||||
|
||||
private Vector2 _gameResolution = Vector2.zero;
|
||||
|
||||
private int _defaultFrameRate = 60;
|
||||
|
||||
private bool _isDeviceResolutionSetting;
|
||||
|
||||
public bool isFullScreen;
|
||||
|
||||
private GameQualityLevel _gameQualityLevel;
|
||||
|
||||
private OutLineLevel _outlineLevel;
|
||||
|
||||
public Vector2 deviceResolution => _deviceResolution;
|
||||
|
||||
public Vector2 gameResolution => _gameResolution;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
UpdateFromUnity();
|
||||
}
|
||||
|
||||
private IEnumerator Start()
|
||||
{
|
||||
while (Toolbox.SavedataManager == null)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
Initialize();
|
||||
Toolbox.QualityManager = this;
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
CheckGPUQuality();
|
||||
CheckMemoryQuality();
|
||||
CheckAssetQuality();
|
||||
CheckSoundQuality();
|
||||
CheckMovieQuality();
|
||||
InitializeGameQuality();
|
||||
}
|
||||
|
||||
private void CheckGPUQuality()
|
||||
{
|
||||
_gpuQualityLevel = GPUQualityLevel.Level_4;
|
||||
}
|
||||
|
||||
private void CheckMemoryQuality()
|
||||
{
|
||||
_memoryQualityLevel = MemoryQualityLevel.Level_2;
|
||||
}
|
||||
|
||||
private void CheckAssetQuality()
|
||||
{
|
||||
_assetQualityLevel = ((_memoryQualityLevel == MemoryQualityLevel.Level_1) ? AssetQualityLevel.Level_1 : AssetQualityLevel.Level_2);
|
||||
SetAssetQualityLevel(_assetQualityLevel);
|
||||
}
|
||||
|
||||
private void CheckSoundQuality()
|
||||
{
|
||||
int num = Toolbox.SavedataManager.GetInt("SOUNDQUALIY");
|
||||
if (num != 0)
|
||||
{
|
||||
_soundQualityLevel = (SoundQualityLevel)num;
|
||||
}
|
||||
else
|
||||
{
|
||||
_soundQualityLevel = ((_memoryQualityLevel == MemoryQualityLevel.Level_1) ? SoundQualityLevel.Level_1 : SoundQualityLevel.Level_2);
|
||||
}
|
||||
SetSoundQualityLevel(_soundQualityLevel);
|
||||
}
|
||||
|
||||
private void CheckMovieQuality()
|
||||
{
|
||||
_movieQualityLevel = ((_memoryQualityLevel == MemoryQualityLevel.Level_1) ? MovieQualityLevel.Level_1 : MovieQualityLevel.Level_2);
|
||||
}
|
||||
|
||||
public static GPUQualityLevel GetGPUQualityLevel()
|
||||
{
|
||||
if (Toolbox.QualityManager == null)
|
||||
{
|
||||
return GPUQualityLevel.Level_1;
|
||||
}
|
||||
return Toolbox.QualityManager._gpuQualityLevel;
|
||||
}
|
||||
|
||||
public static MemoryQualityLevel GetMemoryQualityLevel()
|
||||
{
|
||||
if (Toolbox.QualityManager == null)
|
||||
{
|
||||
return MemoryQualityLevel.Level_1;
|
||||
}
|
||||
return Toolbox.QualityManager._memoryQualityLevel;
|
||||
}
|
||||
|
||||
public static void SetAssetQualityLevel(AssetQualityLevel _AssetQualityLevel)
|
||||
{
|
||||
if (Toolbox.QualityManager != null)
|
||||
{
|
||||
Toolbox.QualityManager._assetQualityLevel = _AssetQualityLevel;
|
||||
}
|
||||
}
|
||||
|
||||
public static AssetQualityLevel GetAssetQualityLevel()
|
||||
{
|
||||
if (Toolbox.QualityManager == null)
|
||||
{
|
||||
return AssetQualityLevel.Level_1;
|
||||
}
|
||||
return Toolbox.QualityManager._assetQualityLevel;
|
||||
}
|
||||
|
||||
public static void SetSoundQualityLevel(SoundQualityLevel _SoundQualityLevel)
|
||||
{
|
||||
if (Toolbox.QualityManager != null)
|
||||
{
|
||||
Toolbox.QualityManager._soundQualityLevel = _SoundQualityLevel;
|
||||
Toolbox.SavedataManager.SetInt("SOUNDQUALIY", (int)Toolbox.QualityManager._soundQualityLevel);
|
||||
}
|
||||
}
|
||||
|
||||
public static SoundQualityLevel GetSoundQualityLevel()
|
||||
{
|
||||
if (Toolbox.QualityManager == null)
|
||||
{
|
||||
return SoundQualityLevel.Level_1;
|
||||
}
|
||||
return Toolbox.QualityManager._soundQualityLevel;
|
||||
}
|
||||
|
||||
public static void SetMovieQualityLevel(MovieQualityLevel _MovieQualityLevel)
|
||||
{
|
||||
if (Toolbox.QualityManager != null)
|
||||
{
|
||||
Toolbox.QualityManager._movieQualityLevel = _MovieQualityLevel;
|
||||
}
|
||||
}
|
||||
|
||||
public static MovieQualityLevel GetMovieQualityLevel()
|
||||
{
|
||||
if (Toolbox.QualityManager == null)
|
||||
{
|
||||
return MovieQualityLevel.Level_1;
|
||||
}
|
||||
return Toolbox.QualityManager._movieQualityLevel;
|
||||
}
|
||||
|
||||
public void LimitResolution()
|
||||
{
|
||||
_gameResolution = _deviceResolution;
|
||||
if (_deviceResolution.x > 1280f || _deviceResolution.y > 1280f)
|
||||
{
|
||||
float num = 1280f / _deviceResolution.x;
|
||||
_gameResolution = new Vector2(_deviceResolution.x * num, _deviceResolution.y * num);
|
||||
Screen.SetResolution((int)_gameResolution.x, (int)_gameResolution.y, isFullScreen);
|
||||
}
|
||||
}
|
||||
|
||||
public void ChangeResolution(float rate, bool saveratio = true)
|
||||
{
|
||||
LimitResolution();
|
||||
float num = _gameResolution.x * rate / _gameResolution.x;
|
||||
_gameResolution = new Vector2(_gameResolution.x * num, _gameResolution.y * num);
|
||||
Screen.SetResolution((int)_gameResolution.x, (int)_gameResolution.y, isFullScreen);
|
||||
}
|
||||
|
||||
public void ChangeResolutionToDeviceSetting()
|
||||
{
|
||||
_gameResolution = _deviceResolution;
|
||||
Screen.SetResolution((int)_gameResolution.x, (int)_gameResolution.y, isFullScreen);
|
||||
}
|
||||
|
||||
public void ChangeResolution(float width, float height, bool fullscreen)
|
||||
{
|
||||
if (width == 0f || height == 0f)
|
||||
{
|
||||
width = Screen.width;
|
||||
height = Screen.height;
|
||||
}
|
||||
isFullScreen = fullscreen;
|
||||
_deviceResolution = new Vector2(width, height);
|
||||
Screen.SetResolution((int)width, (int)height, fullscreen);
|
||||
}
|
||||
|
||||
private void InitializeGameQuality()
|
||||
{
|
||||
if (_gpuQualityLevel == GPUQualityLevel.Level_4)
|
||||
{
|
||||
_gameQualityLevel = GameQualityLevel.Level_4;
|
||||
}
|
||||
else if (_gpuQualityLevel == GPUQualityLevel.Level_3)
|
||||
{
|
||||
_gameQualityLevel = GameQualityLevel.Level_3;
|
||||
}
|
||||
else if (_gpuQualityLevel == GPUQualityLevel.Level_2)
|
||||
{
|
||||
_gameQualityLevel = GameQualityLevel.Level_2;
|
||||
}
|
||||
else
|
||||
{
|
||||
_gameQualityLevel = GameQualityLevel.Level_1;
|
||||
}
|
||||
if (_memoryQualityLevel == MemoryQualityLevel.Level_1)
|
||||
{
|
||||
_gameQualityLevel = GameQualityLevel.Level_1;
|
||||
}
|
||||
if (!_isDeviceResolutionSetting)
|
||||
{
|
||||
_deviceResolution = new Vector2(Screen.width, Screen.height);
|
||||
_isDeviceResolutionSetting = true;
|
||||
}
|
||||
if (_gpuQualityLevel <= GPUQualityLevel.Level_2 && Toolbox.SavedataManager.GetInt("SOUNDQUALIY") == 0)
|
||||
{
|
||||
SetSoundQualityLevel(SoundQualityLevel.Level_1);
|
||||
}
|
||||
DecideDeviceSetting();
|
||||
}
|
||||
|
||||
private void DecideDeviceSetting()
|
||||
{
|
||||
string graphicsDeviceName = SystemInfo.graphicsDeviceName;
|
||||
if (graphicsDeviceName.Contains("PowerVR") && graphicsDeviceName.Contains("SGX 540"))
|
||||
{
|
||||
_outlineLevel = OutLineLevel.OutLine_Off;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetGameQualityLevel(GPUQualityLevel level)
|
||||
{
|
||||
_gpuQualityLevel = level;
|
||||
}
|
||||
|
||||
public GameQualityLevel GetGameQualityLevel()
|
||||
{
|
||||
return _gameQualityLevel;
|
||||
}
|
||||
|
||||
public void SetFrameRate(int frameRate)
|
||||
{
|
||||
_defaultFrameRate = frameRate;
|
||||
}
|
||||
|
||||
public int GetFrameRate()
|
||||
{
|
||||
return _defaultFrameRate;
|
||||
}
|
||||
|
||||
public void ChangeResolutionFixedHalf()
|
||||
{
|
||||
}
|
||||
|
||||
public void ChangeResolutionFixedBack()
|
||||
{
|
||||
}
|
||||
|
||||
public OutLineLevel GetOutLineLevel()
|
||||
{
|
||||
return _outlineLevel;
|
||||
}
|
||||
|
||||
public void UpdateFromUnity()
|
||||
{
|
||||
isFullScreen = Screen.fullScreen;
|
||||
|
||||
@@ -143,81 +143,35 @@ public class ResourcesManager : MonoBehaviour, IManager
|
||||
private enum ProgressDebugType
|
||||
{
|
||||
Progress_NONE,
|
||||
Progress_DOWNLOAD,
|
||||
Progress_LOAD
|
||||
}
|
||||
|
||||
public enum BackgroundDownloadState
|
||||
{
|
||||
None,
|
||||
Init,
|
||||
Download,
|
||||
StopRequest
|
||||
}
|
||||
|
||||
public enum StopResult
|
||||
{
|
||||
Paused,
|
||||
Stopped,
|
||||
Finished
|
||||
}
|
||||
|
||||
public List<string> Card3DAssetPathList = new List<string>();
|
||||
|
||||
public List<string> Card2DAssetPathList = new List<string>();
|
||||
|
||||
public List<string> CardListAssetPathList = new List<string>();
|
||||
|
||||
public List<string> SleeveListAssetPathList = new List<string>();
|
||||
|
||||
public List<string> BattleListAssetPathList = new List<string>();
|
||||
|
||||
private bool downloadSemaphore;
|
||||
|
||||
private AssetRequestContext downloadRequestContext = new AssetRequestContext(null, new Utility.LeanSemaphore(0), new AssetErrorState());
|
||||
|
||||
private bool loadSemaphore;
|
||||
|
||||
private AssetRequestContext loadRequestContext = new AssetRequestContext(null, new Utility.LeanSemaphore(0), new AssetErrorState());
|
||||
|
||||
private bool useAssetBundle = true;
|
||||
|
||||
public static int fixedParallelTasks;
|
||||
|
||||
private int _preferredParallelLoadTasks = -1;
|
||||
|
||||
private int _preferredParallelDownloadTasks = -1;
|
||||
|
||||
private List<string> downloadList;
|
||||
|
||||
public BackgroundDownloadState BgDownloadState;
|
||||
|
||||
private bool _stopForMovie;
|
||||
|
||||
public static float TextureScaleRatio
|
||||
{
|
||||
get
|
||||
{
|
||||
if (QualityManager.GetAssetQualityLevel() == QualityManager.AssetQualityLevel.Level_1)
|
||||
{
|
||||
return 2f;
|
||||
}
|
||||
return 1f;
|
||||
}
|
||||
}
|
||||
|
||||
public static float AtlasValueRatio
|
||||
{
|
||||
get
|
||||
{
|
||||
if (QualityManager.GetAssetQualityLevel() == QualityManager.AssetQualityLevel.Level_1)
|
||||
{
|
||||
return 0.5f;
|
||||
}
|
||||
return 1f;
|
||||
}
|
||||
}
|
||||
|
||||
public string GetAssetTypePath(string path, AssetLoadPathType type, bool isfetch = false)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
@@ -934,12 +888,6 @@ public class ResourcesManager : MonoBehaviour, IManager
|
||||
return sleeveId;
|
||||
}
|
||||
|
||||
public bool IsExistSleeveNormalMap(long sleeveId)
|
||||
{
|
||||
string assetTypePath = GetAssetTypePath(sleeveId.ToString(), AssetLoadPathType.SleeveTextureNormalMap);
|
||||
return ExistsAssetBundleManifest(assetTypePath);
|
||||
}
|
||||
|
||||
private void AddAssetNotFoundLog(string path)
|
||||
{
|
||||
string text = "asset not found : " + path;
|
||||
@@ -947,11 +895,6 @@ public class ResourcesManager : MonoBehaviour, IManager
|
||||
LocalLog.AccumulateTraceLog(text);
|
||||
}
|
||||
|
||||
public string GetLoadFontFilePath(string fileName)
|
||||
{
|
||||
return "f/" + fileName;
|
||||
}
|
||||
|
||||
public Material FindCardMaterial(int cardId, AssetLoadPathType type, bool isEvol = false, bool isMutation = false, CardBasePrm.CharaType originalType = CardBasePrm.CharaType.NORMAL, bool isChoiceBrave = false)
|
||||
{
|
||||
string text = ((cardId / 1000000000 == 1) ? GetAssetTypePath($"{cardId}_M", AssetLoadPathType.UnitCardMaterial, isfetch: true) : ((isEvol && type == AssetLoadPathType.UnitCardMaterial) ? GetAssetTypePath($"{cardId}1_M", type, isfetch: true) : ((!(isMutation || isChoiceBrave)) ? GetAssetTypePath($"{cardId}0_M", type, isfetch: true) : ((originalType != CardBasePrm.CharaType.NORMAL) ? GetAssetTypePath($"{cardId}0_M", AssetLoadPathType.SpellCardMaterial, isfetch: true) : GetAssetTypePath($"{cardId}0_M", AssetLoadPathType.UnitCardMaterial, isfetch: true)))));
|
||||
@@ -963,19 +906,6 @@ public class ResourcesManager : MonoBehaviour, IManager
|
||||
return obj;
|
||||
}
|
||||
|
||||
public int GetPreferredParallelDownloadNum()
|
||||
{
|
||||
if (fixedParallelTasks > 0)
|
||||
{
|
||||
return fixedParallelTasks;
|
||||
}
|
||||
if (_preferredParallelDownloadTasks < 0)
|
||||
{
|
||||
_preferredParallelDownloadTasks = 4;
|
||||
}
|
||||
return _preferredParallelDownloadTasks;
|
||||
}
|
||||
|
||||
public int GetPreferredParallelLoadNum()
|
||||
{
|
||||
if (fixedParallelTasks > 0)
|
||||
@@ -993,177 +923,6 @@ public class ResourcesManager : MonoBehaviour, IManager
|
||||
{
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
downloadList = new List<string>();
|
||||
Toolbox.ResourcesManager = this;
|
||||
}
|
||||
|
||||
public void RequestDownloadStopForMovie()
|
||||
{
|
||||
if (BgDownloadState == BackgroundDownloadState.Download)
|
||||
{
|
||||
BgDownloadState = BackgroundDownloadState.StopRequest;
|
||||
_stopForMovie = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void RequestDownloadStopForMainDownload()
|
||||
{
|
||||
if (BgDownloadState == BackgroundDownloadState.Download)
|
||||
{
|
||||
BgDownloadState = BackgroundDownloadState.StopRequest;
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator WaitBgDownloadStopRequestFulfilled()
|
||||
{
|
||||
while (!Toolbox.AssetManager.IsDownloadJobIdle())
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
BgDownloadState = BackgroundDownloadState.None;
|
||||
}
|
||||
|
||||
public StopResult Stop()
|
||||
{
|
||||
if (BgDownloadState == BackgroundDownloadState.StopRequest)
|
||||
{
|
||||
BgDownloadState = BackgroundDownloadState.None;
|
||||
if (_stopForMovie)
|
||||
{
|
||||
_stopForMovie = false;
|
||||
return StopResult.Paused;
|
||||
}
|
||||
return StopResult.Stopped;
|
||||
}
|
||||
if (BgDownloadState == BackgroundDownloadState.Download)
|
||||
{
|
||||
BgDownloadState = BackgroundDownloadState.None;
|
||||
return StopResult.Finished;
|
||||
}
|
||||
return StopResult.Stopped;
|
||||
}
|
||||
|
||||
public bool CanStartBgDownload()
|
||||
{
|
||||
if (CanStartDownload())
|
||||
{
|
||||
return !Toolbox.MovieManager.IsPlaying();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool CanStartDownload()
|
||||
{
|
||||
if (BgDownloadState == BackgroundDownloadState.None && !downloadSemaphore)
|
||||
{
|
||||
return Toolbox.AssetManager.IsDownloadJobIdle();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public IEnumerator DownloadAssetGroupBackground(List<string> assetList, Action callback, bool isProgress = true, bool isSavePlayerPrefs = true)
|
||||
{
|
||||
if (BgDownloadState == BackgroundDownloadState.Init)
|
||||
{
|
||||
BgDownloadState = BackgroundDownloadState.Download;
|
||||
yield return _DownloadAssetGroup(assetList, callback, isProgress, isSavePlayerPrefs);
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerator DownloadAssetGroup(List<string> assetList, Action callback, bool isProgress = true, bool isSavePlayerPrefs = true)
|
||||
{
|
||||
while (BgDownloadState == BackgroundDownloadState.Init)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
if (BgDownloadState == BackgroundDownloadState.Download)
|
||||
{
|
||||
BgDownloadState = BackgroundDownloadState.StopRequest;
|
||||
}
|
||||
while (BgDownloadState == BackgroundDownloadState.StopRequest)
|
||||
{
|
||||
yield return WaitBgDownloadStopRequestFulfilled();
|
||||
}
|
||||
Action callback2 = delegate
|
||||
{
|
||||
if (callback != null)
|
||||
{
|
||||
callback();
|
||||
}
|
||||
};
|
||||
yield return _DownloadAssetGroup(assetList, callback2, isProgress, isSavePlayerPrefs);
|
||||
}
|
||||
|
||||
private IEnumerator _DownloadAssetGroup(List<string> assetList, Action callback, bool isProgress = true, bool isSavePlayerPrefs = true)
|
||||
{
|
||||
if (assetList == null || assetList.Count == 0)
|
||||
{
|
||||
callback?.Invoke();
|
||||
yield break;
|
||||
}
|
||||
while (downloadSemaphore)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
SetDownloadProcessLock(enable_lock: true);
|
||||
QualitySettings.vSyncCount = 0;
|
||||
Application.targetFrameRate = 60;
|
||||
if (downloadList.Count > 0)
|
||||
{
|
||||
downloadList.Clear();
|
||||
}
|
||||
bool isDownloadVoiceUse = Toolbox.AudioManager.isDownloadVoiceUse;
|
||||
for (int i = 0; i < assetList.Count; i++)
|
||||
{
|
||||
AssetHandle assetHandle = Toolbox.AssetManager.GetAssetHandle(assetList[i]);
|
||||
if (assetHandle != null && (!assetHandle.IsSoundVoice() || isDownloadVoiceUse) && assetHandle.isReDownloadAsset(CustomPreference.IsNormalResource))
|
||||
{
|
||||
downloadList.Add(assetList[i]);
|
||||
}
|
||||
}
|
||||
if (downloadList.Count > 0)
|
||||
{
|
||||
Toolbox.AssetManager.AddDownloadMaxCount(downloadList.Count);
|
||||
yield return StartCoroutine(DownloadAssetGroupSub(downloadList, isProgress));
|
||||
yield return new WaitForFixedUpdate();
|
||||
if (isSavePlayerPrefs)
|
||||
{
|
||||
Toolbox.SavedataManager.Save();
|
||||
}
|
||||
}
|
||||
QualitySettings.vSyncCount = 0;
|
||||
Application.targetFrameRate = Toolbox.QualityManager.GetFrameRate();
|
||||
SetDownloadProcessLock(enable_lock: false);
|
||||
callback?.Invoke();
|
||||
}
|
||||
|
||||
private IEnumerator DownloadAssetGroupSub(List<string> assetList, bool isProgress = true)
|
||||
{
|
||||
if (isProgress)
|
||||
{
|
||||
UIManager.GetInstance().LoadingViewManager.UpdateLoadingNum(0);
|
||||
}
|
||||
if (BgDownloadState != BackgroundDownloadState.StopRequest)
|
||||
{
|
||||
downloadRequestContext.callback = null;
|
||||
yield return StartCoroutine(ParallelAssetListExec(assetList, GetPreferredParallelDownloadNum(), downloadRequestContext, DownloadAssetSub, isProgress ? ProgressDebugType.Progress_DOWNLOAD : ProgressDebugType.Progress_NONE));
|
||||
UIManager.GetInstance().LoadingViewManager.UpdateLoadingNum(100);
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerator DownloadAsset(string assetName, Action callback, bool isSavePlayerPrefs = true)
|
||||
{
|
||||
List<string> assetList = new List<string> { assetName };
|
||||
yield return StartCoroutine(DownloadAssetGroup(assetList, callback, isProgress: true, isSavePlayerPrefs));
|
||||
}
|
||||
|
||||
private void DownloadAssetSub(string assetName, AssetRequestContext requestContext)
|
||||
{
|
||||
Toolbox.AssetManager.DownloadAsset(assetName, requestContext);
|
||||
}
|
||||
|
||||
private List<string> FilterAssetList(List<string> assetList, ref List<string> duplicateList)
|
||||
{
|
||||
if (assetList.Count < 2)
|
||||
@@ -1305,17 +1064,6 @@ public class ResourcesManager : MonoBehaviour, IManager
|
||||
LocalLog.UpdateLoadResourceLog("FinishLoad");
|
||||
}
|
||||
|
||||
public IEnumerator DownloadAssetGroupWithLoadAsset(List<string> assetList, Action callback, bool isProgress = true)
|
||||
{
|
||||
if (assetList == null || assetList.Count == 0)
|
||||
{
|
||||
callback?.Invoke();
|
||||
yield break;
|
||||
}
|
||||
yield return StartCoroutine(DownloadAssetGroup(assetList, null, isProgress));
|
||||
yield return StartCoroutine(LoadAssetGroupAsync(assetList, null, isProgress));
|
||||
}
|
||||
|
||||
private bool QuickLoadAsset(string assetName)
|
||||
{
|
||||
AssetHandle assetHandle = Toolbox.AssetManager.GetAssetHandle(assetName);
|
||||
@@ -1395,23 +1143,6 @@ public class ResourcesManager : MonoBehaviour, IManager
|
||||
Toolbox.AssetManager.CacheAsset(assetName, requestContext);
|
||||
}
|
||||
|
||||
public void StartCoroutine_DownloadAssetGroupWithLoadAsset(List<string> assetList, Action callback, bool isProgress = true)
|
||||
{
|
||||
if (assetList == null || assetList.Count == 0)
|
||||
{
|
||||
callback?.Invoke();
|
||||
}
|
||||
else
|
||||
{
|
||||
StartCoroutine(DownloadAssetGroupWithLoadAsset(assetList, callback, isProgress));
|
||||
}
|
||||
}
|
||||
|
||||
public void StartCoroutine_DownloadAssetGroupWithLoadAsset(string asset, Action callback, bool isProgress = true)
|
||||
{
|
||||
StartCoroutine_DownloadAssetGroupWithLoadAsset(new List<string> { asset }, callback, isProgress);
|
||||
}
|
||||
|
||||
public void StartCoroutine_LoadAssetGroupAsync(List<string> assetList, Action callback, bool isProgress = true)
|
||||
{
|
||||
if (assetList == null || assetList.Count == 0)
|
||||
@@ -1441,11 +1172,6 @@ public class ResourcesManager : MonoBehaviour, IManager
|
||||
}
|
||||
}
|
||||
|
||||
public void StartCoroutine_LoadAssetGroupSync(string asset, Action callback, bool isProgress = true)
|
||||
{
|
||||
StartCoroutine(LoadAssetGroupSync(new List<string> { asset }, callback, isProgress));
|
||||
}
|
||||
|
||||
public void RemoveAssetGroup(List<string> assetList)
|
||||
{
|
||||
for (int i = 0; i < assetList.Count; i++)
|
||||
@@ -1459,39 +1185,6 @@ public class ResourcesManager : MonoBehaviour, IManager
|
||||
Toolbox.AssetManager.UnloadAsset(assetName);
|
||||
}
|
||||
|
||||
public void RemoveAssetForceCommon()
|
||||
{
|
||||
Toolbox.AssetManager.UnloadCommonAssetAll();
|
||||
}
|
||||
|
||||
public void RemoveAssetCommon(string assetName)
|
||||
{
|
||||
Toolbox.AssetManager.UnloadCommonAsset(assetName);
|
||||
}
|
||||
|
||||
public void RegistCommonAsset(List<string> assetList)
|
||||
{
|
||||
for (int i = 0; i < assetList.Count; i++)
|
||||
{
|
||||
Toolbox.AssetManager.RegistCommonAsset(assetList[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveAssetForceTemporary()
|
||||
{
|
||||
Toolbox.AssetManager.UnloadTemporaryAssetAll();
|
||||
}
|
||||
|
||||
public void RemoveAssetTemporary(string assetName)
|
||||
{
|
||||
Toolbox.AssetManager.UnloadTemporaryAsset(assetName);
|
||||
}
|
||||
|
||||
public void RegistTemporaryAsset(string assetName)
|
||||
{
|
||||
Toolbox.AssetManager.RegistTemporaryAsset(assetName);
|
||||
}
|
||||
|
||||
public bool ExistsAssetBundleManifest(string assetName)
|
||||
{
|
||||
if (Toolbox.AssetManager.GetAssetHandle(assetName) != null)
|
||||
@@ -1501,43 +1194,6 @@ public class ResourcesManager : MonoBehaviour, IManager
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool CheckBeforeFileRequeset(string assetName)
|
||||
{
|
||||
return Toolbox.AssetManager.IsEnableAssetName(assetName);
|
||||
}
|
||||
|
||||
public bool IsLoadedAssetBundle(string assetName)
|
||||
{
|
||||
if (Toolbox.AssetManager == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (Toolbox.AssetManager.GetAssetBundleObject(assetName) != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsLoadedAssetBundleAndObjectArrayExist(string assetName)
|
||||
{
|
||||
if (IsLoadedAssetBundle(assetName))
|
||||
{
|
||||
return Toolbox.AssetManager.GetAssetBundleObject(assetName).objectArray.Count > 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void UseAssetBundle(bool bEnabled)
|
||||
{
|
||||
useAssetBundle = bEnabled;
|
||||
}
|
||||
|
||||
public bool IsUseAssetBundle()
|
||||
{
|
||||
return useAssetBundle;
|
||||
}
|
||||
|
||||
public UnityEngine.Object LoadObject(string objectName, bool isServerResources = true, bool isIfFindLoad = false)
|
||||
{
|
||||
return LoadObject<UnityEngine.Object>(objectName, isServerResources);
|
||||
@@ -1561,147 +1217,8 @@ public class ResourcesManager : MonoBehaviour, IManager
|
||||
return Resources.Load<T>(objectName);
|
||||
}
|
||||
|
||||
public UnityEngine.Object LoadObject(string assetName, string objectName, bool isServerResources = true)
|
||||
{
|
||||
return LoadObject<UnityEngine.Object>(assetName, objectName, isServerResources);
|
||||
}
|
||||
|
||||
public T LoadObject<T>(string assetName, string objectName, bool isServerResources = true) where T : UnityEngine.Object
|
||||
{
|
||||
if (!isServerResources)
|
||||
{
|
||||
return Resources.Load<T>(objectName);
|
||||
}
|
||||
AssetManager assetManager = Toolbox.AssetManager;
|
||||
if (assetManager != null)
|
||||
{
|
||||
UnityEngine.Object obj = assetManager.LoadObject(assetName, objectName, typeof(T));
|
||||
if (obj != null)
|
||||
{
|
||||
return (T)obj;
|
||||
}
|
||||
}
|
||||
return Resources.Load<T>(objectName);
|
||||
}
|
||||
|
||||
private void SetDownloadProcessLock(bool enable_lock)
|
||||
{
|
||||
downloadSemaphore = enable_lock;
|
||||
}
|
||||
|
||||
private void SetLoadProcessLock(bool enable_lock)
|
||||
{
|
||||
loadSemaphore = enable_lock;
|
||||
}
|
||||
|
||||
public IEnumerator GameInitialize()
|
||||
{
|
||||
Toolbox.BootNetwork.SetupNetwork();
|
||||
while (!Toolbox.BootNetwork.IsDoneGameStartCheck)
|
||||
{
|
||||
yield return 0;
|
||||
}
|
||||
yield return StartCoroutine(Toolbox.AssetManager.InitializeManifest(null, !Data.Load.data._userTutorial.NeedAllResource));
|
||||
}
|
||||
|
||||
public static int calcTextureSize(int x)
|
||||
{
|
||||
return (int)(TextureScaleRatio * (float)x);
|
||||
}
|
||||
|
||||
public static Vector2 calcTextureSize(Vector2 vec)
|
||||
{
|
||||
return vec * TextureScaleRatio;
|
||||
}
|
||||
|
||||
public static int calcAtlasValue(int x, float rate)
|
||||
{
|
||||
return (int)(rate * (float)x + 0.5f);
|
||||
}
|
||||
|
||||
public static void ResizeUISprite(UISprite _sprite)
|
||||
{
|
||||
_sprite.MakePixelPerfect();
|
||||
int w = calcTextureSize(_sprite.width);
|
||||
int h = calcTextureSize(_sprite.height);
|
||||
_sprite.SetDimensions(w, h);
|
||||
}
|
||||
|
||||
public static void ResizeUISpriteSliced(UISprite _sprite)
|
||||
{
|
||||
}
|
||||
|
||||
public static void resizeUIAtlas(UIAtlas atlas, GameObject parentObject, Material material = null)
|
||||
{
|
||||
if (atlas == null || atlas.replacement != null || QualityManager.GetAssetQualityLevel() != QualityManager.AssetQualityLevel.Level_1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
string text = atlas.name;
|
||||
UIAtlas uIAtlas = UnityEngine.Object.Instantiate(atlas);
|
||||
uIAtlas.transform.parent = parentObject.transform;
|
||||
uIAtlas.name = text + "_half";
|
||||
atlas.replacement = uIAtlas;
|
||||
if (material != null)
|
||||
{
|
||||
uIAtlas.spriteMaterial = material;
|
||||
}
|
||||
List<UISpriteData> spriteList = uIAtlas.spriteList;
|
||||
if (spriteList != null)
|
||||
{
|
||||
for (int i = 0; i < spriteList.Count; i++)
|
||||
{
|
||||
UISpriteData uISpriteData = spriteList[i];
|
||||
int width = uISpriteData.width;
|
||||
int height = uISpriteData.height;
|
||||
uISpriteData.x = calcAtlasValue(uISpriteData.x, AtlasValueRatio);
|
||||
uISpriteData.y = calcAtlasValue(uISpriteData.y, AtlasValueRatio);
|
||||
uISpriteData.width = calcAtlasValue(uISpriteData.width, AtlasValueRatio);
|
||||
uISpriteData.height = calcAtlasValue(uISpriteData.height, AtlasValueRatio);
|
||||
uISpriteData.borderLeft = uISpriteData.width - calcAtlasValue(width - uISpriteData.borderLeft, AtlasValueRatio);
|
||||
uISpriteData.borderRight = calcAtlasValue(uISpriteData.borderRight, AtlasValueRatio);
|
||||
uISpriteData.borderTop = calcAtlasValue(uISpriteData.borderTop, AtlasValueRatio);
|
||||
uISpriteData.borderBottom = uISpriteData.height - calcAtlasValue(height - uISpriteData.borderBottom, AtlasValueRatio);
|
||||
uISpriteData.paddingLeft = calcAtlasValue(uISpriteData.paddingLeft, AtlasValueRatio);
|
||||
uISpriteData.paddingRight = calcAtlasValue(uISpriteData.paddingRight, AtlasValueRatio);
|
||||
uISpriteData.paddingTop = calcAtlasValue(uISpriteData.paddingTop, AtlasValueRatio);
|
||||
uISpriteData.paddingBottom = calcAtlasValue(uISpriteData.paddingBottom, AtlasValueRatio);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearLoadCount()
|
||||
{
|
||||
Toolbox.AssetManager.ResetDownloadCount();
|
||||
}
|
||||
|
||||
public int GetDownLoadMax()
|
||||
{
|
||||
return Toolbox.AssetManager.GetDownloadMaxCount();
|
||||
}
|
||||
|
||||
public int GetDownLoadCompleted()
|
||||
{
|
||||
return Toolbox.AssetManager.GetDownloadCurrentCount();
|
||||
}
|
||||
|
||||
public float GetDownloadCompletedSize()
|
||||
{
|
||||
return Toolbox.AssetManager.GetDownloadCompletedSize();
|
||||
}
|
||||
|
||||
public float GetDownloadMaxSize()
|
||||
{
|
||||
return Toolbox.AssetManager.GetDownloadSize(CustomPreference.IsNormalResource);
|
||||
}
|
||||
|
||||
public int GetLoadingMax()
|
||||
{
|
||||
return Toolbox.AssetManager.GetLoadingMaxCount();
|
||||
}
|
||||
|
||||
public int GetLoadingCompleted()
|
||||
{
|
||||
return Toolbox.AssetManager.GetLoadingCurrentCount();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,48 +5,6 @@ namespace Cute;
|
||||
|
||||
public class SavedataManager : MonoBehaviour, IManager
|
||||
{
|
||||
public const string RESOURCE_VERSION_KEY = "RES_VER";
|
||||
|
||||
public const string LANGUAGE_FIRST_SET = "LANG_FIRST_SET";
|
||||
|
||||
public const string LANGUAGE_KEY = "LANG_SETTING";
|
||||
|
||||
public const string LANGUAGE_SOUND_KEY = "LANG_SOUND_SETTING";
|
||||
|
||||
public const string LANGUAGE_FONT_KEY = "LANG_FONT";
|
||||
|
||||
public static string OMOTENASHI_COUNTRY_KEY = "OMOTE_COUNTRY";
|
||||
|
||||
public static string LANGUAGE_CHANGE = "LANG_CHANGE";
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Toolbox.SavedataManager = this;
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
}
|
||||
|
||||
public void DeleteAll()
|
||||
{
|
||||
ObscuredPrefs.DeleteAll();
|
||||
}
|
||||
|
||||
public void DeleteKey(string key)
|
||||
{
|
||||
ObscuredPrefs.DeleteKey(key);
|
||||
}
|
||||
|
||||
public float GetFloat(string key, float defaultValue = 0f)
|
||||
{
|
||||
return ObscuredPrefs.GetFloat(key, defaultValue);
|
||||
}
|
||||
|
||||
public void SetFloat(string key, float value)
|
||||
{
|
||||
ObscuredPrefs.SetFloat(key, value);
|
||||
}
|
||||
|
||||
public int GetInt(string key, int defaultValue = 0)
|
||||
{
|
||||
@@ -68,16 +26,6 @@ public class SavedataManager : MonoBehaviour, IManager
|
||||
ObscuredPrefs.SetString(key, value);
|
||||
}
|
||||
|
||||
public bool HasKey(string key)
|
||||
{
|
||||
return ObscuredPrefs.HasKey(key);
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
ObscuredPrefs.Save();
|
||||
}
|
||||
|
||||
public void SetResourceVersion(string version)
|
||||
{
|
||||
SetString("RES_VER", version);
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
namespace Cute;
|
||||
|
||||
public enum SceneType
|
||||
{
|
||||
None,
|
||||
_Splash,
|
||||
GameTitle,
|
||||
Title,
|
||||
Battle,
|
||||
CardList,
|
||||
GAMESCENE_TYPE_MAX,
|
||||
_SoftwareReset,
|
||||
TYPE_MAX
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
using LitJson;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class SignUpTask : NetworkTask
|
||||
{
|
||||
private class LoginPostParams : PostParams
|
||||
{
|
||||
public string device_name = "";
|
||||
|
||||
public string client_type = "";
|
||||
|
||||
public string os_version = "";
|
||||
|
||||
public string app_version = "";
|
||||
|
||||
public string resource_version = "";
|
||||
|
||||
public string carrier = "";
|
||||
}
|
||||
|
||||
private CuteNetworkDefine.ApiType apiType;
|
||||
|
||||
public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}";
|
||||
|
||||
public void SetParameter()
|
||||
{
|
||||
LoginPostParams loginPostParams = new LoginPostParams();
|
||||
loginPostParams.device_name = Toolbox.DeviceManager.GetModelName();
|
||||
loginPostParams.client_type = Toolbox.DeviceManager.GetDeviceType().ToString();
|
||||
loginPostParams.os_version = Toolbox.DeviceManager.GetOsVersion();
|
||||
loginPostParams.app_version = Toolbox.DeviceManager.GetAppVersionName();
|
||||
loginPostParams.resource_version = "00000000";
|
||||
loginPostParams.carrier = Toolbox.DeviceManager.GetCarrier();
|
||||
base.Params = loginPostParams;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
JsonData jsonData = base.ResponseData["data_headers"];
|
||||
resultCode = jsonData["result_code"].ToInt();
|
||||
if (resultCode != 1)
|
||||
{
|
||||
return resultCode;
|
||||
}
|
||||
int viewerId = jsonData["viewer_id"].ToInt();
|
||||
int shortUdid = jsonData["short_udid"].ToInt();
|
||||
string text = jsonData["udid"].ToString();
|
||||
if (Certification.Udid != text)
|
||||
{
|
||||
Debug.LogError("udid一致しません。不正のアクセスです。");
|
||||
}
|
||||
else
|
||||
{
|
||||
Certification.ViewerId = viewerId;
|
||||
Certification.ShortUdid = shortUdid;
|
||||
Certification.SessionId = "";
|
||||
AdjustManager.ViewerIDEvent();
|
||||
GameObject gameObject = GameObject.Find("OmotePlugin");
|
||||
if (gameObject != null)
|
||||
{
|
||||
OmotePlugin component = gameObject.GetComponent<OmotePlugin>();
|
||||
if (component != null)
|
||||
{
|
||||
component.SendConversion(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
return resultCode;
|
||||
}
|
||||
}
|
||||
@@ -18,23 +18,8 @@ internal class SkipCuteCheckResultCodes
|
||||
return skipAll;
|
||||
}
|
||||
|
||||
public void Add(int resultCode)
|
||||
{
|
||||
resultCodes.Add(resultCode);
|
||||
}
|
||||
|
||||
public void Add(List<int> pResultCodes)
|
||||
{
|
||||
resultCodes.AddRange(pResultCodes);
|
||||
}
|
||||
|
||||
public bool Contains(int resultCode)
|
||||
{
|
||||
return resultCodes.Contains(resultCode);
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
resultCodes.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,210 +0,0 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Facebook.Unity;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class SocialServiceUtility : MonoBehaviour
|
||||
{
|
||||
private bool isLogin_;
|
||||
|
||||
private bool isCountTime;
|
||||
|
||||
private float timer;
|
||||
|
||||
public bool IsRunning { get; protected set; }
|
||||
|
||||
public bool IsLoggedIn
|
||||
{
|
||||
get
|
||||
{
|
||||
return isLogin_;
|
||||
}
|
||||
protected set
|
||||
{
|
||||
isLogin_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string SocialServiceUserId { get; private set; }
|
||||
|
||||
public string FirebaseIdToken { get; private set; }
|
||||
|
||||
public string FaceBookAccountId { get; private set; }
|
||||
|
||||
public string FaceBookAuthenticationToken { get; private set; }
|
||||
|
||||
public bool FaceBookIsLoggedIn => FB.IsLoggedIn;
|
||||
|
||||
public static SocialServiceUtility Instance { get; private set; }
|
||||
|
||||
public static SocialServiceUtility CreateInstance()
|
||||
{
|
||||
if (null == Instance)
|
||||
{
|
||||
Instance = new GameObject(typeof(SocialServiceUtility).Name).AddComponent<SocialServiceUtility>();
|
||||
UnityEngine.Object.DontDestroyOnLoad(Instance);
|
||||
}
|
||||
return Instance;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (isCountTime)
|
||||
{
|
||||
checkTimeOut();
|
||||
}
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
}
|
||||
|
||||
private void AndroidInit()
|
||||
{
|
||||
}
|
||||
|
||||
private void FbInit()
|
||||
{
|
||||
}
|
||||
|
||||
public void FbSignIn(string nonce, Action<bool> onetimeCallback)
|
||||
{
|
||||
if (IsRunning)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (FaceBookIsLoggedIn && FaceBookAccountId != null)
|
||||
{
|
||||
if (onetimeCallback != null)
|
||||
{
|
||||
onetimeCallback(FaceBookIsLoggedIn);
|
||||
}
|
||||
return;
|
||||
}
|
||||
IsRunning = true;
|
||||
INetworkUI networkUI = Toolbox.NetworkManager.NetworkUI;
|
||||
networkUI.StartLoading();
|
||||
FB.LogInWithReadPermissions(new List<string> { "public_profile" }, delegate(ILoginResult result)
|
||||
{
|
||||
IsRunning = false;
|
||||
networkUI.StopLoading();
|
||||
if (result == null)
|
||||
{
|
||||
onetimeCallback(obj: false);
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(result.Error))
|
||||
{
|
||||
onetimeCallback(obj: false);
|
||||
}
|
||||
else if (result.Cancelled)
|
||||
{
|
||||
onetimeCallback(obj: false);
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(result.RawResult))
|
||||
{
|
||||
FaceBookAccountId = AccessToken.CurrentAccessToken.TokenString;
|
||||
FaceBookAuthenticationToken = "";
|
||||
onetimeCallback(obj: true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public IEnumerator SignIn(Action<bool> onetimeCallback)
|
||||
{
|
||||
if (IsRunning)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
if (IsLoggedIn && SocialServiceUserId != null)
|
||||
{
|
||||
onetimeCallback?.Invoke(IsLoggedIn);
|
||||
yield break;
|
||||
}
|
||||
IsRunning = true;
|
||||
INetworkUI networkUI = Toolbox.NetworkManager.NetworkUI;
|
||||
networkUI.StartLoading();
|
||||
StartTimeCount();
|
||||
UnitySocialPlatformSingIn(networkUI);
|
||||
while (IsRunning)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
onetimeCallback(IsLoggedIn);
|
||||
}
|
||||
|
||||
public void UnitySocialPlatformSingIn(INetworkUI networkUI)
|
||||
{
|
||||
Social.localUser.Authenticate(delegate(bool result)
|
||||
{
|
||||
if (IsRunning && !result)
|
||||
{
|
||||
IsLoggedIn = false;
|
||||
IsRunning = false;
|
||||
StopTimeCount();
|
||||
networkUI.StopLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void getFirebaseIdToken(INetworkUI networkUI)
|
||||
{
|
||||
}
|
||||
|
||||
public void FbSignOut()
|
||||
{
|
||||
if (FaceBookIsLoggedIn)
|
||||
{
|
||||
FB.LogOut();
|
||||
FaceBookAccountId = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void SignOut(Action onetimeCallback = null)
|
||||
{
|
||||
if (IsLoggedIn && !IsRunning)
|
||||
{
|
||||
IsRunning = true;
|
||||
IsRunning = false;
|
||||
IsLoggedIn = false;
|
||||
onetimeCallback?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetSocialServiceName()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
public static int GetSocialServiceType()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void StartTimeCount()
|
||||
{
|
||||
isCountTime = true;
|
||||
}
|
||||
|
||||
public void StopTimeCount()
|
||||
{
|
||||
isCountTime = false;
|
||||
timer = 0f;
|
||||
}
|
||||
|
||||
private void checkTimeOut()
|
||||
{
|
||||
timer += Time.deltaTime;
|
||||
if (timer >= 30f)
|
||||
{
|
||||
timer = 0f;
|
||||
INetworkUI networkUI = Toolbox.NetworkManager.NetworkUI;
|
||||
networkUI.StopLoading();
|
||||
StopTimeCount();
|
||||
networkUI.OpenSocialServiceNoResponseErrorPopup();
|
||||
IsRunning = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,6 @@ public static class SoftwareResetBase
|
||||
|
||||
private static Action resetAction;
|
||||
|
||||
public static bool IsSoftwareReset()
|
||||
{
|
||||
return isSoftwareReset;
|
||||
}
|
||||
|
||||
public static void setSoftwareResetAction(Action _action)
|
||||
{
|
||||
resetAction = _action;
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
namespace Cute;
|
||||
|
||||
public struct SoundData
|
||||
{
|
||||
public string _acbName;
|
||||
|
||||
public string _cueName;
|
||||
|
||||
public int _cueId;
|
||||
|
||||
public SoundData(string acbName, string cueName, int cueId)
|
||||
{
|
||||
_acbName = acbName;
|
||||
_cueName = cueName;
|
||||
_cueId = cueId;
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
using System;
|
||||
using Steamworks;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class SteamMicroTxnInitTask : NetworkTask
|
||||
{
|
||||
private class MicroTxtInitPost : PostParams
|
||||
{
|
||||
public new string steam_id = "";
|
||||
|
||||
public string app_id = "";
|
||||
|
||||
public string currency = "";
|
||||
|
||||
public string ip_address = "";
|
||||
|
||||
public string item_id = "";
|
||||
}
|
||||
|
||||
private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.SteamMicroTxnInit;
|
||||
|
||||
public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}";
|
||||
|
||||
public void SetParameter(string item_id)
|
||||
{
|
||||
MicroTxtInitPost microTxtInitPost = new MicroTxtInitPost();
|
||||
try
|
||||
{
|
||||
microTxtInitPost.steam_id = SteamUser.GetSteamID().ToString();
|
||||
microTxtInitPost.app_id = SteamUtils.GetAppID().ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError(ex.Message);
|
||||
Debug.LogError(ex.StackTrace);
|
||||
Debug.LogError("steam client を起動してください。");
|
||||
}
|
||||
microTxtInitPost.currency = PCPlatformSTEAM.Currency;
|
||||
microTxtInitPost.ip_address = Toolbox.DeviceManager.GetIpAddress();
|
||||
microTxtInitPost.item_id = item_id;
|
||||
base.Params = microTxtInitPost;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int result = base.Parse();
|
||||
_ = 1;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -16,11 +16,6 @@ public class TimeData
|
||||
connectClientTime = (long)TimeNativePlugin.GetDeviceOperatingTime();
|
||||
}
|
||||
|
||||
public DateTime GetNowTime()
|
||||
{
|
||||
return TimeUtil.GetNowTime(serverTime, connectClientTime);
|
||||
}
|
||||
|
||||
public DateTime GetNowTime_UTC()
|
||||
{
|
||||
return TimeUtil.GetNowTime_UTC(serverTime, connectClientTime);
|
||||
@@ -30,48 +25,4 @@ public class TimeData
|
||||
{
|
||||
return (float)TimeUtil.GetTimeLeft(serverTime, endTime, 0L).millisecond / 1000f;
|
||||
}
|
||||
|
||||
[Obsolete("動作未検証", false)]
|
||||
public IEnumerator StartTimeLeft(MonoBehaviour obj, long endTime, Action<TimeUtil.TimeLeftParam> callback)
|
||||
{
|
||||
IEnumerator enumerator = timeLeftCoroutine(callback, endTime, 0L);
|
||||
obj.StartCoroutine(enumerator);
|
||||
return enumerator;
|
||||
}
|
||||
|
||||
[Obsolete("動作未検証", false)]
|
||||
public IEnumerator StartTimeLeft(MonoBehaviour obj, long endTime, long consumingTime, Action<TimeUtil.TimeLeftParam> callback)
|
||||
{
|
||||
IEnumerator enumerator = timeLeftCoroutine(callback, endTime, consumingTime);
|
||||
obj.StartCoroutine(enumerator);
|
||||
return enumerator;
|
||||
}
|
||||
|
||||
[Obsolete("動作未検証", false)]
|
||||
public string GetNowTimeString()
|
||||
{
|
||||
DateTime nowTime = GetNowTime();
|
||||
return $"{nowTime.Year:D4}-{nowTime.Month:D2}-{nowTime.Day:D2} {nowTime.Hour:D2}:{nowTime.Minute:D2}:{nowTime.Second:D2}";
|
||||
}
|
||||
|
||||
[Obsolete("動作未検証", false)]
|
||||
private TimeUtil.TimeLeftParam GetTimeLeft(long endTime, long consumingTime = 0L)
|
||||
{
|
||||
return TimeUtil.GetTimeLeft(TimeUtil.ToUnixTime(GetNowTime()), endTime, consumingTime);
|
||||
}
|
||||
|
||||
[Obsolete("動作未検証", false)]
|
||||
private IEnumerator timeLeftCoroutine(Action<TimeUtil.TimeLeftParam> callback, long endTime, long consumingTime = 0L)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
TimeUtil.TimeLeftParam timeLeft = GetTimeLeft(endTime, consumingTime);
|
||||
callback(timeLeft);
|
||||
if (timeLeft.isEnd)
|
||||
{
|
||||
break;
|
||||
}
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
using System;
|
||||
// TODO(engine-cleanup-pass2): 11 of 12 methods unrun in baseline
|
||||
// Type: Cute.TimeUtil
|
||||
// See data_dumps/reports/engine-cleanup/live-methods.baseline.txt
|
||||
|
||||
|
||||
namespace Cute;
|
||||
|
||||
@@ -70,21 +74,6 @@ public class TimeUtil
|
||||
|
||||
private static readonly DateTime UNIX_EPOCH = new DateTime(1970, 1, 1, 0, 0, 0, 0);
|
||||
|
||||
public const int DAY_HOUR = 24;
|
||||
|
||||
public const int DAY_SECOND = 86400;
|
||||
|
||||
public const int HOUR_SECOND = 3600;
|
||||
|
||||
public const int MINUTE_SECOND = 60;
|
||||
|
||||
public const int MILLI_SECOND = 1000;
|
||||
|
||||
public static DateTime GetNowTime(long serverTime, long connectClientTime)
|
||||
{
|
||||
return UNIX_EPOCH.AddSeconds((float)serverTime + TimeNativePlugin.GetDeviceOperatingTime() - (float)connectClientTime).ToLocalTime();
|
||||
}
|
||||
|
||||
public static DateTime GetNowTime_UTC(long serverTime, long connectClientTime)
|
||||
{
|
||||
return UNIX_EPOCH.AddSeconds((float)serverTime + TimeNativePlugin.GetDeviceOperatingTime() - (float)connectClientTime);
|
||||
@@ -95,53 +84,13 @@ public class TimeUtil
|
||||
return UNIX_EPOCH.AddSeconds(TimeNativePlugin.GetDeviceOperatingTime());
|
||||
}
|
||||
|
||||
public static long ToUnixTime(string str)
|
||||
{
|
||||
if (str == null)
|
||||
{
|
||||
return 0L;
|
||||
}
|
||||
return ToUnixTime(DateTime.Parse(str));
|
||||
}
|
||||
|
||||
public static long ToUnixTime(DateTime dateTime)
|
||||
{
|
||||
return (long)ToUnixTimeDouble(dateTime);
|
||||
}
|
||||
|
||||
public static double ToUnixTimeDouble(DateTime dateTime)
|
||||
{
|
||||
dateTime = dateTime.ToUniversalTime();
|
||||
return (dateTime - UNIX_EPOCH).TotalSeconds;
|
||||
}
|
||||
|
||||
public static DateTime FromUnixTime(long unixTime)
|
||||
{
|
||||
return UNIX_EPOCH.AddSeconds(Convert.ToDouble(unixTime)).ToLocalTime();
|
||||
}
|
||||
|
||||
public static DateTime MicroTimeToFromUnixTime(long unixTime)
|
||||
{
|
||||
return FromUnixTime(unixTime / 1000);
|
||||
}
|
||||
|
||||
public static TimeLeftParam GetTimeLeft(long nowTime, long endTime, long consumingTime = 0L)
|
||||
{
|
||||
return new TimeLeftParam(endTime - nowTime, consumingTime);
|
||||
}
|
||||
|
||||
public static long GetElapsedTime(DateTime baseDateTime, DateTime dateTime)
|
||||
{
|
||||
return ToUnixTime(dateTime) - ToUnixTime(baseDateTime);
|
||||
}
|
||||
|
||||
public static TimeSpan GetElapsedTimeByTimeSpan(DateTime baseDateTime, DateTime dateTime)
|
||||
{
|
||||
return baseDateTime - dateTime;
|
||||
}
|
||||
|
||||
public static bool IsTermTime(string startDate, string endDate, long checkTime = 0L)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,65 +1,32 @@
|
||||
using System.Threading;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class Toolbox
|
||||
{
|
||||
private enum SYSTEM_INIT
|
||||
{
|
||||
SYSTEM_NOT_READY,
|
||||
SYSTEM_READY
|
||||
}
|
||||
|
||||
public static bool isLoadFromLocal;
|
||||
|
||||
public static bool isLoadLocalSound;
|
||||
|
||||
public static BootSystem BootSystem;
|
||||
|
||||
public static BootNetwork BootNetwork;
|
||||
|
||||
public static SceneManager SceneManager;
|
||||
|
||||
public static NetworkManager NetworkManager;
|
||||
|
||||
public static AssetManager AssetManager;
|
||||
|
||||
public static SavedataManager SavedataManager;
|
||||
|
||||
public static DeviceManager DeviceManager;
|
||||
|
||||
public static QualityManager QualityManager;
|
||||
|
||||
public static ResourcesManager ResourcesManager;
|
||||
|
||||
public static AudioManager AudioManager;
|
||||
|
||||
public static MovieManager MovieManager;
|
||||
|
||||
public static DebugManager DebugManager;
|
||||
|
||||
public static Mutex mute;
|
||||
|
||||
public static void Clear()
|
||||
{
|
||||
BootSystem = null;
|
||||
BootNetwork = null;
|
||||
SceneManager = null;
|
||||
NetworkManager = null;
|
||||
AssetManager = null;
|
||||
SavedataManager = null;
|
||||
DeviceManager = null;
|
||||
QualityManager = null;
|
||||
ResourcesManager = null;
|
||||
AudioManager = null;
|
||||
}
|
||||
|
||||
public static bool isFrameWorkLoaded()
|
||||
{
|
||||
if (BootSystem != null && BootNetwork != null && SceneManager != null && NetworkManager != null && AssetManager != null && SavedataManager != null && DeviceManager != null && QualityManager != null && ResourcesManager != null && AudioManager != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
using System.Threading;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class Toolbox
|
||||
{
|
||||
private enum SYSTEM_INIT
|
||||
{
|
||||
}
|
||||
|
||||
public static BootSystem BootSystem;
|
||||
|
||||
public static BootNetwork BootNetwork;
|
||||
|
||||
public static NetworkManager NetworkManager;
|
||||
|
||||
public static AssetManager AssetManager;
|
||||
|
||||
public static SavedataManager SavedataManager;
|
||||
|
||||
public static DeviceManager DeviceManager;
|
||||
|
||||
public static QualityManager QualityManager;
|
||||
|
||||
public static ResourcesManager ResourcesManager;
|
||||
|
||||
|
||||
|
||||
public static DebugManager DebugManager;
|
||||
|
||||
public static Mutex mute;
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace Cute;
|
||||
|
||||
internal class TransitionCodeParams : PostParams
|
||||
{
|
||||
public string input_viewer_id = "";
|
||||
|
||||
public string password = "";
|
||||
}
|
||||
@@ -1,180 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class URLScheme
|
||||
{
|
||||
private enum CPTYPE
|
||||
{
|
||||
IORI = 1,
|
||||
ALIVE
|
||||
}
|
||||
|
||||
private static string process = "";
|
||||
|
||||
private static string result = "";
|
||||
|
||||
private static string scheme = "";
|
||||
|
||||
private static int short_udid = 0;
|
||||
|
||||
private static string udid = "";
|
||||
|
||||
private static string error_code = "";
|
||||
|
||||
private static string campaign_data = "";
|
||||
|
||||
private static int app_type = 0;
|
||||
|
||||
private const string COMBINE = "combine";
|
||||
|
||||
private const string MIGRATION = "migration";
|
||||
|
||||
private const string OK = "ok";
|
||||
|
||||
private const string NG = "ng";
|
||||
|
||||
private const string IORI = "cg";
|
||||
|
||||
private const string ALIVE = "pc";
|
||||
|
||||
public const string EC_MIGRATION_CANCEL = "3070";
|
||||
|
||||
public const string EC_COMBINE_CANCEL = "3060";
|
||||
|
||||
public const string EC_MIGRATION_ALREADY_RECORDED = "3061";
|
||||
|
||||
public const string EC_COMBINE_NO_URL = "3054";
|
||||
|
||||
public const string EC_MIGRATION_NO_URL = "3063";
|
||||
|
||||
public const string EC_COMBINE_EXEC_HAVE_RECORD = "3057";
|
||||
|
||||
public static string CampaignData => campaign_data;
|
||||
|
||||
public static int AppType => app_type;
|
||||
|
||||
public static void URLSchemeStartAndroid()
|
||||
{
|
||||
GetURLSchemeParamsAndroid();
|
||||
ProcessSetting();
|
||||
}
|
||||
|
||||
public static void URLSchemeStartiOS(string message)
|
||||
{
|
||||
GetURLSchemeParamsiOS(message);
|
||||
ProcessSetting();
|
||||
}
|
||||
|
||||
public static bool IsCombineOK()
|
||||
{
|
||||
if (process == "combine" && result == "ok")
|
||||
{
|
||||
return short_udid == Certification.ShortUdid;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool IsCombineNG()
|
||||
{
|
||||
if (process == "combine" && result == "ng")
|
||||
{
|
||||
return error_code != "";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool IsMigrationOK()
|
||||
{
|
||||
if (process == "migration" && result == "ok")
|
||||
{
|
||||
return udid == Certification.Udid;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool IsMigrationNG()
|
||||
{
|
||||
if (process == "migration" && result == "ng")
|
||||
{
|
||||
return error_code != "";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool IsMigrationFinished()
|
||||
{
|
||||
if (process == "migration" && result == "ng")
|
||||
{
|
||||
return error_code == "3061";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void Clear()
|
||||
{
|
||||
scheme = "";
|
||||
process = "";
|
||||
result = "";
|
||||
short_udid = 0;
|
||||
udid = "";
|
||||
error_code = "";
|
||||
}
|
||||
|
||||
public static void ClearCampaignData()
|
||||
{
|
||||
campaign_data = "";
|
||||
app_type = 0;
|
||||
}
|
||||
|
||||
private static void GetURLSchemeParamsAndroid()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
private static void GetURLSchemeParamsiOS(string url)
|
||||
{
|
||||
Clear();
|
||||
if (url == "")
|
||||
{
|
||||
url = PlayerPrefs.GetString("iOSUrlScheme", "");
|
||||
PlayerPrefs.DeleteKey("iOSUrlScheme");
|
||||
}
|
||||
if (url.IndexOf("://") >= 0)
|
||||
{
|
||||
scheme = url.Substring(0, url.IndexOf("://"));
|
||||
AnalysisResult(url.Substring(url.IndexOf("://") + 3));
|
||||
}
|
||||
}
|
||||
|
||||
private static void ProcessSetting()
|
||||
{
|
||||
if (!(scheme == ""))
|
||||
{
|
||||
if (IsCombineOK())
|
||||
{
|
||||
DataMigration.CombineSucceed();
|
||||
}
|
||||
else if (IsCombineNG())
|
||||
{
|
||||
DataMigration.CombineFailed();
|
||||
}
|
||||
else if (IsMigrationOK())
|
||||
{
|
||||
DataMigration.MigrationSucceed();
|
||||
}
|
||||
else if (IsMigrationNG())
|
||||
{
|
||||
DataMigration.MigrationFailed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void AnalysisResult(string host)
|
||||
{
|
||||
if (scheme == "shadowverse")
|
||||
{
|
||||
UIManager.GetInstance().AccountTransferHelper.GetAppleData(host);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class UpdateBirthTask : NetworkTask
|
||||
{
|
||||
private class UpdateBirthPostParams : PostParams
|
||||
{
|
||||
public string birth = "";
|
||||
}
|
||||
|
||||
private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.BirthUpdate;
|
||||
|
||||
public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}";
|
||||
|
||||
public void SetParameter(string birth)
|
||||
{
|
||||
UpdateBirthPostParams updateBirthPostParams = new UpdateBirthPostParams();
|
||||
updateBirthPostParams.birth = birth;
|
||||
base.Params = updateBirthPostParams;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
CreateItemList.BirthDayUpdateServerTime = base.ResponseData["data_headers"]["servertime"].ToInt();
|
||||
CreateItemList.BirthDayUpdateRealTime = Time.realtimeSinceStartup;
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Cute;
|
||||
|
||||
public class UpdateiCloudUserDataTask : NetworkTask
|
||||
{
|
||||
private class iCloudUserParams : PostParams
|
||||
{
|
||||
public string carrier = "";
|
||||
|
||||
public string icloud_data = "";
|
||||
}
|
||||
|
||||
private CuteNetworkDefine.ApiType apiType = CuteNetworkDefine.ApiType.MigrateiCloudUser;
|
||||
|
||||
public override string Url => $"{CustomPreference.GetApplicationServerURL()}{CuteNetworkDefine.ApiUrlList[apiType]}";
|
||||
|
||||
public void SetParameter(string iCloudData)
|
||||
{
|
||||
iCloudUserParams iCloudUserParams = new iCloudUserParams();
|
||||
iCloudUserParams.icloud_data = iCloudData;
|
||||
iCloudUserParams.carrier = Toolbox.DeviceManager.GetCarrier();
|
||||
base.Params = iCloudUserParams;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
if (resultCode != 1)
|
||||
{
|
||||
return base.Parse();
|
||||
}
|
||||
JsonData jsonData = base.ResponseData["data_headers"];
|
||||
int viewerId = jsonData["viewer_id"].ToInt();
|
||||
int shortUdid = jsonData["short_udid"].ToInt();
|
||||
string text = jsonData["udid"].ToString();
|
||||
if (Certification.Udid != text)
|
||||
{
|
||||
Debug.LogError("udid一致しません。不正のアクセスです。");
|
||||
}
|
||||
else
|
||||
{
|
||||
Certification.ViewerId = viewerId;
|
||||
Certification.ShortUdid = shortUdid;
|
||||
}
|
||||
return resultCode;
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -23,26 +23,6 @@ public class WebViewManager : MonoBehaviour
|
||||
|
||||
private bool screenDpiChangedWhileInvisible;
|
||||
|
||||
private static readonly Dictionary<string, string> FontFamilyDict = new Dictionary<string, string>
|
||||
{
|
||||
{
|
||||
Global.LANG_TYPE.Jpn.ToString(),
|
||||
"font_jpn"
|
||||
},
|
||||
{
|
||||
Global.LANG_TYPE.Kor.ToString(),
|
||||
"font_kor"
|
||||
},
|
||||
{
|
||||
Global.LANG_TYPE.Cht.ToString(),
|
||||
"font_cht"
|
||||
},
|
||||
{
|
||||
Global.LANG_TYPE.Chs.ToString(),
|
||||
"font_chs"
|
||||
}
|
||||
};
|
||||
|
||||
public Action<string> Callback { get; set; }
|
||||
|
||||
public static bool HasInstance => instance != null;
|
||||
@@ -77,11 +57,6 @@ public class WebViewManager : MonoBehaviour
|
||||
screenDpi = Screen.dpi;
|
||||
}
|
||||
|
||||
private bool IsScreenDpiChanged()
|
||||
{
|
||||
return Math.Abs(screenDpi - Screen.dpi) > 0.1f;
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
instance = this;
|
||||
@@ -89,47 +64,6 @@ public class WebViewManager : MonoBehaviour
|
||||
UpdateScreenDpi();
|
||||
}
|
||||
|
||||
private void OnLoadedCallback(string msg)
|
||||
{
|
||||
if (onLoaded != null)
|
||||
{
|
||||
onLoaded(msg);
|
||||
}
|
||||
}
|
||||
|
||||
private string GetFontFamilyName()
|
||||
{
|
||||
if (!FontFamilyDict.TryGetValue(CustomPreference.GetTextLanguage(), out var value))
|
||||
{
|
||||
return "font_alphabet";
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
private void OnErrorCallback(string error)
|
||||
{
|
||||
if (onError != null)
|
||||
{
|
||||
onError(error);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnApplicationFocus(bool focus)
|
||||
{
|
||||
if (focus && IsScreenDpiChanged())
|
||||
{
|
||||
UpdateScreenDpi();
|
||||
if (Visible)
|
||||
{
|
||||
OnDpiChange();
|
||||
}
|
||||
else
|
||||
{
|
||||
screenDpiChangedWhileInvisible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDpiChange()
|
||||
{
|
||||
if (OnDpiChangedAction != null)
|
||||
@@ -147,70 +81,15 @@ public class WebViewManager : MonoBehaviour
|
||||
SetMargins((int)oldMargin.x, (int)oldMargin.y, (int)oldMargin.z, (int)oldMargin.w);
|
||||
}
|
||||
|
||||
public void ClearFontFilePaths()
|
||||
{
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
instance = null;
|
||||
ClearFontFilePaths();
|
||||
}
|
||||
|
||||
public void InitCustomFontFileInfo(Dictionary<string, string> fileNamePathDict, int currentCustomFontFileIndex)
|
||||
{
|
||||
}
|
||||
|
||||
private void InitIOSCustomFont()
|
||||
{
|
||||
}
|
||||
|
||||
private void DisableIOSCustomFont()
|
||||
{
|
||||
}
|
||||
|
||||
public void OpenWeb(string url)
|
||||
{
|
||||
m_WebViewScreen.CurBoxCollider.enabled = true;
|
||||
SetMargins(UIManager.GetInstance().UIManagerRoot, m_WebViewScreen);
|
||||
LoadWeb(url);
|
||||
SetVisible(visible: true);
|
||||
}
|
||||
|
||||
public void LoadWeb(string url)
|
||||
{
|
||||
}
|
||||
|
||||
public void ClearHistory()
|
||||
{
|
||||
}
|
||||
|
||||
public void SetMargins(int leftMargin, int topMargin, int rightMargin, int bottomMargin)
|
||||
{
|
||||
marginNow = new Vector4(leftMargin, topMargin, rightMargin, bottomMargin);
|
||||
}
|
||||
|
||||
public void SetMargins(UIRoot trgUIRoot, WebViewScreen trgScreen)
|
||||
{
|
||||
float arg = trgUIRoot.activeHeight;
|
||||
Func<float, float, float, float, int> func = delegate(float deviceSize, float activeScreenSize, float screenSize, float pos)
|
||||
{
|
||||
screenSize += pos * 2f;
|
||||
screenSize /= activeScreenSize;
|
||||
screenSize = 1f - screenSize;
|
||||
return (int)(screenSize * deviceSize * 0.5f);
|
||||
};
|
||||
Vector2 deviceResolution = Toolbox.QualityManager.deviceResolution;
|
||||
float num = Mathf.Max(deviceResolution.x, deviceResolution.y);
|
||||
BoxCollider curBoxCollider = trgScreen.CurBoxCollider;
|
||||
int num2 = (int)(num - num * AspectCamera.SafeAreaRate);
|
||||
int num3 = (int)(num * AspectCamera.SafeAreaRate) / 30 + num2 / 2;
|
||||
int rightMargin = num3;
|
||||
int topMargin = func(deviceResolution.y, arg, curBoxCollider.size.y, curBoxCollider.center.y);
|
||||
int bottomMargin = func(deviceResolution.y, arg, curBoxCollider.size.y, 0f - curBoxCollider.center.y);
|
||||
getInstance().SetMargins(num3, topMargin, rightMargin, bottomMargin);
|
||||
}
|
||||
|
||||
public void UnloadWebView()
|
||||
{
|
||||
m_WebViewScreen.CurBoxCollider.enabled = false;
|
||||
@@ -221,14 +100,6 @@ public class WebViewManager : MonoBehaviour
|
||||
OnError = null;
|
||||
}
|
||||
|
||||
public void DestroyWebViewObject()
|
||||
{
|
||||
}
|
||||
|
||||
public void EvaluateJS(string js)
|
||||
{
|
||||
}
|
||||
|
||||
public void SetVisible(bool visible)
|
||||
{
|
||||
Visible = visible;
|
||||
@@ -239,14 +110,6 @@ public class WebViewManager : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearCaches()
|
||||
{
|
||||
}
|
||||
|
||||
public void Reload()
|
||||
{
|
||||
}
|
||||
|
||||
public bool CanGoBack()
|
||||
{
|
||||
return false;
|
||||
@@ -256,21 +119,8 @@ public class WebViewManager : MonoBehaviour
|
||||
{
|
||||
}
|
||||
|
||||
public void Screenshot()
|
||||
{
|
||||
}
|
||||
|
||||
public void SetScreenshotData(int width, int height)
|
||||
{
|
||||
}
|
||||
|
||||
public void SetCallback(Action<string> cb)
|
||||
{
|
||||
Callback = cb;
|
||||
}
|
||||
|
||||
public void CacheClear()
|
||||
{
|
||||
LoadWeb(CustomPreference.GetApplicationServerURL() + "information/blank");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user