Compare commits

...

3 Commits

Author SHA1 Message Date
441ff1d21d ADD 2024-11-03 19:07:13 +08:00
0059644b31 Merge branch 'main' of http://192.168.2.19:3000/shurongsen/Cute_demon_attacks 2024-11-03 18:45:15 +08:00
105c1b3237 add 2024-11-03 18:44:58 +08:00
5 changed files with 57 additions and 52 deletions

View File

@ -13,17 +13,17 @@ public struct Register
{ {
public string Phone; public string Phone;
} }
[Serializable]
public struct AddGold public struct AddGold
{ {
public int Gold; public int Gold;
} }
[Serializable]
public struct Login public struct Login
{ {
public string Phone; public string Phone;
} }
[Serializable]
public struct GetListByPhone public struct GetListByPhone
{ {
public string Phone; public string Phone;
@ -44,6 +44,7 @@ public class Item//
public List<float> ReferrerBouns; public List<float> ReferrerBouns;
public string CreateDateTime; public string CreateDateTime;
} }
[Serializable]
public class VoucherItem:Res//返回的代金卷数据 public class VoucherItem:Res//返回的代金卷数据
{ {
public string Id; public string Id;
@ -59,19 +60,19 @@ public class VoucherItem:Res//
} }
[Serializable]
public class Use_daijinjuan public class Use_daijinjuan
{ {
public string Id; public string Id;
} }
[Serializable]
public class Mining_Wizard_ID //挖矿精灵id public class Mining_Wizard_ID //挖矿精灵id
{ {
public string[] Ids; public string[] Ids;
} }
[Serializable]
public class Giveaway //赠送代金卷 public class Giveaway //赠送代金卷
{ {
public string[] Ids; public string[] Ids;
@ -80,20 +81,25 @@ public class Giveaway //
[Serializable]
public class AllVocherItem //所有代金卷数据 public class AllVocherItem //所有代金卷数据
{ {
public string Id; public string Id;
public string GeneratorId; public string GeneratorId;
public string OwnerId; public string OwnerId;
public int Type; public float Type;
public int Num; public float Num;
public bool IsUsed; public bool IsUsed;
public bool IsAdmin; public bool IsAdmin;
public string UsedDateTime; public string UsedDateTime;
public string CreateDateTime; public string CreateDateTime;
} }
[Serializable]
public class Res//ÏûÏ¢·µ»ØÀà
{
public int ErrorCode;
public string ErrorMessage;
}
[Serializable] [Serializable]
public class AllVocherItemRes : Res public class AllVocherItemRes : Res
@ -130,11 +136,7 @@ public class ids:Res
public List<string> Ids; public List<string> Ids;
} }
public class Res//ÏûÏ¢·µ»ØÀà
{
public int ErrorCode;
public string ErrorMessage;
}
[System.Serializable] [System.Serializable]
public class ItemData//道具类 所有的道具都是这个结构体 public class ItemData//道具类 所有的道具都是这个结构体

View File

@ -6,12 +6,19 @@ public class Get_a_voucher : mount
{ {
List<AllVocherItem> Wakuanglist = new List<AllVocherItem>(); List<AllVocherItem> Wakuanglist = new List<AllVocherItem>();
int[] Floorint = new int[] {0,0,0,0,0};
// Start is called before the first frame update // Start is called before the first frame update
public override void Awake()
{
}
void Start() void Start()
{ {
InvokeRepeating("ExecuteTask", 1.0f, 1.0f); InvokeRepeating("ExecuteTask", 1.0f, 1.0f);
} }
public async void iii() public async void iii()
@ -24,14 +31,17 @@ public class Get_a_voucher : mount
async void ExecuteTask() async void ExecuteTask()
{ {
string userponse = await web.SendRequest(web.URL + "/Voucher/GetList", "POST"); string daijinjuanponse = await web.SendRequest(web.URL + "/Voucher/GetList", "POST");
// Debug.Log(userponse); Debug.Log("用户所有代金卷" + daijinjuanponse);
AllVocherItemRes itemList = JsonUtility.FromJson<AllVocherItemRes>(userponse); AllVocherItemRes itemList = JsonUtility.FromJson<AllVocherItemRes>(daijinjuanponse);
// Debug.Log(itemList.List.Length); Debug.Log(itemList.List.Length);
Debug.Log(itemList.List.Length);
} }
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {

View File

@ -67,7 +67,7 @@ public class Logo_in : mount
login.Phone = boxTypes[0].content; login.Phone = boxTypes[0].content;
//register.Code = boxTypes[0].content; //register.Code = boxTypes[0].content;
string jsonString = JsonUtility.ToJson(login); string jsonString = JsonUtility.ToJson(login);
string response = await web.SendRequest("http://47.109.133.52/Player/Register", "POST", jsonString); string response = await web.SendRequest(web.URL+"/Player/Register", "POST", jsonString);
Debug.Log(response); Debug.Log(response);
} }
else if (type == 1)//怬 else if (type == 1)//怬
@ -77,13 +77,10 @@ public class Logo_in : mount
Debug.Log(boxTypes[0].content); Debug.Log(boxTypes[0].content);
//register.Code = boxTypes[0].content; //register.Code = boxTypes[0].content;
string jsonString = JsonUtility.ToJson(login); string jsonString = JsonUtility.ToJson(login);
string response = await web.SendRequest("http://47.109.133.52/Player/Login", "POST", jsonString); string response = await web.SendRequest(web.URL+"/Player/Login", "POST", jsonString);
Debug.Log(response); Debug.Log(response);
string daijinjuanponse = await web.SendRequest(web.URL + "/Voucher/GetList", "POST");
Debug.Log("用户所有代金卷" + daijinjuanponse);
Rootobject root = JsonUtility.FromJson<Rootobject>(response); Rootobject root = JsonUtility.FromJson<Rootobject>(response);

View File

@ -32,14 +32,12 @@ public class jinsha : mount
} }
public int type = 0; public int type = 0;
public async void loding()
{
public async void Start()
{
} }
public async void buy_miners()//¹ºÂò½ð±Ò¿ó¹¤½çÃæ public async void buy_miners()//¹ºÂò½ð±Ò¿ó¹¤½çÃæ
{ {

View File

@ -48,7 +48,7 @@ public class room : mount
ChangeTextPro(); ChangeTextPro();
loding(); loding();
// Allminer(); // Allminer();
} }
@ -113,22 +113,22 @@ public class room : mount
return; return;
} }
if (toolsNumber_text == null) //if (toolsNumber_text == null)
{ //{
GetRoom();
Debug.Log("扣钱检测");
if (PlayerManager.Instance.GetNumer(MoneyType.Stones) < 11)
{
Promptmgr.Instance.PromptBubble("购买卷不足", Color.black, Color.red);
return;
}
PlayerManager.Instance.SetMoney(MoneyType.Stones, -10);
}
// Debug.Log("¿ÛÇ®¼ì²â");
// if (PlayerManager.Instance.GetNumer(MoneyType.Stones) < 11)
// {
// Promptmgr.Instance.PromptBubble("¹ºÂò¾í²»×ã", Color.black, Color.red);
// return;
// }
// PlayerManager.Instance.SetMoney(MoneyType.Stones, -10);
//}
Generate(1);
if (!Buy_succefful) return; if (!Buy_succefful) return;
Generate(1);
GetRoom();
haveNumber--; haveNumber--;
toolsNumber--; toolsNumber--;
UpdateShowCazhi(); UpdateShowCazhi();
@ -144,7 +144,7 @@ public class room : mount
newMiner.transform.SetParent(startPos); newMiner.transform.SetParent(startPos);
newMiner.transform.position = startPos.position; newMiner.transform.position = startPos.position;
Buy_succefful = false;
} }
@ -246,13 +246,11 @@ public class room : mount
generateForFisherElf.Num = buy_type; generateForFisherElf.Num = buy_type;
generateForFisherElf.Count = count; generateForFisherElf.Count = count;
string response = await web.SendRequest(web.URL + "/Voucher/GenerateForMinerElf", "POST", JsonUtility.ToJson(generateForFisherElf)); string response = await web.SendRequest(web.URL + "/Voucher/GenerateForMinerElf", "POST", JsonUtility.ToJson(generateForFisherElf));
Mining_Wizard_ID data = JsonUtility.FromJson<Mining_Wizard_ID>(response); Mining_Wizard_ID data = JsonUtility.FromJson<Mining_Wizard_ID>(response);
Use use = new Use(); Use use = new Use();
use.Id = data.Ids[0]; use.Id = data.Ids[0];
if (data.Ids[0] != null) if (use.Id != null)
{ {
Buy_succefful = true; Buy_succefful = true;
} }