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 = "";
|
||||
}
|
||||
Reference in New Issue
Block a user