From 739842b55b7301f87706755042f707b4e5eb61b7 Mon Sep 17 00:00:00 2001 From: milimoe Date: Tue, 21 Jan 2025 02:09:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=95=86=E5=93=81=E7=9A=84?= =?UTF-8?q?=E7=89=A9=E5=93=81=E5=88=97=E8=A1=A8=E6=97=A0=E9=99=90=E5=8F=A0?= =?UTF-8?q?=E5=8A=A0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OshimaServers/Service/FunGameService.cs | 13 +++++++------ OshimaWebAPI/Controllers/FunGameController.cs | 6 +----- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/OshimaServers/Service/FunGameService.cs b/OshimaServers/Service/FunGameService.cs index 849fcc2..394272d 100644 --- a/OshimaServers/Service/FunGameService.cs +++ b/OshimaServers/Service/FunGameService.cs @@ -2,6 +2,7 @@ using System.Text; using Milimoe.FunGame.Core.Api.Utility; using Milimoe.FunGame.Core.Entity; using Milimoe.FunGame.Core.Library.Constant; +using Oshima.Core.Configs; using Oshima.Core.Constant; using Oshima.FunGame.OshimaModules.Characters; using Oshima.FunGame.OshimaModules.Effects.OpenEffects; @@ -2035,18 +2036,18 @@ namespace Oshima.FunGame.OshimaServers.Service { int index = Random.Shared.Next(AllItems.Count); Item item = AllItems[index].Copy(); - double price = Random.Shared.NextDouble() * 10000 * (int)item.QualityType * 20; - item.Price = price; - daily.AddItem(item, Random.Shared.Next(3)); + double price = Random.Shared.NextDouble() * 10000 * (int)item.QualityType * Random.Shared.Next(5,20); + item.Price = Calculation.Round2Digits(price); + daily.AddItem(item, Random.Shared.Next(1, 3)); } store.Add("daily", daily); - return store.ToString() + "\r\n温馨提示:使用【商店查看+序号】查看物品详细信息,使用【商店购买+序号】购买物品!每天 4:00 刷新每日商店。"; + return daily.ToString() + "\r\n温馨提示:使用【商店查看+序号】查看物品详细信息,使用【商店购买+序号】购买物品!每天 4:00 刷新每日商店。"; } else { - if (store.Count > 0) + if (store.Count > 0 && store.Where(kv => kv.Key == "daily").Select(kv => kv.Value).FirstOrDefault() is Store daily) { - return store.ToString() + "\r\n温馨提示:使用【商店查看+序号】查看物品详细信息,使用【商店购买+序号】购买物品!每天 4:00 刷新每日商店。"; + return daily.ToString() + "\r\n温馨提示:使用【商店查看+序号】查看物品详细信息,使用【商店购买+序号】购买物品!每天 4:00 刷新每日商店。"; } else { diff --git a/OshimaWebAPI/Controllers/FunGameController.cs b/OshimaWebAPI/Controllers/FunGameController.cs index 8856419..8104368 100644 --- a/OshimaWebAPI/Controllers/FunGameController.cs +++ b/OshimaWebAPI/Controllers/FunGameController.cs @@ -4595,8 +4595,6 @@ namespace Oshima.FunGame.WebAPI.Controllers EntityModuleConfig store = new("stores", userid.ToString()); store.LoadConfig(); - FunGameService.CheckDailyStore(store); - store.SaveConfig(); string msg = ""; Store? daily = store.Get("daily"); @@ -4663,7 +4661,7 @@ namespace Oshima.FunGame.WebAPI.Controllers } else { - return NetworkUtility.JsonSerialize($"商品列表不存在,请刷新!"); + return NetworkUtility.JsonSerialize($"商品列表为空,请使用【每日商店】指令来获取商品列表!"); } store.Add("daily", daily); @@ -4694,8 +4692,6 @@ namespace Oshima.FunGame.WebAPI.Controllers EntityModuleConfig store = new("stores", userid.ToString()); store.LoadConfig(); - FunGameService.CheckDailyStore(store); - store.SaveConfig(); string msg = ""; Store? daily = store.Get("daily");