From 10f5ad39ebb233def1b61578253a77835b25b0d6 Mon Sep 17 00:00:00 2001 From: Somebody Date: Sat, 13 Jul 2024 19:47:26 +0800 Subject: [PATCH] Feature: Total internationlisation & Rogue Buff Reroll & Reset floor --- Command/Command/Cmd/CommandScene.cs | 25 ++ .../Message/LanguageCHS.cs | 1 + .../Message/LanguageCHT.cs | 282 +++++++++++------- .../Message/LanguageEN.cs | 73 ++++- GameServer/Game/Player/PlayerInstance.cs | 13 +- .../Game/Rogue/Buff/RogueBuffSelectMenu.cs | 2 +- .../Recv/Scene/HandlerEnterSceneCsReq.cs | 2 +- 7 files changed, 280 insertions(+), 118 deletions(-) diff --git a/Command/Command/Cmd/CommandScene.cs b/Command/Command/Cmd/CommandScene.cs index 65bbec50..bf653871 100644 --- a/Command/Command/Cmd/CommandScene.cs +++ b/Command/Command/Cmd/CommandScene.cs @@ -130,5 +130,30 @@ namespace EggLink.DanhengServer.Command.Cmd player.EnterScene(player.Data.EntryId, 0, true); arg.SendMsg(I18nManager.Translate("Game.Command.Scene.SceneReloaded")); } + + [CommandMethod("0 reset")] + public void ResetFloor(CommandArg arg) + { + if (arg.Target == null) + { + arg.SendMsg(I18nManager.Translate("Game.Command.Notice.PlayerNotFound")); + return; + } + + var floorId = arg.GetInt(0); + if (floorId == 0) + { + arg.SendMsg(I18nManager.Translate("Game.Command.Notice.InvalidArguments")); + return; + } + + var player = arg.Target!.Player!; + if (player.SceneData?.ScenePropData.TryGetValue(floorId, out var _) == true) + { + player.SceneData.ScenePropData[floorId] = []; + } + + arg.SendMsg(I18nManager.Translate("Game.Command.Scene.SceneReset", floorId.ToString())); + } } } diff --git a/Common/Internationalization/Message/LanguageCHS.cs b/Common/Internationalization/Message/LanguageCHS.cs index c3479694..322b00fc 100644 --- a/Common/Internationalization/Message/LanguageCHS.cs +++ b/Common/Internationalization/Message/LanguageCHS.cs @@ -340,6 +340,7 @@ namespace EggLink.DanhengServer.Internationalization.Message public string AllPropsUnlocked { get; } = "所有道具已解锁!"; public string SceneChanged { get; } = "已进入场景 {0}"; public string SceneReloaded { get; } = "场景已重新加载!"; + public string SceneReset { get; } = "已重置场景 {0} 中所有道具状态!"; } /// diff --git a/Common/Internationalization/Message/LanguageCHT.cs b/Common/Internationalization/Message/LanguageCHT.cs index 481f9bfd..b728fd0c 100644 --- a/Common/Internationalization/Message/LanguageCHT.cs +++ b/Common/Internationalization/Message/LanguageCHT.cs @@ -8,11 +8,11 @@ namespace EggLink.DanhengServer.Internationalization.Message { #region Root - public class LanguageCHT + public class LanguageCHS { - public GameTextCHT Game { get; } = new(); - public ServerTextCHT Server { get; } = new(); - public WordTextCHT Word { get; } = new(); // a placeholder for the actual word text + public GameTextCHS Game { get; } = new(); + public ServerTextCHS Server { get; } = new(); + public WordTextCHS Word { get; } = new(); // a placeholder for the actual word text } #endregion @@ -22,23 +22,24 @@ namespace EggLink.DanhengServer.Internationalization.Message /// /// path: Game /// - public class GameTextCHT + public class GameTextCHS { - public CommandTextCHT Command { get; } = new(); + public CommandTextCHS Command { get; } = new(); } /// /// path: Server /// - public class ServerTextCHT + public class ServerTextCHS { - public WebTextCHT Web { get; } = new(); + public WebTextCHS Web { get; } = new(); + public ServerInfoTextCHS ServerInfo { get; } = new(); } /// /// path: Word /// - public class WordTextCHT + public class WordTextCHS { public string Rank { get; } = "星魂"; public string Avatar { get; } = "角色"; @@ -51,6 +52,38 @@ namespace EggLink.DanhengServer.Internationalization.Message public string Buff { get; } = "祝福"; public string Miracle { get; } = "奇物"; public string Unlock { get; } = "奢侈品"; + + // server info + public string Config { get; } = "配置文件"; + public string Language { get; } = "語言"; + public string Log { get; } = "日誌"; + public string GameData { get; } = "遊戲數據"; + public string Database { get; } = "數據庫"; + public string Command { get; } = "命令"; + public string WebServer { get; } = "Web服務器"; + public string Plugin { get; } = "插件"; + public string Handler { get; } = "包處理器"; + public string Dispatch { get; } = "全局分發"; + public string Game { get; } = "遊戲"; + public string Handbook { get; } = "手冊"; + public string NotFound { get; } = "未找到"; + public string Error { get; } = "錯誤"; + public string FloorInfo { get; } = "區域文件"; + public string FloorGroupInfo { get; } = "區域組文件"; + public string FloorMissingResult { get; } = "傳送與世界生成"; + public string FloorGroupMissingResult { get; } = "傳送、怪物戰鬥與世界生成"; + public string Mission { get; } = "任務"; + public string MissionInfo { get; } = "任務文件"; + public string MazeSkill { get; } = "角色秘技"; + public string MazeSkillInfo { get; } = "角色秘技文件"; + public string Dialogue { get; } = "模擬宇宙事件"; + public string DialogueInfo { get; } = "模擬宇宙事件文件"; + public string Performance { get; } = "劇情操作"; + public string PerformanceInfo { get; } = "劇情操作文件"; + public string RogueChestMap { get; } = "模擬宇宙地圖"; + public string RogueChestMapInfo { get; } = "模擬宇宙地圖文件"; + public string ChessRogueRoom { get; } = "模擬宇宙DLC"; + public string ChessRogueRoomInfo { get; } = "模擬宇宙DLC文件"; } #endregion @@ -62,24 +95,25 @@ namespace EggLink.DanhengServer.Internationalization.Message /// /// path: Game.Command /// - public class CommandTextCHT + public class CommandTextCHS { - public NoticeTextCHT Notice { get; } = new(); + public NoticeTextCHS Notice { get; } = new(); - public HeroTextCHT Hero { get; } = new(); - public AvatarTextCHT Avatar { get; } = new(); - public GiveTextCHT Give { get; } = new(); - public GiveAllTextCHT GiveAll { get; } = new(); - public LineupTextCHT Lineup { get; } = new(); - public HelpTextCHT Help { get; } = new(); - public KickTextCHT Kick { get; } = new(); - public MissionTextCHT Mission { get; } = new(); - public RelicTextCHT Relic { get; } = new(); - public ReloadTextCHT Reload { get; } = new(); - public RogueTextCHT Rogue { get; } = new(); - public SceneTextCHT Scene { get; } = new(); - public UnlockAllTextCHT UnlockAll { get; } = new(); - public MailTextCHT Mail { get; } = new(); + public HeroTextCHS Hero { get; } = new(); + public AvatarTextCHS Avatar { get; } = new(); + public GiveTextCHS Give { get; } = new(); + public GiveAllTextCHS GiveAll { get; } = new(); + public LineupTextCHS Lineup { get; } = new(); + public HelpTextCHS Help { get; } = new(); + public KickTextCHS Kick { get; } = new(); + public MissionTextCHS Mission { get; } = new(); + public RelicTextCHS Relic { get; } = new(); + public ReloadTextCHS Reload { get; } = new(); + public RogueTextCHS Rogue { get; } = new(); + public SceneTextCHS Scene { get; } = new(); + public UnlockAllTextCHS UnlockAll { get; } = new(); + public MailTextCHS Mail { get; } = new(); + public RaidTextCHS Raid { get; } = new(); } #endregion @@ -89,10 +123,35 @@ namespace EggLink.DanhengServer.Internationalization.Message /// /// path: Server.Web /// - public class WebTextCHT + public class WebTextCHS { } + /// + /// path: Server.ServerInfo + /// + public class ServerInfoTextCHS + { + public string Shutdown { get; } = "關閉中…"; + public string CancelKeyPressed { get; } = "已按下取消鍵 (Ctrl + C),服務器即將關閉…"; + public string StartingServer { get; } = "正在啟動 DanhengServer…"; + public string LoadingItem { get; } = "正在加載 {0}…"; + public string RegisterItem { get; } = "註冊了 {0} 個 {1}。"; + public string FailedToLoadItem { get; } = "加載 {0} 失敗。"; + public string FailedToInitializeItem { get; } = "初始化 {0} 失敗。"; + public string FailedToReadItem { get; } = "讀取 {0} 失敗,文件{1}"; + public string GeneratedItem { get; } = "已生成 {0}。"; + public string LoadedItem { get; } = "已加載 {0}。"; + public string LoadedItems { get; } = "已加載 {0} 個 {1}。"; + public string ServerRunning { get; } = "{0} 服務器正在監聽 {1}"; + public string ServerStarted { get; } = "啟動完成!用時 {0}s,擊敗了99%的用戶,輸入 『help』 來獲取命令幫助"; // 玩梗,考慮英語版本將其本土化 + public string MissionEnabled { get; } = "任務系統已啟用,此功能仍在開發中,且可能不會按預期工作,如果遇見任何bug,請匯報給開發者。"; + + public string ConfigMissing { get; } = "{0} 缺失,請檢查你的資源文件夾:{1},{2} 可能不能使用。"; + public string UnloadedItems { get; } = "卸載了所有 {0}。"; + public string SaveDatabase { get; } = "已保存數據庫,用時 {0}s"; + } + #endregion #endregion @@ -104,158 +163,158 @@ namespace EggLink.DanhengServer.Internationalization.Message /// /// path: Game.Command.Notice /// - public class NoticeTextCHT + public class NoticeTextCHS { - public string PlayerNotFound { get; } = "未找到玩家!"; - public string InvalidArguments { get; } = "無效的參數!"; - public string NoPermission { get; } = "你沒有權限執行此動作!"; - public string CommandNotFound { get; } = "該指令不存在!輸入 '/help' 來取得幫助"; - public string TargetOffline { get; } = "目標玩家 {0}({1}) 已離線!清除目前目標"; - public string TargetFound { get; } = "找到目標玩家 {0}({1}),下次輸入指令時將預設對其執行"; - public string TargetNotFound { get; } = "未找到目標玩家 {0}!"; - public string InternalError { get; } = "處理指令時發生內部錯誤!"; + public string PlayerNotFound { get; } = "未找到玩家!"; + public string InvalidArguments { get; } = "無效的參數!"; + public string NoPermission { get; } = "你沒有權限這麼做!"; + public string CommandNotFound { get; } = "未找到命令! 輸入 '/help' 來獲取幫助"; + public string TargetOffline { get; } = "目標 {0}({1}) 離線了!清除當前目標"; + public string TargetFound { get; } = "找到目標 {0}({1}),下一次命令將默認對其執行"; + public string TargetNotFound { get; } = "未找到目標 {0}!"; + public string InternalError { get; } = "在處理命令時發生了內部錯誤!"; } /// /// path: Game.Command.Hero /// - public class HeroTextCHT + public class HeroTextCHS { - public string Desc { get; } = "切換主角的性別或型態"; + public string Desc { get; } = "切換主角的性別/形態"; public string Usage { get; } = "/hero /"; - public string GenderNotSpecified { get; } = "該性別不存在!"; - public string HeroTypeNotSpecified { get; } = "主角類型不存在!"; - public string GenderChanged { get; } = "性別已變更!"; - public string HeroTypeChanged { get; } = "主角類型已變更!"; + public string GenderNotSpecified { get; } = "性別不存在!"; + public string HeroTypeNotSpecified { get; } = "主角類型不存在!"; + public string GenderChanged { get; } = "性別已更改!"; + public string HeroTypeChanged { get; } = "主角類型已更改!"; } /// /// path: Game.Command.UnlockAll /// - public class UnlockAllTextCHT + public class UnlockAllTextCHS { public string Desc { get; } = "解鎖所有在類別內的對象"; public string Usage { get; } = "/unlockall "; - public string AllMissionsUnlocked { get; } = "已解鎖所有任務!"; + public string AllMissionsUnlocked { get; } = "所有任務已解鎖!"; } /// /// path: Game.Command.Avatar /// - public class AvatarTextCHT + public class AvatarTextCHS { - public string Desc { get; } = "設定玩家已有角色之屬性"; - public string Usage { get; } = "/avatar ///"; - public string InvalidLevel { get; } = "無效之{0}等級"; - public string AllAvatarsLevelSet { get; } = "已將所有角色之 {0} 等級設定為{1}"; - public string AvatarLevelSet { get; } = "已將 {0} 角色之 {1} 等級設定為{2}"; - public string AvatarNotFound { get; } = "該角色不存在!"; - public string AvatarGet { get; } = "已成功取得角色 {0}!"; - public string AvatarFailedGet { get; } = "取得角色 {0} 失敗!"; + public string Desc { get; } = "設定玩家已有角色的屬性"; + public string Usage { get; } = "/avatar ///"; + public string InvalidLevel { get; } = "無效 {0}等級"; + public string AllAvatarsLevelSet { get; } = "已將全部角色 {0}等級設置為 {1}"; + public string AvatarLevelSet { get; } = "已將 {0} 角色 {1}等級設置為 {2}"; + public string AvatarNotFound { get; } = "角色不存在!"; + public string AvatarGet { get; } = "獲取到角色 {0}!"; + public string AvatarFailedGet { get; } = "獲取角色 {0} 失敗!"; } /// /// path: Game.Command.Give /// - public class GiveTextCHT + public class GiveTextCHS { public string Desc { get; } = "給予玩家物品"; public string Usage { get; } = "/give <物品ID> l<等級> x<數量> r<疊影>"; - public string ItemNotFound { get; } = "該物品不存在!"; - public string GiveItem { get; } = "已給予玩家 @{0} {1} 個物品 {2}"; + public string ItemNotFound { get; } = "未找到物品!"; + public string GiveItem { get; } = "給予 @{0} {1} 個物品 {2}"; } /// /// path: Game.Command.GiveAll /// - public class GiveAllTextCHT + public class GiveAllTextCHS { - public string Desc { get; } = "給予玩家全部指令類型之物品"; - public string Usage { get; } = "/giveall r<疊影> l<等級> x<數量>"; + public string Desc { get; } = "給予玩家全部指定類型的物品"; + public string Usage { get; } = "/giveall r<疊影> l<等級> x<數量>"; public string GiveAllItems { get; } = "已給予所有 {0}, 各 {1} 個"; } /// /// path: Game.Command.Lineup /// - public class LineupTextCHT + public class LineupTextCHS { - public string Desc { get; } = "管理玩家之隊伍"; - public string Usage { get; } = "/lineup /"; - public string PlayerGainedMp { get; } = "玩家已獲得 {0} 密技點"; - public string HealedAllAvatars { get; } = "已成功治癒所有於目前隊伍中之角色"; + public string Desc { get; } = "管理玩家的隊伍"; + public string Usage { get; } = "/lineup /"; + public string PlayerGainedMp { get; } = "玩家已獲得 {0} 秘技點"; + public string HealedAllAvatars { get; } = "成功治癒當前隊伍中的所有角色"; } /// /// path: Game.Command.Help /// - public class HelpTextCHT + public class HelpTextCHS { - public string Desc { get; } = "顯示幫助訊息"; + public string Desc { get; } = "顯示幫助信息"; public string Usage { get; } = "/help"; - public string Commands { get; } = "指令:"; - public string CommandUsage { get; } = "|使用方法:"; + public string Commands { get; } = "命令:"; + public string CommandUsage { get; } = "用法: "; } /// /// path: Game.Command.Kick /// - public class KickTextCHT + public class KickTextCHS { public string Desc { get; } = "踢出玩家"; public string Usage { get; } = "/kick"; - public string PlayerKicked { get; } = "玩家 {0} 已被踢出!"; + public string PlayerKicked { get; } = "玩家 {0} 已被踢出!"; } /// /// path: Game.Command.Mission /// - public class MissionTextCHT + public class MissionTextCHS { - public string Desc { get; } = "管理玩家之任務"; - public string Usage { get; } = "/mission ////"; - public string AllMissionsFinished { get; } = "已完成所有任務!"; - public string AllRunningMissionsFinished { get; } = "已完成共 {0} 個進行中之任務!"; - public string MissionFinished { get; } = "任務 {0} 已完成!"; - public string InvalidMissionId { get; } = "無效之任務ID!"; - public string NoRunningMissions { get; } = "目前沒有進行中之任務!"; + public string Desc { get; } = "管理玩家的任務"; + public string Usage { get; } = "/mission ////"; + public string AllMissionsFinished { get; } = "所有任務已完成!"; + public string AllRunningMissionsFinished { get; } = "共 {0} 個進行中的任務已完成!"; + public string MissionFinished { get; } = "任務 {0} 已完成!"; + public string InvalidMissionId { get; } = "無效的任務ID!"; + public string NoRunningMissions { get; } = "沒有正在進行的任務!"; - public string RunningMissions { get; } = "正在進行的任務:"; - public string PossibleStuckMissions { get; } = "可岑存在問題之任務:"; + public string RunningMissions { get; } = "正在進行的任務:"; + public string PossibleStuckMissions { get; } = "可能卡住的任務:"; public string MainMission { get; } = "主任務"; - public string MissionReAccepted { get; } = "已重新接受任務 {0}"; + public string MissionReAccepted { get; } = "重新接受任務 {0}!"; } /// /// path: Game.Command.Relic /// - public class RelicTextCHT + public class RelicTextCHS { - public string Desc { get; } = "管理玩家之遺器"; + public string Desc { get; } = "管理玩家的遺器"; public string Usage { get; } = "/relic <遺器ID> <主詞條ID> <小詞條ID1:小詞條等級> <小詞條ID2:小詞條等級> <小詞條ID3:小詞條等級> <小詞條ID4:小詞條等級> l<等級> x<數量>"; - public string RelicNotFound { get; } = "該遺器不存在!"; - public string InvalidMainAffixId { get; } = "該主詞條ID不存在!"; - public string InvalidSubAffixId { get; } = "該副詞條ID不存在!"; - public string RelicGiven { get; } = "已給予玩家 @{0} {1} 個遺器 {2}, 主詞條 {3}"; + public string RelicNotFound { get; } = "遺器不存在!"; + public string InvalidMainAffixId { get; } = "主詞條ID無效"; + public string InvalidSubAffixId { get; } = "副詞條ID無效"; + public string RelicGiven { get; } = "給予玩家 @{0} {1} 個遺器 {2}, 主詞條 {3}"; } /// /// path: Game.Command.Reload /// - public class ReloadTextCHT + public class ReloadTextCHS { - public string Desc { get; } = "重新載入指定的設定"; - public string Usage { get; } = "/reload <設定名稱>(banner - 卡池, activity - 活動)"; - public string ConfigReloaded { get; } = "設定 {0} 已重新載入完成!"; + public string Desc { get; } = "重新加載指定的配置"; + public string Usage { get; } = "/reload <配置名>(banner - 卡池, activity - 活動)"; + public string ConfigReloaded { get; } = "配置 {0} 已重新加載!"; } /// /// path: Game.Command.Rogue /// - public class RogueTextCHT + public class RogueTextCHS { - public string Desc { get; } = "管理玩家模擬宇宙中的資料"; + public string Desc { get; } = "管理玩家模擬宇宙中的數據"; public string Usage { get; } = "/rogue ////"; public string PlayerGainedMoney { get; } = "玩家已獲得 {0} 宇宙碎片"; public string PlayerGainedAllItems { get; } = "玩家已獲得所有{0}"; @@ -263,35 +322,46 @@ namespace EggLink.DanhengServer.Internationalization.Message public string PlayerEnhancedBuff { get; } = "玩家已強化祝福 {0}"; public string PlayerEnhancedAllBuffs { get; } = "玩家已強化所有祝福"; public string PlayerUnstuck { get; } = "玩家已脫離事件"; - public string NotFoundItem { get; } = "{0} 不存在!"; + public string NotFoundItem { get; } = "未找到 {0}!"; } /// /// path: Game.Command.Scene /// - public class SceneTextCHT + public class SceneTextCHS { - public string Desc { get; } = "管理玩家之場景"; - public string Usage { get; } = "/scene ////"; - public string LoadedGroups { get; } = "已載入組: {0}"; - public string PropStateChanged { get; } = "道具: {0} 的狀態已設定為 {1}"; - public string PropNotFound { get; } = "該道具不存在!"; + public string Desc { get; } = "管理玩家場景"; + public string Usage { get; } = "/scene ////"; + public string LoadedGroups { get; } = "已加載組: {0}"; + public string PropStateChanged { get; } = "道具: {0} 的狀態已設置為 {1}"; + public string PropNotFound { get; } = "未找到道具!"; public string EntityRemoved { get; } = "實體 {0} 已被移除"; - public string EntityNotFound { get; } = "該實體不存在!"; - public string AllPropsUnlocked { get; } = "已解鎖全部道具!"; + public string EntityNotFound { get; } = "未找到實體!"; + public string AllPropsUnlocked { get; } = "所有道具已解鎖!"; public string SceneChanged { get; } = "已進入場景 {0}"; - public string SceneReloaded { get; } = "場景已重新讀取!"; + public string SceneReloaded { get; } = "場景已重新加載!"; + public string SceneReset { get; } = "已重置場景 {0} 中所有道具狀態!"; } /// /// path: Game.Command.Mail /// - public class MailTextCHT + public class MailTextCHS { - public string Desc { get; } = "管理員家的郵件"; + public string Desc { get; } = "管理玩家的郵件"; public string Usage { get; } = "/mail /"; - public string MailSent { get; } = "郵件已發送!"; - public string MailSentWithAttachment { get; } = "帶附件的郵件已發送!"; + public string MailSent { get; } = "郵件已發送!"; + public string MailSentWithAttachment { get; } = "帶附件的郵件已發送!"; + } + + /// + /// path: Game.Command.Raid + /// + public class RaidTextCHS + { + public string Desc { get; } = "管理玩家的任務臨時場景"; + public string Usage { get; } = "/raid "; + public string Leaved { get; } = "已離開臨時場景!"; } #endregion diff --git a/Common/Internationalization/Message/LanguageEN.cs b/Common/Internationalization/Message/LanguageEN.cs index 2fb8e4a6..0035e884 100644 --- a/Common/Internationalization/Message/LanguageEN.cs +++ b/Common/Internationalization/Message/LanguageEN.cs @@ -31,6 +31,7 @@ namespace EggLink.DanhengServer.Internationalization.Message public class ServerTextEN { public WebTextEN Web { get; } = new(); + public ServerInfoTextEN ServerInfo { get; } = new(); } /// @@ -49,6 +50,38 @@ namespace EggLink.DanhengServer.Internationalization.Message public string Buff { get; } = "Blessing"; public string Miracle { get; } = "Curio"; public string Unlock { get; } = "Luxury"; + + // server info + public string Config { get; } = "Config File"; + public string Language { get; } = "Language"; + public string Log { get; } = "Log"; + public string GameData { get; } = "Game Data"; + public string Database { get; } = "Database"; + public string Command { get; } = "Command"; + public string WebServer { get; } = "Web Server"; + public string Plugin { get; } = "Plugin"; + public string Handler { get; } = "Packet Handler"; + public string Dispatch { get; } = "Global Dispatch"; + public string Game { get; } = "Game"; + public string Handbook { get; } = "Handbook"; + public string NotFound { get; } = "Not Found"; + public string Error { get; } = "Error"; + public string FloorInfo { get; } = "Floor Info"; + public string FloorGroupInfo { get; } = "Floor Group Info"; + public string FloorMissingResult { get; } = "Teleportation and World Generation"; + public string FloorGroupMissingResult { get; } = "Teleportation, Monster Battles, and World Generation"; + public string Mission { get; } = "Mission"; + public string MissionInfo { get; } = "Mission Info"; + public string MazeSkill { get; } = "Maze Skill"; + public string MazeSkillInfo { get; } = "Maze Skill Info"; + public string Dialogue { get; } = "Simulated Universe Event"; + public string DialogueInfo { get; } = "Simulated Universe Event Info"; + public string Performance { get; } = "Performance"; + public string PerformanceInfo { get; } = "Performance Info"; + public string RogueChestMap { get; } = "Simulated Universe Map"; + public string RogueChestMapInfo { get; } = "Simulated Universe Map Info"; + public string ChessRogueRoom { get; } = "Simulated Universe DLC"; + public string ChessRogueRoomInfo { get; } = "Simulated Universe DLC Info"; } #endregion @@ -78,6 +111,7 @@ namespace EggLink.DanhengServer.Internationalization.Message public SceneTextEN Scene { get; } = new(); public UnlockAllTextEN UnlockAll { get; } = new(); public MailTextEN Mail { get; } = new(); + public RaidTextEN Raid { get; } = new(); } #endregion @@ -91,6 +125,32 @@ namespace EggLink.DanhengServer.Internationalization.Message { } + /// + /// path: Server.ServerInfo + /// + public class ServerInfoTextEN + { + public string Shutdown { get; } = "Shutting down..."; + public string CancelKeyPressed { get; } = "Cancel key pressed (Ctrl + C), server shutting down..."; + public string StartingServer { get; } = "Starting DanhengServer..."; + public string LoadingItem { get; } = "Loading {0}..."; + public string RegisterItem { get; } = "Registered {0} {1}(s)."; + public string FailedToLoadItem { get; } = "Failed to load {0}."; + public string FailedToInitializeItem { get; } = "Failed to initialize {0}."; + public string FailedToReadItem { get; } = "Failed to read {0}, file {1}"; + public string GeneratedItem { get; } = "Generated {0}."; + public string LoadedItem { get; } = "Loaded {0}."; + public string LoadedItems { get; } = "Loaded {0} {1}(s)."; + public string ServerRunning { get; } = "{0} server listening on {1}"; + public string ServerStarted { get; } = "Startup complete! Took {0}s, better than 99% of users. Type 'help' for command help"; // This is a meme, consider localizing in English + public string MissionEnabled { get; } = "Mission system enabled. This feature is still in development and may not work as expected. Please report any bugs to the developers."; + + public string ConfigMissing { get; } = "{0} is missing. Please check your resource folder: {1}, {2} may not be available."; + public string UnloadedItems { get; } = "Unloaded all {0}."; + public string SaveDatabase { get; } = "Database saved in {0}s"; + } + + #endregion #endregion @@ -279,6 +339,7 @@ namespace EggLink.DanhengServer.Internationalization.Message public string AllPropsUnlocked { get; } = "All props have been unlocked!"; public string SceneChanged { get; } = "Entered scene {0}"; public string SceneReloaded { get; } = "Scene has been reloaded!"; + public string SceneReset { get; } = "The prop state in floor {0} has been reset!"; } /// @@ -287,11 +348,21 @@ namespace EggLink.DanhengServer.Internationalization.Message public class MailTextEN { public string Desc { get; } = "Manage player's mails"; - public string Usage { get; } = "/mail /"; + public string Usage { get; } = "/mail /"; public string MailSent { get; } = "Mail has been sent!"; public string MailSentWithAttachment { get; } = "Mail with attachments has been sent!"; } + /// + /// path: Game.Command.Raid + /// + public class RaidTextEN + { + public string Desc { get; } = "Manage player's temporary scene"; + public string Usage { get; } = "/raid "; + public string Leaved { get; } = "Leaved temporary scene!"; + } + #endregion #endregion diff --git a/GameServer/Game/Player/PlayerInstance.cs b/GameServer/Game/Player/PlayerInstance.cs index f95f9ea4..6766cd65 100644 --- a/GameServer/Game/Player/PlayerInstance.cs +++ b/GameServer/Game/Player/PlayerInstance.cs @@ -29,17 +29,13 @@ using EggLink.DanhengServer.Server.Packet.Send.Scene; using EggLink.DanhengServer.Util; using EggLink.DanhengServer.Enums.Avatar; using EggLink.DanhengServer.Server.Packet.Send.Avatar; -using System.Numerics; using EggLink.DanhengServer.Game.Challenge; using EggLink.DanhengServer.Game.Drop; using static EggLink.DanhengServer.Plugin.Event.PluginEvent; -using EggLink.DanhengServer.Plugin.Event; using EggLink.DanhengServer.Game.Task; using EggLink.DanhengServer.GameServer.Game.Mail; using EggLink.DanhengServer.GameServer.Game.Raid; using EggLink.DanhengServer.GameServer.Game.Mission; -using SqlSugar; -using EggLink.DanhengServer.Database.Lineup; namespace EggLink.DanhengServer.Game.Player { @@ -290,7 +286,6 @@ namespace EggLink.DanhengServer.Game.Player } OnLevelChange(); - DatabaseHelper.Instance?.UpdateInstance(Data); } public void OnLevelChange() @@ -454,7 +449,7 @@ namespace EggLink.DanhengServer.Game.Player return null; } - public bool EnterScene(int entryId, int teleportId, bool sendPacket, ChangeStoryLineAction storyLineAction = ChangeStoryLineAction.None, int storyLineId = 0) + public bool EnterScene(int entryId, int teleportId, bool sendPacket, ChangeStoryLineAction storyLineAction = ChangeStoryLineAction.None, int storyLineId = 0, bool mapTp = false) { if (storyLineId != StoryLineManager?.StoryLineData.CurStoryLineId) { @@ -489,7 +484,7 @@ namespace EggLink.DanhengServer.Game.Player var beforeEntryId = Data.EntryId; - LoadScene(entrance.PlaneID, entrance.FloorID, entryId, anchor!.ToPositionProto(), anchor.ToRotationProto(), sendPacket, storyLineAction); + LoadScene(entrance.PlaneID, entrance.FloorID, entryId, anchor!.ToPositionProto(), anchor.ToRotationProto(), sendPacket, storyLineAction, mapTp); var afterEntryId = Data.EntryId; @@ -536,7 +531,7 @@ namespace EggLink.DanhengServer.Game.Player SendPacket(new PacketSceneEntityMoveScNotify(this)); } - public void LoadScene(int planeId, int floorId, int entryId, Position pos, Position rot, bool sendPacket, ChangeStoryLineAction storyLineAction = ChangeStoryLineAction.None) + public void LoadScene(int planeId, int floorId, int entryId, Position pos, Position rot, bool sendPacket, ChangeStoryLineAction storyLineAction = ChangeStoryLineAction.None, bool mapTp = false) { GameData.MazePlaneData.TryGetValue(planeId, out var plane); if (plane == null) return; @@ -566,7 +561,7 @@ namespace EggLink.DanhengServer.Game.Player Data.FloorId = floorId; Data.EntryId = entryId; } - else if (StoryLineManager?.StoryLineData.CurStoryLineId == 0) + else if (StoryLineManager?.StoryLineData.CurStoryLineId == 0 && mapTp) // only send move packet when not in story line and mapTp { notSendMove = false; } diff --git a/GameServer/Game/Rogue/Buff/RogueBuffSelectMenu.cs b/GameServer/Game/Rogue/Buff/RogueBuffSelectMenu.cs index cae9dc3f..60ed2b16 100644 --- a/GameServer/Game/Rogue/Buff/RogueBuffSelectMenu.cs +++ b/GameServer/Game/Rogue/Buff/RogueBuffSelectMenu.cs @@ -14,7 +14,7 @@ namespace EggLink.DanhengServer.Game.Rogue.Buff public int HintId { get; set; } = 1; public List Buffs { get; set; } = []; public int RollMaxCount { get; set; } = rogue.BaseRerollCount; - public int RollCount { get; set; } = 0; + public int RollCount { get; set; } = rogue.BaseRerollCount; public int RollFreeCount { get; set; } = rogue.BaseRerollFreeCount; public int RollCost { get; set; } = rogue.CurRerollCost; public int QueueAppend { get; set; } = 3; diff --git a/GameServer/Server/Packet/Recv/Scene/HandlerEnterSceneCsReq.cs b/GameServer/Server/Packet/Recv/Scene/HandlerEnterSceneCsReq.cs index 7b09a13b..11495f32 100644 --- a/GameServer/Server/Packet/Recv/Scene/HandlerEnterSceneCsReq.cs +++ b/GameServer/Server/Packet/Recv/Scene/HandlerEnterSceneCsReq.cs @@ -14,7 +14,7 @@ namespace EggLink.DanhengServer.Server.Packet.Recv.Scene public override void OnHandle(Connection connection, byte[] header, byte[] data) { var req = EnterSceneCsReq.Parser.ParseFrom(data); - var overMapTp = connection.Player?.EnterScene((int)req.EntryId, (int)req.TeleportId, true, storyLineId:(int) req.GameStoryLineId); + var overMapTp = connection.Player?.EnterScene((int)req.EntryId, (int)req.TeleportId, true, storyLineId:(int)req.GameStoryLineId, mapTp:req.MapTp); connection.SendPacket(new PacketEnterSceneScRsp(overMapTp == true, req.MapTp, (int)req.GameStoryLineId)); }