From 00c2758df202d2f52a2d6fc87871b3bb6488db93 Mon Sep 17 00:00:00 2001 From: Putoo <290555932@qq.com> Date: Thu, 16 Jul 2026 17:52:33 +0800 Subject: [PATCH] 121212 --- .../game/game/game_magic.cs | 39 +++++ .../game/user/unit_user_maxname.cs | 6 +- .../Application.Domain.Entity/model/NpcBus.cs | 1 + .../model/RankAwardModel.cs | 8 + .../resource/game/game_cdk.cs | 51 +++++++ .../resource/game/game_cdk_item.cs | 33 +++++ .../resource/game/game_maxname.cs | 6 +- .../BusEvents/BusEventsEnum.cs | 1 + .../BusEvents/BusEventsSubscriber.cs | 6 + .../Application.Domain/Config/GameConfig.cs | 2 + Service/Application.Domain/Enum/GameEnum.cs | 3 + Service/Application.Domain/Enum/MapEnum.cs | 10 +- .../Interface/Business/IGameCdkService.cs | 14 ++ .../Interface/Business/IGameMagicService.cs | 9 ++ .../Services/Interface/Map/IGameMapService.cs | 4 +- .../Services/Interface/Pub/IGameDicService.cs | 1 + .../Interface/Pub/IGameMaxNameService.cs | 10 ++ .../Services/Interface/Pub/IMessageService.cs | 2 +- .../Service/Business/GameCdkService.cs | 36 +++++ .../Service/Business/GameMagicService.cs | 138 ++++++++++++++++++ .../Service/Fight/GameFightService.cs | 15 +- .../Services/Service/Map/GameMapService.cs | 32 +++- .../Services/Service/Pub/GameDicService.cs | 10 ++ .../Service/Pub/GameMaxNameService.cs | 126 +++++++++++++--- .../Services/Service/Pub/MessageService.cs | 6 +- .../Service/User/UnitUserAttrService.cs | 10 ++ .../Application.Domain/Tool/Base/GameBus.cs | 5 + .../Application.Web/Application.Web.csproj | 3 + .../Business/Job/GameAutoJobService.cs | 6 + .../Controllers/Login/LoginController.cs | 4 +- .../Controllers/Map/MapBusController.cs | 49 +++++-- .../Controllers/Map/MapController.cs | 71 ++++++++- .../Controllers/Pub/CdkController.cs | 88 +++++++++++ .../Controllers/Pub/RecoverController.cs | 1 + .../Application.Web/applicationsettings.txt | 43 ++++++ Web/src/config/BaseConfig.ts | 8 +- Web/src/pages/business/cdk.vue | 51 +++++++ Web/src/pages/map/npc/index.vue | 23 ++- Web/src/pages/user/friend/index.vue | 2 +- Web/src/pages/user/maxname/index.vue | 13 +- Web/src/pages/user/{friend => }/search.vue | 6 +- Web/src/services/Index/CdkService.ts | 9 ++ Web/src/services/map/MapService.ts | 8 + 43 files changed, 897 insertions(+), 72 deletions(-) create mode 100644 Service/Application.Domain.Entity/game/game/game_magic.cs create mode 100644 Service/Application.Domain.Entity/model/RankAwardModel.cs create mode 100644 Service/Application.Domain.Entity/resource/game/game_cdk.cs create mode 100644 Service/Application.Domain.Entity/resource/game/game_cdk_item.cs create mode 100644 Service/Application.Domain/Services/Interface/Business/IGameCdkService.cs create mode 100644 Service/Application.Domain/Services/Interface/Business/IGameMagicService.cs create mode 100644 Service/Application.Domain/Services/Service/Business/GameCdkService.cs create mode 100644 Service/Application.Domain/Services/Service/Business/GameMagicService.cs create mode 100644 Service/Application.Web/Controllers/Pub/CdkController.cs create mode 100644 Service/Application.Web/applicationsettings.txt create mode 100644 Web/src/pages/business/cdk.vue rename Web/src/pages/user/{friend => }/search.vue (84%) create mode 100644 Web/src/services/Index/CdkService.ts diff --git a/Service/Application.Domain.Entity/game/game/game_magic.cs b/Service/Application.Domain.Entity/game/game/game_magic.cs new file mode 100644 index 0000000..21d8698 --- /dev/null +++ b/Service/Application.Domain.Entity/game/game/game_magic.cs @@ -0,0 +1,39 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Game")] + public class game_magic + { + /// + /// userId + /// + [SugarColumn(IsPrimaryKey = true, Length = 50)] + public string userId { get; set; } + + /// + /// areaId + /// + [SugarColumn(IsNullable = true)] + public int? areaId { get; set; } + + /// + /// time + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? time { get; set; } + + /// + /// isWin + /// + [SugarColumn(IsNullable = true)] + public int? isWin { get; set; } + + /// + /// uptime + /// + [SugarColumn(IsNullable = true)] + public long? uptime { get; set; } + } +} \ No newline at end of file diff --git a/Service/Application.Domain.Entity/game/user/unit_user_maxname.cs b/Service/Application.Domain.Entity/game/user/unit_user_maxname.cs index 9c53c06..20a4b5e 100644 --- a/Service/Application.Domain.Entity/game/user/unit_user_maxname.cs +++ b/Service/Application.Domain.Entity/game/user/unit_user_maxname.cs @@ -39,8 +39,8 @@ namespace Application.Domain.Entity /// /// attr /// - [SugarColumn(Length = 1000, IsNullable = true)] - public string attr { get; set; } + [SugarColumn(IsNullable = true, IsJson = true)] + public List attr { get; set; } /// /// count @@ -66,4 +66,4 @@ namespace Application.Domain.Entity [SugarColumn(IsNullable = true)] public int? show { get; set; } } -} +} \ No newline at end of file diff --git a/Service/Application.Domain.Entity/model/NpcBus.cs b/Service/Application.Domain.Entity/model/NpcBus.cs index c832149..7d3233d 100644 --- a/Service/Application.Domain.Entity/model/NpcBus.cs +++ b/Service/Application.Domain.Entity/model/NpcBus.cs @@ -5,4 +5,5 @@ public class NpcBus public string code { get; set; } public string name { get; set; } public string url { get; set; } + public string parms { get; set; } } \ No newline at end of file diff --git a/Service/Application.Domain.Entity/model/RankAwardModel.cs b/Service/Application.Domain.Entity/model/RankAwardModel.cs new file mode 100644 index 0000000..85d8284 --- /dev/null +++ b/Service/Application.Domain.Entity/model/RankAwardModel.cs @@ -0,0 +1,8 @@ +namespace Application.Domain.Entity; + +public class RankAwardModel +{ + public int min { get; set; } + public int max { get; set; } + public List award { get; set; } +} \ No newline at end of file diff --git a/Service/Application.Domain.Entity/resource/game/game_cdk.cs b/Service/Application.Domain.Entity/resource/game/game_cdk.cs new file mode 100644 index 0000000..fe5298b --- /dev/null +++ b/Service/Application.Domain.Entity/resource/game/game_cdk.cs @@ -0,0 +1,51 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Resource")] + public class game_cdk + { + /// + /// cdkId + /// + [SugarColumn(IsPrimaryKey = true)] + public int cdkId { get; set; } + + /// + /// area + /// + [SugarColumn(IsNullable = true)] + public int? area { get; set; } + + /// + /// cdkName + /// + [SugarColumn(Length = 255, IsNullable = true)] + public string? cdkName { get; set; } + + /// + /// award + /// + [SugarColumn(IsNullable = true,IsJson = true)] + public List award { get; set; } + + /// + /// limit + /// + [SugarColumn(IsNullable = true)] + public int? limit { get; set; } + + /// + /// addTime + /// + [SugarColumn(IsNullable = true)] + public DateTime? addTime { get; set; } + + /// + /// endTime + /// + [SugarColumn(IsNullable = true)] + public DateTime? endTime { get; set; } + } +} \ No newline at end of file diff --git a/Service/Application.Domain.Entity/resource/game/game_cdk_item.cs b/Service/Application.Domain.Entity/resource/game/game_cdk_item.cs new file mode 100644 index 0000000..1f61c6b --- /dev/null +++ b/Service/Application.Domain.Entity/resource/game/game_cdk_item.cs @@ -0,0 +1,33 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Resource")] + public class game_cdk_item + { + /// + /// ciId + /// + [SugarColumn(IsPrimaryKey = true, Length = 50)] + public string ciId { get; set; } + + /// + /// cdkId + /// + [SugarColumn(IsNullable = true)] + public int? cdkId { get; set; } + + /// + /// userId + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? userId { get; set; } + + /// + /// upTime + /// + [SugarColumn(IsNullable = true)] + public DateTime? upTime { get; set; } + } +} \ No newline at end of file diff --git a/Service/Application.Domain.Entity/resource/game/game_maxname.cs b/Service/Application.Domain.Entity/resource/game/game_maxname.cs index c140d41..4d28d80 100644 --- a/Service/Application.Domain.Entity/resource/game/game_maxname.cs +++ b/Service/Application.Domain.Entity/resource/game/game_maxname.cs @@ -27,8 +27,8 @@ namespace Application.Domain.Entity /// /// attr /// - [SugarColumn(Length = 1000, IsNullable = true)] - public string attr { get; set; } + [SugarColumn(IsNullable = true, IsJson = true)] + public List attr { get; set; } /// /// remark @@ -36,4 +36,4 @@ namespace Application.Domain.Entity [SugarColumn(IsNullable = true)] public string remark { get; set; } } -} +} \ No newline at end of file diff --git a/Service/Application.Domain/BusEvents/BusEventsEnum.cs b/Service/Application.Domain/BusEvents/BusEventsEnum.cs index f282d80..24cbd98 100644 --- a/Service/Application.Domain/BusEvents/BusEventsEnum.cs +++ b/Service/Application.Domain/BusEvents/BusEventsEnum.cs @@ -22,6 +22,7 @@ namespace Application.Domain HandelTaskUser,//处理角色任务 HandleClearChat,//清理频道信息 HandleMessageData,//处理消息类 + HandleMagicData,//处理魔城争霸赛 } } diff --git a/Service/Application.Domain/BusEvents/BusEventsSubscriber.cs b/Service/Application.Domain/BusEvents/BusEventsSubscriber.cs index 0acabb1..d676d24 100644 --- a/Service/Application.Domain/BusEvents/BusEventsSubscriber.cs +++ b/Service/Application.Domain/BusEvents/BusEventsSubscriber.cs @@ -122,5 +122,11 @@ var messageService = App.GetService(); await messageService.HandleMessageData(); } + [EventSubscribe(BusEventsEnum.BusEventsName.HandleMagicData, NumRetries = 0,RetryTimeout = 999999999)] + public async Task HandleMagicData(EventHandlerExecutingContext context) + { + var magicService = App.GetService(); + await magicService.HandleMagicData(); + } } } \ No newline at end of file diff --git a/Service/Application.Domain/Config/GameConfig.cs b/Service/Application.Domain/Config/GameConfig.cs index a343937..505b75c 100644 --- a/Service/Application.Domain/Config/GameConfig.cs +++ b/Service/Application.Domain/Config/GameConfig.cs @@ -20,4 +20,6 @@ public static class GameConfig public const int GameEquApprGoods = 10019;//鉴定装备道具 public const int GameGetTaskGoods =10034 ;//引路蜂 public const int GameRetTaskGoods =10033 ;//领路蝶 + public const string GameMagicMapId = "257_18";//魔城地图ID + public const string GameMagicInMapId = "260_15";//魔城进入地图ID } \ No newline at end of file diff --git a/Service/Application.Domain/Enum/GameEnum.cs b/Service/Application.Domain/Enum/GameEnum.cs index a887bda..33562fe 100644 --- a/Service/Application.Domain/Enum/GameEnum.cs +++ b/Service/Application.Domain/Enum/GameEnum.cs @@ -19,6 +19,7 @@ public static class GameEnum UpdateTaskUser,//更新角色任务 ClearChat,//清理频道信息 ClearMessage,//清理个人消息信息 + UpdateMagicData,//处理魔城数据 } public enum PropCode//游戏资源编码 { @@ -84,6 +85,8 @@ public static class GameEnum { Awaken,//觉醒配置 Quality,//洗练配置 + MagicAward,//魔城奖励 + } public enum ComputeType { diff --git a/Service/Application.Domain/Enum/MapEnum.cs b/Service/Application.Domain/Enum/MapEnum.cs index ee43287..80dc2c3 100644 --- a/Service/Application.Domain/Enum/MapEnum.cs +++ b/Service/Application.Domain/Enum/MapEnum.cs @@ -14,14 +14,18 @@ public class MapEnum public enum MapCode { DEF_MAP, - Dup_Map + Dup_Map, + Magic_Map, } public enum NpcCode { Default, Task, - Dup_In, - Dup_Exit + Event, + } + public enum NpcEventCode + { + Magic_Event, } } \ No newline at end of file diff --git a/Service/Application.Domain/Services/Interface/Business/IGameCdkService.cs b/Service/Application.Domain/Services/Interface/Business/IGameCdkService.cs new file mode 100644 index 0000000..6f9c387 --- /dev/null +++ b/Service/Application.Domain/Services/Interface/Business/IGameCdkService.cs @@ -0,0 +1,14 @@ +namespace Application.Domain; + +public interface IGameCdkService +{ + Task GetCdkInfo(int cdkId); + + Task GetCdkItemInfo(string cdk); + + Task UpdateCdkUser(string cdk, string userId); + + Task GetUserCdkCount(int cdkId, string userId); + + Task AddCdkItem(List data); +} \ No newline at end of file diff --git a/Service/Application.Domain/Services/Interface/Business/IGameMagicService.cs b/Service/Application.Domain/Services/Interface/Business/IGameMagicService.cs new file mode 100644 index 0000000..138800c --- /dev/null +++ b/Service/Application.Domain/Services/Interface/Business/IGameMagicService.cs @@ -0,0 +1,9 @@ +namespace Application.Domain; + +public interface IGameMagicService +{ + Task UpdateUserMagicTime(string userId,int areaId); + Task UpdateUserMagicEndTime(string userId, bool isWin); + Task CheckInMagic(string userId); + Task HandleMagicData(); +} \ No newline at end of file diff --git a/Service/Application.Domain/Services/Interface/Map/IGameMapService.cs b/Service/Application.Domain/Services/Interface/Map/IGameMapService.cs index 563aeab..2d1192b 100644 --- a/Service/Application.Domain/Services/Interface/Map/IGameMapService.cs +++ b/Service/Application.Domain/Services/Interface/Map/IGameMapService.cs @@ -21,7 +21,7 @@ public interface IGameMapService Task GetUserOnMapId(string userId); Task GetUserOnToMapInfo(string userId); Task GetUserOnMap(string userId); - Task UpdateUserOnMap(string userId); + Task UpdateUserOnMap(string userId, string mapId = ""); Task UpdateUserOnMap(string userId, string ip, string mapId); Task UpdateUserOnMap(unit_user_online data, string mapId); Task GetUserOnMapInfo(string userId); @@ -34,6 +34,8 @@ public interface IGameMapService #region 其他相关 + Task> GetMapUserByAll(string mapId, int area, int showArea, List noUser); + Task> GetMapUser(string mapId, int area, int showArea, List noUser); Task> GetMapUser(string mapId, int area, int showArea, List noUser, int take); Task> GetMapUser(string mapId, int area, int showArea, List noUser, int page, diff --git a/Service/Application.Domain/Services/Interface/Pub/IGameDicService.cs b/Service/Application.Domain/Services/Interface/Pub/IGameDicService.cs index f7f34d3..5128d64 100644 --- a/Service/Application.Domain/Services/Interface/Pub/IGameDicService.cs +++ b/Service/Application.Domain/Services/Interface/Pub/IGameDicService.cs @@ -3,4 +3,5 @@ public interface IGameDicService { Task GetDicInfo(string code); + Task GetDicInfoContent(string code); } \ No newline at end of file diff --git a/Service/Application.Domain/Services/Interface/Pub/IGameMaxNameService.cs b/Service/Application.Domain/Services/Interface/Pub/IGameMaxNameService.cs index beec1a4..0b02119 100644 --- a/Service/Application.Domain/Services/Interface/Pub/IGameMaxNameService.cs +++ b/Service/Application.Domain/Services/Interface/Pub/IGameMaxNameService.cs @@ -2,9 +2,19 @@ public interface IGameMaxNameService { + #region 资源 + + Task GetMaxNameInfo(string mnId); + + #endregion + #region unit_user_maxname + + Task AddMaxName(string userId, string mnId, int addCount); Task UpdateUserMaxname(unit_user_maxname name); Task GetUserMaxnameInfo(string umnId); Task> GetUserMaxnameList(string userId, int page, int limit, RefAsync total); + Task> GetUserMaxNameData(string userId); + #endregion } \ No newline at end of file diff --git a/Service/Application.Domain/Services/Interface/Pub/IMessageService.cs b/Service/Application.Domain/Services/Interface/Pub/IMessageService.cs index 02223d3..e161418 100644 --- a/Service/Application.Domain/Services/Interface/Pub/IMessageService.cs +++ b/Service/Application.Domain/Services/Interface/Pub/IMessageService.cs @@ -50,7 +50,7 @@ public interface IMessageService #region 广播消息 Task> GetBroadcastData(int area); - Task SendBroadcast(string userId, string code, string msg); + Task SendBroadcast(string userId, string code, string msg, int area = 0); #endregion diff --git a/Service/Application.Domain/Services/Service/Business/GameCdkService.cs b/Service/Application.Domain/Services/Service/Business/GameCdkService.cs new file mode 100644 index 0000000..b062004 --- /dev/null +++ b/Service/Application.Domain/Services/Service/Business/GameCdkService.cs @@ -0,0 +1,36 @@ +namespace Application.Domain; + +public class GameCdkService(ISqlSugarClient DbClient, IRedisCache redis) : IGameCdkService, ITransient +{ + public async Task GetCdkInfo(int cdkId) + { + var db = DbClient.AsTenant().GetConnectionWithAttr(); + return await db.Queryable().Where(it => it.cdkId == cdkId).SingleAsync(); + } + + public async Task GetCdkItemInfo(string cdk) + { + var db = DbClient.AsTenant().GetConnectionWithAttr(); + return await db.Queryable().Where(it => it.ciId == cdk).SingleAsync(); + } + + public async Task UpdateCdkUser(string cdk, string userId) + { + var db = DbClient.AsTenant().GetConnectionWithAttr(); + return await db.Updateable().SetColumns(it => it.userId == userId) + .SetColumns(it => it.upTime == DateTime.Now) + .Where(it => it.ciId == cdk).ExecuteCommandAsync() > 0; + } + + public async Task GetUserCdkCount(int cdkId, string userId) + { + var db = DbClient.AsTenant().GetConnectionWithAttr(); + return await db.Queryable().Where(it => it.cdkId == cdkId && it.userId == userId).CountAsync(); + } + + public async Task AddCdkItem(List data) + { + var db = DbClient.AsTenant().GetConnectionWithAttr(); + return await db.Insertable(data).ExecuteCommandAsync() > 0; + } +} \ No newline at end of file diff --git a/Service/Application.Domain/Services/Service/Business/GameMagicService.cs b/Service/Application.Domain/Services/Service/Business/GameMagicService.cs new file mode 100644 index 0000000..b5e7200 --- /dev/null +++ b/Service/Application.Domain/Services/Service/Business/GameMagicService.cs @@ -0,0 +1,138 @@ +using Newtonsoft.Json; + +namespace Application.Domain; + +public class GameMagicService(ISqlSugarClient DbClient, IRedisCache redis) : IGameMagicService, ITransient +{ + public async Task UpdateUserMagicTime(string userId, int areaId) + { + string time = TimeAssist.GetDateTimeYMDString(0); + long upTime = TimeExtend.GetTimeStampMilliseconds; + game_magic data = new game_magic() + { + userId = userId, + areaId = areaId, + time = time, + isWin = 0, + uptime = upTime + }; + var db = DbClient.AsTenant().GetConnectionWithAttr(); + await db.Storageable(data).ExecuteCommandAsync(); + } + + public async Task UpdateUserMagicEndTime(string userId, bool isWin) + { + long upTime = TimeExtend.GetTimeStampMilliseconds; + if (isWin) + { + upTime = TimeExtend.GetTimeStampByMilliseconds(TimeAssist.GetDateTimeYMD(7)); + } + + var db = DbClient.AsTenant().GetConnectionWithAttr(); + await db.Updateable().SetColumns(it => it.uptime == upTime) + .SetColumns(it => it.isWin == (isWin ? 1 : 0)) + .Where(it => it.userId == userId) + .ExecuteCommandAsync(); + } + + public async Task CheckInMagic(string userId) + { + var db = DbClient.AsTenant().GetConnectionWithAttr(); + var myInfo = await db.Queryable().Where(it => it.userId == userId).SingleAsync(); + if (myInfo == null) + { + return true; + } + + if (myInfo.isWin == 0) + { + return true; + } + + long time = TimeExtend.GetTimeStampMilliseconds; + if (myInfo.uptime < time) + { + return true; + } + + return false; + } + + public async Task HandleMagicData() + { + List magicAward = new List(); + var mapService = App.GetService(); + var userService = App.GetService(); + var areaService = App.GetService(); + var dicService = App.GetService(); + var messageService = App.GetService(); + + + string time = TimeAssist.GetDateTimeYMDString(0); + + var dicData = await dicService.GetDicInfoContent(nameof(GameEnum.DicCode.MagicAward)); + if (!string.IsNullOrEmpty(dicData)) + { + magicAward = JsonConvert.DeserializeObject>(dicData); + } + + var areaData = await areaService.GetAreaData(); + foreach (var area in areaData) + { + //清退处理 + var users = await mapService.GetMapUserByAll(GameConfig.GameMagicMapId, area.areaId, 1, []); + if (users.Count > 0) + { + for (int i = 1; i <= users.Count; i++) + { + string userId = users[i - 1].userId; + bool isWin = false; + if (i == users.Count) + { + isWin = true; + } + + await UpdateUserMagicEndTime(userId, isWin); + await mapService.UpdateUserOnMap(userId, GameConfig.GameMagicInMapId); + } + } + + //发放奖励 + if (magicAward.Count > 0) + { + var db = DbClient.AsTenant().GetConnectionWithAttr(); + var userData = await db.Queryable().Where(it => it.areaId == area.areaId && it.time == time) + .OrderByDescending(it => it + .isWin).OrderByDescending(it => it.uptime).ToListAsync(); + if (userData.Any(it => it.isWin == 1)) + { + string msg = "魔城争霸赛已结束,前三名分别是:"; + int rank = 1; + foreach (var user in userData) + { + var onAward = magicAward.Find(it => it.min <= rank && it.max >= rank); + if (onAward != null) + { + string mailContent = $"恭喜您获得魔城争霸赛第【{rank}】名奖励,再接再厉噢!"; + await messageService.SendMaill(user.userId, "魔城争霸赛奖励发放通知", mailContent, onAward.award); + if (rank <= 3) + { + var userInfo = await userService.GetUserInfoByUserId(user.userId); + msg += $"{UbbTool.HomeUbb(userInfo.userNo, userInfo.nick)}、"; + } + + rank++; + } + else + { + break; + } + } + + msg = msg.TrimEnd('、'); + await messageService.SendBroadcast("0", nameof(MessageEnum.BroadcastCode.System), msg, area.areaId); + } + } + } + } +} \ No newline at end of file diff --git a/Service/Application.Domain/Services/Service/Fight/GameFightService.cs b/Service/Application.Domain/Services/Service/Fight/GameFightService.cs index 1424e1a..a5aeb80 100644 --- a/Service/Application.Domain/Services/Service/Fight/GameFightService.cs +++ b/Service/Application.Domain/Services/Service/Fight/GameFightService.cs @@ -233,9 +233,10 @@ public class GameFightService(ISqlSugarClient DbClient, IRedisCache redis) : IGa { await UserStateTool.SetUserMapDefault(lowUser); } + //战败后,结束挂机 var hookService = App.GetService(); - await hookService.StopOnHook(lowUser); + await hookService.StopOnHook(lowUser); fightData.state = 1; fightData.winCode = nameof(UserEnum.AttrCode.Person); @@ -427,7 +428,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 && fightData.userId == winUser) + if (mapInfo.isPk == 1 && fightData.userId == winUser && fightData.scene == nameof(MapEnum.MapCode.DEF_MAP)) { var relationService = App.GetService(); if (await relationService.CheckUserEnemy(winUser, lowUser) == false) @@ -436,6 +437,16 @@ public class GameFightService(ISqlSugarClient DbClient, IRedisCache redis) : IGa await accService.UpdateUserData(winUser, 1, nameof(AccEnum.AccType.enemy), 5, "击杀玩家"); //加罪恶 } } + + #region 场景处理 + + if (fightData.scene == nameof(MapEnum.MapCode.Magic_Map)) //魔城 + { + var magicService = App.GetService(); + await magicService.UpdateUserMagicEndTime(lowUser, false); + } + + #endregion } #endregion diff --git a/Service/Application.Domain/Services/Service/Map/GameMapService.cs b/Service/Application.Domain/Services/Service/Map/GameMapService.cs index cd7acfa..1b85f2f 100644 --- a/Service/Application.Domain/Services/Service/Map/GameMapService.cs +++ b/Service/Application.Domain/Services/Service/Map/GameMapService.cs @@ -140,7 +140,7 @@ public class GameMapService(ISqlSugarClient DbClient, IRedisCache redis) : IGame }; if (item.code == nameof(MapEnum.NpcCode.Task)) { - var task = await taskService.GetTaskDataByNpc(userId,item.npcId); + var task = await taskService.GetTaskDataByNpc(userId, item.npcId); if (task.Count > 0) { temp.state = task.Any(it => it.state == 0) ? 1 : 2; @@ -218,9 +218,14 @@ public class GameMapService(ISqlSugarClient DbClient, IRedisCache redis) : IGame }; } - public async Task UpdateUserOnMap(string userId) + public async Task UpdateUserOnMap(string userId, string mapId = "") { unit_user_online onLine = await GetUserOnMap(userId); + if (!string.IsNullOrEmpty(mapId)) + { + onLine.mapId = mapId; + } + onLine.upTime = TimeExtend.GetTimeStampSeconds; string key = string.Format(UserCache.BaseCacheKey, "UserOnline"); if (await redis.AddHashAsync(key, userId, onLine)) @@ -400,7 +405,28 @@ public class GameMapService(ISqlSugarClient DbClient, IRedisCache redis) : IGame #region 其他相关 - private async Task> GetMapUser(string mapId, int area, int showArea, List noUser) + public async Task> GetMapUserByAll(string mapId, int area, int showArea, List noUser) + { + var db = DbClient.AsTenant().GetConnectionWithAttr(); + var data = await db.Queryable().Where(it => it.mapId == mapId) + .WhereIF(noUser.Count > 0, it => !noUser.Contains(it.userId)) + .OrderByDescending(it => it.upTime) + .ToListAsync(); + + List result = new List(); + data.ForEach(async it => + { + var temp = await UserModelTool.GetUserView(it.userId); + bool isAdd = showArea == 1 && area != temp.area ? false : true; + if (isAdd) + { + result.Add(temp); + } + }); + return result; + } + + public async Task> GetMapUser(string mapId, int area, int showArea, List noUser) { var db = DbClient.AsTenant().GetConnectionWithAttr(); long time = TimeExtend.GetTimeStampBySeconds(DateTime.Now.AddMinutes(0 - GameConfig.OnLineTime)); diff --git a/Service/Application.Domain/Services/Service/Pub/GameDicService.cs b/Service/Application.Domain/Services/Service/Pub/GameDicService.cs index 91d74a5..40334b5 100644 --- a/Service/Application.Domain/Services/Service/Pub/GameDicService.cs +++ b/Service/Application.Domain/Services/Service/Pub/GameDicService.cs @@ -15,5 +15,15 @@ public class GameDicService(ISqlSugarClient DbClient, IRedisCache redis) : IGame await redis.AddHashAsync(key, code, data); return data; } + public async Task GetDicInfoContent(string code) + { + string result = string.Empty; + var data = await GetDicInfo(code); + if (data != null) + { + result = data.sign; + } + return result; + } } \ No newline at end of file diff --git a/Service/Application.Domain/Services/Service/Pub/GameMaxNameService.cs b/Service/Application.Domain/Services/Service/Pub/GameMaxNameService.cs index 770c29d..8a2572a 100644 --- a/Service/Application.Domain/Services/Service/Pub/GameMaxNameService.cs +++ b/Service/Application.Domain/Services/Service/Pub/GameMaxNameService.cs @@ -2,39 +2,127 @@ public class GameMaxNameService(ISqlSugarClient DbClient, IRedisCache redis) : IGameMaxNameService, ITransient { + #region 资源 + + public async Task GetMaxNameInfo(string mnId) + { + string key = string.Format(BaseCache.BaseCacheKey, "GameMaxName"); + if (await redis.HExistsHashAsync(key, mnId)) + { + return await redis.GetHashAsync(key, mnId); + } + + var db = DbClient.AsTenant().GetConnectionWithAttr(); + var data = await db.Queryable().Where(i => i.mnId == mnId).SingleAsync(); + if (data != null) + { + await redis.AddHashAsync(key, mnId, data); + } + + return data; + } + + #endregion #region unit_user_maxname + + public async Task AddMaxName(string userId, string mnId, int addCount) + { + var db = DbClient.AsTenant().GetConnectionWithAttr(); + bool isok = false; + string umnId = $"{userId}_{mnId}"; + var data = await GetUserMaxnameInfo(umnId); + if (data == null) + { + var mnInfo = await GetMaxNameInfo(mnId); + if (mnInfo != null) + { + unit_user_maxname mu = new unit_user_maxname(); + mu.umnId = umnId; + mu.userId = userId; + mu.mnId = mnId; + mu.name = mnInfo.name; + mu.img = mnInfo.img; + mu.attr = mnInfo.attr; + mu.count = 1; + mu.addTime = DateTime.Now; + mu.endTime = DateTime.Now.AddDays(addCount); + mu.show = 0; + isok = db.Insertable(mu).ExecuteCommand() > 0; + } + } + else + { + data.count = data.count + 1; + if (data.endTime > DateTime.Now) + { + data.endTime = Convert.ToDateTime(data.endTime).AddDays(addCount); + } + else + { + data.show = 0; + data.endTime = DateTime.Now.AddDays(addCount); + } + + isok = db.Updateable(data).IgnoreColumns(true, true).Where(i => i.umnId == data.umnId).ExecuteCommand() > 0; + } + + if (isok) + { + await ClearUserMaxNameCache(userId); + } + + return isok; + } + public async Task UpdateUserMaxname(unit_user_maxname name) { var db = DbClient.AsTenant().GetConnectionWithAttr(); bool isok = await db.Updateable(name).ExecuteCommandAsync() > 0; - if (isok) - { - string key = string.Format(BaseCache.BaseCacheKeys, "UserMaxname", "MaxnameInfo"); - await redis.DelHashAsync(key, name.umnId); - } + return isok; } + public async Task GetUserMaxnameInfo(string umnId) { - string key = string.Format(BaseCache.BaseCacheKeys, "UserMaxname", "MaxnameInfo"); - var data = await redis.GetHashAsync(key, umnId); - if (data == null) - { - var db = DbClient.AsTenant().GetConnectionWithAttr(); - data = await db.Queryable().Where(i => i.umnId == umnId).SingleAsync(); - if (data != null) - { - await redis.AddHashAsync(key, umnId, data); - } - } - return data; + var db = DbClient.AsTenant().GetConnectionWithAttr(); + return await db.Queryable().Where(i => i.umnId == umnId).SingleAsync(); } - public async Task> GetUserMaxnameList(string userId, int page, int limit, RefAsync total) + + public async Task> GetUserMaxnameList(string userId, int page, int limit, + RefAsync total) { var db = DbClient.AsTenant().GetConnectionWithAttr(); return await db.Queryable().Where(i => i.userId == userId).OrderBy(i => i.addTime) .ToPageListAsync(page, limit, total); } - #endregion + + public async Task> GetUserMaxNameData(string userId) + { + string key = string.Format(UserCache.BaseCacheKey, "UserMaxName"); + List data = new List(); + if (await redis.HExistsHashAsync(key, userId)) + { + data = await redis.GetHashAsync>(key, userId); + } + else + { + var db = DbClient.AsTenant().GetConnectionWithAttr(); + data = await db.Queryable().Where(i => i.userId == userId).ToListAsync(); + if (data == null) + { + data = new List(); + } + await redis.AddHashAsync(key, userId, data); + } + return data.FindAll(it=>it.endTime > DateTime.Now); + } + + private async Task ClearUserMaxNameCache(string userId) + { + string key = string.Format(UserCache.BaseCacheKey, "UserMaxName"); + await redis.DelHashAsync(key,userId); + } + + #endregion } \ No newline at end of file diff --git a/Service/Application.Domain/Services/Service/Pub/MessageService.cs b/Service/Application.Domain/Services/Service/Pub/MessageService.cs index c1f8a90..7c15a89 100644 --- a/Service/Application.Domain/Services/Service/Pub/MessageService.cs +++ b/Service/Application.Domain/Services/Service/Pub/MessageService.cs @@ -404,17 +404,16 @@ public class MessageService(ISqlSugarClient DbClient, IRedisCache redis) : IMess return data; } - public async Task SendBroadcast(string userId, string code, string msg) + public async Task SendBroadcast(string userId, string code, string msg, int area = 0) { game_broadcast add = new game_broadcast(); add.Id = StringAssist.NewGuid; add.userId = userId; add.code = code; add.msg = msg; - int area = 0; if (add.userId == "0") { - add.area = 0; + add.area = area; add.userNo = "0"; add.nick = "海精灵"; } @@ -425,7 +424,6 @@ public class MessageService(ISqlSugarClient DbClient, IRedisCache redis) : IMess add.area = (int)userInfo.areaId; add.userNo = userInfo.userNo; add.nick = userInfo.nick; - area = add.area; } add.endTime = TimeExtend.GetTimeStampSeconds + 300; diff --git a/Service/Application.Domain/Services/Service/User/UnitUserAttrService.cs b/Service/Application.Domain/Services/Service/User/UnitUserAttrService.cs index d0d9653..ee39098 100644 --- a/Service/Application.Domain/Services/Service/User/UnitUserAttrService.cs +++ b/Service/Application.Domain/Services/Service/User/UnitUserAttrService.cs @@ -83,6 +83,16 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) : #endregion + #region 称号加层 + var maxNameService = App.GetService(); + var userMaxName = await maxNameService.GetUserMaxNameData(userId); + foreach (var maxName in userMaxName) + { + ExtendAttrData.AddRange(maxName.attr); + } + #endregion + + #region Buff加层 diff --git a/Service/Application.Domain/Tool/Base/GameBus.cs b/Service/Application.Domain/Tool/Base/GameBus.cs index f24f49d..a41b76c 100644 --- a/Service/Application.Domain/Tool/Base/GameBus.cs +++ b/Service/Application.Domain/Tool/Base/GameBus.cs @@ -74,6 +74,11 @@ public static class GameBus var skillService = App.GetService(); isok = await skillService.UpdateUserSkill(userId, Convert.ToInt32(parameter)); } + else if (goodsType.Equals(nameof(GameEnum.PropCode.maxName))) + { + var maxNameService = App.GetService(); + isok = await maxNameService.AddMaxName(userId, parameter, Convert.ToInt32(count)); + } return isok; } diff --git a/Service/Application.Web/Application.Web.csproj b/Service/Application.Web/Application.Web.csproj index 28bbe2e..a192538 100644 --- a/Service/Application.Web/Application.Web.csproj +++ b/Service/Application.Web/Application.Web.csproj @@ -19,6 +19,9 @@ Always + + Always + diff --git a/Service/Application.Web/Business/Job/GameAutoJobService.cs b/Service/Application.Web/Business/Job/GameAutoJobService.cs index 5cf0f7d..a117d62 100644 --- a/Service/Application.Web/Business/Job/GameAutoJobService.cs +++ b/Service/Application.Web/Business/Job/GameAutoJobService.cs @@ -117,5 +117,11 @@ public class GameAutoJobService(ISqlSugarClient DbClient, IRedisCache redis, ITi await _eventPublisher.PublishAsync(new ChannelEventSource(BusEventsEnum.BusEventsName.HandleMessageData, data)); } + else if (data.code == nameof(GameEnum.JobCode.UpdateMagicData)) //处理魔城数据 + { + var _eventPublisher = App.GetService(); + await _eventPublisher.PublishAsync(new ChannelEventSource(BusEventsEnum.BusEventsName.HandleMagicData, + data)); + } } } \ No newline at end of file diff --git a/Service/Application.Web/Controllers/Login/LoginController.cs b/Service/Application.Web/Controllers/Login/LoginController.cs index bf488ab..944f01a 100644 --- a/Service/Application.Web/Controllers/Login/LoginController.cs +++ b/Service/Application.Web/Controllers/Login/LoginController.cs @@ -52,8 +52,8 @@ namespace Application.Web.Controllers.Login [HttpGet] public async Task HandleError() { - var attrService = App.GetService(); - var model = await attrService.GetUserAttrModel("32cd4777-e523-4cf9-b8f1-de13235f6170"); + var magicService = App.GetService(); + await magicService.HandleMagicData(); return "1"; diff --git a/Service/Application.Web/Controllers/Map/MapBusController.cs b/Service/Application.Web/Controllers/Map/MapBusController.cs index fead8a2..a6449ab 100644 --- a/Service/Application.Web/Controllers/Map/MapBusController.cs +++ b/Service/Application.Web/Controllers/Map/MapBusController.cs @@ -11,10 +11,13 @@ public class MapBusController : ControllerBase { private readonly IGameMapService _mapService; private readonly IMessageService _messageService; - public MapBusController(IGameMapService mapService,IMessageService messageService) + private readonly IGameMagicService _magicService; + + public MapBusController(IGameMapService mapService, IMessageService messageService, IGameMagicService magicService) { _mapService = mapService; _messageService = messageService; + _magicService = magicService; } /// @@ -52,6 +55,7 @@ public class MapBusController : ControllerBase public async Task MapBusTo(int id, int num) { string userId = StateHelper.userId; + int areaId = StateHelper.areaId; var busData = await _mapService.GetMapBusInfo(id); if (busData == null) { @@ -63,39 +67,59 @@ public class MapBusController : ControllerBase return PoAction.Message("业务不存在!"); } - var toData = JsonConvert.DeserializeObject >(busData.busContent); + var toData = JsonConvert.DeserializeObject>(busData.busContent); if (num > (toData.Count - 1)) { return PoAction.Message("业务不存在!"); } + var onMap = await _mapService.GetUserOnMapId(userId); if (busData.busCode != onMap) { return PoAction.Message("业务不存在!"); } + var mapToData = toData[num]; if (TimeAssist.GetHourNum < mapToData.sTime || TimeAssist.GetHourNum > mapToData.eTime) { return PoAction.Message($"当前时间不允许进入"); } - + + #region 验证机制 + + if (mapToData.code == nameof(MapEnum.MapCode.Magic_Map)) //魔城场景,验证否否进入过 + { + if (await _magicService.CheckInMagic(userId) == false) + { + return PoAction.Message($"您的魔城记录冷却中,冷却时间为7天!"); + } + } + + #endregion + + var checkResult = await GameBus.CheckNeed(userId, busData.busNeed, 1); - if (checkResult.result==false) + if (checkResult.result == false) { return PoAction.Message("不满足传送要求!"); } - - + + if (await GameBus.UpdateBag(userId, 0, busData.busNeed, "业务传送")) { var ResultMap = await _mapService.GetToMapInfo(userId, mapToData.mapId, true, true); if (ResultMap != null) { + if (mapToData.code == nameof(MapEnum.MapCode.Magic_Map)) //魔城场景 + { + await _magicService.UpdateUserMagicTime(userId,areaId); + } + return PoAction.Ok(true); } else { - return PoAction.Message("操作失败,请稍后尝试!"); + return PoAction.Message("操作失败,请稍后尝试!"); } } else @@ -103,7 +127,7 @@ public class MapBusController : ControllerBase return PoAction.Message("操作失败,请稍后尝试!"); } } - + /// /// 打开宝箱 /// @@ -129,13 +153,13 @@ public class MapBusController : ControllerBase { return PoAction.Message("业务不存在!"); } - + var checkResult = await GameBus.CheckNeed(userId, busData.busNeed, 1); - if (checkResult.result==false) + if (checkResult.result == false) { return PoAction.Message("不满足开启要求!"); } - + if (await GameBus.UpdateBag(userId, 0, busData.busNeed, "业务传送")) { string message = ""; @@ -158,7 +182,8 @@ public class MapBusController : ControllerBase { message = "空空如也,什么也没有得到!"; } - return PoAction.Ok(true,message); + + return PoAction.Ok(true, message); } else { diff --git a/Service/Application.Web/Controllers/Map/MapController.cs b/Service/Application.Web/Controllers/Map/MapController.cs index 44dc1db..91801f2 100644 --- a/Service/Application.Web/Controllers/Map/MapController.cs +++ b/Service/Application.Web/Controllers/Map/MapController.cs @@ -1,4 +1,6 @@ -namespace Application.Web.Controllers.Map; +using Newtonsoft.Json; + +namespace Application.Web.Controllers.Map; /// /// 地图接口 @@ -29,7 +31,7 @@ public class MapController : ControllerBase IUnitUserAttrService attrService, IMessageService messageService, IUnitUserWeight weightService, IUnitUserAccService accService, IGameSkillService skillService, IGameGoodsService goodsService, IGameTeamService teamService, IGameMonsterService monsterService, IGameFightService fightService, - IOnHookService hookService, IGameTaskService taskService,INoticeService noticeService) + IOnHookService hookService, IGameTaskService taskService, INoticeService noticeService) { _userService = userService; _mapService = mapService; @@ -128,8 +130,8 @@ public class MapController : ControllerBase #endregion - - var busData = await _mapService.GetMapBus(mapInfo.mapId, 0, 0);//地图业务 + + var busData = await _mapService.GetMapBus(mapInfo.mapId, 0, 0); //地图业务 IEnumerable business = busData.Select(it => new { busId = it.busId, @@ -214,6 +216,7 @@ public class MapController : ControllerBase var onMap = await _mapService.GetUserOnMap(userId); var mapInfo = await _mapService.GetMapInfo(onMap.mapId); var data = await _mapService.GetCityMap((int)mapInfo.cityId); + data = data.FindAll(it => it.code == nameof(MapEnum.MapCode.DEF_MAP)); if (!string.IsNullOrEmpty(search)) { data = data.FindAll(it => it.mapName.Contains(search)); @@ -672,6 +675,66 @@ public class MapController : ControllerBase return PoAction.Ok(new { data, task }); } + /// + /// 处理Npc事务 + /// + /// + /// + /// + [HttpGet] + public async Task HandleNpcEvent(int npcId, string code, string? parms) + { + string userId = StateHelper.userId; + int areaId = StateHelper.areaId; + var data = await _mapService.GetNpcInfo(npcId); + if (data == null) + { + return PoAction.Message("Npc不存在!"); + } + + if (data.status != 1) + { + return PoAction.Message("Npc不存在!"); + } + + if (data.code != nameof(MapEnum.NpcCode.Event)) + { + return PoAction.Message("无法处理该业务!"); + } + + if (data.bus.Any(it => it.code == code) == false) + { + return PoAction.Message("无法处理该业务!"); + } + + var onMap = await _mapService.GetUserOnMap(userId); + if (data.mapId != onMap.mapId) + { + return PoAction.Message("Npc不存在!"); + } + + if (code == nameof(MapEnum.NpcEventCode.Magic_Event)) //魔城 + { + bool isWin = false; + if (TimeAssist.GetHourNum > 221000) + { + var onMapUser = await _mapService.GetMapUser(GameConfig.GameMagicMapId, areaId, 1, [userId], 1); + if (onMapUser.Count == 0) + { + isWin = true; + } + } + + var magicService = App.GetService(); + await magicService.UpdateUserMagicEndTime(userId, isWin); + + await _mapService.UpdateUserOnMap(onMap, GameConfig.GameMagicInMapId);//设置地图 + return PoAction.Ok(0, "魔城成功退出!"); + } + + return PoAction.Message("非处理的游戏项!"); + } + #endregion #region 采集相关 diff --git a/Service/Application.Web/Controllers/Pub/CdkController.cs b/Service/Application.Web/Controllers/Pub/CdkController.cs new file mode 100644 index 0000000..fbbeb92 --- /dev/null +++ b/Service/Application.Web/Controllers/Pub/CdkController.cs @@ -0,0 +1,88 @@ +using Microsoft.AspNetCore.Mvc; + +namespace Application.Web.Controllers.Pub; + +/// +/// Cdk接口 +/// +[Route("[controller]/[action]")] +[ApiController] +[Authorize] +public class CdkController : ControllerBase +{ + private readonly IGameCdkService _cdkService; + public CdkController(IGameCdkService cdkService) + { + _cdkService = cdkService; + } + + /// + /// 兑换CDK + /// + /// + /// + [HttpGet] + public async Task Exchange(string cdk) + { + if (string.IsNullOrEmpty(cdk)) + { + return PoAction.Message("CDK不能为空!"); + } + var cdkItem = await _cdkService.GetCdkItemInfo(cdk); + if (cdkItem == null) + { + return PoAction.Message("CDK无效!"); + } + if (cdkItem.userId != "0") + { + return PoAction.Message("CDK已被使用!"); + } + var cdkInfo = await _cdkService.GetCdkInfo((int)cdkItem.cdkId); + if (cdkInfo == null) + { + return PoAction.Message("CDK无效!"); + } + if (cdkInfo.endTime < DateTime.Now) + { + return PoAction.Message("CDK已过期!"); + } + if (cdkInfo.area != 0) + { + if (cdkInfo.area != StateHelper.areaId) + { + return PoAction.Message($"该CDK仅可在{cdkInfo.area}区使用!"); + } + } + + string userId = StateHelper.userId; + if (cdkInfo.limit > 0) + { + int onCount = await _cdkService.GetUserCdkCount(cdkInfo.cdkId, userId); + if (onCount >= cdkInfo.limit) + { + return PoAction.Message($"该类型CDK限制兑换{cdkInfo.limit}个!"); + } + } + if (await _cdkService.UpdateCdkUser(cdk, userId)) + { + if (await GameBus.UpdateBag(userId, 1, cdkInfo.award, "CDK获得")) + { + string message = "兑换成功,获得:"; + foreach (var item in cdkInfo.award) + { + message += $"{item.name}+{item.count},"; + } + message = message.TrimEnd(','); + return PoAction.Ok(true,message); + } + else + { + return PoAction.Message("兑换失败,请稍后尝试!"); + } + } + else + { + return PoAction.Message("兑换失败,请稍后尝试!"); + } + } +} \ No newline at end of file diff --git a/Service/Application.Web/Controllers/Pub/RecoverController.cs b/Service/Application.Web/Controllers/Pub/RecoverController.cs index 7b741ac..05ebc97 100644 --- a/Service/Application.Web/Controllers/Pub/RecoverController.cs +++ b/Service/Application.Web/Controllers/Pub/RecoverController.cs @@ -250,6 +250,7 @@ public class RecoverController : ControllerBase var needData = data.FindAll(it => it.isAppr == 1 && it.durability < it.maxdurability && it.useEndTime > TimeExtend.GetTimeStampSeconds); need = needData.Sum(it => (int)it.maxdurability - (int)it.durability); + need = need * 500; return PoAction.Ok(new { data, need }); } diff --git a/Service/Application.Web/applicationsettings.txt b/Service/Application.Web/applicationsettings.txt new file mode 100644 index 0000000..3a3eda5 --- /dev/null +++ b/Service/Application.Web/applicationsettings.txt @@ -0,0 +1,43 @@ +{ + "AutoProgram": 0, + "Redis": { + "connection": "127.0.0.1:6379,password=,defaultdatabase=5" + }, + "SqlData": [ + { + "type": 0, + "name": "Kg.SeaTime.Game", + "connect": "data source=81.70.212.61;database=kg.seatime.game;user id=root;password=1f5ozxRGE3Y;pooling=true;port=3306;sslmode=Required;charset=utf8mb4;" + }, + { + "type": 0, + "name": "Kg.SeaTime.Resource", + "connect": "data source=81.70.212.61;database=kg.seatime.resource;user id=root;password=1f5ozxRGE3Y;pooling=true;port=3306;sslmode=Required;charset=utf8mb4;" + }, + { + "type": 0, + "name": "Kg.SeaTime.Log", + "connect": "data source=81.70.212.61;database=kg.seatime.log;user id=root;password=1f5ozxRGE3Y;pooling=true;port=3306;sslmode=Required;charset=utf8mb4;" + } + ], + "JwtTokenOptions": { + "Issuer": "kx.seatime", + "Audience": "kx.seatime", + "SecurityKey": "46055HR0n7FeNHhDKAYD2i9ZsdsYn4jn" + }, + "ResUrl": { + "local": "http://192.168.0.142:5298", + "resUrl": "http://localhost:12206", + "imgCDN": "/", + "videoCDN": "/" + }, + "Sms": { + "SmsType": 1, + "AccessKey": "AKIDVptgCRP5UcT4PTGm1yf5E6pKYVBajeKn", + "Secret": "FG2atxlKflcEclgKhnc9XeU3LM6YjdGf", + "signName": "探玩驿站", + "TemplateCode": "963929", + "SmsSdkAppId": "1400523979", + "SmsOnTime": 300 + } +} \ No newline at end of file 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/business/cdk.vue b/Web/src/pages/business/cdk.vue new file mode 100644 index 0000000..c3a9275 --- /dev/null +++ b/Web/src/pages/business/cdk.vue @@ -0,0 +1,51 @@ + + \ No newline at end of file diff --git a/Web/src/pages/map/npc/index.vue b/Web/src/pages/map/npc/index.vue index 063bfe2..4516805 100644 --- a/Web/src/pages/map/npc/index.vue +++ b/Web/src/pages/map/npc/index.vue @@ -12,6 +12,11 @@ ◈{{ item.name }} +
+
+ ◈{{ item.name }} +
+
当前任务:
@@ -21,7 +26,7 @@ [{{ item.code }}]{{ item.name }}
-
+
{{ item.name }}
@@ -61,4 +66,20 @@ const BindData = async (): Promise => { } }; +const HandleEvent = async (item: any) => { + let npc = PageExtend.QueryString("npc"); + MessageExtend.LoadingToast("处理中..."); + let result = await MapService.HandleNpcEvent(Number(npc), item.code, item.parms) + MessageExtend.LoadingClose(); + if (result.code == 0) { + MessageExtend.Notify(result.msg, "success"); + if (result.data == 0) { + PageExtend.RedirectTo("/map"); + } + } + else { + MessageExtend.ShowDialog("提示", result.msg); + } +} + \ No newline at end of file diff --git a/Web/src/pages/user/friend/index.vue b/Web/src/pages/user/friend/index.vue index 4242522..d12706b 100644 --- a/Web/src/pages/user/friend/index.vue +++ b/Web/src/pages/user/friend/index.vue @@ -46,7 +46,7 @@
- ➢添加好友 + ➢添加好友