Files
SVSimServer/SVSim.BattleEngine/Engine/Wizard/RoomBattleWatchTaskBase.cs
gamer147 4be630bd09 feat(battle-engine): full-surface app-type god-object/manager stubs (1692->1586 true)
Make the minimal hand shims partial + generate full member surface for the manager/
task/controller god-objects (LoadingViewManager/DeckUpdateTask/MyPageTask/ReplayController/
PlayerControllerForWatching/WatchDataHandler/EvolutionTouchProcessor/StoryChapterSelection
Utility/NonDialogPopup). NonDialogPopup given MonoBehaviour base + hand Close() removed
(superseded by full surface). LoadTask dup deleted (already copied verbatim). RoomMatch
watch/replay closure types stubbed. Copied 8 more closure files.

CS0246-in-generated-signature masking note: 4 such errors were hiding ~1582 — generated
CS0246 masks as hard as header CS0246; the real frontier is 1586 (CS7036 base-ctor +
member-level), 0 structural.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 22:33:37 -04:00

115 lines
2.9 KiB
C#

using System;
using System.Collections.Generic;
using LitJson;
namespace Wizard;
public class RoomBattleWatchTaskBase : BaseTask
{
public class UserInfo
{
public int battlePoint;
public int degreeId;
public long emblemId;
public string countryCode;
public int rank;
public string userName;
public int viewerId;
public bool IsOfficialUser { get; set; }
public UserInfo()
{
}
public UserInfo(Dictionary<string, object> data)
{
viewerId = Convert.ToInt32(data["viewerId"]);
countryCode = data["country_code"].ToString();
userName = data["userName"].ToString();
rank = Convert.ToInt32(data["rank"]);
battlePoint = Convert.ToInt32(data["battlePoint"]);
emblemId = Convert.ToInt32(data["emblemId"]);
degreeId = Convert.ToInt32(data["degreeId"]);
IsOfficialUser = Convert.ToInt32(data["isOfficial"]) == 1;
}
}
public int result_reason;
public string node_server_url;
public UserInfo owner_info;
public UserInfo visitor_info;
public BattleParameter BattleParameterInstance { get; private set; }
protected override int Parse()
{
int num = base.Parse();
if (num != 1)
{
return num;
}
JsonData jsonData = base.ResponseData["data"];
result_reason = jsonData["result_reason"].ToInt();
if (result_reason == 0)
{
if (jsonData.Keys.Contains("owner_info"))
{
ParseUserInfo(jsonData["owner_info"], ref owner_info);
}
if (jsonData.Keys.Contains("visitor_info"))
{
ParseUserInfo(jsonData["visitor_info"], ref visitor_info);
}
node_server_url = jsonData["node_server_url"].ToString();
}
if (jsonData.Keys.Contains("is_admin"))
{
bool flag = Convert.ToBoolean(jsonData["is_admin"].ToInt());
GameMgr.GetIns().IsAdmin = flag;
GameMgr.GetIns().HasAuthAdmin = flag;
}
else
{
GameMgr.GetIns().IsAdmin = false;
GameMgr.GetIns().HasAuthAdmin = false;
}
BattleParameterInstance = BattleParameter.JsonToBattleParameter(base.ResponseData["data"]);
if (BattleParameterInstance.BattleType == NetworkDefine.ServerBattleType.RoomTwoPick)
{
GameMgr.GetIns().GetDataMgr().m_BattleType = DataMgr.BattleType.RoomTwoPick;
GameMgr.GetIns().GetDataMgr().TwoPickFormat = BattleParameterInstance.TwoPickFormat;
}
else
{
GameMgr.GetIns().GetDataMgr().m_BattleType = DataMgr.BattleType.RoomBattle;
}
return num;
}
private void ParseUserInfo(JsonData receive, ref UserInfo info)
{
if (receive != null)
{
info = new UserInfo();
info.viewerId = receive["viewer_id"].ToInt();
info.battlePoint = receive["battlePoint"].ToInt();
info.degreeId = receive["degreeId"].ToInt();
info.emblemId = receive["emblemId"].ToLong();
info.countryCode = receive["country_code"].ToString();
info.rank = receive["rank"].ToInt();
info.userName = receive["userName"].ToString();
info.IsOfficialUser = receive["isOfficial"].ToInt() == 1;
}
}
}