feat(battle-engine): copy-loop closure to 3282 files (member-surface frontier)
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
26
SVSim.BattleEngine/Engine/Cute/PaymentStartCancelParams.cs
Normal file
26
SVSim.BattleEngine/Engine/Cute/PaymentStartCancelParams.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
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();
|
||||
}
|
||||
25
SVSim.BattleEngine/Engine/Cute/PublistTransitionCode.cs
Normal file
25
SVSim.BattleEngine/Engine/Cute/PublistTransitionCode.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
51
SVSim.BattleEngine/Engine/Cute/SteamMicroTxnInitTask.cs
Normal file
51
SVSim.BattleEngine/Engine/Cute/SteamMicroTxnInitTask.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
8
SVSim.BattleEngine/Engine/Cute/TransitionCodeParams.cs
Normal file
8
SVSim.BattleEngine/Engine/Cute/TransitionCodeParams.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Cute;
|
||||
|
||||
internal class TransitionCodeParams : PostParams
|
||||
{
|
||||
public string input_viewer_id = "";
|
||||
|
||||
public string password = "";
|
||||
}
|
||||
15
SVSim.BattleEngine/Engine/UIDragDropContainer.cs
Normal file
15
SVSim.BattleEngine/Engine/UIDragDropContainer.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using UnityEngine;
|
||||
|
||||
[AddComponentMenu("NGUI/Interaction/Drag and Drop Container")]
|
||||
public class UIDragDropContainer : MonoBehaviour
|
||||
{
|
||||
public Transform reparentTarget;
|
||||
|
||||
protected virtual void Start()
|
||||
{
|
||||
if (reparentTarget == null)
|
||||
{
|
||||
reparentTarget = base.transform;
|
||||
}
|
||||
}
|
||||
}
|
||||
20
SVSim.BattleEngine/Engine/UIDragDropRoot.cs
Normal file
20
SVSim.BattleEngine/Engine/UIDragDropRoot.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using UnityEngine;
|
||||
|
||||
[AddComponentMenu("NGUI/Interaction/Drag and Drop Root")]
|
||||
public class UIDragDropRoot : MonoBehaviour
|
||||
{
|
||||
public static Transform root;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
root = base.transform;
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
if (root == base.transform)
|
||||
{
|
||||
root = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Wizard.Battle.Card;
|
||||
|
||||
namespace Wizard.Battle.Operation;
|
||||
|
||||
public class SimulateCostNoDuplicationRandomSelectFilter : ISkillSelectFilter
|
||||
{
|
||||
private readonly IVirtualBattleCard _virtualOwnerCard;
|
||||
|
||||
private readonly string _contText;
|
||||
|
||||
public SimulateCostNoDuplicationRandomSelectFilter(IVirtualBattleCard virtualOwnerCard, string randomCountText)
|
||||
{
|
||||
_virtualOwnerCard = virtualOwnerCard;
|
||||
_contText = randomCountText;
|
||||
}
|
||||
|
||||
public int CalcCount(SkillOptionValue option)
|
||||
{
|
||||
return option.ParseInt(_contText);
|
||||
}
|
||||
|
||||
public IEnumerable<BattleCardBase> Filtering(IEnumerable<BattleCardBase> cards, SkillOptionValue option, SkillConditionCheckerOption checkerOption)
|
||||
{
|
||||
_virtualOwnerCard.UsedRandomSkill = true;
|
||||
int count = CalcCount(option);
|
||||
List<BattleCardBase> cardList = cards.ToList();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if (cardList.Count != 0)
|
||||
{
|
||||
BattleCardBase card = cardList[0];
|
||||
cardList = cardList.Where((BattleCardBase c) => c.Card.BaseParameter.Cost != card.BaseParameter.Cost).ToList();
|
||||
yield return card;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Wizard.Battle.Card;
|
||||
|
||||
namespace Wizard.Battle.Operation;
|
||||
|
||||
public class SimulateIdNoDuplicationRandomSelectFilter : ISkillSelectFilter
|
||||
{
|
||||
private readonly IVirtualBattleCard _virtualOwnerCard;
|
||||
|
||||
private readonly string _contText;
|
||||
|
||||
public SimulateIdNoDuplicationRandomSelectFilter(IVirtualBattleCard virtualOwnerCard, string randomCountText)
|
||||
{
|
||||
_virtualOwnerCard = virtualOwnerCard;
|
||||
_contText = randomCountText;
|
||||
}
|
||||
|
||||
public int CalcCount(SkillOptionValue option)
|
||||
{
|
||||
return option.ParseInt(_contText);
|
||||
}
|
||||
|
||||
public IEnumerable<BattleCardBase> Filtering(IEnumerable<BattleCardBase> cards, SkillOptionValue option, SkillConditionCheckerOption checkerOption)
|
||||
{
|
||||
_virtualOwnerCard.UsedRandomSkill = true;
|
||||
int count = CalcCount(option);
|
||||
List<BattleCardBase> cardList = cards.ToList();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if (cardList.Count != 0)
|
||||
{
|
||||
BattleCardBase card = cardList[0];
|
||||
cardList = cardList.Where((BattleCardBase c) => c.Card.BaseParameter.BaseCardId != card.BaseParameter.BaseCardId).ToList();
|
||||
yield return card;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
namespace Wizard.Battle.Phase;
|
||||
|
||||
public class RecoveryNetworkAfterSubmitMulliganPhase : RecoveryNetworkBeforeSubmitMulliganPhase
|
||||
{
|
||||
public RecoveryNetworkAfterSubmitMulliganPhase(NetworkBattleManagerBase networkBattleMgr, NetworkBattleSender networkBattleSender)
|
||||
: base(networkBattleMgr, networkBattleSender)
|
||||
{
|
||||
}
|
||||
|
||||
public override VfxBase Setup()
|
||||
{
|
||||
base.Setup();
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
|
||||
public override VfxBase Teardown()
|
||||
{
|
||||
base.Teardown();
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,580 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using LitJson;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
namespace Wizard.Battle.Recovery;
|
||||
|
||||
public class AINetworkBattleOperationRecorder : OperationRecorderBase
|
||||
{
|
||||
protected DataMgr.BattleType _battleType;
|
||||
|
||||
protected long _turnStartTime;
|
||||
|
||||
protected JsonData _setupJsonData = new JsonData();
|
||||
|
||||
public AINetworkBattleOperationRecorder(string filePath)
|
||||
: base(filePath)
|
||||
{
|
||||
if (RecoveryRecordManagerBase.IsExistsAINetworkRecoveryFile())
|
||||
{
|
||||
JsonData jsonData = RecoveryOperationInfo.ReadRecoveryFile(filePath);
|
||||
_setupJsonData = jsonData["setup"];
|
||||
_battleType = (DataMgr.BattleType)jsonData["battle_type"].ToInt();
|
||||
if (jsonData.Keys.Any((string a) => a == "operations"))
|
||||
{
|
||||
foreach (object item in (IEnumerable)jsonData["operations"])
|
||||
{
|
||||
_operationJsonDataList.Add((JsonData)item);
|
||||
}
|
||||
}
|
||||
if (jsonData.Keys.Any((string a) => a == "skill_targets"))
|
||||
{
|
||||
foreach (object item2 in (IEnumerable)jsonData["skill_targets"])
|
||||
{
|
||||
_skillTargetList.Add((string)item2);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_setupJsonData["player"] = new JsonData();
|
||||
_setupJsonData["player"].SetJsonType(JsonType.Object);
|
||||
_setupJsonData["enemy"] = new JsonData();
|
||||
_setupJsonData["enemy"].SetJsonType(JsonType.Object);
|
||||
}
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordMulliganStart()
|
||||
{
|
||||
DateTimeOffset dateTimeOffset = new DateTimeOffset(DateTime.Now.Ticks, new TimeSpan(0, 0, 0));
|
||||
_setupJsonData["start_mulligan_time"] = dateTimeOffset.ToUnixTimeSeconds();
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordPractice3DFieldId(int id)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordBattleType(DataMgr.BattleType battleType)
|
||||
{
|
||||
_battleType = battleType;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordRandomSeed(int randomSeed)
|
||||
{
|
||||
_setupJsonData["random_seed"] = randomSeed;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordBackGroundId(int backGroundId)
|
||||
{
|
||||
_setupJsonData["background_id"] = backGroundId;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordBgmId(string bgmId)
|
||||
{
|
||||
_setupJsonData["bgm_id"] = bgmId;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordClass(string playerName, int clanType)
|
||||
{
|
||||
_setupJsonData[playerName]["clan_type"] = clanType;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordSubClass(string playerName, int clanType)
|
||||
{
|
||||
_setupJsonData[playerName]["sub_class_type"] = clanType;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordMyRotationId(string playerName, string myRotationId)
|
||||
{
|
||||
_setupJsonData[playerName]["my_rotation_id"] = myRotationId;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordSleeve(string playerName, long sleeveId)
|
||||
{
|
||||
_setupJsonData[playerName]["sleeve_id"] = sleeveId;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordChara(string playerName, int charaId)
|
||||
{
|
||||
_setupJsonData[playerName]["chara_id"] = charaId;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordDeck(string playerName, char indexHeadChar, IEnumerable<int> cardIds)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
_setupJsonData[playerName]["deck"] = jsonData;
|
||||
jsonData.SetJsonType(JsonType.Array);
|
||||
int num = 1;
|
||||
foreach (int cardId in cardIds)
|
||||
{
|
||||
JsonData jsonData2 = new JsonData();
|
||||
jsonData2.SetJsonType(JsonType.Object);
|
||||
jsonData2["index"] = indexHeadChar.ToString() + num;
|
||||
jsonData2["id"] = cardId;
|
||||
jsonData2["name"] = CardMaster.GetInstanceForBattle().GetCardParameterFromId(cardId).CardName;
|
||||
jsonData.Add(jsonData2);
|
||||
num++;
|
||||
}
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordEnemyAIDifficulty(int level)
|
||||
{
|
||||
_setupJsonData["enemy"]["ai_difficulty"] = level;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordEnemyAILogicLevel(int level)
|
||||
{
|
||||
_setupJsonData["enemy"]["ai_logic_level"] = level;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordEnemyAIMaxLife(int life)
|
||||
{
|
||||
_setupJsonData["enemy"]["ai_max_life"] = life;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordEnemyAIDeckId(int deckId)
|
||||
{
|
||||
_setupJsonData["enemy"]["ai_deck_id"] = deckId;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordEnemyAIStyleId(int styleId)
|
||||
{
|
||||
_setupJsonData["enemy"]["ai_style_id"] = styleId;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordEnemyAIEmoteId(int emoteId)
|
||||
{
|
||||
_setupJsonData["enemy"]["ai_emote_id"] = emoteId;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordEnemyAIUseInnerEmote(bool useInnerEmote)
|
||||
{
|
||||
_setupJsonData["enemy"]["ai_use_inner_emote"] = useInnerEmote;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordStartTurnIsPlayer(bool startTurnIsPlayer)
|
||||
{
|
||||
_setupJsonData["player_start_turn"] = startTurnIsPlayer;
|
||||
DateTimeOffset dateTimeOffset = new DateTimeOffset(DateTime.Now.Ticks, new TimeSpan(0, 0, 0));
|
||||
_setupJsonData["opening_start_time"] = dateTimeOffset.ToUnixTimeSeconds();
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordPracticeDifficultyDegreeId(int degreeId)
|
||||
{
|
||||
_setupJsonData["practice_difficulty_degree_id"] = degreeId;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordIsPreBuildDeck(bool isPreBuildDeck)
|
||||
{
|
||||
_setupJsonData["is_prebuild_deck"] = isPreBuildDeck;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordIsTrialDeck(bool isTrialDeck)
|
||||
{
|
||||
_setupJsonData["is_trial_deck"] = isTrialDeck;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordIsDefaultDeck(bool isDefaultDeck)
|
||||
{
|
||||
_setupJsonData["is_default_deck"] = isDefaultDeck;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestStageId(int id)
|
||||
{
|
||||
_setupJsonData["quest_stage_id"] = id;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestEnemyAiId(int id)
|
||||
{
|
||||
_setupJsonData["quest_enemy_ai_id"] = id;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestEnemyEmblemId(int id)
|
||||
{
|
||||
_setupJsonData["quest_enemy_emblem_id"] = id;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestEnemyDegreeId(int id)
|
||||
{
|
||||
_setupJsonData["quest_enemy_degree_id"] = id;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestEnemyEmotionOverride(int id)
|
||||
{
|
||||
_setupJsonData["quest_enemy_emotion_override"] = id;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestPlayerEmotionOverride(int id)
|
||||
{
|
||||
_setupJsonData["quest_player_emotion_override"] = id;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestRecoveryPoint(int recoveryPoint)
|
||||
{
|
||||
_setupJsonData["recovery_point"] = recoveryPoint;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestPlayerSkillList(List<BossRushSpecialSkill> skills)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
_setupJsonData["quest_player_skill_list"] = jsonData;
|
||||
jsonData.SetJsonType(JsonType.Array);
|
||||
foreach (BossRushSpecialSkill skill in skills)
|
||||
{
|
||||
JsonData jsonData2 = new JsonData();
|
||||
jsonData2.SetJsonType(JsonType.Object);
|
||||
jsonData2["original_card_id"] = skill.OriginalCardId;
|
||||
jsonData2["name"] = skill.Name;
|
||||
jsonData2["skill_text"] = skill.SkillText;
|
||||
jsonData2["skill_desc_text"] = skill.SkillDescText;
|
||||
jsonData2["is_foil"] = skill.IsFoil;
|
||||
jsonData.Add(jsonData2);
|
||||
}
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestEnemySkill(BossRushSpecialSkill skill)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData.SetJsonType(JsonType.Object);
|
||||
jsonData["original_card_id"] = skill.OriginalCardId;
|
||||
jsonData["name"] = skill.Name;
|
||||
jsonData["skill_text"] = skill.SkillText;
|
||||
jsonData["skill_desc_text"] = skill.SkillDescText;
|
||||
jsonData["is_foil"] = skill.IsFoil;
|
||||
_setupJsonData["quest_enemy_skill"] = jsonData;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestMaxBattleCount(int maxBattleCount)
|
||||
{
|
||||
_setupJsonData["quest_max_battle_count"] = maxBattleCount;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestCurrentWinCount(int currentWinCount)
|
||||
{
|
||||
_setupJsonData["quest_current_win_count"] = currentWinCount;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestIsExtra(bool isExtra)
|
||||
{
|
||||
_setupJsonData["quest_is_extra"] = isExtra;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestIsMockBattle(bool isMockBattle)
|
||||
{
|
||||
_setupJsonData["quest_is_mock_battle"] = isMockBattle;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordQuestExtraDeckScheduleId(int id)
|
||||
{
|
||||
_setupJsonData["quest_extra_deck_schedule_id"] = id;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordMissionNecessaryInformation(BattleManagerBase.MissionNecessaryInformation missionNecessaryInformation)
|
||||
{
|
||||
_setupJsonData["mission_necessary_information"] = new JsonData();
|
||||
_setupJsonData["mission_necessary_information"].SetJsonType(JsonType.Object);
|
||||
foreach (KeyValuePair<string, string> item in missionNecessaryInformation.GetOriginalTargetDictionary())
|
||||
{
|
||||
_setupJsonData["mission_necessary_information"][item.Key] = item.Value;
|
||||
}
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordPlayerMulliganReplaceCards(IEnumerable<BattleCardBase> replaceCards, IEnumerable<int> completeCards)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData.SetJsonType(JsonType.Array);
|
||||
foreach (BattleCardBase replaceCard in replaceCards)
|
||||
{
|
||||
jsonData.Add(replaceCard.GetName());
|
||||
}
|
||||
_setupJsonData["player_mulligan_abandon"] = jsonData;
|
||||
JsonData jsonData2 = new JsonData();
|
||||
jsonData2.SetJsonType(JsonType.Array);
|
||||
foreach (int completeCard in completeCards)
|
||||
{
|
||||
jsonData2.Add("p" + completeCard);
|
||||
}
|
||||
_setupJsonData["player_mulligan_complete"] = jsonData2;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordEnemyMulliganReplaceCards(IEnumerable<BattleCardBase> replaceCards, IEnumerable<int> completeCards)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData.SetJsonType(JsonType.Array);
|
||||
foreach (BattleCardBase replaceCard in replaceCards)
|
||||
{
|
||||
jsonData.Add(replaceCard.GetName());
|
||||
}
|
||||
_setupJsonData["enemy_mulligan_abandon"] = jsonData;
|
||||
JsonData jsonData2 = new JsonData();
|
||||
jsonData2.SetJsonType(JsonType.Array);
|
||||
foreach (int completeCard in completeCards)
|
||||
{
|
||||
jsonData2.Add("e" + completeCard);
|
||||
}
|
||||
_setupJsonData["enemy_mulligan_complete"] = jsonData2;
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordPlay(BattleCardBase card, BattleCardBase originalCard, IEnumerable<BattleCardBase> selectedCards)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["ope"] = "play";
|
||||
jsonData["index"] = CardToIndexName(card);
|
||||
jsonData["id"] = card.CardId;
|
||||
jsonData["name"] = card.BaseParameter.CardName;
|
||||
jsonData["cost"] = card.Cost;
|
||||
jsonData["is_choice_brave"] = (originalCard.IsChoiceBraveSkillCard ? 1 : 0);
|
||||
WriteSkillTargetInfoToJson(selectedCards, jsonData);
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override VfxBase RecordAttack(BattleCardBase attackCard, BattleCardBase targetCard, SkillProcessor skillProcessor)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["ope"] = "attack";
|
||||
jsonData["index"] = CardToIndexName(attackCard);
|
||||
jsonData["id"] = attackCard.CardId;
|
||||
jsonData["name"] = attackCard.BaseParameter.CardName;
|
||||
jsonData["target"] = CardToIndexName(targetCard);
|
||||
jsonData["target_id"] = targetCard.CardId;
|
||||
jsonData["target_name"] = targetCard.BaseParameter.CardName;
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
|
||||
public override void RecordEvolve(BattleCardBase originalCard, BattleCardBase card, IEnumerable<BattleCardBase> selectedCards)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["ope"] = "evolve";
|
||||
jsonData["index"] = CardToIndexName(card);
|
||||
jsonData["id"] = card.CardId;
|
||||
jsonData["name"] = card.BaseParameter.CardName;
|
||||
WriteSkillTargetInfoToJson(selectedCards, jsonData);
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordStartSelect(BattleCardBase card, bool isEvolve, List<BattleCardBase> selectableCards, bool isChoiceBrave)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordSelect(BattleCardBase card, bool isEvolve, BattleCardBase actCard, bool isBurialRite, bool isChoiceBrave)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordCompleteSelect(BattleCardBase card, bool isEvolve, BattleCardBase actCard, bool isChoiceBrave, bool isBurialRite)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordStartChoice(BattleCardBase card, bool isEvolve, List<BattleCardBase> choiceCards, bool isChoiceBrave)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordStartFusion(BattleCardBase card, List<BattleCardBase> selectableCards)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordSelectFusion(BattleCardBase card)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordCompleteChoice(BattleCardBase card, bool isEvolve, List<BattleCardBase> chosenCardList, BattleCardBase actCard, List<int> chosenCardIndexList, bool hasSelectionSkill, bool isChoiceBrave)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordCancelChoice(BattleCardBase card, bool isEvolve, bool isChoiceBrave)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordCancelFusion(BattleCardBase card)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordCancelSelect(BattleCardBase actCard, bool isEvolve, bool isChoiceBrave)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordTurnStart()
|
||||
{
|
||||
DateTimeOffset dateTimeOffset = new DateTimeOffset(DateTime.Now.Ticks, new TimeSpan(0, 0, 0));
|
||||
_turnStartTime = dateTimeOffset.ToUnixTimeSeconds();
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordTurnEnd()
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["ope"] = "turn_end";
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordRetire()
|
||||
{
|
||||
}
|
||||
|
||||
public void RecordChangeAI(string logicName, int operationQueueCount)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["ope"] = "change_ai";
|
||||
jsonData["logic"] = logicName;
|
||||
jsonData["queue_count"] = operationQueueCount;
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordSkillTargets(IEnumerable<BattleCardBase> targetCards)
|
||||
{
|
||||
foreach (BattleCardBase targetCard in targetCards)
|
||||
{
|
||||
_skillTargetList.Add(targetCard.GetName());
|
||||
}
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public void RecordSpecialBattleSetting(DataMgr.SpecialBattleSetting setting)
|
||||
{
|
||||
if (setting != null)
|
||||
{
|
||||
_setupJsonData["story_special_battle_player_attach_skill"] = setting.PlayerAttachSkillText;
|
||||
_setupJsonData["story_special_battle_enemy_attach_skill"] = setting.EnemyAttachSkillText;
|
||||
_setupJsonData["story_special_battle_player_start_pp"] = setting.PlayerStartPp;
|
||||
_setupJsonData["story_special_battle_enemy_start_pp"] = setting.EnemyStartPp;
|
||||
_setupJsonData["story_special_battle_player_start_life"] = setting.PlayerStartMaxLife;
|
||||
_setupJsonData["story_special_battle_enemy_start_life"] = setting.EnemyStartMaxLife;
|
||||
_setupJsonData["story_special_battle_banish_effect_override"] = setting.IdOverrideInBattleLogText;
|
||||
_setupJsonData["story_special_battle_token_draw_effect_override"] = setting.TokenDrawEffectOverrideText;
|
||||
_setupJsonData["story_special_battle_id_override_in_battle_log"] = setting.IdOverrideInBattleLogText;
|
||||
WriteJsonData();
|
||||
}
|
||||
}
|
||||
|
||||
public override void RecordCompleteFusionSelect(BattleCardBase fusionCard, IEnumerable<BattleCardBase> ingredientCards)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["ope"] = "comp_fusion";
|
||||
jsonData["index"] = CardToIndexName(fusionCard);
|
||||
jsonData["id"] = fusionCard.CardId;
|
||||
jsonData["name"] = fusionCard.BaseParameter.CardName;
|
||||
WriteSkillTargetInfoToJson(ingredientCards, jsonData);
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
protected override void WriteJsonData()
|
||||
{
|
||||
if (RecoveryManagerBase.failedRecoveryFlag)
|
||||
{
|
||||
return;
|
||||
}
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["version"] = 0;
|
||||
jsonData["battle_type"] = (int)_battleType;
|
||||
jsonData["record_time"] = DateTime.Now.Ticks;
|
||||
jsonData["turn_start_time"] = _turnStartTime;
|
||||
jsonData["setup"] = _setupJsonData;
|
||||
jsonData["operations"] = new JsonData();
|
||||
jsonData["operations"].SetJsonType(JsonType.Array);
|
||||
foreach (JsonData operationJsonData in _operationJsonDataList)
|
||||
{
|
||||
jsonData["operations"].Add(operationJsonData);
|
||||
}
|
||||
jsonData["check"] = new JsonData();
|
||||
jsonData["check"]["player"] = new JsonData();
|
||||
jsonData["check"]["player"].SetJsonType(JsonType.Object);
|
||||
jsonData["check"]["enemy"] = new JsonData();
|
||||
jsonData["check"]["enemy"].SetJsonType(JsonType.Object);
|
||||
BattlePlayer battlePlayer = BattleManagerBase.GetIns().BattlePlayer;
|
||||
BattleEnemy battleEnemy = BattleManagerBase.GetIns().BattleEnemy;
|
||||
JsonData jsonData2 = new JsonData();
|
||||
jsonData2.SetJsonType(JsonType.Array);
|
||||
JsonData jsonData3 = new JsonData();
|
||||
jsonData3.SetJsonType(JsonType.Array);
|
||||
JsonData jsonData4 = new JsonData();
|
||||
jsonData4.SetJsonType(JsonType.Array);
|
||||
JsonData jsonData5 = new JsonData();
|
||||
jsonData5.SetJsonType(JsonType.Array);
|
||||
foreach (BattleCardBase handCard in battlePlayer.HandCardList)
|
||||
{
|
||||
jsonData2.Add(handCard.GetName());
|
||||
}
|
||||
foreach (BattleCardBase inPlayCard in battlePlayer.InPlayCards)
|
||||
{
|
||||
jsonData3.Add(inPlayCard.GetName());
|
||||
}
|
||||
foreach (BattleCardBase handCard2 in battleEnemy.HandCardList)
|
||||
{
|
||||
jsonData4.Add(handCard2.GetName());
|
||||
}
|
||||
foreach (BattleCardBase inPlayCard2 in battleEnemy.InPlayCards)
|
||||
{
|
||||
jsonData5.Add(inPlayCard2.GetName());
|
||||
}
|
||||
jsonData["check"]["player"]["hand"] = jsonData2;
|
||||
jsonData["check"]["player"]["inplay"] = jsonData3;
|
||||
jsonData["check"]["enemy"]["hand"] = jsonData4;
|
||||
jsonData["check"]["enemy"]["inplay"] = jsonData5;
|
||||
JsonData jsonData6 = new JsonData();
|
||||
jsonData6.SetJsonType(JsonType.Array);
|
||||
foreach (string skillTarget in _skillTargetList)
|
||||
{
|
||||
jsonData6.Add(skillTarget);
|
||||
}
|
||||
if (jsonData6.Count > 0)
|
||||
{
|
||||
jsonData["skill_targets"] = jsonData6;
|
||||
}
|
||||
WriteJsonDataToFile(jsonData);
|
||||
}
|
||||
|
||||
protected override void WriteJsonDataToFile(JsonData jsonData, string overrideFilePath = "")
|
||||
{
|
||||
base.WriteJsonDataToFile(jsonData, string.Empty);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,421 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using LitJson;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
namespace Wizard.Battle.Recovery;
|
||||
|
||||
public class NetworkBattleOperationRecorder : OperationRecorderBase
|
||||
{
|
||||
public NetworkBattleOperationRecorder(string filePath)
|
||||
: base(filePath)
|
||||
{
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
JsonData operationDataList = RecoveryOperationInfo.ReadRecoveryFile(filePath);
|
||||
SetOperationDataList(operationDataList);
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteJsonData();
|
||||
}
|
||||
}
|
||||
|
||||
public override void RecordBattleType(DataMgr.BattleType battleType)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordRandomSeed(int randomSeed)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordBackGroundId(int backGroundId)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordBgmId(string bgmId)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordClass(string playerName, int clanType)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordSubClass(string playerName, int clanType)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordMyRotationId(string playerName, string myRotationId)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordSleeve(string playerName, long sleeveId)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordChara(string playerName, int charaId)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordDeck(string playerName, char indexHeadChar, IEnumerable<int> cardIds)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordEnemyAIDifficulty(int difficulty)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordEnemyAILogicLevel(int level)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordEnemyAIMaxLife(int life)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordEnemyAIDeckId(int deckId)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordEnemyAIStyleId(int styleId)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordEnemyAIEmoteId(int emoteId)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordEnemyAIUseInnerEmote(bool useInnerEmote)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordStartTurnIsPlayer(bool startTurnIsPlayer)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordPracticeDifficultyDegreeId(int degreeId)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordIsPreBuildDeck(bool isPreBuildDeck)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordIsTrialDeck(bool isTrialDeck)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordIsDefaultDeck(bool isDefaultDeck)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordQuestStageId(int id)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordQuestEnemyAiId(int id)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordQuestEnemyEmblemId(int id)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordQuestEnemyDegreeId(int id)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordQuestEnemyEmotionOverride(int id)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordQuestPlayerEmotionOverride(int id)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordQuestRecoveryPoint(int recoveryPoint)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordQuestPlayerSkillList(List<BossRushSpecialSkill> skills)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordQuestEnemySkill(BossRushSpecialSkill skill)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordQuestMaxBattleCount(int maxBattleCount)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordQuestCurrentWinCount(int currentWinCount)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordQuestIsExtra(bool isExtra)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordQuestIsMockBattle(bool isMockBattle)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordQuestExtraDeckScheduleId(int id)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordMissionNecessaryInformation(BattleManagerBase.MissionNecessaryInformation missionNecessaryInformation)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordMulliganStart()
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordPractice3DFieldId(int id)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordPlayerMulliganReplaceCards(IEnumerable<BattleCardBase> replaceCards, IEnumerable<int> completeCards)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
JsonData jsonData2 = new JsonData();
|
||||
jsonData2.SetJsonType(JsonType.Array);
|
||||
foreach (BattleCardBase replaceCard in replaceCards)
|
||||
{
|
||||
jsonData2.Add(replaceCard.GetName());
|
||||
}
|
||||
jsonData["operation"] = "mulligan";
|
||||
jsonData["seq"] = GetCurrentSequenceNumber();
|
||||
jsonData["abandoned_cards"] = jsonData2;
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordEnemyMulliganReplaceCards(IEnumerable<BattleCardBase> replaceCards, IEnumerable<int> completeCards)
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordPlay(BattleCardBase card, BattleCardBase originalCard, IEnumerable<BattleCardBase> selectedCards)
|
||||
{
|
||||
if (card.IsPlayer)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["operation"] = "play";
|
||||
jsonData["seq"] = GetCurrentSequenceNumber();
|
||||
jsonData["index"] = CardToIndexName(card);
|
||||
jsonData["is_choice_brave"] = (originalCard.IsChoiceBraveSkillCard ? 1 : 0);
|
||||
WriteSkillTargetInfoToJson(selectedCards, jsonData);
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
}
|
||||
|
||||
public override VfxBase RecordAttack(BattleCardBase attackCard, BattleCardBase targetCard, SkillProcessor skillProcessor)
|
||||
{
|
||||
if (!attackCard.IsPlayer)
|
||||
{
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["operation"] = "attack";
|
||||
jsonData["seq"] = GetCurrentSequenceNumber();
|
||||
jsonData["index"] = CardToIndexName(attackCard);
|
||||
jsonData["target"] = CardToIndexName(targetCard);
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
|
||||
public override void RecordEvolve(BattleCardBase originalCard, BattleCardBase card, IEnumerable<BattleCardBase> selectedCards)
|
||||
{
|
||||
if (card.IsPlayer)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["operation"] = "evolve";
|
||||
jsonData["seq"] = GetCurrentSequenceNumber();
|
||||
jsonData["index"] = CardToIndexName(card);
|
||||
WriteSkillTargetInfoToJson(selectedCards, jsonData);
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
}
|
||||
|
||||
public override void RecordCompleteFusionSelect(BattleCardBase fusionCard, IEnumerable<BattleCardBase> ingredientCards)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["operation"] = "comp_fusion";
|
||||
jsonData["seq"] = GetCurrentSequenceNumber();
|
||||
jsonData["index"] = CardToIndexName(fusionCard);
|
||||
WriteSkillTargetInfoToJson(ingredientCards, jsonData);
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordStartFusion(BattleCardBase fusionCard, List<BattleCardBase> selectableCards)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["operation"] = "start_fusion";
|
||||
jsonData["seq"] = GetCurrentSequenceNumber();
|
||||
jsonData["index"] = CardToIndexName(fusionCard);
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordSelectFusion(BattleCardBase card)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["operation"] = "select_fusion";
|
||||
jsonData["seq"] = GetCurrentSequenceNumber();
|
||||
jsonData["index"] = CardToIndexName(card);
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordCancelFusion(BattleCardBase card)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["operation"] = "cancel_fusion";
|
||||
jsonData["seq"] = GetCurrentSequenceNumber();
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordStartSelect(BattleCardBase card, bool isEvolve, List<BattleCardBase> selectableCards, bool isChoiceBrave)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["operation"] = "start_select";
|
||||
jsonData["seq"] = GetCurrentSequenceNumber();
|
||||
jsonData["index"] = CardToIndexName(card);
|
||||
jsonData["bool"] = (isEvolve ? 1 : 0);
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordSelect(BattleCardBase card, bool isEvolve, BattleCardBase actCard, bool isBurialRite, bool isChoiceBrave)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["operation"] = "select";
|
||||
jsonData["seq"] = GetCurrentSequenceNumber();
|
||||
jsonData["index"] = CardToIndexName(card);
|
||||
jsonData["bool"] = (isEvolve ? 1 : 0);
|
||||
jsonData["is_burial_rite"] = (isBurialRite ? 1 : 0);
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordCompleteSelect(BattleCardBase card, bool isEvolve, BattleCardBase actCard, bool isChoiceBrave, bool isBurialRite)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["operation"] = "comp_select";
|
||||
jsonData["seq"] = GetCurrentSequenceNumber();
|
||||
jsonData["index"] = CardToIndexName(card);
|
||||
jsonData["bool"] = (isEvolve ? 1 : 0);
|
||||
jsonData["is_burial_rite"] = (isBurialRite ? 1 : 0);
|
||||
jsonData["is_choice_brave"] = (isChoiceBrave ? 1 : 0);
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordCancelSelect(BattleCardBase actCard, bool isEvolve, bool isChoiceBrave)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["operation"] = "cancel_select";
|
||||
jsonData["seq"] = GetCurrentSequenceNumber();
|
||||
jsonData["bool"] = (isEvolve ? 1 : 0);
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordStartChoice(BattleCardBase card, bool isEvolve, List<BattleCardBase> choiceCards, bool isChoiceBrave)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["operation"] = "start_choice";
|
||||
jsonData["seq"] = GetCurrentSequenceNumber();
|
||||
jsonData["index"] = CardToIndexName(card);
|
||||
jsonData["bool"] = (isEvolve ? 1 : 0);
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordCompleteChoice(BattleCardBase card, bool isEvolve, List<BattleCardBase> chosenCardList, BattleCardBase actCard, List<int> chosenCardIndexList, bool hasSelectionSkill, bool isChoiceBrave)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["operation"] = "comp_choice";
|
||||
jsonData["seq"] = GetCurrentSequenceNumber();
|
||||
jsonData["index"] = CardToIndexName(card);
|
||||
jsonData["bool"] = (isEvolve ? 1 : 0);
|
||||
WriteSkillTargetInfoToJson(chosenCardList, jsonData);
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordCancelChoice(BattleCardBase card, bool isEvolve, bool isChoiceBrave)
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["operation"] = "cancel_choice";
|
||||
jsonData["seq"] = GetCurrentSequenceNumber();
|
||||
jsonData["bool"] = (isEvolve ? 1 : 0);
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordTurnStart()
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordTurnEnd()
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["operation"] = "turn_end";
|
||||
jsonData["seq"] = GetCurrentSequenceNumber();
|
||||
_operationJsonDataList.Add(jsonData);
|
||||
WriteJsonData();
|
||||
}
|
||||
|
||||
public override void RecordRetire()
|
||||
{
|
||||
}
|
||||
|
||||
public override void RecordSkillTargets(IEnumerable<BattleCardBase> targetCards)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void WriteJsonData()
|
||||
{
|
||||
JsonData jsonData = new JsonData();
|
||||
jsonData["operations"] = new JsonData();
|
||||
jsonData["operations"].SetJsonType(JsonType.Array);
|
||||
foreach (JsonData operationJsonData in _operationJsonDataList)
|
||||
{
|
||||
jsonData["operations"].Add(operationJsonData);
|
||||
}
|
||||
WriteJsonDataToFile(jsonData);
|
||||
}
|
||||
|
||||
private void SetOperationDataList(JsonData recoveryLogData)
|
||||
{
|
||||
if (recoveryLogData.Keys.Contains("operations"))
|
||||
{
|
||||
JsonData jsonData = recoveryLogData["operations"];
|
||||
for (int i = 0; i < jsonData.Count; i++)
|
||||
{
|
||||
_operationJsonDataList.Add(jsonData[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LocalLog.AccumulateTraceLog("operations key is not found in recovery file");
|
||||
}
|
||||
}
|
||||
|
||||
private int GetCurrentSequenceNumber()
|
||||
{
|
||||
if (ToolboxGame.RealTimeNetworkAgent != null)
|
||||
{
|
||||
return ToolboxGame.RealTimeNetworkAgent.GetCurrentSequenceNumber() + 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase;
|
||||
|
||||
public class BuildDeckPurchaseInfoTask : BaseTask
|
||||
{
|
||||
public class BuildDeckPurchaseInfoTaskParam : BaseParam
|
||||
{
|
||||
public int add_series_id;
|
||||
}
|
||||
|
||||
public BuildDeckPurchaseInfoTask()
|
||||
{
|
||||
base.type = ApiType.Type.BuildDeckInfo;
|
||||
}
|
||||
|
||||
public void SetParameter(int add_series_id)
|
||||
{
|
||||
BuildDeckPurchaseInfoTaskParam buildDeckPurchaseInfoTaskParam = new BuildDeckPurchaseInfoTaskParam();
|
||||
buildDeckPurchaseInfoTaskParam.add_series_id = add_series_id;
|
||||
base.Params = buildDeckPurchaseInfoTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
Wizard.Data.BuildDeckPurchaseInfo.seriesList.Clear();
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
for (int i = 0; i < jsonData.Count; i++)
|
||||
{
|
||||
int num2 = jsonData[i]["series_id"].ToInt();
|
||||
if (!Wizard.Data.Master.BuildDeckSeriesIdDic.ContainsKey(num2))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
BuildDeckSeriesPurchaseInfo buildDeckSeriesPurchaseInfo = new BuildDeckSeriesPurchaseInfo();
|
||||
buildDeckSeriesPurchaseInfo._seriesId = num2;
|
||||
buildDeckSeriesPurchaseInfo._introduction = Wizard.Data.Master.BuildDeckSeriesIdDic[buildDeckSeriesPurchaseInfo._seriesId].Introduction;
|
||||
buildDeckSeriesPurchaseInfo._isNew = jsonData[i]["is_new"].ToBoolean();
|
||||
JsonData jsonData2 = jsonData[i]["products"];
|
||||
for (int j = 0; j < jsonData2.Count; j++)
|
||||
{
|
||||
BuildDeckProductInfo buildDeckProductInfo = new BuildDeckProductInfo();
|
||||
buildDeckProductInfo.product_id = jsonData2[j]["product_id"].ToInt();
|
||||
buildDeckProductInfo.leader_id = jsonData2[j]["leader_id"].ToInt();
|
||||
buildDeckProductInfo.deck_code = jsonData2[j]["deck_code"].ToString();
|
||||
buildDeckProductInfo.featured_card_id = jsonData2[j]["featured_card_id"].ToInt();
|
||||
buildDeckProductInfo.purchase_num_max = jsonData2[j]["purchase_num_max"].ToInt();
|
||||
buildDeckProductInfo.purchase_num_current = jsonData2[j]["purchase_num_current"].ToInt();
|
||||
buildDeckProductInfo.is_first_price = jsonData2[j]["is_first_price"].ToBoolean();
|
||||
ShopCommonSaleInfo shopCommonSaleInfo = new ShopCommonSaleInfo();
|
||||
string key = jsonData2[j]["product_name"].ToString();
|
||||
shopCommonSaleInfo.name = Wizard.Data.Master.GetBuildDeckProductText(key);
|
||||
shopCommonSaleInfo.path = jsonData2[j]["product_id"].ToString();
|
||||
if (jsonData2[j].Keys.Contains("price_crystal"))
|
||||
{
|
||||
shopCommonSaleInfo.costCrystal = jsonData2[j]["price_crystal"].ToInt();
|
||||
}
|
||||
if (jsonData2[j].Keys.Contains("price_rupy"))
|
||||
{
|
||||
shopCommonSaleInfo.costRupy = jsonData2[j]["price_rupy"].ToInt();
|
||||
}
|
||||
if (jsonData2[j].Keys.Contains("price_ticket"))
|
||||
{
|
||||
shopCommonSaleInfo.costTicket = jsonData2[j]["price_ticket"].ToInt();
|
||||
}
|
||||
if (jsonData2[j].Keys.Contains("ticket_id"))
|
||||
{
|
||||
shopCommonSaleInfo.costTicketItemId = jsonData2[j]["ticket_id"].ToInt();
|
||||
shopCommonSaleInfo.haveTicketNum = PlayerStaticData.GetHaveUserGoods(UserGoods.Type.Item, shopCommonSaleInfo.costTicketItemId.Value);
|
||||
}
|
||||
shopCommonSaleInfo.isFree = false;
|
||||
if (shopCommonSaleInfo.costCrystal.HasValue && shopCommonSaleInfo.costRupy.HasValue && shopCommonSaleInfo.costCrystal <= 0 && shopCommonSaleInfo.costRupy <= 0)
|
||||
{
|
||||
shopCommonSaleInfo.isFree = true;
|
||||
}
|
||||
shopCommonSaleInfo.expirtyTimeInfo = new ShopExpirtyInfo(jsonData2[j]["sales_period_info"]);
|
||||
buildDeckProductInfo.saleInfo = shopCommonSaleInfo;
|
||||
JsonData jsonData3 = jsonData2[j]["rewards"];
|
||||
for (int k = 0; k < jsonData3.Count; k++)
|
||||
{
|
||||
ShopCommonRewardInfo shopCommonRewardInfo = new ShopCommonRewardInfo();
|
||||
shopCommonRewardInfo.Type = jsonData3[k]["reward_type"].ToInt();
|
||||
shopCommonRewardInfo.UserGoodsId = jsonData3[k]["reward_detail_id"].ToLong();
|
||||
shopCommonRewardInfo.Num = jsonData3[k]["reward_number"].ToInt();
|
||||
buildDeckProductInfo.rewardInfoList.Add(shopCommonRewardInfo);
|
||||
}
|
||||
if (Wizard.Data.Master.BuildDeckCardListDic.ContainsKey(buildDeckProductInfo.product_id))
|
||||
{
|
||||
for (int l = 0; l < Wizard.Data.Master.BuildDeckCardListDic[buildDeckProductInfo.product_id].Count; l++)
|
||||
{
|
||||
buildDeckProductInfo.cardList.Add(Wizard.Data.Master.BuildDeckCardListDic[buildDeckProductInfo.product_id][l]);
|
||||
}
|
||||
buildDeckSeriesPurchaseInfo.productList.Add(buildDeckProductInfo);
|
||||
}
|
||||
}
|
||||
JsonData jsonData4 = jsonData[i]["series_rewards"];
|
||||
for (int m = 0; m < jsonData4.Count; m++)
|
||||
{
|
||||
PurchaseRewardInfo purchaseRewardInfo = new PurchaseRewardInfo();
|
||||
JsonData jsonData5 = jsonData4[m];
|
||||
string key2 = $"Shop_BuildDeckRewardNum_{(m + 1).ToString()}";
|
||||
purchaseRewardInfo.PurchaseNthText = Wizard.Data.SystemText.Get(key2);
|
||||
for (int n = 0; n < jsonData5["reward_list"].Count; n++)
|
||||
{
|
||||
ShopCommonRewardInfo shopCommonRewardInfo2 = new ShopCommonRewardInfo();
|
||||
shopCommonRewardInfo2.Type = jsonData5["reward_list"][n]["reward_type"].ToInt();
|
||||
shopCommonRewardInfo2.UserGoodsId = jsonData5["reward_list"][n]["reward_detail_id"].ToLong();
|
||||
shopCommonRewardInfo2.Num = jsonData5["reward_list"][n]["reward_number"].ToInt();
|
||||
purchaseRewardInfo.RewardInfoList.Add(shopCommonRewardInfo2);
|
||||
}
|
||||
purchaseRewardInfo.IsGet = jsonData4[m]["is_get"].ToBoolean();
|
||||
buildDeckSeriesPurchaseInfo.SeriesRewardList.Add(purchaseRewardInfo);
|
||||
}
|
||||
Wizard.Data.BuildDeckPurchaseInfo.seriesList.Add(buildDeckSeriesPurchaseInfo);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard.Scripts.Network.Data.TaskData.BuildDeckPurchase;
|
||||
|
||||
public class BuildDeckSelectBuyMeansDialog : BaseSelectBuyMeansDialog
|
||||
{
|
||||
[SerializeField]
|
||||
private BuildDeckProductDetail _buildDeckProductDetail;
|
||||
|
||||
public void Init(BuildDeckProductInfo productInfo, DialogBase dialog, Action onPushBuyCrystalBtnCallBack, Action onPushBuyRupyBtnCallBack, Action onPushBuyTicketBtnCallBack)
|
||||
{
|
||||
_buildDeckProductDetail.SetSingleProductDetail(productInfo);
|
||||
_Init(productInfo.saleInfo, dialog, onPushBuyCrystalBtnCallBack, onPushBuyRupyBtnCallBack, onPushBuyTicketBtnCallBack);
|
||||
}
|
||||
}
|
||||
21
SVSim.BattleEngine/Engine/Wizard/AdjustSettingUpdateTask.cs
Normal file
21
SVSim.BattleEngine/Engine/Wizard/AdjustSettingUpdateTask.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class AdjustSettingUpdateTask : BaseTask
|
||||
{
|
||||
public class TaskParam : BaseParam
|
||||
{
|
||||
public int is_allow_send_adjust;
|
||||
}
|
||||
|
||||
public AdjustSettingUpdateTask()
|
||||
{
|
||||
base.type = ApiType.Type.AdjustSettingUpdate;
|
||||
}
|
||||
|
||||
public void SetParameter(bool arrow)
|
||||
{
|
||||
TaskParam taskParam = new TaskParam();
|
||||
taskParam.is_allow_send_adjust = (arrow ? 1 : 0);
|
||||
base.Params = taskParam;
|
||||
}
|
||||
}
|
||||
131
SVSim.BattleEngine/Engine/Wizard/ArenaBuyDialog.cs
Normal file
131
SVSim.BattleEngine/Engine/Wizard/ArenaBuyDialog.cs
Normal file
@@ -0,0 +1,131 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class ArenaBuyDialog : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UISprite m_SpriteConfirmClystal;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite m_SpriteHaveClystal;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite m_SpriteConfirmRupy;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite m_SpriteHaveRupy;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite m_SpriteConfirmTicket;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite m_SpriteHaveTicket;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel m_LabelUseItemCnt;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel m_LabelBuyPack;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel m_LabelItemName;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel m_LabelBeforeItemCnt;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel m_LabelAfterItemCnt;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _jpnLawRoot;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _jpnLawButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIScrollView _scrollView;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _scrollBar;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _expirtyTextLabel;
|
||||
|
||||
public void SetClystalConfirmDialog(int useItemNum, int haveItemCnt, string arenaModeNameId, ShopExpirtyInfo expirtyInfo)
|
||||
{
|
||||
m_SpriteConfirmClystal.gameObject.SetActive(value: true);
|
||||
m_SpriteHaveClystal.gameObject.SetActive(value: true);
|
||||
m_SpriteConfirmRupy.gameObject.SetActive(value: false);
|
||||
m_SpriteHaveRupy.gameObject.SetActive(value: false);
|
||||
m_SpriteConfirmTicket.gameObject.SetActive(value: false);
|
||||
m_SpriteHaveTicket.gameObject.SetActive(value: false);
|
||||
int num = haveItemCnt - useItemNum;
|
||||
string useItemNumText = Data.SystemText.Get("Shop_0091", useItemNum.ToString());
|
||||
string afterItemNum = Data.SystemText.Get("Shop_0055", num.ToString());
|
||||
SetLabelText(Data.SystemText.Get("Common_0201"), useItemNumText, afterItemNum, haveItemCnt, arenaModeNameId);
|
||||
_jpnLawButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
|
||||
UIManager.GetInstance().WebViewHelper.OpenWebView(WebViewHelper.WebViewType.LEGALTEXT);
|
||||
}));
|
||||
if (expirtyInfo.IsEnableText)
|
||||
{
|
||||
_expirtyTextLabel.text = expirtyInfo.GetText();
|
||||
}
|
||||
else
|
||||
{
|
||||
_expirtyTextLabel.gameObject.SetActive(value: false);
|
||||
}
|
||||
_jpnLawRoot.SetActive(value: false);
|
||||
}
|
||||
|
||||
private void HideScrollBar()
|
||||
{
|
||||
_scrollView.enabled = false;
|
||||
_scrollBar.SetActive(value: false);
|
||||
_jpnLawRoot.SetActive(value: false);
|
||||
}
|
||||
|
||||
public void SetTicketConfirmDialog(int useItemNum, int haveItemCnt, string arenaModeNameId, string ticketSpriteName)
|
||||
{
|
||||
m_SpriteConfirmClystal.gameObject.SetActive(value: false);
|
||||
m_SpriteHaveClystal.gameObject.SetActive(value: false);
|
||||
m_SpriteConfirmRupy.gameObject.SetActive(value: false);
|
||||
m_SpriteHaveRupy.gameObject.SetActive(value: false);
|
||||
m_SpriteConfirmTicket.gameObject.SetActive(value: true);
|
||||
m_SpriteHaveTicket.gameObject.SetActive(value: true);
|
||||
m_SpriteConfirmTicket.spriteName = ticketSpriteName;
|
||||
m_SpriteHaveTicket.spriteName = ticketSpriteName;
|
||||
int num = haveItemCnt - useItemNum;
|
||||
string useItemNumText = Data.SystemText.Get("Shop_0042", useItemNum.ToString());
|
||||
string afterItemNum = Data.SystemText.Get("Shop_0054", num.ToString());
|
||||
SetLabelText(Data.SystemText.Get("Common_0114"), useItemNumText, afterItemNum, haveItemCnt, arenaModeNameId);
|
||||
HideScrollBar();
|
||||
}
|
||||
|
||||
public void SetRupyConfirmDialog(int useItemNum, int haveItemCnt, string arenaModeNameId)
|
||||
{
|
||||
m_SpriteConfirmClystal.gameObject.SetActive(value: false);
|
||||
m_SpriteHaveClystal.gameObject.SetActive(value: false);
|
||||
m_SpriteConfirmRupy.gameObject.SetActive(value: true);
|
||||
m_SpriteHaveRupy.gameObject.SetActive(value: true);
|
||||
m_SpriteConfirmTicket.gameObject.SetActive(value: false);
|
||||
m_SpriteHaveTicket.gameObject.SetActive(value: false);
|
||||
int num = haveItemCnt - useItemNum;
|
||||
string useItemNumText = Data.SystemText.Get("Shop_0090", useItemNum.ToString());
|
||||
string afterItemNum = Data.SystemText.Get("Shop_0056", num.ToString());
|
||||
SetLabelText(Data.SystemText.Get("Common_0115"), useItemNumText, afterItemNum, haveItemCnt, arenaModeNameId);
|
||||
HideScrollBar();
|
||||
}
|
||||
|
||||
private void SetLabelText(string itemName, string useItemNumText, string afterItemNum, int haveItemCnt, string arenaModeNameId)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
m_LabelUseItemCnt.text = useItemNumText;
|
||||
m_LabelBuyPack.text = systemText.Get(arenaModeNameId);
|
||||
m_LabelItemName.text = itemName;
|
||||
m_LabelBeforeItemCnt.text = haveItemCnt.ToString();
|
||||
m_LabelAfterItemCnt.text = afterItemNum;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class CompetitionPermanentEntryTask : BaseTask
|
||||
{
|
||||
public class CompetitionPermanentEntryTaskParam : BaseParam
|
||||
{
|
||||
public int consume_item_type;
|
||||
}
|
||||
|
||||
public CompetitionPermanentEntryTask()
|
||||
{
|
||||
base.type = ApiType.Type.CompetitionPermanentEntry;
|
||||
}
|
||||
|
||||
public void SetParameter(ArenaData.eARENA_PAY inPayType)
|
||||
{
|
||||
CompetitionPermanentEntryTaskParam competitionPermanentEntryTaskParam = new CompetitionPermanentEntryTaskParam();
|
||||
competitionPermanentEntryTaskParam.consume_item_type = (int)inPayType;
|
||||
base.Params = competitionPermanentEntryTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(base.ResponseData["data"]["reward_list"]);
|
||||
Data.ArenaData.CompetitionData.SetRestChallangeCountByEntry(base.ResponseData["data"]);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
28
SVSim.BattleEngine/Engine/Wizard/FriendApplySendTask.cs
Normal file
28
SVSim.BattleEngine/Engine/Wizard/FriendApplySendTask.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class FriendApplySendTask : BaseTask
|
||||
{
|
||||
public class FriendApplySendTaskParam : BaseParam
|
||||
{
|
||||
public int friend_id;
|
||||
}
|
||||
|
||||
public FriendApplySendTask()
|
||||
{
|
||||
base.type = ApiType.Type.FriendApplySend;
|
||||
}
|
||||
|
||||
public void SetParameter(int friend_id)
|
||||
{
|
||||
FriendApplySendTaskParam friendApplySendTaskParam = new FriendApplySendTaskParam();
|
||||
friendApplySendTaskParam.friend_id = friend_id;
|
||||
base.Params = friendApplySendTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int result = base.Parse();
|
||||
_ = 1;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
39
SVSim.BattleEngine/Engine/Wizard/FriendUserSearchTask.cs
Normal file
39
SVSim.BattleEngine/Engine/Wizard/FriendUserSearchTask.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class FriendUserSearchTask : BaseTask
|
||||
{
|
||||
public class FriendUserSearchTaskParam : BaseParam
|
||||
{
|
||||
public int search_viewer_id;
|
||||
}
|
||||
|
||||
public FriendUserSearchTask()
|
||||
{
|
||||
base.type = ApiType.Type.FriendUserSearch;
|
||||
}
|
||||
|
||||
public void SetParameter(int search_viewer_id)
|
||||
{
|
||||
FriendUserSearchTaskParam friendUserSearchTaskParam = new FriendUserSearchTaskParam();
|
||||
friendUserSearchTaskParam.search_viewer_id = search_viewer_id;
|
||||
base.Params = friendUserSearchTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
Data.SearchUserInfo.Initizalize();
|
||||
JsonData jsonData = base.ResponseData["data"]["user_info"];
|
||||
if (jsonData.Count > 0)
|
||||
{
|
||||
Data.SearchUserInfo.data.user = new UserFriend(jsonData);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
60
SVSim.BattleEngine/Engine/Wizard/GatheringEntryTask.cs
Normal file
60
SVSim.BattleEngine/Engine/Wizard/GatheringEntryTask.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringEntryTask : BaseTask
|
||||
{
|
||||
public class DeckEntry
|
||||
{
|
||||
public int deck_no;
|
||||
|
||||
public string deck_name;
|
||||
|
||||
public DeckEntry(DeckData deck)
|
||||
{
|
||||
deck_no = deck.GetDeckID();
|
||||
deck_name = deck.GetDeckName();
|
||||
}
|
||||
}
|
||||
|
||||
public class GatheringEntryTaskParam : BaseParam
|
||||
{
|
||||
public string gathering_id;
|
||||
|
||||
public Dictionary<string, DeckEntry> deck_list = new Dictionary<string, DeckEntry>();
|
||||
}
|
||||
|
||||
public GatheringEntryTask()
|
||||
{
|
||||
base.type = ApiType.Type.GatheringEntry;
|
||||
}
|
||||
|
||||
public void SetParameter(string id, List<DeckData> deckList)
|
||||
{
|
||||
GatheringEntryTaskParam gatheringEntryTaskParam = new GatheringEntryTaskParam();
|
||||
gatheringEntryTaskParam.gathering_id = id;
|
||||
if (deckList != null)
|
||||
{
|
||||
for (int i = 0; i < deckList.Count; i++)
|
||||
{
|
||||
gatheringEntryTaskParam.deck_list[i.ToString()] = new DeckEntry(deckList[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gatheringEntryTaskParam.deck_list = null;
|
||||
}
|
||||
base.Params = gatheringEntryTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
Data.MyPageNotifications.data.IsInviteGathering = false;
|
||||
return num;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringFriendInviteListPlate : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private GameObject _alreadyAddGathering;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _alreadyInvited;
|
||||
|
||||
[SerializeField]
|
||||
private UserListViewPlate _friendListPlate;
|
||||
|
||||
public void Initialize(GatheringFriendListTask.InviteFriendData inviteData)
|
||||
{
|
||||
_alreadyAddGathering.SetActive(inviteData.IsJoinGathering);
|
||||
_friendListPlate.SetButtonVisible(!inviteData.IsJoinGathering && !inviteData.IsInvited);
|
||||
_alreadyInvited.SetActive(inviteData.IsInvited);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringInviteCancelTask : BaseTask
|
||||
{
|
||||
public class GatheringInviteCancelTaskParam : BaseParam
|
||||
{
|
||||
public string invite_id;
|
||||
}
|
||||
|
||||
public GatheringInviteCancelTask()
|
||||
{
|
||||
base.type = ApiType.Type.GatheringInviteCancel;
|
||||
}
|
||||
|
||||
public void SetParameter(string inviteId)
|
||||
{
|
||||
GatheringInviteCancelTaskParam gatheringInviteCancelTaskParam = new GatheringInviteCancelTaskParam();
|
||||
gatheringInviteCancelTaskParam.invite_id = inviteId;
|
||||
base.Params = gatheringInviteCancelTaskParam;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringInviteRejectTask : BaseTask
|
||||
{
|
||||
public class GatheringInviteRejectTaskParam : BaseParam
|
||||
{
|
||||
public string invite_id;
|
||||
}
|
||||
|
||||
public GatheringInviteRejectTask()
|
||||
{
|
||||
base.type = ApiType.Type.GatheringInviteReject;
|
||||
}
|
||||
|
||||
public void SetParameter(string inviteId)
|
||||
{
|
||||
GatheringInviteRejectTaskParam gatheringInviteRejectTaskParam = new GatheringInviteRejectTaskParam();
|
||||
gatheringInviteRejectTaskParam.invite_id = inviteId;
|
||||
base.Params = gatheringInviteRejectTaskParam;
|
||||
}
|
||||
}
|
||||
21
SVSim.BattleEngine/Engine/Wizard/GatheringInviteTask.cs
Normal file
21
SVSim.BattleEngine/Engine/Wizard/GatheringInviteTask.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringInviteTask : BaseTask
|
||||
{
|
||||
public class GatheringInviteTaskParam : BaseParam
|
||||
{
|
||||
public string target_viewer_id;
|
||||
}
|
||||
|
||||
public GatheringInviteTask()
|
||||
{
|
||||
base.type = ApiType.Type.GatheringInvite;
|
||||
}
|
||||
|
||||
public void SetParameter(string targetViewerId)
|
||||
{
|
||||
GatheringInviteTaskParam gatheringInviteTaskParam = new GatheringInviteTaskParam();
|
||||
gatheringInviteTaskParam.target_viewer_id = targetViewerId;
|
||||
base.Params = gatheringInviteTaskParam;
|
||||
}
|
||||
}
|
||||
56
SVSim.BattleEngine/Engine/Wizard/GatheringKickConfirm.cs
Normal file
56
SVSim.BattleEngine/Engine/Wizard/GatheringKickConfirm.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringKickConfirm : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UIToggle _toggleEternal;
|
||||
|
||||
[SerializeField]
|
||||
private UserPlateBase _userPlate;
|
||||
|
||||
private Action<bool> OnKickDecide;
|
||||
|
||||
private bool _toggleClickFirst = true;
|
||||
|
||||
public static void Create(GameObject prefab, GatheringUserInfo userInfo, Action<bool> onKickDecide)
|
||||
{
|
||||
GatheringKickConfirm component = UnityEngine.Object.Instantiate(prefab).GetComponent<GatheringKickConfirm>();
|
||||
DialogBase dialog = UIManager.GetInstance().CreateDialogClose();
|
||||
component.Initialize(dialog, userInfo, onKickDecide);
|
||||
}
|
||||
|
||||
private void Initialize(DialogBase dialog, GatheringUserInfo userInfo, Action<bool> onKickDecide)
|
||||
{
|
||||
OnKickDecide = onKickDecide;
|
||||
SystemText systemText = Data.SystemText;
|
||||
string titleLabel = systemText.Get("Gathering_Member_0012");
|
||||
string text_btn = systemText.Get("Gathering_Member_0005");
|
||||
dialog.SetTitleLabel(titleLabel);
|
||||
dialog.SetButtonText(text_btn);
|
||||
dialog.SetObj(base.gameObject);
|
||||
dialog.SetSize(DialogBase.Size.S);
|
||||
dialog.SetButtonLayout(DialogBase.ButtonLayout.RedBtn_CancelBtn);
|
||||
_userPlate.InitializeSimplePlate(userInfo);
|
||||
dialog.onPushButton1 = delegate
|
||||
{
|
||||
OnKickDecide.Call(_toggleEternal.value);
|
||||
};
|
||||
_toggleEternal.onChange.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnClickToggle();
|
||||
}));
|
||||
}
|
||||
|
||||
private void OnClickToggle()
|
||||
{
|
||||
if (!_toggleClickFirst)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(_toggleEternal.value ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF);
|
||||
}
|
||||
_toggleClickFirst = false;
|
||||
}
|
||||
}
|
||||
24
SVSim.BattleEngine/Engine/Wizard/GatheringKickTask.cs
Normal file
24
SVSim.BattleEngine/Engine/Wizard/GatheringKickTask.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringKickTask : BaseTask
|
||||
{
|
||||
public class GatheringKickTaskParam : BaseParam
|
||||
{
|
||||
public string target_viewer_id;
|
||||
|
||||
public int is_restrict;
|
||||
}
|
||||
|
||||
public GatheringKickTask()
|
||||
{
|
||||
base.type = ApiType.Type.GatheringKick;
|
||||
}
|
||||
|
||||
public void SetParameter(string targetViewerId, bool isRestrict)
|
||||
{
|
||||
GatheringKickTaskParam gatheringKickTaskParam = new GatheringKickTaskParam();
|
||||
gatheringKickTaskParam.target_viewer_id = targetViewerId;
|
||||
gatheringKickTaskParam.is_restrict = (isRestrict ? 1 : 0);
|
||||
base.Params = gatheringKickTaskParam;
|
||||
}
|
||||
}
|
||||
59
SVSim.BattleEngine/Engine/Wizard/GatheringMemberPlate.cs
Normal file
59
SVSim.BattleEngine/Engine/Wizard/GatheringMemberPlate.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringMemberPlate : UserPlateBase
|
||||
{
|
||||
[SerializeField]
|
||||
private UIButton _friendRequestButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _dropOutButton;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _kickButton;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _ownerOrGuestLabel;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _friendRequestSending;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _friendIcon;
|
||||
|
||||
public Action<GatheringUserInfo> OnClickFriendRequest;
|
||||
|
||||
public Action OnClickDropOut;
|
||||
|
||||
public Action<GatheringUserInfo> OnClickKick;
|
||||
|
||||
public void Initialize(GatheringInfo info, GatheringUserInfo userInfo)
|
||||
{
|
||||
InitializeBase(userInfo);
|
||||
_dropOutButton.gameObject.SetActive(info.Role == GatheringRule.eRole.GUEST && userInfo.IsSelf);
|
||||
_friendRequestButton.gameObject.SetActive(userInfo.IsFriend == false && !userInfo.IsSelf && userInfo.IsFriendRequestSending == false);
|
||||
_friendIcon.SetActive(userInfo.IsFriend.Value);
|
||||
_friendRequestSending.SetActive(userInfo.IsFriendRequestSending.Value);
|
||||
_kickButton.gameObject.SetActive(info.Role == GatheringRule.eRole.OWNER && !userInfo.IsSelf);
|
||||
_friendRequestButton.onClick.Clear();
|
||||
_dropOutButton.onClick.Clear();
|
||||
_kickButton.onClick.Clear();
|
||||
_friendRequestButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnClickFriendRequest.Call(userInfo);
|
||||
}));
|
||||
_dropOutButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnClickDropOut.Call();
|
||||
}));
|
||||
_kickButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnClickKick.Call(userInfo);
|
||||
}));
|
||||
SystemText systemText = Data.SystemText;
|
||||
_ownerOrGuestLabel.text = (userInfo.IsOwner ? systemText.Get("Gathering_Information_0013") : systemText.Get("Gathering_Member_0001"));
|
||||
}
|
||||
}
|
||||
49
SVSim.BattleEngine/Engine/Wizard/GatheringRankingPlate.cs
Normal file
49
SVSim.BattleEngine/Engine/Wizard/GatheringRankingPlate.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringRankingPlate : UserPlateBase
|
||||
{
|
||||
private const string BG_RANK_1 = "ranking_plate_01";
|
||||
|
||||
private const string BG_RANK_2 = "ranking_plate_02";
|
||||
|
||||
private const string BG_RANK_3 = "ranking_plate_03";
|
||||
|
||||
private const string BG_RANK_OTHER = "ranking_plate_common";
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _winCount;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _ranking;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _youMark;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _bg;
|
||||
|
||||
public void Initialize(GatheringRankingTask.RankingUserInfo userInfo)
|
||||
{
|
||||
InitializeBase(userInfo.gatheringUserInfo);
|
||||
_winCount.text = Data.SystemText.Get("Gathering_Ranking_0001", userInfo.WinCount.ToString());
|
||||
_ranking.text = userInfo.Order.ToString();
|
||||
_youMark.SetActive(userInfo.gatheringUserInfo.IsSelf);
|
||||
switch (userInfo.Order)
|
||||
{
|
||||
case 1:
|
||||
_bg.spriteName = "ranking_plate_01";
|
||||
break;
|
||||
case 2:
|
||||
_bg.spriteName = "ranking_plate_02";
|
||||
break;
|
||||
case 3:
|
||||
_bg.spriteName = "ranking_plate_03";
|
||||
break;
|
||||
default:
|
||||
_bg.spriteName = "ranking_plate_common";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringReceiveInfoDialog : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private GatheringRuleView _ruleView;
|
||||
|
||||
private Action _onReject;
|
||||
|
||||
private const int ADDITIONAL_DIALOG_DEPTH = 10;
|
||||
|
||||
public static void Create(GameObject prefab, string id, Action onReject)
|
||||
{
|
||||
GatheringGetInfoTask task = new GatheringGetInfoTask();
|
||||
task.SetParameter(id);
|
||||
UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate
|
||||
{
|
||||
CreateDialog(prefab, task, onReject);
|
||||
}));
|
||||
}
|
||||
|
||||
public static void CreateDialog(GameObject prefab, GatheringGetInfoTask task, Action onReject)
|
||||
{
|
||||
GatheringInfo info = task.Info;
|
||||
DialogBase dialog = UIManager.GetInstance().CreateDialogClose();
|
||||
UnityEngine.Object.Instantiate(prefab).GetComponent<GatheringReceiveInfoDialog>().Initialize(info, dialog, onReject);
|
||||
}
|
||||
|
||||
private void Initialize(GatheringInfo info, DialogBase dialog, Action onReject)
|
||||
{
|
||||
_onReject = onReject;
|
||||
SystemText systemText = Data.SystemText;
|
||||
dialog.SetObj(base.gameObject);
|
||||
dialog.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_RedBtn);
|
||||
dialog.SetTitleLabel(systemText.Get("Gathering_Menu_0002"));
|
||||
dialog.SetSize(DialogBase.Size.M);
|
||||
dialog.SetButtonText(systemText.Get("Gathering_Join_0003"), systemText.Get("Gathering_Join_0004"));
|
||||
dialog.onPushButton1 = delegate
|
||||
{
|
||||
OnClickJoinButton(info);
|
||||
};
|
||||
dialog.onPushButton2 = delegate
|
||||
{
|
||||
_onReject.Call();
|
||||
};
|
||||
_ruleView.SetGatheringInfo(info);
|
||||
}
|
||||
|
||||
private static void OnClickJoinButton(GatheringInfo info)
|
||||
{
|
||||
if (info.Rule.IsEntryDeckOnly || info.Rule.IsTournament)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
||||
dialogBase.SetButtonText(Data.SystemText.Get("Gathering_0022"));
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("Gathering_0025"));
|
||||
dialogBase.SetText(Data.SystemText.Get("Gathering_Join_0007"));
|
||||
dialogBase.onPushButton1 = delegate
|
||||
{
|
||||
GatheringEntryConfirm.ShowDeckListDialog(info);
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
GatheringEntryConfirm.EntryGathering(null, info);
|
||||
}
|
||||
}
|
||||
}
|
||||
73
SVSim.BattleEngine/Engine/Wizard/GatheringSettingDialog.cs
Normal file
73
SVSim.BattleEngine/Engine/Wizard/GatheringSettingDialog.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringSettingDialog : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private GatheringRuleView _ruleView;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _stopButton;
|
||||
|
||||
private const int ADDITIONAL_DIALOG_DEPTH = 15;
|
||||
|
||||
private DialogBase _dialog;
|
||||
|
||||
public static void Create(GameObject prefab, GatheringInfo info)
|
||||
{
|
||||
DialogBase dialog = UIManager.GetInstance().CreateDialogClose();
|
||||
Object.Instantiate(prefab).GetComponent<GatheringSettingDialog>().Initialize(info, dialog);
|
||||
}
|
||||
|
||||
private void Initialize(GatheringInfo info, DialogBase dialog)
|
||||
{
|
||||
_dialog = dialog;
|
||||
dialog.SetObj(base.gameObject);
|
||||
dialog.SetButtonLayout(DialogBase.ButtonLayout.CloseBtn);
|
||||
dialog.SetTitleLabel(Data.SystemText.Get("Gathering_Information_0012"));
|
||||
dialog.SetSize(DialogBase.Size.M);
|
||||
_ruleView.SetGatheringInfo(info);
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_stopButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
OnClickStopButton();
|
||||
}));
|
||||
}
|
||||
|
||||
private void OnClickStopButton()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
SystemText systemText = Data.SystemText;
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.RedBtn_CancelBtn);
|
||||
dialogBase.SetButtonText(systemText.Get("Gathering_Information_0018"), systemText.Get("Common_0005"));
|
||||
dialogBase.SetText(systemText.Get("Gathering_Information_0017"));
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("Gathering_Information_0020"));
|
||||
dialogBase.SetSize(DialogBase.Size.S);
|
||||
dialogBase.SetPanelDepth(15);
|
||||
dialogBase.onPushButton1 = delegate
|
||||
{
|
||||
StopGathering();
|
||||
};
|
||||
}
|
||||
|
||||
private void StopGathering()
|
||||
{
|
||||
GatheringInterruptTask task = new GatheringInterruptTask();
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate
|
||||
{
|
||||
_dialog.SetActive(inActive: false);
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("Gathering_Information_0019"));
|
||||
dialogBase.SetPanelDepth(15);
|
||||
dialogBase.OnCloseStart = delegate
|
||||
{
|
||||
Gathering.BackToMyPageForDrop();
|
||||
};
|
||||
}));
|
||||
}
|
||||
}
|
||||
304
SVSim.BattleEngine/Engine/Wizard/GatheringTournamentInfoTask.cs
Normal file
304
SVSim.BattleEngine/Engine/Wizard/GatheringTournamentInfoTask.cs
Normal file
@@ -0,0 +1,304 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringTournamentInfoTask : BaseTask
|
||||
{
|
||||
private class Match
|
||||
{
|
||||
public int MatchId;
|
||||
|
||||
public int ParentMatchId;
|
||||
|
||||
public int ParentMatchUserIndex;
|
||||
|
||||
public int Status;
|
||||
|
||||
public int ViewerId1;
|
||||
|
||||
public int ViewerId2;
|
||||
|
||||
public int WinnerViewerId;
|
||||
|
||||
public int RoomId;
|
||||
|
||||
public bool IsForceLose1;
|
||||
|
||||
public bool IsForceLose2;
|
||||
|
||||
public bool IsForceLoseWinner;
|
||||
|
||||
public bool IsExtra;
|
||||
|
||||
public bool IsFinalMatchReset;
|
||||
|
||||
public bool IsActive
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ViewerId1 > 0 && ViewerId2 > 0)
|
||||
{
|
||||
return WinnerViewerId == 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<TournamentData> TournamentDataList { get; private set; }
|
||||
|
||||
public GatheringTournamentInfoTask()
|
||||
{
|
||||
base.type = ApiType.Type.GatheringTournamentInfo;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
TournamentDataList = ParseTournamentDataList(base.ResponseData["data"]);
|
||||
return num;
|
||||
}
|
||||
|
||||
private List<TournamentData> ParseTournamentDataList(JsonData data)
|
||||
{
|
||||
if (data == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
Dictionary<int, (string, long)> userInfo = CollectUserInfo(data);
|
||||
List<TournamentData> list = new List<TournamentData>();
|
||||
if (data.TryGetValue("1", out var value))
|
||||
{
|
||||
list.Add(ParseTournamentData(value, isWinners: true, userInfo));
|
||||
}
|
||||
if (data.TryGetValue("2", out var value2))
|
||||
{
|
||||
list.Add(ParseTournamentData(value2, isWinners: false, userInfo));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private TournamentData ParseTournamentData(JsonData data, bool isWinners, Dictionary<int, (string, long)> userInfo)
|
||||
{
|
||||
Match[][] matches = ConvertToMatch(data);
|
||||
Dictionary<TournamentCellData, int> cellMatchIdDict = new Dictionary<TournamentCellData, int>();
|
||||
TournamentData tournamentData = new TournamentData();
|
||||
int num = matches.Length + 1;
|
||||
List<TournamentRoundData> list = (tournamentData.Rounds = new List<TournamentRoundData>(num));
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
TournamentRoundData item = new TournamentRoundData
|
||||
{
|
||||
RoundNo = i + 1,
|
||||
Cells = new List<TournamentCellData>(),
|
||||
Watchs = new List<TournamentWatchData>()
|
||||
};
|
||||
list.Add(item);
|
||||
}
|
||||
Match match = matches[matches.Length - 1][0];
|
||||
TournamentCellData.CellState cellState = GetCellState(match, match.WinnerViewerId, match.IsForceLoseWinner);
|
||||
CreateCell(list[num - 1], match.WinnerViewerId, match.MatchId, cellState, isWinners).IsTerminal = true;
|
||||
int i2 = matches.Length - 1;
|
||||
while (i2 >= 0)
|
||||
{
|
||||
Match[] source = matches[i2];
|
||||
TournamentRoundData tournamentRoundData = list[i2 + 1];
|
||||
TournamentRoundData tournamentRoundData2 = list[i2];
|
||||
foreach (TournamentCellData cell in tournamentRoundData.Cells)
|
||||
{
|
||||
if (cell == null || !cellMatchIdDict.ContainsKey(cell))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
int matchId = cellMatchIdDict[cell];
|
||||
Match match2 = source.FirstOrDefault((Match m) => m.MatchId == matchId);
|
||||
TournamentCellData tournamentCellData = CreateCell(tournamentRoundData2, match2.ViewerId1, GetChildMatchId(1), GetCellState(match2, match2.ViewerId1, match2.IsForceLose1), isChampion: false);
|
||||
tournamentCellData.Line = TournamentCellData.LineType.Down;
|
||||
tournamentCellData.Parent = cell;
|
||||
tournamentCellData.IsFinalMatchReset = false;
|
||||
TournamentCellData tournamentCellData2 = CreateCell(tournamentRoundData2, match2.ViewerId2, GetChildMatchId(2), GetCellState(match2, match2.ViewerId2, match2.IsForceLose2), isChampion: false);
|
||||
tournamentCellData2.Line = TournamentCellData.LineType.Up;
|
||||
tournamentCellData2.Parent = cell;
|
||||
tournamentCellData2.IsFinalMatchReset = match2.IsFinalMatchReset;
|
||||
cell.Children = new TournamentCellData[2] { tournamentCellData, tournamentCellData2 };
|
||||
tournamentRoundData2.IsExtraRound = match2.IsExtra;
|
||||
if (match2.RoomId > 0)
|
||||
{
|
||||
CreateWatch(tournamentRoundData2, match2);
|
||||
}
|
||||
if (match2.IsExtra)
|
||||
{
|
||||
i2--;
|
||||
match2 = matches[i2][0];
|
||||
matchId = match2.MatchId;
|
||||
tournamentRoundData2 = list[i2];
|
||||
tournamentCellData = CreateCell(tournamentRoundData2, match2.ViewerId1, GetChildMatchId(1), GetCellState(match2, match2.ViewerId1, match2.IsForceLose1), isChampion: false);
|
||||
tournamentCellData.Line = TournamentCellData.LineType.Down;
|
||||
tournamentCellData.IsPreExtra = true;
|
||||
tournamentCellData2 = CreateCell(tournamentRoundData2, match2.ViewerId2, GetChildMatchId(2), GetCellState(match2, match2.ViewerId2, match2.IsForceLose2), isChampion: false);
|
||||
tournamentCellData2.Line = TournamentCellData.LineType.Up;
|
||||
tournamentCellData2.IsPreExtra = true;
|
||||
if (match2.RoomId > 0)
|
||||
{
|
||||
CreateWatch(tournamentRoundData2, match2);
|
||||
}
|
||||
}
|
||||
int GetChildMatchId(int parentMatchUserIndex)
|
||||
{
|
||||
if (i2 == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return matches[i2 - 1].FirstOrDefault((Match m) => m.ParentMatchId == matchId && m.ParentMatchUserIndex == parentMatchUserIndex)?.MatchId ?? 0;
|
||||
}
|
||||
}
|
||||
int num2 = i2 - 1;
|
||||
i2 = num2;
|
||||
}
|
||||
return tournamentData;
|
||||
TournamentCellData CreateCell(TournamentRoundData round, int viewerId, int num3, TournamentCellData.CellState state, bool isChampion)
|
||||
{
|
||||
TournamentCellData tournamentCellData3 = new TournamentCellData
|
||||
{
|
||||
State = state
|
||||
};
|
||||
(string, long) tuple = userInfo[viewerId];
|
||||
tournamentCellData3.Name = tuple.Item1;
|
||||
tournamentCellData3.EmblemId = tuple.Item2;
|
||||
tournamentCellData3.ViewerId = viewerId;
|
||||
tournamentCellData3.IsChampion = isChampion;
|
||||
tournamentCellData3.Round = round;
|
||||
round.Cells.Add(tournamentCellData3);
|
||||
if (num3 > 0)
|
||||
{
|
||||
cellMatchIdDict.Add(tournamentCellData3, num3);
|
||||
}
|
||||
return tournamentCellData3;
|
||||
}
|
||||
static TournamentWatchData CreateWatch(TournamentRoundData round, Match match3)
|
||||
{
|
||||
TournamentWatchData tournamentWatchData = new TournamentWatchData
|
||||
{
|
||||
RoomId = match3.RoomId,
|
||||
ViewerId0 = match3.ViewerId1,
|
||||
ViewerId1 = match3.ViewerId2
|
||||
};
|
||||
round.Watchs.Add(tournamentWatchData);
|
||||
return tournamentWatchData;
|
||||
}
|
||||
}
|
||||
|
||||
private TournamentCellData.CellState GetCellState(Match match, int viewerId, bool isForceLose)
|
||||
{
|
||||
if (isForceLose)
|
||||
{
|
||||
if (viewerId != 0)
|
||||
{
|
||||
return TournamentCellData.CellState.LoseByDefault;
|
||||
}
|
||||
return TournamentCellData.CellState.Blank;
|
||||
}
|
||||
if (match.Status == 5)
|
||||
{
|
||||
if (viewerId == 0)
|
||||
{
|
||||
return TournamentCellData.CellState.LoseByDefault;
|
||||
}
|
||||
if (match.WinnerViewerId != viewerId)
|
||||
{
|
||||
return TournamentCellData.CellState.Lose;
|
||||
}
|
||||
return TournamentCellData.CellState.Win;
|
||||
}
|
||||
if (viewerId == 0)
|
||||
{
|
||||
return TournamentCellData.CellState.Blank;
|
||||
}
|
||||
if (match.IsActive)
|
||||
{
|
||||
return TournamentCellData.CellState.Active;
|
||||
}
|
||||
return TournamentCellData.CellState.Unresolved;
|
||||
}
|
||||
|
||||
private Dictionary<int, (string, long)> CollectUserInfo(JsonData data)
|
||||
{
|
||||
Dictionary<int, (string, long)> dictionary = new Dictionary<int, (string, long)> {
|
||||
{
|
||||
0,
|
||||
(string.Empty, 0L)
|
||||
} };
|
||||
foreach (string key2 in data.Keys)
|
||||
{
|
||||
JsonData jsonData = data[key2];
|
||||
foreach (string key3 in jsonData.Keys)
|
||||
{
|
||||
JsonData jsonData2 = jsonData[key3];
|
||||
for (int i = 0; i < jsonData2.Count; i++)
|
||||
{
|
||||
JsonData jsonData3 = jsonData2[i];
|
||||
Add(jsonData3["user1"], dictionary);
|
||||
Add(jsonData3["user2"], dictionary);
|
||||
}
|
||||
}
|
||||
}
|
||||
return dictionary;
|
||||
static void Add(JsonData userData, Dictionary<int, (string, long)> dict)
|
||||
{
|
||||
if (userData != null)
|
||||
{
|
||||
int key = userData["viewer_id"].ToInt();
|
||||
if (!dict.ContainsKey(key))
|
||||
{
|
||||
string item = userData["name"].ToString();
|
||||
long item2 = userData["emblem_id"].ToLong();
|
||||
dict.Add(key, (item, item2));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Match[][] ConvertToMatch(JsonData data)
|
||||
{
|
||||
Match[][] array = new Match[data.Count][];
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
{
|
||||
JsonData jsonData = data[(i + 1).ToString()];
|
||||
Match[] array2 = new Match[jsonData.Count];
|
||||
for (int j = 0; j < jsonData.Count; j++)
|
||||
{
|
||||
JsonData jsonData2 = jsonData[j];
|
||||
bool isFinalMatchReset = false;
|
||||
if (jsonData2.TryGetValue("is_show_one_more_win", out var value))
|
||||
{
|
||||
isFinalMatchReset = value.ToInt() == 1;
|
||||
}
|
||||
Match match = new Match
|
||||
{
|
||||
MatchId = jsonData2["matching_id"].ToInt(),
|
||||
ParentMatchId = jsonData2["winner_parent_matching_id"].ToInt(),
|
||||
ParentMatchUserIndex = jsonData2["winner_parent_matching_viewer_id_suffix"].ToInt(),
|
||||
Status = jsonData2["status"].ToInt(),
|
||||
ViewerId1 = jsonData2["viewer_id1"].ToInt(),
|
||||
ViewerId2 = jsonData2["viewer_id2"].ToInt(),
|
||||
WinnerViewerId = jsonData2["winner_viewer_id"].ToInt(),
|
||||
RoomId = jsonData2["display_room_id"].ToInt(),
|
||||
IsForceLose1 = (jsonData2["is_force_lose1"].ToInt() == 1),
|
||||
IsForceLose2 = (jsonData2["is_force_lose2"].ToInt() == 1),
|
||||
IsExtra = (jsonData2["side_type"].ToInt() == 3),
|
||||
IsFinalMatchReset = isFinalMatchReset
|
||||
};
|
||||
match.IsForceLoseWinner = ((match.ViewerId1 == match.WinnerViewerId) ? match.IsForceLose1 : match.IsForceLose2);
|
||||
array2[j] = match;
|
||||
}
|
||||
array[i] = array2;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class GatheringUpdateDescriptionTask : BaseTask
|
||||
{
|
||||
public class GatheringUpdateDescriptionTaskParam : BaseParam
|
||||
{
|
||||
public string description;
|
||||
}
|
||||
|
||||
public GatheringUpdateDescriptionTask()
|
||||
{
|
||||
base.type = ApiType.Type.GatheringUpdateDescription;
|
||||
}
|
||||
|
||||
public void SetParameter(string description)
|
||||
{
|
||||
GatheringUpdateDescriptionTaskParam gatheringUpdateDescriptionTaskParam = new GatheringUpdateDescriptionTaskParam();
|
||||
gatheringUpdateDescriptionTaskParam.description = description;
|
||||
base.Params = gatheringUpdateDescriptionTaskParam;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GuildInputDescriptionDialog : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UIInput _inputText;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _labelText;
|
||||
|
||||
public string InputValue
|
||||
{
|
||||
get
|
||||
{
|
||||
return _inputText.value;
|
||||
}
|
||||
set
|
||||
{
|
||||
_inputText.value = value;
|
||||
_labelText.text = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
38
SVSim.BattleEngine/Engine/Wizard/GuildInputViewerIdDialog.cs
Normal file
38
SVSim.BattleEngine/Engine/Wizard/GuildInputViewerIdDialog.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GuildInputViewerIdDialog : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UIInput _inputId;
|
||||
|
||||
public int InputValue => int.Parse(_inputId.value);
|
||||
|
||||
public void InitInput(Action onChangeInputLength)
|
||||
{
|
||||
_inputId.value = string.Empty;
|
||||
_inputId.onChange.Clear();
|
||||
_inputId.onChange.Add(new EventDelegate(delegate
|
||||
{
|
||||
onChangeInputLength();
|
||||
}));
|
||||
}
|
||||
|
||||
public void InitializeDialog(DialogBase dialog)
|
||||
{
|
||||
UIManager.SetObjectToGrey(dialog.button1.gameObject, b: true);
|
||||
InitInput(delegate
|
||||
{
|
||||
if (UIUtil.IsValidViewerId(_inputId.value))
|
||||
{
|
||||
UIManager.SetObjectToGrey(dialog.button1.gameObject, b: false);
|
||||
}
|
||||
else
|
||||
{
|
||||
UIManager.SetObjectToGrey(dialog.button1.gameObject, b: true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
38
SVSim.BattleEngine/Engine/Wizard/GuildUserDataDialog.cs
Normal file
38
SVSim.BattleEngine/Engine/Wizard/GuildUserDataDialog.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class GuildUserDataDialog : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UITexture _textureEmblem;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture _textureCountry;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture _textureRank;
|
||||
|
||||
[SerializeField]
|
||||
private UITexture _textureDegree;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _labelName;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _labelDiscription;
|
||||
|
||||
public void SetUserData(UserInfoBase userInfo)
|
||||
{
|
||||
_textureEmblem.mainTexture = userInfo.GetUserEmblemTexture();
|
||||
_textureRank.mainTexture = userInfo.GetUserRankTexture();
|
||||
userInfo.InitializeDegreeTexture(_textureDegree);
|
||||
_textureCountry.mainTexture = userInfo.GetUserCountryTexture();
|
||||
_labelName.text = userInfo.Name;
|
||||
}
|
||||
|
||||
public void SetDiscriptionLabel(string text)
|
||||
{
|
||||
_labelDiscription.text = text;
|
||||
}
|
||||
}
|
||||
69
SVSim.BattleEngine/Engine/Wizard/MailReadTask.cs
Normal file
69
SVSim.BattleEngine/Engine/Wizard/MailReadTask.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class MailReadTask : BaseTask
|
||||
{
|
||||
public class MailReadTaskParam : BaseParam
|
||||
{
|
||||
public string[] present_id_array;
|
||||
|
||||
public int state;
|
||||
}
|
||||
|
||||
public const int MAIL_READ = 1;
|
||||
|
||||
public const int MAIL_DELETE = 3;
|
||||
|
||||
public MailReadTask(int state)
|
||||
{
|
||||
base.type = ApiType.Type.MailRead;
|
||||
}
|
||||
|
||||
public void SetParameter(string[] present_id_array, int state, bool isTutorial)
|
||||
{
|
||||
base.type = (isTutorial ? ApiType.Type.MailReadTutorial : ApiType.Type.MailRead);
|
||||
MailReadTaskParam mailReadTaskParam = new MailReadTaskParam();
|
||||
mailReadTaskParam.present_id_array = present_id_array;
|
||||
mailReadTaskParam.state = state;
|
||||
base.Params = mailReadTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
Data.ReadMail.data = new ReadMailDetail();
|
||||
Data.ReadMail.data.total_recieve_count_list = new List<ReceivedReward>();
|
||||
GameMgr.GetIns().GetMailTopTask().SetToFirstPage();
|
||||
Data.MailTop.data = new MailDataDetail();
|
||||
Data.MailTop.data.mail_data_list = new List<MailData>();
|
||||
Data.MailTop.data.mail_history_list = new List<MailData>();
|
||||
JsonData jsonData = base.ResponseData["data"]["total_receive_count_list"];
|
||||
for (int i = 0; i < jsonData.Count; i++)
|
||||
{
|
||||
ReceivedReward item = new ReceivedReward(jsonData[i]);
|
||||
Data.ReadMail.data.total_recieve_count_list.Add(item);
|
||||
}
|
||||
PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(base.ResponseData["data"]["reward_list"]);
|
||||
Data.ReadMail.data.is_unreceived_present = base.ResponseData["data"]["is_unreceived_present"].ToBoolean();
|
||||
JsonData jsonData2 = base.ResponseData["data"]["present_list"];
|
||||
for (int j = 0; j < jsonData2.Count; j++)
|
||||
{
|
||||
MailData item2 = new MailData(jsonData2[j]);
|
||||
Data.MailTop.data.mail_data_list.Add(item2);
|
||||
}
|
||||
JsonData jsonData3 = base.ResponseData["data"]["present_history_list"];
|
||||
for (int k = 0; k < jsonData3.Count; k++)
|
||||
{
|
||||
MailData item3 = new MailData(jsonData3[k]);
|
||||
Data.MailTop.data.mail_history_list.Add(item3);
|
||||
}
|
||||
Data.Load.data._userTutorial.Update(base.ResponseData["data"]);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
35
SVSim.BattleEngine/Engine/Wizard/ReplayDetailTask.cs
Normal file
35
SVSim.BattleEngine/Engine/Wizard/ReplayDetailTask.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
namespace Wizard;
|
||||
|
||||
public class ReplayDetailTask : BaseTask
|
||||
{
|
||||
public class ReplayDetailTaskParam : BaseParam
|
||||
{
|
||||
public new int viewer_id;
|
||||
|
||||
public long battle_id;
|
||||
}
|
||||
|
||||
public ReplayDetailTask()
|
||||
{
|
||||
base.type = ApiType.Type.ReplayDetail;
|
||||
}
|
||||
|
||||
public void SetParameter(int viewerId, long battleId)
|
||||
{
|
||||
ReplayDetailTaskParam replayDetailTaskParam = new ReplayDetailTaskParam();
|
||||
replayDetailTaskParam.viewer_id = viewerId;
|
||||
replayDetailTaskParam.battle_id = battleId;
|
||||
base.Params = replayDetailTaskParam;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
Data.ReplayBattleInfo = new ReplayDetailInfo(base.ResponseData["data"]);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
115
SVSim.BattleEngine/Engine/Wizard/ReplayDialogContent.cs
Normal file
115
SVSim.BattleEngine/Engine/Wizard/ReplayDialogContent.cs
Normal file
@@ -0,0 +1,115 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
using Wizard.Replay;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class ReplayDialogContent : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private GameObject _rootReplayContentView;
|
||||
|
||||
[SerializeField]
|
||||
private ReplayContentView _prefabReplayContentView;
|
||||
|
||||
private ReplayContentView _replayContentView;
|
||||
|
||||
public Action OnClickReplayButton;
|
||||
|
||||
private long _battle_id;
|
||||
|
||||
private ReplayInfoItem _replayInfo;
|
||||
|
||||
public void ReplayButtonClicked()
|
||||
{
|
||||
OnClickReplayButton.Call();
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE_TRANS);
|
||||
long battleId = _battle_id;
|
||||
ReplayInfoItem replayInfo = _replayInfo;
|
||||
CheckTimeSlipRotationPeriodTask task = new CheckTimeSlipRotationPeriodTask();
|
||||
StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate
|
||||
{
|
||||
GoReplay(battleId, replayInfo);
|
||||
}));
|
||||
}
|
||||
|
||||
private static void GoReplay(long battleId, ReplayInfoItem replayInfo)
|
||||
{
|
||||
string replayDataDirectoryPath = Application.persistentDataPath + "/NewReplay";
|
||||
string text = (Directory.Exists(replayDataDirectoryPath) ? (from d in Directory.GetDirectories(replayDataDirectoryPath, "*", SearchOption.TopDirectoryOnly)
|
||||
select d.Replace("\\", "/")).FirstOrDefault((string f) => f == replayDataDirectoryPath + "/" + battleId) : null);
|
||||
bool num = (text == null) | (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.NEWREPLAY_ALL) || (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.NEWREPLAY_EXCLUDE_ROTATION) && replayInfo.BattleFormat != Format.Rotation));
|
||||
UIManager.ChangeViewSceneParam param = new UIManager.ChangeViewSceneParam();
|
||||
param.MyPageMenuIndex = 6;
|
||||
param.IsCutCardMotion = true;
|
||||
param.OnFinishChangeView = delegate
|
||||
{
|
||||
ReplayDialog.Create();
|
||||
};
|
||||
param.IsUpdateFooterMenuTexture = true;
|
||||
if (num)
|
||||
{
|
||||
ReplayDetailTask replayDetailTask = new ReplayDetailTask();
|
||||
replayDetailTask.SetParameter(PlayerStaticData.UserViewerID, battleId);
|
||||
UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(replayDetailTask, delegate
|
||||
{
|
||||
ReplayController.StartPlayReplay(replayInfo, UIManager.ViewScene.MyPage, param);
|
||||
}));
|
||||
return;
|
||||
}
|
||||
Data.ReplayBattleInfo = new ReplayDetailInfo(NewReplayBattleMgr.ReadJson(Directory.GetFiles(text, "*", SearchOption.TopDirectoryOnly).ToList().FirstOrDefault((string x) => x.Contains("replay_info.json"))));
|
||||
Data.ReplayBattleInfo.is_two_pick = replayInfo.BattleParameter.IsTwoPick;
|
||||
Data.ReplayBattleInfo._battleType = (int)replayInfo.BattleParameter.BattleType;
|
||||
Data.ReplayBattleInfo._twoPickFormat = replayInfo.BattleParameter.TwoPickFormat;
|
||||
Data.CurrentFormat = replayInfo.BattleFormat;
|
||||
ReplayController.StartPlayReplay(UIManager.ViewScene.MyPage, param, isNewReplay: true, battleId.ToString());
|
||||
}
|
||||
|
||||
public IEnumerator Setup(ReplayInfoItem item, List<string> loadedTextures)
|
||||
{
|
||||
if (_replayContentView == null)
|
||||
{
|
||||
_replayContentView = NGUITools.AddChild(_rootReplayContentView, _prefabReplayContentView.gameObject).GetComponent<ReplayContentView>();
|
||||
}
|
||||
_replayInfo = item;
|
||||
_battle_id = item.BattleId;
|
||||
_replayContentView.SetOpponentPlayerInfo(item);
|
||||
_replayContentView.SetBattleInfo(item);
|
||||
string text = Application.persistentDataPath + "/NewReplay";
|
||||
if ((!Directory.Exists(text) || !(from d in Directory.GetDirectories(text, "*", SearchOption.TopDirectoryOnly)
|
||||
select d.Replace("\\", "/")).Contains(text + "/" + _battle_id)) | (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.NEWREPLAY_ALL) || (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.NEWREPLAY_EXCLUDE_ROTATION) && _replayInfo.BattleFormat != Format.Rotation)))
|
||||
{
|
||||
_replayContentView.SetOldReplayLabel(isActive: true);
|
||||
}
|
||||
else
|
||||
{
|
||||
_replayContentView.SetOldReplayLabel(isActive: false);
|
||||
}
|
||||
_replayContentView.ClearTexture();
|
||||
while (true)
|
||||
{
|
||||
if (item.BattleId != _battle_id)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
string assetTypePath = Toolbox.ResourcesManager.GetAssetTypePath(item.OpponentEmblemId, ResourcesManager.AssetLoadPathType.Emblem_S);
|
||||
string assetTypePath2 = Toolbox.ResourcesManager.GetAssetTypePath(item.OpponentCountryCode, ResourcesManager.AssetLoadPathType.Country_S);
|
||||
if (!loadedTextures.Contains(assetTypePath))
|
||||
{
|
||||
yield return null;
|
||||
continue;
|
||||
}
|
||||
if (string.IsNullOrEmpty(assetTypePath2) || loadedTextures.Contains(assetTypePath2))
|
||||
{
|
||||
break;
|
||||
}
|
||||
yield return null;
|
||||
}
|
||||
_replayContentView.SetTexture(item);
|
||||
}
|
||||
}
|
||||
45
SVSim.BattleEngine/Engine/Wizard/TweenPositionWithUpdate.cs
Normal file
45
SVSim.BattleEngine/Engine/Wizard/TweenPositionWithUpdate.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class TweenPositionWithUpdate : TweenPosition
|
||||
{
|
||||
private Action<float> _onUpdate;
|
||||
|
||||
public static TweenPosition Begin(GameObject go, float duration, Vector3 pos, Action<float> onUpdate)
|
||||
{
|
||||
TweenPositionWithUpdate tweenPositionWithUpdate = UITweener.Begin<TweenPositionWithUpdate>(go, duration);
|
||||
tweenPositionWithUpdate.from = tweenPositionWithUpdate.value;
|
||||
tweenPositionWithUpdate.to = pos;
|
||||
if (duration <= 0f)
|
||||
{
|
||||
tweenPositionWithUpdate.Sample(1f, isFinished: true);
|
||||
tweenPositionWithUpdate.enabled = false;
|
||||
}
|
||||
tweenPositionWithUpdate._onUpdate = onUpdate;
|
||||
return tweenPositionWithUpdate;
|
||||
}
|
||||
|
||||
public static TweenPosition Begin(GameObject go, float duration, Vector3 pos, bool worldSpace, Action<float> onUpdate)
|
||||
{
|
||||
TweenPositionWithUpdate tweenPositionWithUpdate = UITweener.Begin<TweenPositionWithUpdate>(go, duration);
|
||||
tweenPositionWithUpdate.worldSpace = worldSpace;
|
||||
tweenPositionWithUpdate.from = tweenPositionWithUpdate.value;
|
||||
tweenPositionWithUpdate.to = pos;
|
||||
if (duration <= 0f)
|
||||
{
|
||||
tweenPositionWithUpdate.Sample(1f, isFinished: true);
|
||||
tweenPositionWithUpdate.enabled = false;
|
||||
}
|
||||
tweenPositionWithUpdate._onUpdate = onUpdate;
|
||||
return tweenPositionWithUpdate;
|
||||
}
|
||||
|
||||
protected override void OnUpdate(float factor, bool isFinished)
|
||||
{
|
||||
base.value = from * (1f - factor) + to * factor;
|
||||
_onUpdate.Call(factor);
|
||||
}
|
||||
}
|
||||
83
SVSim.BattleEngine/Engine/Wizard/UserDataDialog.cs
Normal file
83
SVSim.BattleEngine/Engine/Wizard/UserDataDialog.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Cute;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class UserDataDialog : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private GuildUserDataDialog _inviteView;
|
||||
|
||||
private bool _isFinishLoadResource;
|
||||
|
||||
private List<string> _loadedResourceList = new List<string>();
|
||||
|
||||
public DialogBase Dialog { get; private set; }
|
||||
|
||||
public static UserDataDialog Create(GameObject prefab, UserInfoBase user, string dialogTitle)
|
||||
{
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetTitleLabel(dialogTitle);
|
||||
dialogBase.SetSize(DialogBase.Size.S);
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.BlueBtn_CancelBtn);
|
||||
UserDataDialog component = UnityEngine.Object.Instantiate(prefab).GetComponent<UserDataDialog>();
|
||||
_ = component.gameObject;
|
||||
dialogBase.SetObj(component.gameObject);
|
||||
component.Dialog = dialogBase;
|
||||
component.Initialize(user, dialogBase);
|
||||
return component;
|
||||
}
|
||||
|
||||
private void Initialize(UserInfoBase user, DialogBase dialog)
|
||||
{
|
||||
UIManager uiManager = UIManager.GetInstance();
|
||||
uiManager.StartCoroutine(LoadResource(user, delegate
|
||||
{
|
||||
if (base.gameObject != null)
|
||||
{
|
||||
_inviteView.SetUserData(user);
|
||||
}
|
||||
}));
|
||||
dialog.OnClose = (Action)Delegate.Combine(dialog.OnClose, (Action)delegate
|
||||
{
|
||||
uiManager.StartCoroutine(UnloadImages(delegate
|
||||
{
|
||||
if (this != null)
|
||||
{
|
||||
UnityEngine.Object.Destroy(base.gameObject);
|
||||
}
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
private IEnumerator LoadResource(UserInfoBase userData, Action callBack)
|
||||
{
|
||||
_isFinishLoadResource = false;
|
||||
List<string> resourcePathList = userData.GetUserAssetPathList();
|
||||
yield return UIManager.GetInstance().StartCoroutine(Toolbox.ResourcesManager.LoadAssetGroupAsync(resourcePathList, delegate
|
||||
{
|
||||
_isFinishLoadResource = true;
|
||||
}));
|
||||
_loadedResourceList.AddRange(resourcePathList);
|
||||
callBack.Call();
|
||||
}
|
||||
|
||||
private IEnumerator UnloadImages(Action callBack)
|
||||
{
|
||||
while (!_isFinishLoadResource)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
Toolbox.ResourcesManager.RemoveAssetGroup(_loadedResourceList);
|
||||
_loadedResourceList.Clear();
|
||||
callBack.Call();
|
||||
}
|
||||
|
||||
public void SetDiscriptionLabel(string text)
|
||||
{
|
||||
_inviteView.SetDiscriptionLabel(text);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user