diff --git a/Service/Application.Domain/Services/Service/Business/RankService.cs b/Service/Application.Domain/Services/Service/Business/RankService.cs index d689289..2b78639 100644 --- a/Service/Application.Domain/Services/Service/Business/RankService.cs +++ b/Service/Application.Domain/Services/Service/Business/RankService.cs @@ -40,7 +40,7 @@ public class RankService(ISqlSugarClient DbClient, IRedisCache redis) : IRankSer .OrderByIF(type == 7, it => it.score, OrderByType.Desc) .Take(100) .ToListAsync(); - total = data.Count; + total.Value = data.Count; data = PageExtend.GetPageList(data, page, limit); List result = new List(); foreach (var item in data) @@ -97,7 +97,7 @@ public class RankService(ISqlSugarClient DbClient, IRedisCache redis) : IRankSer .OrderByDescending(uc => uc.copper) .Take(100) .ToListAsync(); - total = data.Count; + total.Value = data.Count; data = PageExtend.GetPageList(data, page, limit); List result = new List(); foreach (var item in data) @@ -120,10 +120,10 @@ public class RankService(ISqlSugarClient DbClient, IRedisCache redis) : IRankSer .Where((uc, u) => uc.lev > 29) .Select() .OrderByDescending(uc => uc.lev) - .OrderByDescending(uc=>uc.levUpdate) + .OrderBy(uc=>uc.levUpdate,OrderByType.Asc) .Take(100) .ToListAsync(); - total = data.Count; + total.Value = data.Count; data = PageExtend.GetPageList(data, page, limit); List result = new List(); foreach (var item in data) @@ -152,7 +152,7 @@ public class RankService(ISqlSugarClient DbClient, IRedisCache redis) : IRankSer .OrderByIF(type == 11, uc => uc.charm, OrderByType.Desc) .Take(100) .ToListAsync(); - total = data.Count; + total.Value = data.Count; data = PageExtend.GetPageList(data, page, limit); List result = new List(); foreach (var item in data) diff --git a/Service/Application.Domain/Services/Service/Equ/GameEquService.cs b/Service/Application.Domain/Services/Service/Equ/GameEquService.cs index e991b5e..7649bbc 100644 --- a/Service/Application.Domain/Services/Service/Equ/GameEquService.cs +++ b/Service/Application.Domain/Services/Service/Equ/GameEquService.cs @@ -57,12 +57,12 @@ public class GameEquService(ISqlSugarClient DbClient, IRedisCache redis) : IGame } public async Task> GetUserEquData(string userId, int type, string equName, int PageIndex, - int PageSize, RefAsync Total,int DealType) + int PageSize, RefAsync Total, int DealType) { long onTime = TimeExtend.GetTimeStampSeconds; var db = DbClient.AsTenant().GetConnectionWithAttr(); return await db.Queryable().Where(it => - it.userId == userId && it.isOn == 0 && it.isLock == 0 && + it.userId == userId && it.isOn == 0 && it.isLock == 0 && it.useEndTime > onTime) .WhereIF(DealType == 0, it => it.isDeal == 1) .WhereIF(DealType == 1, it => it.isDeal == 1 && it.isGive == 1) @@ -627,7 +627,7 @@ public class GameEquService(ISqlSugarClient DbClient, IRedisCache redis) : IGame await redis.SetAsync(key, result, 300); } - return result; + return result == null ? new List() : result; } #endregion diff --git a/Service/Application.Domain/Services/Service/Fight/GameFightService.cs b/Service/Application.Domain/Services/Service/Fight/GameFightService.cs index 88afc10..1424e1a 100644 --- a/Service/Application.Domain/Services/Service/Fight/GameFightService.cs +++ b/Service/Application.Domain/Services/Service/Fight/GameFightService.cs @@ -233,6 +233,9 @@ public class GameFightService(ISqlSugarClient DbClient, IRedisCache redis) : IGa { await UserStateTool.SetUserMapDefault(lowUser); } + //战败后,结束挂机 + var hookService = App.GetService(); + await hookService.StopOnHook(lowUser); fightData.state = 1; fightData.winCode = nameof(UserEnum.AttrCode.Person); @@ -414,7 +417,7 @@ public class GameFightService(ISqlSugarClient DbClient, IRedisCache redis) : IGa var cityInfo = await mapService.GetCityInfo((int)mapInfo.cityId); var winUserInfo = await userService.GetUserInfoByUserId(winUser); var lowUserInfo = await userService.GetUserInfoByUserId(lowUser); - + //系统广播 string boradMsg = $"[{UbbTool.HomeUbb(winUserInfo.userNo, winUserInfo.nick)}]在{cityInfo.cityName}·{mapInfo.mapName}击杀了[{UbbTool.HomeUbb(lowUserInfo.userNo, lowUserInfo.nick)}]!"; @@ -424,7 +427,7 @@ public class GameFightService(ISqlSugarClient DbClient, IRedisCache redis) : IGa string noticeMsg = $"您在{cityInfo.cityName}·{mapInfo.mapName}被[{UbbTool.HomeUbb(winUserInfo.userNo, winUserInfo.nick)}]击杀!"; await chatService.SendChat(lowUser, (int)lowUserInfo.areaId, nameof(GameChatEnum.Code.Notice), noticeMsg); - if (mapInfo.isPk == 1) + if (mapInfo.isPk == 1 && fightData.userId == winUser) { var relationService = App.GetService(); if (await relationService.CheckUserEnemy(winUser, lowUser) == false) diff --git a/Service/Application.Domain/Services/Service/User/UnitUserAttrService.cs b/Service/Application.Domain/Services/Service/User/UnitUserAttrService.cs index 0a5b677..d0d9653 100644 --- a/Service/Application.Domain/Services/Service/User/UnitUserAttrService.cs +++ b/Service/Application.Domain/Services/Service/User/UnitUserAttrService.cs @@ -125,11 +125,9 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) : var loadState = await GetUserLoadState(userId); result = await GameAttrTool.CheckRoleLoadBuff(result, loadState); result = await ReviseUserRoleAttr(result); - return result; #endregion - return result; } catch (Exception e) @@ -588,13 +586,15 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) : var data = await redis.GetHashAsync>(key, userId); if (data == null) { - long endTime = TimeExtend.GetTimeStampSeconds; var db = DbClient.AsTenant().GetConnectionWithAttr(); - data = await db.Queryable().Where(it => it.userId == userId && it.endTime > endTime) + data = await db.Queryable().Where(it => it.userId == userId) .ToListAsync(); await redis.AddHashAsync(key, userId, data); } + long endTime = TimeExtend.GetTimeStampSeconds; + data = data.FindAll(it => it.endTime > endTime); + return data; } diff --git a/Service/Application.Web/Controllers/Pub/TradeController.cs b/Service/Application.Web/Controllers/Pub/TradeController.cs index 935e4c9..8338f8d 100644 --- a/Service/Application.Web/Controllers/Pub/TradeController.cs +++ b/Service/Application.Web/Controllers/Pub/TradeController.cs @@ -44,6 +44,11 @@ public class TradeController : ControllerBase count = count < 1 ? 1 : count; string userId = StateHelper.userId; int areaId = StateHelper.areaId; + if (price > 100000000000) + { + return PoAction.Message("最大单价不能超过10万金!"); + } + int lev = await _attrService.GetUserLev(userId); if (lev < 60) { diff --git a/Web/src/config/BaseConfig.ts b/Web/src/config/BaseConfig.ts index 300e453..3f8dda4 100644 --- a/Web/src/config/BaseConfig.ts +++ b/Web/src/config/BaseConfig.ts @@ -2,8 +2,8 @@ 统一配置中心 */ export class BaseConfig { - public static BaseUrl: string = 'https://localhost:7198' - public static BaseMediaUrl: string = 'https://localhost:7198/' - // public static BaseUrl:string="http://v3.pccsh.com"; - // public static BaseMediaUrl:string="http://v3.pccsh.com"; + // public static BaseUrl: string = 'https://localhost:7198' + // public static BaseMediaUrl: string = 'https://localhost:7198/' + public static BaseUrl:string="http://v3.pccsh.com"; + public static BaseMediaUrl:string="http://v3.pccsh.com"; } diff --git a/Web/src/pages/trade/index.vue b/Web/src/pages/trade/index.vue index 7a367e4..5c1be04 100644 --- a/Web/src/pages/trade/index.vue +++ b/Web/src/pages/trade/index.vue @@ -18,10 +18,12 @@
{{ PageExtend.GetPageIndex(currentPage, 10, index + 1) }}. - {{ item.name }}({{ item.price }}铜贝) + {{ item.name }}({{ GameTool.FormatCopper(item.price) }}) + - {{ item.name }}({{ item.price }}铜贝) + {{ item.name }}({{ GameTool.FormatCopper(item.price) }}) + [购买]
@@ -36,7 +38,7 @@
物品名称:{{ showGoods.name }}
- 购买单价:{{ showGoods.price }} 铜贝
+ 购买单价:{{ GameTool.FormatCopper(showGoods.price) }}
剩余数量:{{ showGoods.count }} @@ -88,6 +90,7 @@ const BindData = async (): Promise => { const Change = async (_type: string) => { type.value = _type; + currentPage.value = 1; await BindData(); } diff --git a/Web/src/pages/trade/my.vue b/Web/src/pages/trade/my.vue index eec486d..acee5e2 100644 --- a/Web/src/pages/trade/my.vue +++ b/Web/src/pages/trade/my.vue @@ -6,10 +6,10 @@
{{ index + 1 }}.[{{ GetRankName(item.code) }}] - {{ item.name }}({{ item.price }}铜贝) + {{ item.name }}({{ GameTool.FormatCopper(item.price) }}) - {{ item.name }}({{ item.price }}铜贝) + {{ item.name }}({{ GameTool.FormatCopper(item.price) }}) (下架)
diff --git a/Web/src/pages/trade/user.vue b/Web/src/pages/trade/user.vue index 0cffc67..55cd881 100644 --- a/Web/src/pages/trade/user.vue +++ b/Web/src/pages/trade/user.vue @@ -6,10 +6,10 @@
{{ PageExtend.GetPageIndex(currentPage, 10, index + 1) }}.[{{ GetRankName(item.code) }}] - {{ item.name }}({{ item.price }}铜贝) + {{ item.name }}({{ GameTool.FormatCopper(item.price) }}) - {{ item.name }}({{ item.price }}铜贝) + {{ item.name }}({{ GameTool.FormatCopper(item.price) }}) [购买]
@@ -24,7 +24,7 @@
物品名称:{{ showGoods.name }}
- 购买单价:{{ showGoods.price }} 铜贝
+ 购买单价:{{ GameTool.FormatCopper(showGoods.price) }}
剩余数量:{{ showGoods.count }} diff --git a/Web/src/pages/user/attr.vue b/Web/src/pages/user/attr.vue index 2c8dc1f..144184f 100644 --- a/Web/src/pages/user/attr.vue +++ b/Web/src/pages/user/attr.vue @@ -46,7 +46,8 @@ const BindData = async () => { if (result.code == 0) { data.value = result.data.data; unitExp.value = result.data.unitExp; - dupExp.value = result.data.dupExp; + dupExp.value = result.data.dupExp; + console.log(result); } else { MessageExtend.ShowDialog("特性", result.msg);