2024-11-29 17:27:21 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class createTemplateInterface : MonoBehaviour
|
|
|
|
|
{
|
2024-12-11 16:36:27 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD> token
|
|
|
|
|
public Dictionary<string, string> CreateHeaders()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Debug.Log("====5555=====" + GlobalData.ServerData.data.access_token);
|
|
|
|
|
return new Dictionary<string, string>
|
|
|
|
|
{
|
|
|
|
|
{ "Authorization","Bearer "+GlobalData.ServerData.data.access_token },
|
|
|
|
|
{"clientId", "e5cd7e4891bf95d1d19206ce24a7b32e" }
|
|
|
|
|
};
|
|
|
|
|
}
|
2024-11-29 17:27:21 +08:00
|
|
|
|
//<2F>½<EFBFBD>ģ<EFBFBD><C4A3>
|
2024-12-12 19:14:48 +08:00
|
|
|
|
public async Task<newTemplateData> createTemplate(string reserveDate)
|
2024-11-29 17:27:21 +08:00
|
|
|
|
{
|
2024-12-11 16:36:27 +08:00
|
|
|
|
|
|
|
|
|
//=====================================================================================================================================================
|
|
|
|
|
Debug.Log(JsonConvert.SerializeObject(createTemplateInfo.Instance.auth_CreateTemplate) + "=====================");
|
|
|
|
|
string response = await web.SendRequest(web.URL + "/game/gameTemplate/add", "POST", JsonConvert.SerializeObject(createTemplateInfo.Instance.auth_CreateTemplate), CreateHeaders());
|
2024-12-12 19:14:48 +08:00
|
|
|
|
|
2024-11-29 17:27:21 +08:00
|
|
|
|
Debug.Log("<22>½<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>б<EFBFBD>" + response);
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
newTemplateData newTemplateData = JsonConvert.DeserializeObject<newTemplateData>(response);
|
|
|
|
|
Debug.Log(newTemplateData.data);
|
2024-12-12 19:14:48 +08:00
|
|
|
|
//=======================================================================
|
|
|
|
|
gameRoomReserve gameRoomReserve = new gameRoomReserve();
|
|
|
|
|
await gameRoomReserve.scheduledDrill(reserveDate, newTemplateData.data);
|
|
|
|
|
//======================================================================
|
2024-11-29 17:27:21 +08:00
|
|
|
|
return newTemplateData;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//====<3D>½<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>==========================
|
|
|
|
|
public class auth_createTemplate
|
|
|
|
|
{
|
|
|
|
|
public string templateName;//ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
public string sceneId;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-----------------------------<2D><><EFBFBD>루û<EBA3A8>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>ѡ<EFBFBD><D1A1>
|
|
|
|
|
public string subjectId;//<2F><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>---------------------------<2D><><EFBFBD><EFBFBD>
|
|
|
|
|
public string isTemplate;//<2F>Ƿ<C7B7>Ϊģ<CEAA><C4A3>
|
|
|
|
|
public string mode;//ģʽ
|
|
|
|
|
public List<PlayerList> playerList;//<2F><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
|
|
|
|
public List<NpcList> npcList;//NPC<50>б<EFBFBD>
|
|
|
|
|
public List<MaterialList> materialList;//<2F>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class PlayerList//<2F><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
public string userId;//<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>------------------------------<2D><><EFBFBD><EFBFBD>
|
|
|
|
|
public string roleId;//<2F><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>------------------------------<2D><><EFBFBD><EFBFBD>
|
|
|
|
|
public string birthAreaId;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>---------------------<2D><><EFBFBD><EFBFBD>
|
|
|
|
|
public string chargeAreaId;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>--------------------<2D><><EFBFBD><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
public class NpcList//NPC<50>б<EFBFBD>
|
|
|
|
|
{
|
2024-12-12 15:21:07 +08:00
|
|
|
|
public string npcId;//NPC<50><43><EFBFBD><EFBFBD>--------------------------------<2D><><EFBFBD><EFBFBD>
|
2024-12-11 16:36:27 +08:00
|
|
|
|
public string areaId;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>------------------------------<2D><><EFBFBD><EFBFBD>
|
2024-12-17 17:44:06 +08:00
|
|
|
|
public int num;//<2F><><EFBFBD><EFBFBD>--------------------------------<2D><><EFBFBD><EFBFBD>
|
|
|
|
|
public int isHere;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
|
2024-11-29 17:27:21 +08:00
|
|
|
|
}
|
|
|
|
|
public class MaterialList//<2F>豸<EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>
|
|
|
|
|
{
|
|
|
|
|
public string materialId;//<2F>豸<EFBFBD><E8B1B8><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>----------------------<2D><><EFBFBD><EFBFBD>
|
|
|
|
|
public int num;//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//===<3D><><EFBFBD><EFBFBD>ֵ======================================
|
|
|
|
|
|
|
|
|
|
public class newTemplateData : Response
|
|
|
|
|
{
|
|
|
|
|
public string data;//<2F><>
|
|
|
|
|
}
|