Files
SVSimServer/SVSim.BattleEngine/Engine/Wizard/UserRegionUpdater.cs
gamer147 0455ff649e feat(battle-engine): EffectType full enum + collection/card/vfx extension copies
Replaces partial EffectMgr.EffectType with all 226 decomp values; copies the
IsNotNullOrEmpty/EquelsID/FindFromCardId/GetAllFuncVfxResults extension files +
UI extensions; adds Renderer/MeshFilter shared-material/mesh/sortingOrder. Compile
loop then closed the revealed deps (3242 files). 9.1k -> 18 errors.
2026-06-05 20:38:56 -04:00

52 lines
1.3 KiB
C#

using System;
using Cute;
namespace Wizard;
public class UserRegionUpdater
{
private enum UpdateRegionType
{
CURRENT,
INSTALL
}
private RegionCodeUpdateTask _regionUpdateTask;
private UpdateRegionType _updateType = UpdateRegionType.INSTALL;
private bool _isUpdateRegion;
public UserRegionUpdater()
{
_regionUpdateTask = new RegionCodeUpdateTask();
}
public void UpDateRegion(Action callback)
{
string value = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.INSTALL_REGION_CODE);
string currentRegionStr = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.CURRENT_REGION_CODE);
if (string.IsNullOrEmpty(value) && !string.IsNullOrEmpty(currentRegionStr))
{
_isUpdateRegion = true;
_updateType = UpdateRegionType.INSTALL;
}
else if (!string.IsNullOrEmpty(currentRegionStr) && value != currentRegionStr)
{
_isUpdateRegion = true;
_updateType = UpdateRegionType.CURRENT;
}
if (!_isUpdateRegion)
{
callback();
return;
}
_regionUpdateTask.SetParameter((int)_updateType);
UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(_regionUpdateTask, delegate
{
PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.INSTALL_REGION_CODE, currentRegionStr);
callback();
}, BaseTask.OnRequestFailed, BaseTask.OnFailedErrorCode));
}
}