From 9b1d029edac22780a41d66632ad8a27dc3cea08f Mon Sep 17 00:00:00 2001 From: StopWuyu Date: Fri, 15 Aug 2025 20:17:39 +0800 Subject: [PATCH] refactor: challenge --- Command/Command/Cmd/CommandUnlockAll.cs | 25 + Common/Common.csproj | 1 + Common/Data/Excel/BattleTargetConfigExcel.cs | 18 + Common/Data/Excel/ChallengeConfigExcel.cs | 25 +- .../Excel/ChallengePeakBossConfigExcel.cs | 30 + Common/Data/Excel/ChallengePeakConfigExcel.cs | 38 + .../Excel/ChallengePeakGroupConfigExcel.cs | 22 + Common/Data/Excel/ChallengeStoryExtraExcel.cs | 2 +- Common/Data/GameData.cs | 4 + Common/Database/Avatar/AvatarData.cs | 16 + Common/Database/Challenge/ChallengeData.cs | 15 +- Common/Util/Extensions.cs | 31 + Common/Util/GameConstants.cs | 1 + DanhengServer.sln | 6 + .../Game/Challenge/ChallengeEntityLoader.cs | 46 +- .../Game/Challenge/ChallengeInstance.cs | 452 --- GameServer/Game/Challenge/ChallengeManager.cs | 108 +- .../Definitions/BaseChallengeInstance.cs | 27 + .../BaseLegacyChallengeInstance.cs | 35 + .../Instances/ChallengeBossInstance.cs | 326 ++ .../Instances/ChallengeMemoryInstance.cs | 210 ++ .../Instances/ChallengeStoryInstance.cs | 250 ++ .../Handler/MissionHandlerChallengeFinish.cs | 9 +- GameServer/Game/Player/PlayerInstance.cs | 9 +- GameServer/GameServer.csproj | 1 + GameServer/Plugin/Event/PluginEvent.cs | 9 +- GameServer/Server/Connection.cs | 1 + .../HandlerEnterChallengeNextPhaseCsReq.cs | 7 +- .../PacketChallengeBossPhaseSettleNotify.cs | 17 +- .../Challenge/PacketChallengeSettleNotify.cs | 13 +- .../Challenge/PacketGetCurChallengeScRsp.cs | 10 +- .../Challenge/PacketStartChallengeScRsp.cs | 11 +- .../Send/Mission/PacketGetMissionDataScRsp.cs | 2 +- Program/Program/EntryPoint.cs | 10 +- ServerSideProto/ChallengeData.cs | 2920 +++++++++++++++++ ServerSideProto/ProtoFile/ChallengeData.proto | 78 + ServerSideProto/RefreshProto.bat | 4 + ServerSideProto/ServerSideProto.csproj | 15 + 38 files changed, 4243 insertions(+), 561 deletions(-) create mode 100644 Common/Data/Excel/BattleTargetConfigExcel.cs create mode 100644 Common/Data/Excel/ChallengePeakBossConfigExcel.cs create mode 100644 Common/Data/Excel/ChallengePeakConfigExcel.cs create mode 100644 Common/Data/Excel/ChallengePeakGroupConfigExcel.cs delete mode 100644 GameServer/Game/Challenge/ChallengeInstance.cs create mode 100644 GameServer/Game/Challenge/Definitions/BaseChallengeInstance.cs create mode 100644 GameServer/Game/Challenge/Definitions/BaseLegacyChallengeInstance.cs create mode 100644 GameServer/Game/Challenge/Instances/ChallengeBossInstance.cs create mode 100644 GameServer/Game/Challenge/Instances/ChallengeMemoryInstance.cs create mode 100644 GameServer/Game/Challenge/Instances/ChallengeStoryInstance.cs create mode 100644 ServerSideProto/ChallengeData.cs create mode 100644 ServerSideProto/ProtoFile/ChallengeData.proto create mode 100644 ServerSideProto/RefreshProto.bat create mode 100644 ServerSideProto/ServerSideProto.csproj diff --git a/Command/Command/Cmd/CommandUnlockAll.cs b/Command/Command/Cmd/CommandUnlockAll.cs index ca9bf58b..cce5f3a1 100644 --- a/Command/Command/Cmd/CommandUnlockAll.cs +++ b/Command/Command/Cmd/CommandUnlockAll.cs @@ -98,4 +98,29 @@ public class CommandUnlockAll : ICommand await arg.Target!.Player!.SendPacket(new PacketPlayerKickOutScNotify()); arg.Target!.Stop(); } + + [CommandMethod("0 challenge")] + public async ValueTask UnlockAllChallenge(CommandArg arg) + { + if (arg.Target == null) + { + await arg.SendMsg(I18NManager.Translate("Game.Command.Notice.PlayerNotFound")); + return; + } + + var player = arg.Target!.Player!; + List peakList = [2200503, 2200504, 2200505, 2200506]; + + List allList = [.. peakList]; + + foreach (var id in allList) + { + // finish mission + await player.QuestManager!.AcceptQuest(id); + await player.QuestManager!.FinishQuest(id); + } + + await arg.SendMsg(I18NManager.Translate("Game.Command.UnlockAll.UnlockedAll", + I18NManager.Translate("Word.TypesOfChallenge"))); + } } \ No newline at end of file diff --git a/Common/Common.csproj b/Common/Common.csproj index 5747df4a..3e0adf1c 100644 --- a/Common/Common.csproj +++ b/Common/Common.csproj @@ -24,6 +24,7 @@ + diff --git a/Common/Data/Excel/BattleTargetConfigExcel.cs b/Common/Data/Excel/BattleTargetConfigExcel.cs new file mode 100644 index 00000000..7d8272f1 --- /dev/null +++ b/Common/Data/Excel/BattleTargetConfigExcel.cs @@ -0,0 +1,18 @@ +namespace EggLink.DanhengServer.Data.Excel; + +[ResourceEntity("BattleTargetConfig.json")] +public class BattleTargetConfigExcel : ExcelResource +{ + public int ID { get; set; } + public int TargetParam { get; set; } + + public override int GetId() + { + return ID; + } + + public override void Loaded() + { + GameData.BattleTargetConfigData.TryAdd(ID, this); + } +} \ No newline at end of file diff --git a/Common/Data/Excel/ChallengeConfigExcel.cs b/Common/Data/Excel/ChallengeConfigExcel.cs index 4b67bf3c..a3caef95 100644 --- a/Common/Data/Excel/ChallengeConfigExcel.cs +++ b/Common/Data/Excel/ChallengeConfigExcel.cs @@ -1,4 +1,5 @@ using Newtonsoft.Json; +using System.Threading; namespace EggLink.DanhengServer.Data.Excel; @@ -31,9 +32,9 @@ public class ChallengeConfigExcel : ExcelResource public List? NpcMonsterIDList2 { get; set; } = []; public List? EventIDList2 { get; set; } = []; - [JsonIgnore] public Dictionary ChallengeMonsters1 { get; set; } = new(); + [JsonIgnore] public Dictionary> ChallengeMonsters1 { get; set; } = new(); - [JsonIgnore] public Dictionary ChallengeMonsters2 { get; set; } = new(); + [JsonIgnore] public Dictionary> ChallengeMonsters2 { get; set; } = new(); public override int GetId() { @@ -53,7 +54,7 @@ public class ChallengeConfigExcel : ExcelResource public void SetStoryExcel(ChallengeStoryExtraExcel storyExcel) { StoryExcel = storyExcel; - ChallengeCountDown = storyExcel.TurnLimit; + ChallengeCountDown = (int)storyExcel.TurnLimit; } public void SetBossExcel(ChallengeBossExtraExcel bossExcel) @@ -68,16 +69,18 @@ public class ChallengeConfigExcel : ExcelResource { if (ConfigList1[i] == 0) break; - var Monster = new ChallengeMonsterInfo(ConfigList1[i], NpcMonsterIDList1![i], EventIDList1![i]); - ChallengeMonsters1.Add(Monster.ConfigId, Monster); + var monster = new ChallengeMonsterInfo(ConfigList1[i], NpcMonsterIDList1![i], EventIDList1![i]); + ChallengeMonsters1.TryAdd(MazeGroupID1, []); + ChallengeMonsters1[MazeGroupID1].Add(monster); } for (var i = 0; i < ConfigList2?.Count; i++) { if (ConfigList2[i] == 0) break; - var Monster = new ChallengeMonsterInfo(ConfigList2[i], NpcMonsterIDList2![i], EventIDList2![i]); - ChallengeMonsters2.Add(Monster.ConfigId, Monster); + var monster = new ChallengeMonsterInfo(ConfigList2[i], NpcMonsterIDList2![i], EventIDList2![i]); + ChallengeMonsters2.TryAdd(MazeGroupID2, []); + ChallengeMonsters2[MazeGroupID2].Add(monster); } ConfigList1 = null; @@ -91,10 +94,10 @@ public class ChallengeConfigExcel : ExcelResource } [method: JsonConstructor] - public class ChallengeMonsterInfo(int ConfigId, int NpcMonsterId, int EventId) + public class ChallengeMonsterInfo(int configId, int npcMonsterId, int eventId) { - public int ConfigId = ConfigId; - public int EventId = EventId; - public int NpcMonsterId = NpcMonsterId; + public int ConfigId = configId; + public int EventId = eventId; + public int NpcMonsterId = npcMonsterId; } } \ No newline at end of file diff --git a/Common/Data/Excel/ChallengePeakBossConfigExcel.cs b/Common/Data/Excel/ChallengePeakBossConfigExcel.cs new file mode 100644 index 00000000..df101a86 --- /dev/null +++ b/Common/Data/Excel/ChallengePeakBossConfigExcel.cs @@ -0,0 +1,30 @@ +using EggLink.DanhengServer.Data.Custom; +using Newtonsoft.Json; + +namespace EggLink.DanhengServer.Data.Excel; + +[ResourceEntity("ChallengePeakBossConfig.json")] +public class ChallengePeakBossConfigExcel : ExcelResource +{ + public int ID { get; set; } + public int HardTarget { get; set; } + public int ColorMedalTarget { get; set; } + public List HardEventIDList { get; set; } = []; + public List HardTagList { get; set; } = []; + public List BuffList { get; set; } = []; + + public override int GetId() + { + return ID; + } + + public override void Loaded() + { + GameData.ChallengePeakBossConfigData.TryAdd(ID, this); + } + + public override void AfterAllDone() + { + GameData.ChallengePeakConfigData[ID].BossExcel = this; + } +} \ No newline at end of file diff --git a/Common/Data/Excel/ChallengePeakConfigExcel.cs b/Common/Data/Excel/ChallengePeakConfigExcel.cs new file mode 100644 index 00000000..58d633d6 --- /dev/null +++ b/Common/Data/Excel/ChallengePeakConfigExcel.cs @@ -0,0 +1,38 @@ +using EggLink.DanhengServer.Data.Custom; +using Newtonsoft.Json; + +namespace EggLink.DanhengServer.Data.Excel; + +[ResourceEntity("ChallengePeakConfig.json")] +public class ChallengePeakConfigExcel : ExcelResource +{ + public int ID { get; set; } + public int MazeGroupID { get; set; } + public int MapEntranceID { get; set; } + public List TagList { get; set; } = []; + public List HPProgressValueList { get; set; } = []; + public List ProgressValueList { get; set; } = []; + public List ConfigIDList { get; set; } = []; + public List EventIDList { get; set; } = []; + public List NpcMonsterIDList { get; set; } = []; + public List NormalTargetList { get; set; } = []; + + [JsonIgnore] public Dictionary> ChallengeMonsters { get; } = []; + [JsonIgnore] public ChallengePeakBossConfigExcel? BossExcel { get; set; } + + public override int GetId() + { + return ID; + } + + public override void Loaded() + { + GameData.ChallengePeakConfigData.TryAdd(ID, this); + + ChallengeMonsters.Add(MazeGroupID, []); + for (var i = 0; i < ConfigIDList.Count; i++) + { + ChallengeMonsters[MazeGroupID].Add(new ChallengeConfigExcel.ChallengeMonsterInfo(ConfigIDList[i], NpcMonsterIDList[i], EventIDList[i])); + } + } +} \ No newline at end of file diff --git a/Common/Data/Excel/ChallengePeakGroupConfigExcel.cs b/Common/Data/Excel/ChallengePeakGroupConfigExcel.cs new file mode 100644 index 00000000..c9486cbc --- /dev/null +++ b/Common/Data/Excel/ChallengePeakGroupConfigExcel.cs @@ -0,0 +1,22 @@ +namespace EggLink.DanhengServer.Data.Excel; + +[ResourceEntity("ChallengePeakGroupConfig.json")] +public class ChallengePeakGroupConfigExcel : ExcelResource +{ + public int ID { get; set; } + public int RewardGroupID { get; set; } + public int MapEntranceID { get; set; } + public int MapEntranceBoss { get; set; } + public int BossLevelID { get; set; } + public List PreLevelIDList { get; set; } = []; + + public override int GetId() + { + return ID; + } + + public override void Loaded() + { + GameData.ChallengePeakGroupConfigData.TryAdd(ID, this); + } +} \ No newline at end of file diff --git a/Common/Data/Excel/ChallengeStoryExtraExcel.cs b/Common/Data/Excel/ChallengeStoryExtraExcel.cs index 0f4627d3..fe2887d3 100644 --- a/Common/Data/Excel/ChallengeStoryExtraExcel.cs +++ b/Common/Data/Excel/ChallengeStoryExtraExcel.cs @@ -4,7 +4,7 @@ public class ChallengeStoryExtraExcel : ExcelResource { public int ID { get; set; } - public int TurnLimit { get; set; } + public uint TurnLimit { get; set; } public int ClearScore { get; set; } public List? BattleTargetID { get; set; } diff --git a/Common/Data/GameData.cs b/Common/Data/GameData.cs index c2949b0f..973f2ec5 100644 --- a/Common/Data/GameData.cs +++ b/Common/Data/GameData.cs @@ -76,6 +76,9 @@ public static class GameData public static Dictionary ChallengeConfigData { get; private set; } = []; public static Dictionary ChallengeTargetData { get; private set; } = []; public static Dictionary ChallengeGroupData { get; private set; } = []; + public static Dictionary ChallengePeakGroupConfigData { get; private set; } = []; + public static Dictionary ChallengePeakConfigData { get; private set; } = []; + public static Dictionary ChallengePeakBossConfigData { get; private set; } = []; public static Dictionary> ChallengeRewardData { get; private set; } = []; #endregion @@ -91,6 +94,7 @@ public static class GameData public static Dictionary MonsterConfigData { get; private set; } = []; public static Dictionary MonsterDropData { get; private set; } = []; public static Dictionary BattleCollegeConfigData { get; private set; } = []; + public static Dictionary BattleTargetConfigData { get; private set; } = []; #endregion diff --git a/Common/Database/Avatar/AvatarData.cs b/Common/Database/Avatar/AvatarData.cs index eb1b8be7..78525a67 100644 --- a/Common/Database/Avatar/AvatarData.cs +++ b/Common/Database/Avatar/AvatarData.cs @@ -268,6 +268,22 @@ public class FormalAvatarInfo : BaseAvatarInfo return proto; } + public ChallengePeakAvatar ToPeakAvatarProto() + { + return new ChallengePeakAvatar + { + AvatarId = (uint)AvatarId, + EquipmentUniqueId = (uint)GetCurPathInfo().EquipId, + RelicList = + { + GetCurPathInfo().Relic.Select(relic => new EquipRelic + { + Type = (uint)relic.Key, + RelicUniqueId = (uint)relic.Value + }) + } + }; + } public List ToAvatarPathProto() { var res = new List(); diff --git a/Common/Database/Challenge/ChallengeData.cs b/Common/Database/Challenge/ChallengeData.cs index 544b1ed2..f7ede889 100644 --- a/Common/Database/Challenge/ChallengeData.cs +++ b/Common/Database/Challenge/ChallengeData.cs @@ -9,16 +9,25 @@ public class ChallengeData : BaseDatabaseDataHelper { [SugarColumn(IsJson = true)] public Dictionary History { get; set; } = new(); - [SugarColumn(IsJson = true)] public ChallengeInstanceData Instance { get; set; } = new(); + [SugarColumn(IsNullable = true)] public string? ChallengeInstance { get; set; } + [SugarColumn(IsNullable = true)] public string? Instance { get; set; } = null; // placeholder [SugarColumn(IsJson = true)] public Dictionary TakenRewards { get; set; } = new(); + [SugarColumn(IsJson = true)] public Dictionary PeakLevelDatas { get; set; } = new(); - public void delete(int ChallengeId) + public void Delete(int challengeId) { - History.Remove(ChallengeId); + History.Remove(challengeId); } } +public class ChallengePeakLevelData +{ + public int LevelId { get; set; } + public uint PeakStar { get; set; } + public List BaseAvatarList { get; set; } = []; +} + public class ChallengeHistoryData(int uid, int challengeId) { public int OwnerId { get; set; } = uid; diff --git a/Common/Util/Extensions.cs b/Common/Util/Extensions.cs index eda40ead..b0650df7 100644 --- a/Common/Util/Extensions.cs +++ b/Common/Util/Extensions.cs @@ -1,5 +1,6 @@ using System.Buffers.Binary; using EggLink.DanhengServer.Proto; +using EggLink.DanhengServer.Proto.ServerSide; using Newtonsoft.Json; namespace EggLink.DanhengServer.Util; @@ -16,6 +17,36 @@ public static class Extensions }; } + public static Position ToPosition(this Vector3Pb vector) + { + return new Position + { + X = vector.X, + Y = vector.Y, + Z = vector.Z + }; + } + + public static Vector ToVector(this Position position) + { + return new Vector + { + X = position.X, + Y = position.Y, + Z = position.Z + }; + } + + public static Vector3Pb ToVector3Pb(this Position position) + { + return new Vector3Pb + { + X = position.X, + Y = position.Y, + Z = position.Z + }; + } + public static T RandomElement(this List values) { var index = new Random().Next(values.Count); diff --git a/Common/Util/GameConstants.cs b/Common/Util/GameConstants.cs index aa2ef851..65338730 100644 --- a/Common/Util/GameConstants.cs +++ b/Common/Util/GameConstants.cs @@ -16,6 +16,7 @@ public static class GameConstants public const int LAST_TRAIN_WORLD_ID = 501; public const int AMBUSH_BUFF_ID = 1000102; public const int CHALLENGE_ENTRANCE = 100000103; + public const int CHALLENGE_PEAK_ENTRANCE = 100000352; public const int CHALLENGE_STORY_ENTRANCE = 102020107; public const int CHALLENGE_BOSS_ENTRANCE = 1030402; public const int CURRENT_ROGUE_TOURN_SEASON = 2; diff --git a/DanhengServer.sln b/DanhengServer.sln index 20786567..0cd2511a 100644 --- a/DanhengServer.sln +++ b/DanhengServer.sln @@ -27,6 +27,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Proto", "Proto\Proto.csproj EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DanhengKcpSharp", "DanhengKcpSharp\DanhengKcpSharp.csproj", "{CD7EFAA3-C655-40EE-8F6A-A8E2DA3B0FCB}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServerSideProto", "ServerSideProto\ServerSideProto.csproj", "{1F94D996-0E35-4A56-9437-00949576D6B8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -61,6 +63,10 @@ Global {CD7EFAA3-C655-40EE-8F6A-A8E2DA3B0FCB}.Debug|Any CPU.Build.0 = Debug|Any CPU {CD7EFAA3-C655-40EE-8F6A-A8E2DA3B0FCB}.Release|Any CPU.ActiveCfg = Release|Any CPU {CD7EFAA3-C655-40EE-8F6A-A8E2DA3B0FCB}.Release|Any CPU.Build.0 = Release|Any CPU + {1F94D996-0E35-4A56-9437-00949576D6B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F94D996-0E35-4A56-9437-00949576D6B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F94D996-0E35-4A56-9437-00949576D6B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F94D996-0E35-4A56-9437-00949576D6B8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/GameServer/Game/Challenge/ChallengeEntityLoader.cs b/GameServer/Game/Challenge/ChallengeEntityLoader.cs index fb5c66a3..d53f0434 100644 --- a/GameServer/Game/Challenge/ChallengeEntityLoader.cs +++ b/GameServer/Game/Challenge/ChallengeEntityLoader.cs @@ -1,10 +1,10 @@ using EggLink.DanhengServer.Data; using EggLink.DanhengServer.Data.Config.Scene; -using EggLink.DanhengServer.Data.Excel; using EggLink.DanhengServer.Enums.Scene; using EggLink.DanhengServer.GameServer.Game.Player; using EggLink.DanhengServer.GameServer.Game.Scene; using EggLink.DanhengServer.GameServer.Game.Scene.Entity; +using EggLink.DanhengServer.Proto.ServerSide; using EggLink.DanhengServer.Util; namespace EggLink.DanhengServer.GameServer.Game.Challenge; @@ -23,16 +23,23 @@ public class ChallengeEntityLoader(SceneInstance scene, PlayerInstance player) : LoadGroups.SafeAddRange(Scene.FloorInfo!.Groups.Keys.ToList()); // Setup first stage - var excel = instance.Excel; - Scene.FloorInfo.Groups.TryGetValue(excel.MazeGroupID1, out var groupData); - if (groupData != null) await LoadGroup(groupData); + var stages = instance.GetStageMonsters(); - // Set leave entry - Scene.LeaveEntryId = - instance.IsStory() ? GameConstants.CHALLENGE_STORY_ENTRANCE : GameConstants.CHALLENGE_ENTRANCE; + foreach (var stage in stages) + { + Scene.FloorInfo.Groups.TryGetValue(stage.Key, out var groupData); + if (groupData != null) await LoadGroup(groupData); + } - if (instance.IsBoss()) - Scene.LeaveEntryId = GameConstants.CHALLENGE_BOSS_ENTRANCE; + Scene.LeaveEntryId = instance.Data.ChallengeTypeCase switch + { + // Set leave entry + ChallengeDataPb.ChallengeTypeOneofCase.Boss => GameConstants.CHALLENGE_BOSS_ENTRANCE, + ChallengeDataPb.ChallengeTypeOneofCase.Memory => GameConstants.CHALLENGE_ENTRANCE, + ChallengeDataPb.ChallengeTypeOneofCase.Peak => GameConstants.CHALLENGE_PEAK_ENTRANCE, + ChallengeDataPb.ChallengeTypeOneofCase.Story => GameConstants.CHALLENGE_STORY_ENTRANCE, + _ => Scene.LeaveEntryId + }; foreach (var group in Scene.FloorInfo.Groups.Values) { @@ -40,7 +47,7 @@ public class ChallengeEntityLoader(SceneInstance scene, PlayerInstance player) : if (group.LoadSide != GroupLoadSideEnum.Server) continue; // Dont load the groups that have monsters in them - if (group.PropList.Count > 0 && group.MonsterList.Count > 0) await LoadGroup(group); + if (group.PropList.Count > 0 && group.MonsterList.Count == 0) await LoadGroup(group); } Scene.IsLoaded = true; @@ -56,21 +63,19 @@ public class ChallengeEntityLoader(SceneInstance scene, PlayerInstance player) : var instance = Player.ChallengeManager.ChallengeInstance; // Get current stage monster infos - Dictionary challengeMonsters; - if (instance.Excel.MazeGroupID1 == group.Id || instance.Excel.MazeGroupID2 == group.Id) - challengeMonsters = instance.CurrentStage == 1 - ? instance.Excel.ChallengeMonsters1 - : instance.Excel.ChallengeMonsters2; - else + var stages = instance.GetStageMonsters(); + + if (!stages.TryGetValue(group.Id, out var challengeMonsters)) + { return null; + } // Get challenge monster info - if (!challengeMonsters.ContainsKey(info.ID)) return null; - var challengeMonsterInfo = challengeMonsters[info.ID]; + if (challengeMonsters.All(x => x.ConfigId != info.ID)) return null; + var challengeMonsterInfo = challengeMonsters.First(x => x.ConfigId == info.ID); // Get excels from game data - if (!GameData.NpcMonsterDataData.ContainsKey(challengeMonsterInfo.NpcMonsterId)) return null; - var npcMonsterExcel = GameData.NpcMonsterDataData[challengeMonsterInfo.NpcMonsterId]; + if (!GameData.NpcMonsterDataData.TryGetValue(challengeMonsterInfo.NpcMonsterId, out var npcMonsterExcel)) return null; // Create monster from group monster info var entity = new EntityMonster(Scene, info.ToPositionProto(), info.ToRotationProto(), group.Id, info.ID, @@ -79,6 +84,7 @@ public class ChallengeEntityLoader(SceneInstance scene, PlayerInstance player) : EventId = challengeMonsterInfo.EventId, CustomStageId = challengeMonsterInfo.EventId }; + await Scene.AddEntity(entity, sendPacket); return entity; diff --git a/GameServer/Game/Challenge/ChallengeInstance.cs b/GameServer/Game/Challenge/ChallengeInstance.cs deleted file mode 100644 index 7846011d..00000000 --- a/GameServer/Game/Challenge/ChallengeInstance.cs +++ /dev/null @@ -1,452 +0,0 @@ -using System.Text.Json.Serialization; -using EggLink.DanhengServer.Data; -using EggLink.DanhengServer.Data.Excel; -using EggLink.DanhengServer.Database.Challenge; -using EggLink.DanhengServer.Enums.Item; -using EggLink.DanhengServer.Enums.Mission; -using EggLink.DanhengServer.GameServer.Game.Battle; -using EggLink.DanhengServer.GameServer.Game.Player; -using EggLink.DanhengServer.GameServer.Game.Scene; -using EggLink.DanhengServer.GameServer.Game.Scene.Entity; -using EggLink.DanhengServer.GameServer.Server.Packet.Send.Challenge; -using EggLink.DanhengServer.GameServer.Server.Packet.Send.Lineup; -using EggLink.DanhengServer.Proto; -using EggLink.DanhengServer.Util; - -namespace EggLink.DanhengServer.GameServer.Game.Challenge; - -public class ChallengeInstance -{ - public ChallengeInstance(PlayerInstance player, ChallengeConfigExcel excel) - { - Player = player; - Excel = excel; - ChallengeId = excel.GetId(); - StartPos = new Position(); - StartRot = new Position(); - CurrentStage = 1; - RoundsLeft = Excel.IsStory() ? 5 : Excel.ChallengeCountDown; - SetStatus(ChallengeStatus.ChallengeDoing); - SetCurrentExtraLineup(ExtraLineupType.LineupChallenge); - } - - public ChallengeInstance(PlayerInstance player, ChallengeConfigExcel excel, ChallengeInstanceData data) - { - Player = player; - Excel = excel; - - StartPos = data.StartPos; - StartRot = data.StartRot; - ChallengeId = data.ChallengeId; - CurrentStage = data.CurrentStage; - CurrentExtraLineup = data.CurrentExtraLineup; - Status = data.Status; - HasAvatarDied = data.HasAvatarDied; - SavedMp = data.SavedMp; - RoundsLeft = data.RoundsLeft; - Stars = data.Stars; - ScoreStage1 = data.ScoreStage1; - ScoreStage2 = data.ScoreStage2; - StoryBuffs = data.StoryBuffs; - BossBuffs = data.BossBuffs; - } - - public Position StartPos { get; set; } - public Position StartRot { get; set; } - public int ChallengeId { get; set; } - public int CurrentStage { get; set; } - public int CurrentExtraLineup { get; set; } - public int Status { get; set; } - public bool HasAvatarDied { get; set; } - - public int SavedMp { get; set; } - public int RoundsLeft { get; set; } - public int Stars { get; set; } - public int ScoreStage1 { get; set; } - public int ScoreStage2 { get; set; } - - [JsonIgnore] public List? BossTarget1 { get; set; } - - [JsonIgnore] public List? BossTarget2 { get; set; } - - [JsonIgnore] private PlayerInstance Player { get; } - - [JsonIgnore] public ChallengeConfigExcel Excel { get; set; } - - public List StoryBuffs { get; set; } = []; - public List BossBuffs { get; set; } = []; - - public SceneInstance GetScene() - { - return Player.SceneInstance!; - } - - public int GetChallengeId() - { - return Excel.GetId(); - } - - public bool IsStory() - { - return Excel.IsStory(); - } - - public bool IsBoss() - { - return Excel.IsBoss(); - } - - public void SetStatus(ChallengeStatus status) - { - Status = (int)status; - } - - public void SetCurrentExtraLineup(ExtraLineupType type) - { - CurrentExtraLineup = (int)type; - } - - public int GetRoundsElapsed() - { - return Excel.ChallengeCountDown - RoundsLeft; - } - - public int GetTotalScore() - { - return ScoreStage1 + ScoreStage2; - } - - public bool IsWin() - { - return Status == (int)ChallengeStatus.ChallengeFinish; - } - - #region Serialization - - public CurChallenge ToProto() - { - var proto = new CurChallenge - { - ChallengeId = (uint)Excel.GetId(), - Status = (ChallengeStatus)Status, - ScoreId = (uint)ScoreStage1, - ScoreTwo = (uint)ScoreStage2, - RoundCount = (uint)GetRoundsElapsed(), - ExtraLineupType = (ExtraLineupType)CurrentExtraLineup, - StageInfo = new ChallengeCurBuffInfo() - }; - - if (Excel.IsBoss()) - proto.StageInfo.CurBossBuffs = new ChallengeBossBuffList - { - ChallengeBossConst = 1 - }; - - if (Excel.IsStory()) proto.StageInfo.CurStoryBuffs = new ChallengeStoryBuffList(); - - if (StoryBuffs.Count >= CurrentStage) - proto.StageInfo.CurStoryBuffs.BuffList.Add(StoryBuffs.Select(x => (uint)x)); - - if (BossBuffs.Count >= CurrentStage) - proto.StageInfo.CurBossBuffs.BuffList.Add(BossBuffs.Select(x => (uint)x)); - - return proto; - } - - public ChallengeStageInfo ToStageInfo() - { - var proto = new ChallengeStageInfo(); - - if (Excel.IsBoss()) - { - proto.BossInfo = new ChallengeBossInfo - { - FirstNode = new ChallengeBossSingleNodeInfo - { - BuffId = (uint)BossBuffs[0] - }, - SecondNode = new ChallengeBossSingleNodeInfo - { - BuffId = (uint)BossBuffs[1] - }, - NCBDNPGPEAI = true - }; - - foreach (var lineupAvatar in Player.LineupManager?.GetExtraLineup(ExtraLineupType.LineupChallenge) - ?.BaseAvatars ?? []) - { - var avatar = Player.AvatarManager?.GetFormalAvatar(lineupAvatar.BaseAvatarId); - if (avatar == null) continue; - proto.BossInfo.FirstLineup.Add((uint)avatar.AvatarId); - var equip = Player.InventoryManager?.GetItem(0, avatar.GetCurPathInfo().EquipId, - ItemMainTypeEnum.Equipment); - if (equip != null) - proto.BossInfo.ChallengeAvatarEquipmentMap.Add((uint)avatar.AvatarId, - equip.ToChallengeEquipmentProto()); - - var relicProto = new ChallengeBossAvatarRelicInfo(); - - foreach (var relicUniqueId in avatar.GetCurPathInfo().Relic) - { - var relic = Player.InventoryManager?.GetItem(0, relicUniqueId.Value, ItemMainTypeEnum.Relic); - if (relic == null) continue; - relicProto.AvatarRelicSlotMap.Add((uint)relicUniqueId.Key, relic.ToChallengeRelicProto()); - } - - proto.BossInfo.ChallengeAvatarRelicMap.Add((uint)avatar.AvatarId, relicProto); - } - - foreach (var lineupAvatar in Player.LineupManager?.GetExtraLineup(ExtraLineupType.LineupChallenge2) - ?.BaseAvatars ?? []) - { - var avatar = Player.AvatarManager?.GetFormalAvatar(lineupAvatar.BaseAvatarId); - if (avatar == null) continue; - proto.BossInfo.SecondLineup.Add((uint)avatar.AvatarId); - var equip = Player.InventoryManager?.GetItem(0, avatar.GetCurPathInfo().EquipId, - ItemMainTypeEnum.Equipment); - if (equip != null) - proto.BossInfo.ChallengeAvatarEquipmentMap.Add((uint)avatar.AvatarId, - equip.ToChallengeEquipmentProto()); - - var relicProto = new ChallengeBossAvatarRelicInfo(); - - foreach (var relicUniqueId in avatar.GetCurPathInfo().Relic) - { - var relic = Player.InventoryManager?.GetItem(0, relicUniqueId.Value, ItemMainTypeEnum.Relic); - if (relic == null) continue; - relicProto.AvatarRelicSlotMap.Add((uint)relicUniqueId.Key, relic.ToChallengeRelicProto()); - } - - proto.BossInfo.ChallengeAvatarRelicMap.Add((uint)avatar.AvatarId, relicProto); - } - } - - return proto; - } - - #endregion - - #region Management - - public void OnBattleStart(BattleInstance battle) - { - battle.RoundLimit = RoundsLeft; - - battle.Buffs.Add(new MazeBuff(Excel.MazeBuffID, 1, -1)); - - if (StoryBuffs.Count >= CurrentStage) - { - var buffId = StoryBuffs[CurrentStage - 1]; - battle.Buffs.Add(new MazeBuff(buffId, 1, -1)); - } - - if (Excel.StoryExcel != null) - { - battle.AddBattleTarget(1, 10002, GetTotalScore()); - - foreach (var id in Excel.StoryExcel.BattleTargetID!) battle.AddBattleTarget(5, id, GetTotalScore()); - } - - if (Excel.BossExcel != null) - { - battle.AddBattleTarget(1, 90004, 0); - battle.AddBattleTarget(1, 90005, 0); - } - } - - public virtual async ValueTask OnBattleEnd(BattleInstance battle, PVEBattleResultCsReq req) - { - if (IsStory()) - { - // Calculate score for current stage - var stageScore = (int)req.Stt.ChallengeScore - GetTotalScore(); - - // Set score - if (CurrentStage == 1) - ScoreStage1 = stageScore; - else - ScoreStage2 = stageScore; - } - - if (IsBoss()) - { - // Calculate score for current stage - var stageScore = 0; - foreach (var battleTarget in req.Stt.BattleTargetInfo[1].BattleTargetList_) - stageScore += (int)battleTarget.Progress; - - // Set score - if (CurrentStage == 1) - ScoreStage1 = stageScore; - else - ScoreStage2 = stageScore; - } - - switch (req.EndStatus) - { - case BattleEndStatus.BattleEndWin: - // Check if any avatar in the lineup has died - foreach (var avatar in battle.Lineup.AvatarData!.FormalAvatars) - if (avatar.CurrentHp <= 0) - HasAvatarDied = true; - - // Get monster count in stage - long monsters = Player.SceneInstance!.Entities.Values.OfType().Count(); - - if (monsters == 0) await AdvanceStage(req); - - // Calculate rounds left - if (!(IsStory() && IsBoss())) - RoundsLeft = (int)Math.Min(Math.Max(RoundsLeft - req.Stt.RoundCnt, 1), RoundsLeft); - - // Set saved technique points (This will be restored if the player resets the challenge) - SavedMp = Player.LineupManager!.GetCurLineup()!.Mp; - break; - case BattleEndStatus.BattleEndQuit: - // Reset technique points and move back to start position - var lineup = Player.LineupManager!.GetCurLineup()!; - lineup.Mp = SavedMp; - await Player.MoveTo(StartPos, StartRot); - await Player.SendPacket(new PacketSyncLineupNotify(lineup)); - break; - default: - // Determine challenge result - if ((IsStory() || IsBoss()) && req.Stt.EndReason == BattleEndReason.TurnLimit) - { - await AdvanceStage(req); - } - else - { - // Fail challenge - Status = (int)ChallengeStatus.ChallengeFailed; - - // Send challenge result data - await Player.SendPacket(new PacketChallengeSettleNotify(this)); - } - - break; - } - } - - private async ValueTask AdvanceStage(PVEBattleResultCsReq req) - { - if (CurrentStage >= Excel.StageNum) - { - // Last stage - Status = (int)ChallengeStatus.ChallengeFinish; - Stars = CalculateStars(); - - // Save history - Player.ChallengeManager!.AddHistory(ChallengeId, Stars, GetTotalScore()); - - // Send challenge result data - if (IsBoss()) - await Player.SendPacket(new PacketChallengeBossPhaseSettleNotify(this, req.Stt.BattleTargetInfo[1])); - else - await Player.SendPacket(new PacketChallengeSettleNotify(this)); - - // Call MissionManager - await Player.MissionManager!.HandleFinishType(MissionFinishTypeEnum.ChallengeFinish, this); - } - else - { - if (IsBoss()) - { - await Player.SendPacket(new PacketChallengeBossPhaseSettleNotify(this, req.Stt.BattleTargetInfo[1])); - } - else - { - // Increment and reset stage - CurrentStage++; - // Unload scene group for stage 1 - await Player.SceneInstance!.EntityLoader!.UnloadGroup(Excel.MazeGroupID1); - - // Load scene group for stage 2 - await Player.SceneInstance!.EntityLoader!.LoadGroup(Excel.MazeGroupID2); - - // Change player line up - SetCurrentExtraLineup(ExtraLineupType.LineupChallenge2); - await Player.LineupManager!.SetCurLineup(CurrentExtraLineup + 10); - await Player.SendPacket(new PacketChallengeLineupNotify((ExtraLineupType)CurrentExtraLineup)); - SavedMp = Player.LineupManager.GetCurLineup()!.Mp; - - // Move player - if (Excel.MapEntranceID2 != 0 && Excel.MapEntranceID2 != Excel.MapEntranceID) - { - await Player.EnterScene(Excel.MapEntranceID2, 0, true); - StartPos = Player.Data.Pos!; - StartRot = Player.Data.Rot!; - await Player.SceneInstance!.EntityLoader!.UnloadGroup(Excel.MazeGroupID1); - await Player.SceneInstance!.EntityLoader!.LoadGroup(Excel.MazeGroupID2); - } - else - { - await Player.MoveTo(StartPos, StartRot); - } - } - } - } - - public async ValueTask NextPhase() - { - // Increment and reset stage - CurrentStage++; - // Load scene group for stage 2 - await Player.SceneInstance!.EntityLoader!.LoadGroup(Excel.MazeGroupID2); - - // Change player line up - SetCurrentExtraLineup(ExtraLineupType.LineupChallenge2); - await Player.LineupManager!.SetCurLineup(CurrentExtraLineup + 10); - await Player.SendPacket(new PacketChallengeLineupNotify((ExtraLineupType)CurrentExtraLineup)); - SavedMp = Player.LineupManager.GetCurLineup()!.Mp; - - // Move player - if (Excel.MapEntranceID2 != 0) - { - await Player.EnterScene(Excel.MapEntranceID2, 0, false); - StartPos = Player.Data.Pos!; - StartRot = Player.Data.Rot!; - await Player.SceneInstance!.EntityLoader!.LoadGroup(Excel.MazeGroupID2); - } - else - { - await Player.MoveTo(StartPos, StartRot); - } - } - - public void OnUpdate() - { - // End challenge if its done - if (Status != (int)ChallengeStatus.ChallengeDoing) Player.ChallengeManager!.ChallengeInstance = null; - } - - public int CalculateStars() - { - var targets = Excel.ChallengeTargetID!; - var stars = 0; - - for (var i = 0; i < targets.Count; i++) - { - if (!GameData.ChallengeTargetData.ContainsKey(targets[i])) continue; - - var target = GameData.ChallengeTargetData[targets[i]]; - - switch (target.ChallengeTargetType) - { - case ChallengeTargetExcel.ChallengeType.ROUNDS_LEFT: - if (RoundsLeft >= target.ChallengeTargetParam1) stars += 1 << i; - break; - case ChallengeTargetExcel.ChallengeType.DEAD_AVATAR: - if (!HasAvatarDied) stars += 1 << i; - break; - case ChallengeTargetExcel.ChallengeType.TOTAL_SCORE: - if (GetTotalScore() >= target.ChallengeTargetParam1) stars += 1 << i; - break; - } - } - - return Math.Min(stars, 7); - } - - #endregion -} \ No newline at end of file diff --git a/GameServer/Game/Challenge/ChallengeManager.cs b/GameServer/Game/Challenge/ChallengeManager.cs index eb02f994..acc0381a 100644 --- a/GameServer/Game/Challenge/ChallengeManager.cs +++ b/GameServer/Game/Challenge/ChallengeManager.cs @@ -2,9 +2,13 @@ using EggLink.DanhengServer.Database; using EggLink.DanhengServer.Database.Challenge; using EggLink.DanhengServer.Database.Inventory; +using EggLink.DanhengServer.GameServer.Game.Challenge.Definitions; +using EggLink.DanhengServer.GameServer.Game.Challenge.Instances; using EggLink.DanhengServer.GameServer.Game.Player; using EggLink.DanhengServer.GameServer.Server.Packet.Send.Challenge; using EggLink.DanhengServer.Proto; +using EggLink.DanhengServer.Proto.ServerSide; +using Google.Protobuf; using static EggLink.DanhengServer.GameServer.Plugin.Event.PluginEvent; namespace EggLink.DanhengServer.GameServer.Game.Challenge; @@ -13,7 +17,7 @@ public class ChallengeManager(PlayerInstance player) : BasePlayerManager(player) { #region Properties - public ChallengeInstance? ChallengeInstance { get; set; } + public BaseChallengeInstance? ChallengeInstance { get; set; } public ChallengeData ChallengeData { get; } = DatabaseHelper.Instance!.GetInstanceOrCreateNew(player.Uid); @@ -82,11 +86,52 @@ public class ChallengeManager(PlayerInstance player) : BasePlayerManager(player) } // Set challenge data for player - ChallengeInstance instance = new(Player, excel); + var data = new ChallengeDataPb(); + BaseLegacyChallengeInstance instance; + + // Set challenge type + if (excel.IsBoss()) + { + data.Boss = new ChallengeBossDataPb + { + ChallengeMazeId = (uint)excel.ID, + CurStatus = 1, + CurrentStage = 1, + CurrentExtraLineup = ChallengeLineupTypePb.Challenge1 + }; + + instance = new ChallengeBossInstance(Player, data); + } + else if (excel.IsStory()) + { + data.Story = new ChallengeStoryDataPb + { + ChallengeMazeId = (uint)excel.ID, + CurStatus = 1, + CurrentStage = 1, + CurrentExtraLineup = ChallengeLineupTypePb.Challenge1 + }; + + instance = new ChallengeStoryInstance(Player, data); + } + else + { + data.Memory = new ChallengeMemoryDataPb + { + ChallengeMazeId = (uint)excel.ID, + CurStatus = 1, + CurrentStage = 1, + CurrentExtraLineup = ChallengeLineupTypePb.Challenge1, + RoundsLeft = (uint)excel.ChallengeCountDown + }; + + instance = new ChallengeMemoryInstance(Player, data); + } + ChallengeInstance = instance; // Set first lineup before we enter scenes - await Player.LineupManager!.SetCurLineup(instance.CurrentExtraLineup + 10); + await Player.LineupManager!.SetCurLineup(instance.GetCurrentExtraLineupType() + 10); // Enter scene try @@ -104,20 +149,20 @@ public class ChallengeManager(PlayerInstance player) : BasePlayerManager(player) } // Save start positions - instance.StartPos = Player.Data.Pos!; - instance.StartRot = Player.Data.Rot!; - instance.SavedMp = Player.LineupManager.GetCurLineup()!.Mp; + instance.SetStartPos(Player.Data.Pos!); + instance.SetStartRot(Player.Data.Rot!); + instance.SetSavedMp(Player.LineupManager.GetCurLineup()!.Mp); if (excel.IsStory() && storyBuffs != null) { - instance.StoryBuffs.Add((int)storyBuffs.BuffOne); - instance.StoryBuffs.Add((int)storyBuffs.BuffTwo); + instance.Data.Story.Buffs.Add(storyBuffs.BuffOne); + instance.Data.Story.Buffs.Add(storyBuffs.BuffTwo); } if (bossBuffs != null) { - instance.BossBuffs.Add((int)bossBuffs.BuffOne); - instance.BossBuffs.Add((int)bossBuffs.BuffTwo); + instance.Data.Boss.Buffs.Add(bossBuffs.BuffOne); + instance.Data.Boss.Buffs.Add(bossBuffs.BuffTwo); } InvokeOnPlayerEnterChallenge(Player, instance); @@ -220,40 +265,37 @@ public class ChallengeManager(PlayerInstance player) : BasePlayerManager(player) return rewardInfos; } - public void SaveInstance(ChallengeInstance instance) + public void SaveInstance(BaseChallengeInstance instance) { - ChallengeData.Instance.StartPos = instance.StartPos; - ChallengeData.Instance.StartRot = instance.StartRot; - ChallengeData.Instance.ChallengeId = instance.ChallengeId; - ChallengeData.Instance.CurrentStage = instance.CurrentStage; - ChallengeData.Instance.CurrentExtraLineup = instance.CurrentExtraLineup; - ChallengeData.Instance.Status = instance.Status; - ChallengeData.Instance.HasAvatarDied = instance.HasAvatarDied; - ChallengeData.Instance.SavedMp = instance.SavedMp; - ChallengeData.Instance.RoundsLeft = instance.RoundsLeft; - ChallengeData.Instance.Stars = instance.Stars; - ChallengeData.Instance.ScoreStage1 = instance.ScoreStage1; - ChallengeData.Instance.ScoreStage2 = instance.ScoreStage2; - ChallengeData.Instance.StoryBuffs = instance.StoryBuffs; - ChallengeData.Instance.BossBuffs = instance.BossBuffs; + ChallengeData.ChallengeInstance = Convert.ToBase64String(instance.Data.ToByteArray()); } public void ClearInstance() { - ChallengeData.Instance.ChallengeId = 0; + ChallengeData.ChallengeInstance = null; + ChallengeInstance = null; } public void ResurrectInstance() { - if (ChallengeData.Instance != null && ChallengeData.Instance.ChallengeId != 0) + if (ChallengeData.ChallengeInstance == null) return; + var protoByte = Convert.FromBase64String(ChallengeData.ChallengeInstance); + var proto = ChallengeDataPb.Parser.ParseFrom(protoByte); + + if (proto != null) { - var ChallengeId = ChallengeData.Instance.ChallengeId; - if (GameData.ChallengeConfigData.TryGetValue(ChallengeId, out var value)) + ChallengeInstance = proto.ChallengeTypeCase switch { - var Excel = value; - var instance = new ChallengeInstance(Player, Excel, ChallengeData.Instance); - ChallengeInstance = instance; - } + ChallengeDataPb.ChallengeTypeOneofCase.Memory => new ChallengeMemoryInstance(Player, proto), + ChallengeDataPb.ChallengeTypeOneofCase.Peak => new ChallengePeakInstance(Player, proto), + ChallengeDataPb.ChallengeTypeOneofCase.Story => new ChallengeStoryInstance(Player, proto), + ChallengeDataPb.ChallengeTypeOneofCase.Boss => new ChallengeBossInstance(Player, proto), + _ => null + }; + } + else + { + ChallengeData.ChallengeInstance = null; } } diff --git a/GameServer/Game/Challenge/Definitions/BaseChallengeInstance.cs b/GameServer/Game/Challenge/Definitions/BaseChallengeInstance.cs new file mode 100644 index 00000000..19199262 --- /dev/null +++ b/GameServer/Game/Challenge/Definitions/BaseChallengeInstance.cs @@ -0,0 +1,27 @@ +using EggLink.DanhengServer.Data.Excel; +using EggLink.DanhengServer.GameServer.Game.Battle; +using EggLink.DanhengServer.GameServer.Game.Player; +using EggLink.DanhengServer.Proto; +using EggLink.DanhengServer.Proto.ServerSide; + +namespace EggLink.DanhengServer.GameServer.Game.Challenge.Definitions; + +public abstract class BaseChallengeInstance(PlayerInstance player, ChallengeDataPb data) +{ + public PlayerInstance Player { get; } = player; + public ChallengeDataPb Data { get; } = data; + + public virtual void OnBattleStart(BattleInstance battle) + { + + } + + public virtual async ValueTask OnBattleEnd(BattleInstance battle, PVEBattleResultCsReq req) + { + await ValueTask.CompletedTask; + } + + public abstract Dictionary> GetStageMonsters(); + + public virtual void OnUpdate() { } +} \ No newline at end of file diff --git a/GameServer/Game/Challenge/Definitions/BaseLegacyChallengeInstance.cs b/GameServer/Game/Challenge/Definitions/BaseLegacyChallengeInstance.cs new file mode 100644 index 00000000..38ef8ff0 --- /dev/null +++ b/GameServer/Game/Challenge/Definitions/BaseLegacyChallengeInstance.cs @@ -0,0 +1,35 @@ +using EggLink.DanhengServer.Data.Excel; +using EggLink.DanhengServer.GameServer.Game.Player; +using EggLink.DanhengServer.Proto; +using EggLink.DanhengServer.Proto.ServerSide; +using EggLink.DanhengServer.Util; + +namespace EggLink.DanhengServer.GameServer.Game.Challenge.Definitions; + +public abstract class BaseLegacyChallengeInstance(PlayerInstance player, ChallengeDataPb data) : BaseChallengeInstance(player, data) +{ + public abstract CurChallenge ToProto(); + public bool IsWin { get; set; } + public abstract ChallengeConfigExcel Config { get; } + + public abstract uint GetStars(); + public abstract int GetCurrentExtraLineupType(); + public abstract void SetStartPos(Position pos); + public abstract void SetStartRot(Position rot); + public abstract void SetSavedMp(int mp); + + public virtual uint GetScore1() + { + return 0; + } + + public virtual uint GetScore2() + { + return 0; + } + + public virtual ChallengeStageInfo ToStageInfo() + { + return new ChallengeStageInfo(); + } +} \ No newline at end of file diff --git a/GameServer/Game/Challenge/Instances/ChallengeBossInstance.cs b/GameServer/Game/Challenge/Instances/ChallengeBossInstance.cs new file mode 100644 index 00000000..cd9113b5 --- /dev/null +++ b/GameServer/Game/Challenge/Instances/ChallengeBossInstance.cs @@ -0,0 +1,326 @@ +using EggLink.DanhengServer.Data; +using EggLink.DanhengServer.Data.Excel; +using EggLink.DanhengServer.Enums.Item; +using EggLink.DanhengServer.Enums.Mission; +using EggLink.DanhengServer.GameServer.Game.Battle; +using EggLink.DanhengServer.GameServer.Game.Challenge.Definitions; +using EggLink.DanhengServer.GameServer.Game.Player; +using EggLink.DanhengServer.GameServer.Game.Scene.Entity; +using EggLink.DanhengServer.GameServer.Server.Packet.Send.Challenge; +using EggLink.DanhengServer.GameServer.Server.Packet.Send.Lineup; +using EggLink.DanhengServer.Proto; +using EggLink.DanhengServer.Proto.ServerSide; +using EggLink.DanhengServer.Util; + +namespace EggLink.DanhengServer.GameServer.Game.Challenge.Instances; + +public class ChallengeBossInstance(PlayerInstance player, ChallengeDataPb data) : BaseLegacyChallengeInstance(player, data) +{ + #region Properties + + public override ChallengeConfigExcel Config { get; } = GameData.ChallengeConfigData[(int)data.Boss.ChallengeMazeId]; + + #endregion + + #region Setter & Getter + + public override uint GetStars() + { + return Data.Boss.Stars; + } + + public override uint GetScore1() + { + return Data.Boss.ScoreStage1; + } + + public override uint GetScore2() + { + return Data.Boss.ScoreStage2; + } + + public void SetCurrentExtraLineup(ExtraLineupType type) + { + Data.Boss.CurrentExtraLineup = (ChallengeLineupTypePb)type; + } + + public int GetTotalScore() + { + return (int)(Data.Boss.ScoreStage1 + Data.Boss.ScoreStage2); + } + + public override int GetCurrentExtraLineupType() + { + return (int)Data.Boss.CurrentExtraLineup; + } + + public override void SetStartPos(Position pos) + { + Data.Boss.StartPos = pos.ToVector3Pb(); + } + + public override void SetStartRot(Position rot) + { + Data.Boss.StartRot = rot.ToVector3Pb(); + } + + public override void SetSavedMp(int mp) + { + Data.Boss.SavedMp = (uint)mp; + } + + public override Dictionary> GetStageMonsters() + { + return Data.Boss.CurrentStage == 1 + ? Config.ChallengeMonsters1 + : Config.ChallengeMonsters2; + } + + #endregion + + #region Serialization + + public override CurChallenge ToProto() + { + return new CurChallenge + { + ChallengeId = Data.Boss.ChallengeMazeId, + ExtraLineupType = (ExtraLineupType)Data.Boss.CurrentExtraLineup, + Status = (ChallengeStatus)Data.Boss.CurStatus, + StageInfo = new ChallengeCurBuffInfo + { + CurBossBuffs = new ChallengeBossBuffList + { + BuffList = { Data.Boss.Buffs }, + ChallengeBossConst = 1 + } + }, + RoundCount = (uint)Config.ChallengeCountDown, + ScoreId = Data.Boss.ScoreStage1, + ScoreTwo = Data.Boss.ScoreStage2, + }; + } + + public override ChallengeStageInfo ToStageInfo() + { + var proto = new ChallengeStageInfo + { + BossInfo = new ChallengeBossInfo + { + FirstNode = new ChallengeBossSingleNodeInfo + { + BuffId = Data.Boss.Buffs[0] + }, + SecondNode = new ChallengeBossSingleNodeInfo + { + BuffId = Data.Boss.Buffs[1] + }, + NCBDNPGPEAI = true + } + }; + + foreach (var lineupAvatar in Player.LineupManager?.GetExtraLineup(ExtraLineupType.LineupChallenge) + ?.BaseAvatars ?? []) + { + var avatar = Player.AvatarManager?.GetFormalAvatar(lineupAvatar.BaseAvatarId); + if (avatar == null) continue; + proto.BossInfo.FirstLineup.Add((uint)avatar.AvatarId); + var equip = Player.InventoryManager?.GetItem(0, avatar.GetCurPathInfo().EquipId, + ItemMainTypeEnum.Equipment); + if (equip != null) + proto.BossInfo.ChallengeAvatarEquipmentMap.Add((uint)avatar.AvatarId, + equip.ToChallengeEquipmentProto()); + + var relicProto = new ChallengeBossAvatarRelicInfo(); + + foreach (var relicUniqueId in avatar.GetCurPathInfo().Relic) + { + var relic = Player.InventoryManager?.GetItem(0, relicUniqueId.Value, ItemMainTypeEnum.Relic); + if (relic == null) continue; + relicProto.AvatarRelicSlotMap.Add((uint)relicUniqueId.Key, relic.ToChallengeRelicProto()); + } + + proto.BossInfo.ChallengeAvatarRelicMap.Add((uint)avatar.AvatarId, relicProto); + } + + foreach (var lineupAvatar in Player.LineupManager?.GetExtraLineup(ExtraLineupType.LineupChallenge2) + ?.BaseAvatars ?? []) + { + var avatar = Player.AvatarManager?.GetFormalAvatar(lineupAvatar.BaseAvatarId); + if (avatar == null) continue; + proto.BossInfo.SecondLineup.Add((uint)avatar.AvatarId); + var equip = Player.InventoryManager?.GetItem(0, avatar.GetCurPathInfo().EquipId, + ItemMainTypeEnum.Equipment); + if (equip != null) + proto.BossInfo.ChallengeAvatarEquipmentMap.Add((uint)avatar.AvatarId, + equip.ToChallengeEquipmentProto()); + + var relicProto = new ChallengeBossAvatarRelicInfo(); + + foreach (var relicUniqueId in avatar.GetCurPathInfo().Relic) + { + var relic = Player.InventoryManager?.GetItem(0, relicUniqueId.Value, ItemMainTypeEnum.Relic); + if (relic == null) continue; + relicProto.AvatarRelicSlotMap.Add((uint)relicUniqueId.Key, relic.ToChallengeRelicProto()); + } + + proto.BossInfo.ChallengeAvatarRelicMap.Add((uint)avatar.AvatarId, relicProto); + } + + return proto; + } + + #endregion + + #region Handlers + + public override void OnBattleStart(BattleInstance battle) + { + battle.RoundLimit = Config.ChallengeCountDown; + + battle.Buffs.Add(new MazeBuff(Config.MazeBuffID, 1, -1) + { + WaveFlag = -1 + }); + + battle.AddBattleTarget(1, 90004, 0); + battle.AddBattleTarget(1, 90005, 0); + + if (Data.Boss.Buffs.Count < Data.Boss.CurrentStage) return; + var buffId = Data.Boss.Buffs[(int)(Data.Boss.CurrentStage - 1)]; + battle.Buffs.Add(new MazeBuff((int)buffId, 1, -1) + { + WaveFlag = -1 + }); + } + + public override async ValueTask OnBattleEnd(BattleInstance battle, PVEBattleResultCsReq req) + { + // Calculate score for current stage + var stageScore = 0; + foreach (var battleTarget in req.Stt.BattleTargetInfo[1].BattleTargetList_) + stageScore += (int)battleTarget.Progress; + + // Set score + if (Data.Boss.CurrentStage == 1) + Data.Boss.ScoreStage1 = (uint)stageScore; + else + Data.Boss.ScoreStage2 = (uint)stageScore; + + switch (req.EndStatus) + { + case BattleEndStatus.BattleEndWin: + // Get monster count in stage + long monsters = Player.SceneInstance!.Entities.Values.OfType().Count(); + + if (monsters == 0) await AdvanceStage(req); + + // Set saved technique points (This will be restored if the player resets the challenge) + Data.Boss.SavedMp = (uint)Player.LineupManager!.GetCurLineup()!.Mp; + break; + case BattleEndStatus.BattleEndQuit: + // Reset technique points and move back to start position + var lineup = Player.LineupManager!.GetCurLineup()!; + lineup.Mp = (int)Data.Boss.SavedMp; + await Player.MoveTo(Data.Boss.StartPos.ToPosition(), Data.Boss.StartRot.ToPosition()); + await Player.SendPacket(new PacketSyncLineupNotify(lineup)); + break; + default: + // Determine challenge result + if (req.Stt.EndReason == BattleEndReason.TurnLimit) + { + await AdvanceStage(req); + } + else + { + // Fail challenge + Data.Boss.CurStatus = (int)ChallengeStatus.ChallengeFailed; + + // Send challenge result data + await Player.SendPacket(new PacketChallengeBossPhaseSettleNotify(this)); + } + + break; + } + } + + public uint CalculateStars() + { + var targets = Config.ChallengeTargetID!; + var stars = 0u; + + for (var i = 0; i < targets.Count; i++) + { + if (!GameData.ChallengeTargetData.ContainsKey(targets[i])) continue; + + var target = GameData.ChallengeTargetData[targets[i]]; + + switch (target.ChallengeTargetType) + { + case ChallengeTargetExcel.ChallengeType.TOTAL_SCORE: + if (GetTotalScore() >= target.ChallengeTargetParam1) stars += 1u << i; + break; + } + } + + return Math.Min(stars, 7); + } + + private async ValueTask AdvanceStage(PVEBattleResultCsReq req) + { + if (Data.Boss.CurrentStage >= Config.StageNum) + { + // Last stage + Data.Boss.CurStatus = (int)ChallengeStatus.ChallengeFinish; + Data.Boss.Stars = CalculateStars(); + + // Save history + Player.ChallengeManager!.AddHistory((int)Data.Boss.ChallengeMazeId, (int)GetStars(), GetTotalScore()); + + // Send challenge result data + await Player.SendPacket(new PacketChallengeBossPhaseSettleNotify(this, req.Stt.BattleTargetInfo[1])); + + // Call MissionManager + await Player.MissionManager!.HandleFinishType(MissionFinishTypeEnum.ChallengeFinish, this); + } + else + { + await Player.SendPacket(new PacketChallengeBossPhaseSettleNotify(this, req.Stt.BattleTargetInfo[1])); + } + } + + public async ValueTask NextPhase() + { + // Increment and reset stage + Data.Boss.CurrentStage++; + + // unload current scene group + await Player.SceneInstance!.EntityLoader!.UnloadGroup(Config.MazeGroupID1); + // Load scene group for stage 2 + await Player.SceneInstance!.EntityLoader!.LoadGroup(Config.MazeGroupID2); + + // Change player line up + SetCurrentExtraLineup(ExtraLineupType.LineupChallenge2); + await Player.LineupManager!.SetCurLineup(GetCurrentExtraLineupType() + 10); + await Player.SendPacket(new PacketChallengeLineupNotify((ExtraLineupType)GetCurrentExtraLineupType())); + Data.Boss.SavedMp = (uint)Player.LineupManager.GetCurLineup()!.Mp; + + // Move player + if (Config.MapEntranceID2 != 0) + { + await Player.EnterScene(Config.MapEntranceID2, 0, false); + Data.Boss.StartPos = Player.Data.Pos!.ToVector3Pb(); + Data.Boss.StartRot = Player.Data.Rot!.ToVector3Pb(); + await Player.SceneInstance!.EntityLoader!.LoadGroup(Config.MazeGroupID2); + } + else + { + await Player.MoveTo(Data.Boss.StartPos.ToPosition(), Data.Boss.StartRot.ToPosition()); + } + + Player.ChallengeManager!.SaveInstance(this); + } + + + #endregion +} \ No newline at end of file diff --git a/GameServer/Game/Challenge/Instances/ChallengeMemoryInstance.cs b/GameServer/Game/Challenge/Instances/ChallengeMemoryInstance.cs new file mode 100644 index 00000000..a7a3b4f6 --- /dev/null +++ b/GameServer/Game/Challenge/Instances/ChallengeMemoryInstance.cs @@ -0,0 +1,210 @@ +using EggLink.DanhengServer.Data; +using EggLink.DanhengServer.Data.Excel; +using EggLink.DanhengServer.Enums.Mission; +using EggLink.DanhengServer.GameServer.Game.Battle; +using EggLink.DanhengServer.GameServer.Game.Challenge.Definitions; +using EggLink.DanhengServer.GameServer.Game.Player; +using EggLink.DanhengServer.GameServer.Game.Scene.Entity; +using EggLink.DanhengServer.GameServer.Server.Packet.Send.Challenge; +using EggLink.DanhengServer.GameServer.Server.Packet.Send.Lineup; +using EggLink.DanhengServer.Proto; +using EggLink.DanhengServer.Proto.ServerSide; +using EggLink.DanhengServer.Util; + +namespace EggLink.DanhengServer.GameServer.Game.Challenge.Instances; + +public class ChallengeMemoryInstance(PlayerInstance player, ChallengeDataPb data) : BaseLegacyChallengeInstance(player, data) +{ + #region Properties + + public override ChallengeConfigExcel Config { get; } = GameData.ChallengeConfigData[(int)data.Memory.ChallengeMazeId]; + + #endregion + + #region Getter & Setter + + public void SetCurrentExtraLineup(ExtraLineupType type) + { + Data.Memory.CurrentExtraLineup = (ChallengeLineupTypePb)type; + } + + public override Dictionary> GetStageMonsters() + { + return Data.Memory.CurrentStage == 1 ? Config.ChallengeMonsters1 : Config.ChallengeMonsters2; + } + + public override uint GetStars() + { + return Data.Memory.Stars; + } + + public override int GetCurrentExtraLineupType() + { + return (int)Data.Memory.CurrentExtraLineup; + } + + public override void SetStartPos(Position pos) + { + Data.Memory.StartPos = pos.ToVector3Pb(); + } + + public override void SetStartRot(Position rot) + { + Data.Memory.StartRot = rot.ToVector3Pb(); + } + + public override void SetSavedMp(int mp) + { + Data.Memory.SavedMp = (uint)mp; + } + + #endregion + + #region Serialization + + public override CurChallenge ToProto() + { + return new CurChallenge + { + ChallengeId = Data.Memory.ChallengeMazeId, + DeadAvatarNum = Data.Memory.DeadAvatarNum, + ExtraLineupType = (ExtraLineupType)Data.Memory.CurrentExtraLineup, + Status = (ChallengeStatus)Data.Memory.CurStatus, + StageInfo = new ChallengeCurBuffInfo(), + RoundCount = (uint)(Config.ChallengeCountDown - Data.Memory.RoundsLeft) + }; + } + + #endregion + + #region Handlers + + public override void OnBattleStart(BattleInstance battle) + { + battle.RoundLimit = (int)Data.Memory.RoundsLeft; + + battle.Buffs.Add(new MazeBuff(Config.MazeBuffID, 1, -1) + { + WaveFlag = -1 + }); + } + + public override async ValueTask OnBattleEnd(BattleInstance battle, PVEBattleResultCsReq req) + { + switch (req.EndStatus) + { + case BattleEndStatus.BattleEndWin: + // Check if any avatar in the lineup has died + foreach (var avatar in battle.Lineup.AvatarData!.FormalAvatars) + if (avatar.CurrentHp <= 0) + Data.Memory.DeadAvatarNum++; + + // Get monster count in stage + long monsters = Player.SceneInstance!.Entities.Values.OfType().Count(); + + if (monsters == 0) await AdvanceStage(); + + // Calculate rounds left + Data.Memory.RoundsLeft = Math.Min(Math.Max(Data.Memory.RoundsLeft - req.Stt.RoundCnt, 1), + Data.Memory.RoundsLeft); + + // Set saved technique points (This will be restored if the player resets the challenge) + Data.Memory.SavedMp = (uint)Player.LineupManager!.GetCurLineup()!.Mp; + break; + case BattleEndStatus.BattleEndQuit: + // Reset technique points and move back to start position + var lineup = Player.LineupManager!.GetCurLineup()!; + lineup.Mp = (int)Data.Memory.SavedMp; + await Player.MoveTo(Data.Memory.StartPos.ToPosition(), Data.Memory.StartRot.ToPosition()); + await Player.SendPacket(new PacketSyncLineupNotify(lineup)); + break; + default: + // Determine challenge result + // Fail challenge + Data.Memory.CurStatus = (int)ChallengeStatus.ChallengeFailed; + + // Send challenge result data + await Player.SendPacket(new PacketChallengeSettleNotify(this)); + + break; + } + } + + public uint CalculateStars() + { + var targets = Config.ChallengeTargetID!; + var stars = 0u; + + for (var i = 0; i < targets.Count; i++) + { + if (!GameData.ChallengeTargetData.ContainsKey(targets[i])) continue; + + var target = GameData.ChallengeTargetData[targets[i]]; + + switch (target.ChallengeTargetType) + { + case ChallengeTargetExcel.ChallengeType.ROUNDS_LEFT: + if (Data.Memory.RoundsLeft >= target.ChallengeTargetParam1) stars += 1u << i; + break; + case ChallengeTargetExcel.ChallengeType.DEAD_AVATAR: + if (Data.Memory.DeadAvatarNum == 0) stars += 1u << i; + break; + } + } + + return Math.Min(stars, 7); + } + + private async ValueTask AdvanceStage() + { + if (Data.Memory.CurrentStage >= Config.StageNum) + { + // Last stage + Data.Memory.CurStatus = (int)ChallengeStatus.ChallengeFinish; + Data.Memory.Stars = CalculateStars(); + + // Save history + Player.ChallengeManager!.AddHistory((int)Data.Memory.ChallengeMazeId, (int)Data.Memory.Stars, 0); + + // Send challenge result data + await Player.SendPacket(new PacketChallengeSettleNotify(this)); + + // Call MissionManager + await Player.MissionManager!.HandleFinishType(MissionFinishTypeEnum.ChallengeFinish, this); + } + else + { + // Increment and reset stage + Data.Memory.CurrentStage++; + // Unload scene group for stage 1 + await Player.SceneInstance!.EntityLoader!.UnloadGroup(Config.MazeGroupID1); + + // Load scene group for stage 2 + await Player.SceneInstance!.EntityLoader!.LoadGroup(Config.MazeGroupID2); + + // Change player line up + SetCurrentExtraLineup(ExtraLineupType.LineupChallenge2); + await Player.LineupManager!.SetCurLineup((int)(Data.Memory.CurrentExtraLineup + 10)); + await Player.SendPacket(new PacketChallengeLineupNotify((ExtraLineupType)Data.Memory.CurrentExtraLineup)); + Data.Memory.SavedMp = (uint)Player.LineupManager.GetCurLineup()!.Mp; + + // Move player + if (Config.MapEntranceID2 != 0 && Config.MapEntranceID2 != Config.MapEntranceID) + { + await Player.EnterScene(Config.MapEntranceID2, 0, true); + Data.Memory.StartPos = Player.Data.Pos!.ToVector3Pb(); + Data.Memory.StartRot = Player.Data.Rot!.ToVector3Pb(); + await Player.SceneInstance!.EntityLoader!.UnloadGroup(Config.MazeGroupID1); + await Player.SceneInstance!.EntityLoader!.LoadGroup(Config.MazeGroupID2); + } + else + { + await Player.MoveTo(Data.Memory.StartPos.ToPosition(), Data.Memory.StartRot.ToPosition()); + } + + Player.ChallengeManager!.SaveInstance(this); + } + } + + #endregion +} \ No newline at end of file diff --git a/GameServer/Game/Challenge/Instances/ChallengeStoryInstance.cs b/GameServer/Game/Challenge/Instances/ChallengeStoryInstance.cs new file mode 100644 index 00000000..1f76fa82 --- /dev/null +++ b/GameServer/Game/Challenge/Instances/ChallengeStoryInstance.cs @@ -0,0 +1,250 @@ +using EggLink.DanhengServer.Data; +using EggLink.DanhengServer.Data.Excel; +using EggLink.DanhengServer.Enums.Mission; +using EggLink.DanhengServer.GameServer.Game.Battle; +using EggLink.DanhengServer.GameServer.Game.Challenge.Definitions; +using EggLink.DanhengServer.GameServer.Game.Player; +using EggLink.DanhengServer.GameServer.Game.Scene.Entity; +using EggLink.DanhengServer.GameServer.Server.Packet.Send.Challenge; +using EggLink.DanhengServer.GameServer.Server.Packet.Send.Lineup; +using EggLink.DanhengServer.Proto; +using EggLink.DanhengServer.Proto.ServerSide; +using EggLink.DanhengServer.Util; + +namespace EggLink.DanhengServer.GameServer.Game.Challenge.Instances; + +public class ChallengeStoryInstance(PlayerInstance player, ChallengeDataPb data) : BaseLegacyChallengeInstance(player, data) +{ + #region Properties + + public override ChallengeConfigExcel Config { get; } = GameData.ChallengeConfigData[(int)data.Story.ChallengeMazeId]; + + #endregion + + #region Setter & Getter + + public override uint GetStars() + { + return Data.Story.Stars; + } + + public override uint GetScore1() + { + return Data.Story.ScoreStage1; + } + + public override uint GetScore2() + { + return Data.Story.ScoreStage2; + } + + public void SetCurrentExtraLineup(ExtraLineupType type) + { + Data.Story.CurrentExtraLineup = (ChallengeLineupTypePb)type; + } + + public int GetTotalScore() + { + return (int)(Data.Story.ScoreStage1 + Data.Story.ScoreStage2); + } + + public override int GetCurrentExtraLineupType() + { + return (int)Data.Story.CurrentExtraLineup; + } + + public override void SetStartPos(Position pos) + { + Data.Story.StartPos = pos.ToVector3Pb(); + } + + public override void SetStartRot(Position rot) + { + Data.Story.StartRot = rot.ToVector3Pb(); + } + + public override void SetSavedMp(int mp) + { + Data.Story.SavedMp = (uint)mp; + } + + public override Dictionary> GetStageMonsters() + { + return Data.Story.CurrentStage == 1 + ? Config.ChallengeMonsters1 + : Config.ChallengeMonsters2; + } + + #endregion + + #region Serialization + + public override CurChallenge ToProto() + { + return new CurChallenge + { + ChallengeId = Data.Story.ChallengeMazeId, + ExtraLineupType = (ExtraLineupType)Data.Story.CurrentExtraLineup, + Status = (ChallengeStatus)Data.Story.CurStatus, + StageInfo = new ChallengeCurBuffInfo + { + CurStoryBuffs = new ChallengeStoryBuffList + { + BuffList = { Data.Story.Buffs } + } + }, + RoundCount = (uint)Config.ChallengeCountDown, + ScoreId = Data.Story.ScoreStage1, + ScoreTwo = Data.Story.ScoreStage2 + }; + } + + #endregion + + #region Handlers + + public override void OnBattleStart(BattleInstance battle) + { + battle.RoundLimit = Config.ChallengeCountDown; + + battle.Buffs.Add(new MazeBuff(Config.MazeBuffID, 1, -1) + { + WaveFlag = -1 + }); + + if (Config.StoryExcel == null) return; + battle.AddBattleTarget(1, 10002, GetTotalScore()); + + foreach (var id in Config.StoryExcel.BattleTargetID!) battle.AddBattleTarget(5, id, GetTotalScore()); + + if (Data.Story.Buffs.Count < Data.Story.CurrentStage) return; + var buffId = Data.Story.Buffs[(int)(Data.Story.CurrentStage - 1)]; + battle.Buffs.Add(new MazeBuff((int)buffId, 1, -1) + { + WaveFlag = -1 + }); + } + + public override async ValueTask OnBattleEnd(BattleInstance battle, PVEBattleResultCsReq req) + { + // Calculate score for current stage + var stageScore = (int)req.Stt.ChallengeScore - GetTotalScore(); + + // Set score + if (Data.Story.CurrentStage == 1) + Data.Story.ScoreStage1 = (uint)stageScore; + else + Data.Story.ScoreStage2 = (uint)stageScore; + + switch (req.EndStatus) + { + case BattleEndStatus.BattleEndWin: + // Get monster count in stage + long monsters = Player.SceneInstance!.Entities.Values.OfType().Count(); + + if (monsters == 0) await AdvanceStage(); + + // Set saved technique points (This will be restored if the player resets the challenge) + Data.Story.SavedMp = (uint)Player.LineupManager!.GetCurLineup()!.Mp; + break; + case BattleEndStatus.BattleEndQuit: + // Reset technique points and move back to start position + var lineup = Player.LineupManager!.GetCurLineup()!; + lineup.Mp = (int)Data.Story.SavedMp; + await Player.MoveTo(Data.Story.StartPos.ToPosition(), Data.Story.StartRot.ToPosition()); + await Player.SendPacket(new PacketSyncLineupNotify(lineup)); + break; + default: + // Determine challenge result + if (req.Stt.EndReason == BattleEndReason.TurnLimit) + { + await AdvanceStage(); + } + else + { + // Fail challenge + Data.Story.CurStatus = (int)ChallengeStatus.ChallengeFailed; + + // Send challenge result data + await Player.SendPacket(new PacketChallengeSettleNotify(this)); + } + + break; + } + } + + public uint CalculateStars() + { + var targets = Config.ChallengeTargetID!; + var stars = 0u; + + for (var i = 0; i < targets.Count; i++) + { + if (!GameData.ChallengeTargetData.ContainsKey(targets[i])) continue; + + var target = GameData.ChallengeTargetData[targets[i]]; + + switch (target.ChallengeTargetType) + { + case ChallengeTargetExcel.ChallengeType.TOTAL_SCORE: + if (GetTotalScore() >= target.ChallengeTargetParam1) stars += 1u << i; + break; + } + } + + return Math.Min(stars, 7); + } + + private async ValueTask AdvanceStage() + { + if (Data.Story.CurrentStage >= Config.StageNum) + { + // Last stage + Data.Story.CurStatus = (int)ChallengeStatus.ChallengeFinish; + Data.Story.Stars = CalculateStars(); + + // Save history + Player.ChallengeManager!.AddHistory((int)Data.Story.ChallengeMazeId, (int)GetStars(), GetTotalScore()); + + // Send challenge result data + await Player.SendPacket(new PacketChallengeSettleNotify(this)); + + // Call MissionManager + await Player.MissionManager!.HandleFinishType(MissionFinishTypeEnum.ChallengeFinish, this); + } + else + { + // Increment and reset stage + Data.Story.CurrentStage++; + // Unload scene group for stage 1 + await Player.SceneInstance!.EntityLoader!.UnloadGroup(Config.MazeGroupID1); + + // Load scene group for stage 2 + await Player.SceneInstance!.EntityLoader!.LoadGroup(Config.MazeGroupID2); + + // Change player line up + SetCurrentExtraLineup(ExtraLineupType.LineupChallenge2); + await Player.LineupManager!.SetCurLineup((int)(Data.Story.CurrentExtraLineup + 10)); + await Player.SendPacket(new PacketChallengeLineupNotify((ExtraLineupType)Data.Story.CurrentExtraLineup)); + Data.Story.SavedMp = (uint)Player.LineupManager.GetCurLineup()!.Mp; + + // Move player + if (Config.MapEntranceID2 != 0 && Config.MapEntranceID2 != Config.MapEntranceID) + { + await Player.EnterScene(Config.MapEntranceID2, 0, true); + Data.Story.StartPos = Player.Data.Pos!.ToVector3Pb(); + Data.Story.StartRot = Player.Data.Rot!.ToVector3Pb(); + await Player.SceneInstance!.EntityLoader!.UnloadGroup(Config.MazeGroupID1); + await Player.SceneInstance!.EntityLoader!.LoadGroup(Config.MazeGroupID2); + } + else + { + await Player.MoveTo(Data.Story.StartPos.ToPosition(), Data.Story.StartRot.ToPosition()); + } + + Player.ChallengeManager!.SaveInstance(this); + } + } + + #endregion +} \ No newline at end of file diff --git a/GameServer/Game/Mission/FinishType/Handler/MissionHandlerChallengeFinish.cs b/GameServer/Game/Mission/FinishType/Handler/MissionHandlerChallengeFinish.cs index 9511e6e7..bf9a01a5 100644 --- a/GameServer/Game/Mission/FinishType/Handler/MissionHandlerChallengeFinish.cs +++ b/GameServer/Game/Mission/FinishType/Handler/MissionHandlerChallengeFinish.cs @@ -2,6 +2,7 @@ using EggLink.DanhengServer.Data.Excel; using EggLink.DanhengServer.Enums.Mission; using EggLink.DanhengServer.GameServer.Game.Challenge; +using EggLink.DanhengServer.GameServer.Game.Challenge.Definitions; using EggLink.DanhengServer.GameServer.Game.Player; namespace EggLink.DanhengServer.GameServer.Game.Mission.FinishType.Handler; @@ -11,16 +12,16 @@ public class MissionHandlerChallengeFinish : MissionFinishTypeHandler { public override async ValueTask HandleMissionFinishType(PlayerInstance player, SubMissionInfo info, object? arg) { - if (arg is ChallengeInstance challenge) - if (challenge.Excel.ID == info.ParamInt1 && challenge.IsWin()) + if (arg is BaseLegacyChallengeInstance challenge) + if (challenge.Config.ID == info.ParamInt1 && challenge.IsWin) await player.MissionManager!.FinishSubMission(info.ID); } public override async ValueTask HandleQuestFinishType(PlayerInstance player, QuestDataExcel quest, FinishWayExcel excel, object? arg) { - if (arg is ChallengeInstance challenge) - if (challenge.Excel.ID == excel.ParamInt1 && challenge.IsWin()) + if (arg is BaseLegacyChallengeInstance challenge) + if (challenge.Config.ID == excel.ParamInt1 && challenge.IsWin) await player.QuestManager!.AddQuestProgress(quest.QuestID, 1); } } \ No newline at end of file diff --git a/GameServer/Game/Player/PlayerInstance.cs b/GameServer/Game/Player/PlayerInstance.cs index 4b7420b7..f335e7d7 100644 --- a/GameServer/Game/Player/PlayerInstance.cs +++ b/GameServer/Game/Player/PlayerInstance.cs @@ -9,6 +9,7 @@ using EggLink.DanhengServer.GameServer.Game.Activity; using EggLink.DanhengServer.GameServer.Game.Avatar; using EggLink.DanhengServer.GameServer.Game.Battle; using EggLink.DanhengServer.GameServer.Game.Challenge; +using EggLink.DanhengServer.GameServer.Game.ChallengePeak; using EggLink.DanhengServer.GameServer.Game.ChessRogue; using EggLink.DanhengServer.GameServer.Game.Friend; using EggLink.DanhengServer.GameServer.Game.Gacha; @@ -93,6 +94,7 @@ public partial class PlayerInstance(PlayerData data) public MailManager? MailManager { get; private set; } public FriendManager? FriendManager { get; private set; } public ChallengeManager? ChallengeManager { get; private set; } + public ChallengePeakManager? ChallengePeakManager { get; private set; } #endregion @@ -180,6 +182,7 @@ public partial class PlayerInstance(PlayerData data) RogueTournManager = new RogueTournManager(this); RogueMagicManager = new RogueMagicManager(this); ChallengeManager = new ChallengeManager(this); + ChallengePeakManager = new ChallengePeakManager(this); TaskManager = new TaskManager(this); RaidManager = new RaidManager(this); StoryLineManager = new StoryLineManager(this); @@ -274,9 +277,6 @@ public partial class PlayerInstance(PlayerData data) AvatarManager!.GetTrialAvatar(e.SpecialAvatarID)?.CheckLevel(Data.WorldLevel); } - await LoadScene(Data.PlaneId, Data.FloorId, Data.EntryId, Data.Pos!, Data.Rot!, false); - if (SceneInstance == null) await EnterScene(2000101, 0, false); - if (ConfigManager.Config.ServerOption.EnableMission) await MissionManager!.AcceptMainMissionByCondition(); await QuestManager!.AcceptQuestByCondition(); @@ -308,6 +308,9 @@ public partial class PlayerInstance(PlayerData data) if (RaidManager != null) await RaidManager.OnLogin(); + await LoadScene(Data.PlaneId, Data.FloorId, Data.EntryId, Data.Pos!, Data.Rot!, false); + if (SceneInstance == null) await EnterScene(2000101, 0, false); + InvokeOnPlayerLogin(this); } diff --git a/GameServer/GameServer.csproj b/GameServer/GameServer.csproj index d59e6a63..170a78f2 100644 --- a/GameServer/GameServer.csproj +++ b/GameServer/GameServer.csproj @@ -20,6 +20,7 @@ + diff --git a/GameServer/Plugin/Event/PluginEvent.cs b/GameServer/Plugin/Event/PluginEvent.cs index ec93bc76..5593fd16 100644 --- a/GameServer/Plugin/Event/PluginEvent.cs +++ b/GameServer/Plugin/Event/PluginEvent.cs @@ -1,6 +1,7 @@ using EggLink.DanhengServer.Command; using EggLink.DanhengServer.GameServer.Game.Battle; using EggLink.DanhengServer.GameServer.Game.Challenge; +using EggLink.DanhengServer.GameServer.Game.Challenge.Definitions; using EggLink.DanhengServer.GameServer.Game.Player; using EggLink.DanhengServer.GameServer.Game.Scene; using EggLink.DanhengServer.GameServer.Game.Scene.Entity; @@ -56,12 +57,12 @@ public static class PluginEvent OnPlayerQuitBattle?.Invoke(player, result); } - public static void InvokeOnPlayerEnterChallenge(PlayerInstance player, ChallengeInstance challenge) + public static void InvokeOnPlayerEnterChallenge(PlayerInstance player, BaseChallengeInstance challenge) { OnPlayerEnterChallenge?.Invoke(player, challenge); } - public static void InvokeOnPlayerQuitChallenge(PlayerInstance player, ChallengeInstance? challenge) + public static void InvokeOnPlayerQuitChallenge(PlayerInstance player, BaseChallengeInstance? challenge) { OnPlayerQuitChallenge?.Invoke(player, challenge); } @@ -96,9 +97,9 @@ public static class PluginEvent public delegate void OnPlayerQuitBattleHandler(PlayerInstance player, PVEBattleResultCsReq result); - public delegate void OnPlayerEnterChallengeHandler(PlayerInstance player, ChallengeInstance challenge); + public delegate void OnPlayerEnterChallengeHandler(PlayerInstance player, BaseChallengeInstance challenge); - public delegate void OnPlayerQuitChallengeHandler(PlayerInstance player, ChallengeInstance? challenge); + public delegate void OnPlayerQuitChallengeHandler(PlayerInstance player, BaseChallengeInstance? challenge); public delegate void OnPlayerSyncLineupHandler(PlayerInstance player, LineupInfo? lineup); diff --git a/GameServer/Server/Connection.cs b/GameServer/Server/Connection.cs index 303b56c1..4fcbb3d9 100644 --- a/GameServer/Server/Connection.cs +++ b/GameServer/Server/Connection.cs @@ -146,6 +146,7 @@ public class Connection(KcpConversation conversation, IPEndPoint remote) : Danhe catch (Exception e) { Logger.Error("An error occured ", e); + // get the packet rsp and set retCode to Retcode.RetFail var curPacket = LogMap.GetValueOrDefault(opcode); if (curPacket == null) return; diff --git a/GameServer/Server/Packet/Recv/Challenge/HandlerEnterChallengeNextPhaseCsReq.cs b/GameServer/Server/Packet/Recv/Challenge/HandlerEnterChallengeNextPhaseCsReq.cs index 53112396..d821730b 100644 --- a/GameServer/Server/Packet/Recv/Challenge/HandlerEnterChallengeNextPhaseCsReq.cs +++ b/GameServer/Server/Packet/Recv/Challenge/HandlerEnterChallengeNextPhaseCsReq.cs @@ -1,4 +1,5 @@ -using EggLink.DanhengServer.GameServer.Server.Packet.Send.Challenge; +using EggLink.DanhengServer.GameServer.Game.Challenge.Instances; +using EggLink.DanhengServer.GameServer.Server.Packet.Send.Challenge; using EggLink.DanhengServer.Kcp; using EggLink.DanhengServer.Proto; @@ -9,13 +10,13 @@ public class HandlerEnterChallengeNextPhaseCsReq : Handler { public override async Task OnHandle(Connection connection, byte[] header, byte[] data) { - if (connection.Player!.ChallengeManager?.ChallengeInstance == null) + if (connection.Player!.ChallengeManager?.ChallengeInstance is not ChallengeBossInstance boss) { await connection.SendPacket(new PacketEnterChallengeNextPhaseScRsp(Retcode.RetChallengeNotDoing)); return; } - await connection.Player.ChallengeManager.ChallengeInstance.NextPhase(); + await boss.NextPhase(); await connection.SendPacket(new PacketEnterChallengeNextPhaseScRsp(connection.Player)); } } \ No newline at end of file diff --git a/GameServer/Server/Packet/Send/Challenge/PacketChallengeBossPhaseSettleNotify.cs b/GameServer/Server/Packet/Send/Challenge/PacketChallengeBossPhaseSettleNotify.cs index 32836abc..4ea588a0 100644 --- a/GameServer/Server/Packet/Send/Challenge/PacketChallengeBossPhaseSettleNotify.cs +++ b/GameServer/Server/Packet/Send/Challenge/PacketChallengeBossPhaseSettleNotify.cs @@ -1,4 +1,5 @@ using EggLink.DanhengServer.GameServer.Game.Challenge; +using EggLink.DanhengServer.GameServer.Game.Challenge.Instances; using EggLink.DanhengServer.Kcp; using EggLink.DanhengServer.Proto; @@ -6,20 +7,20 @@ namespace EggLink.DanhengServer.GameServer.Server.Packet.Send.Challenge; public class PacketChallengeBossPhaseSettleNotify : BasePacket { - public PacketChallengeBossPhaseSettleNotify(ChallengeInstance challenge, BattleTargetList? targetLists = null) : + public PacketChallengeBossPhaseSettleNotify(ChallengeBossInstance challenge, BattleTargetList? targetLists = null) : base(CmdIds .ChallengeBossPhaseSettleNotify) { var proto = new ChallengeBossPhaseSettleNotify { - ChallengeId = (uint)challenge.Excel.ID, - IsWin = challenge.IsWin(), - ChallengeScore = (uint)challenge.ScoreStage1, - ScoreTwo = (uint)challenge.ScoreStage2, - Star = (uint)challenge.Stars, - Phase = (uint)challenge.CurrentStage, + ChallengeId = (uint)challenge.Config.ID, + IsWin = challenge.IsWin, + ChallengeScore = challenge.Data.Boss.ScoreStage1, + ScoreTwo = challenge.Data.Boss.ScoreStage2, + Star = challenge.Data.Boss.Stars, + Phase = challenge.Data.Boss.CurrentStage, IsReward = true, - IsSecondHalf = challenge.CurrentStage == challenge.Excel.StageNum, + IsSecondHalf = challenge.Data.Boss.CurrentStage == challenge.Config.StageNum, PageType = 1 }; diff --git a/GameServer/Server/Packet/Send/Challenge/PacketChallengeSettleNotify.cs b/GameServer/Server/Packet/Send/Challenge/PacketChallengeSettleNotify.cs index 3d6909cd..d236faaa 100644 --- a/GameServer/Server/Packet/Send/Challenge/PacketChallengeSettleNotify.cs +++ b/GameServer/Server/Packet/Send/Challenge/PacketChallengeSettleNotify.cs @@ -1,4 +1,5 @@ using EggLink.DanhengServer.GameServer.Game.Challenge; +using EggLink.DanhengServer.GameServer.Game.Challenge.Definitions; using EggLink.DanhengServer.Kcp; using EggLink.DanhengServer.Proto; @@ -6,15 +7,15 @@ namespace EggLink.DanhengServer.GameServer.Server.Packet.Send.Challenge; public class PacketChallengeSettleNotify : BasePacket { - public PacketChallengeSettleNotify(ChallengeInstance challenge) : base(CmdIds.ChallengeSettleNotify) + public PacketChallengeSettleNotify(BaseLegacyChallengeInstance challenge) : base(CmdIds.ChallengeSettleNotify) { var proto = new ChallengeSettleNotify { - ChallengeId = (uint)challenge.Excel.ID, - IsWin = challenge.IsWin(), - ChallengeScore = (uint)challenge.ScoreStage1, - ScoreTwo = (uint)challenge.ScoreStage2, - Star = (uint)challenge.Stars, + ChallengeId = (uint)challenge.Config.ID, + IsWin = challenge.IsWin, + ChallengeScore = challenge.GetScore1(), + ScoreTwo = challenge.GetScore2(), + Star = challenge.GetStars(), Reward = new ItemList() }; diff --git a/GameServer/Server/Packet/Send/Challenge/PacketGetCurChallengeScRsp.cs b/GameServer/Server/Packet/Send/Challenge/PacketGetCurChallengeScRsp.cs index b6dda577..2fad8614 100644 --- a/GameServer/Server/Packet/Send/Challenge/PacketGetCurChallengeScRsp.cs +++ b/GameServer/Server/Packet/Send/Challenge/PacketGetCurChallengeScRsp.cs @@ -1,4 +1,5 @@ -using EggLink.DanhengServer.GameServer.Game.Player; +using EggLink.DanhengServer.GameServer.Game.Challenge.Definitions; +using EggLink.DanhengServer.GameServer.Game.Player; using EggLink.DanhengServer.Kcp; using EggLink.DanhengServer.Proto; @@ -10,13 +11,12 @@ public class PacketGetCurChallengeScRsp : BasePacket { var proto = new GetCurChallengeScRsp(); - if (player.ChallengeManager!.ChallengeInstance != null) + if (player.ChallengeManager!.ChallengeInstance is BaseLegacyChallengeInstance inst) { - proto.CurChallenge = player.ChallengeManager.ChallengeInstance.ToProto(); + proto.CurChallenge = inst.ToProto(); Task.Run(async () => { - await player.LineupManager!.SetCurLineup(player.ChallengeManager.ChallengeInstance - .CurrentExtraLineup + 10); + await player.LineupManager!.SetCurLineup(inst.GetCurrentExtraLineupType() + 10); }).Wait(); var proto1 = player.LineupManager?.GetExtraLineup(ExtraLineupType.LineupChallenge)?.ToProto(); if (proto1 != null) diff --git a/GameServer/Server/Packet/Send/Challenge/PacketStartChallengeScRsp.cs b/GameServer/Server/Packet/Send/Challenge/PacketStartChallengeScRsp.cs index 8c9f9cd8..3f24da88 100644 --- a/GameServer/Server/Packet/Send/Challenge/PacketStartChallengeScRsp.cs +++ b/GameServer/Server/Packet/Send/Challenge/PacketStartChallengeScRsp.cs @@ -1,4 +1,5 @@ -using EggLink.DanhengServer.GameServer.Game.Player; +using EggLink.DanhengServer.GameServer.Game.Challenge.Definitions; +using EggLink.DanhengServer.GameServer.Game.Player; using EggLink.DanhengServer.Kcp; using EggLink.DanhengServer.Proto; @@ -22,8 +23,12 @@ public class PacketStartChallengeScRsp : BasePacket if (player.ChallengeManager!.ChallengeInstance != null) { - proto.CurChallenge = player.ChallengeManager.ChallengeInstance.ToProto(); - proto.StageInfo = player.ChallengeManager.ChallengeInstance.ToStageInfo(); + if (player.ChallengeManager.ChallengeInstance is BaseLegacyChallengeInstance inst) + { + proto.CurChallenge = inst.ToProto(); + proto.StageInfo = inst.ToStageInfo(); + } + proto.LineupList.Add(player.LineupManager!.GetExtraLineup(ExtraLineupType.LineupChallenge)!.ToProto()); proto.LineupList.Add(player.LineupManager!.GetExtraLineup(ExtraLineupType.LineupChallenge2)!.ToProto()); if (sendScene) proto.Scene = player.SceneInstance!.ToProto(); diff --git a/GameServer/Server/Packet/Send/Mission/PacketGetMissionDataScRsp.cs b/GameServer/Server/Packet/Send/Mission/PacketGetMissionDataScRsp.cs index d263e7e6..86269f30 100644 --- a/GameServer/Server/Packet/Send/Mission/PacketGetMissionDataScRsp.cs +++ b/GameServer/Server/Packet/Send/Mission/PacketGetMissionDataScRsp.cs @@ -23,7 +23,7 @@ public class PacketGetMissionDataScRsp : BasePacket Status = MissionStatus.MissionDoing }); - foreach (var mission in GameData.SubMissionInfoData.Keys) + foreach (var mission in GameData.SubMissionInfoData.Keys.Concat(GameData.SubMissionData.Keys)) if (player.MissionManager!.GetSubMissionStatus(mission) == MissionPhaseEnum.Accept) proto.MissionList.Add(new Proto.Mission { diff --git a/Program/Program/EntryPoint.cs b/Program/Program/EntryPoint.cs index 12dad28a..c40b9f70 100644 --- a/Program/Program/EntryPoint.cs +++ b/Program/Program/EntryPoint.cs @@ -8,6 +8,7 @@ using EggLink.DanhengServer.Database.Avatar; using EggLink.DanhengServer.Enums; using EggLink.DanhengServer.Enums.Rogue; using EggLink.DanhengServer.GameServer.Command; +using EggLink.DanhengServer.GameServer.Game.Challenge.Definitions; using EggLink.DanhengServer.GameServer.Plugin; using EggLink.DanhengServer.GameServer.Server; using EggLink.DanhengServer.GameServer.Server.Packet; @@ -280,13 +281,14 @@ public class EntryPoint _ => PlayerStatusEnum.Rogue }; } - else if ((con as Connection)!.Player!.ChallengeManager?.ChallengeInstance != null) + else if ((con as Connection)!.Player!.ChallengeManager?.ChallengeInstance is + BaseLegacyChallengeInstance inst) { status = PlayerStatusEnum.Challenge; - if ((con as Connection)!.Player?.ChallengeManager?.ChallengeInstance?.Excel.StoryExcel != null) + + if (inst.Config.StoryExcel != null) status = PlayerStatusEnum.ChallengeStory; - else if ((con as Connection)!.Player?.ChallengeManager?.ChallengeInstance?.Excel.BossExcel != - null) + else if (inst.Config.BossExcel != null) status = PlayerStatusEnum.ChallengeBoss; } else if ((con as Connection)!.Player!.RaidManager?.RaidData.CurRaidId != 0) diff --git a/ServerSideProto/ChallengeData.cs b/ServerSideProto/ChallengeData.cs new file mode 100644 index 00000000..e5f27b7a --- /dev/null +++ b/ServerSideProto/ChallengeData.cs @@ -0,0 +1,2920 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ChallengeData.proto +// +#pragma warning disable 1591, 0612, 3021, 8981 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace EggLink.DanhengServer.Proto.ServerSide { + + /// Holder for reflection information generated from ChallengeData.proto + public static partial class ChallengeDataReflection { + + #region Descriptor + /// File descriptor for ChallengeData.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ChallengeDataReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChNDaGFsbGVuZ2VEYXRhLnByb3RvIiwKCVZlY3RvcjNQYhIJCgF4GAEgASgF", + "EgkKAXkYAiABKAUSCQoBehgDIAEoBSKUAgoVQ2hhbGxlbmdlTWVtb3J5RGF0", + "YVBiEhcKD0NoYWxsZW5nZU1hemVJZBgBIAEoDRIcCghTdGFydFBvcxgCIAEo", + "CzIKLlZlY3RvcjNQYhIcCghTdGFydFJvdBgDIAEoCzIKLlZlY3RvcjNQYhIU", + "CgxDdXJyZW50U3RhZ2UYBCABKA0SEQoJQ3VyU3RhdHVzGAUgASgNEhUKDURl", + "YWRBdmF0YXJOdW0YBiABKA0SDwoHU2F2ZWRNcBgHIAEoDRIyChJDdXJyZW50", + "RXh0cmFMaW5ldXAYCCABKA4yFi5DaGFsbGVuZ2VMaW5ldXBUeXBlUGISEgoK", + "Um91bmRzTGVmdBgJIAEoDRINCgVTdGFycxgKIAEoDSKhAgoUQ2hhbGxlbmdl", + "U3RvcnlEYXRhUGISFwoPQ2hhbGxlbmdlTWF6ZUlkGAEgASgNEhwKCFN0YXJ0", + "UG9zGAIgASgLMgouVmVjdG9yM1BiEhwKCFN0YXJ0Um90GAMgASgLMgouVmVj", + "dG9yM1BiEhQKDEN1cnJlbnRTdGFnZRgEIAEoDRIRCglDdXJTdGF0dXMYBSAB", + "KA0SDwoHU2F2ZWRNcBgGIAEoDRIyChJDdXJyZW50RXh0cmFMaW5ldXAYByAB", + "KA4yFi5DaGFsbGVuZ2VMaW5ldXBUeXBlUGISDQoFU3RhcnMYCCABKA0SEwoL", + "U2NvcmVTdGFnZTEYCSABKA0SEwoLU2NvcmVTdGFnZTIYCiABKA0SDQoFQnVm", + "ZnMYCyADKA0ioAIKE0NoYWxsZW5nZUJvc3NEYXRhUGISFwoPQ2hhbGxlbmdl", + "TWF6ZUlkGAEgASgNEhwKCFN0YXJ0UG9zGAIgASgLMgouVmVjdG9yM1BiEhwK", + "CFN0YXJ0Um90GAMgASgLMgouVmVjdG9yM1BiEhQKDEN1cnJlbnRTdGFnZRgE", + "IAEoDRIRCglDdXJTdGF0dXMYBSABKA0SDwoHU2F2ZWRNcBgGIAEoDRIyChJD", + "dXJyZW50RXh0cmFMaW5ldXAYByABKA4yFi5DaGFsbGVuZ2VMaW5ldXBUeXBl", + "UGISDQoFU3RhcnMYCCABKA0SEwoLU2NvcmVTdGFnZTEYCSABKA0SEwoLU2Nv", + "cmVTdGFnZTIYCiABKA0SDQoFQnVmZnMYCyADKA0i8wEKE0NoYWxsZW5nZVBl", + "YWtEYXRhUGISGgoSQ3VycmVudFBlYWtMZXZlbElkGAIgASgNEg0KBUJ1ZmZz", + "GAMgAygNEhEKCUN1clN0YXR1cxgEIAEoDRIcCghTdGFydFBvcxgFIAEoCzIK", + "LlZlY3RvcjNQYhIcCghTdGFydFJvdBgGIAEoCzIKLlZlY3RvcjNQYhIPCgdT", + "YXZlZE1wGAcgASgNEg0KBVN0YXJzGAggASgNEjIKEkN1cnJlbnRFeHRyYUxp", + "bmV1cBgJIAEoDjIWLkNoYWxsZW5nZUxpbmV1cFR5cGVQYhIOCgZJc0hhcmQY", + "CiABKAgiwQEKD0NoYWxsZW5nZURhdGFQYhIoCgZtZW1vcnkYASABKAsyFi5D", + "aGFsbGVuZ2VNZW1vcnlEYXRhUGJIABImCgVzdG9yeRgCIAEoCzIVLkNoYWxs", + "ZW5nZVN0b3J5RGF0YVBiSAASJAoEYm9zcxgDIAEoCzIULkNoYWxsZW5nZUJv", + "c3NEYXRhUGJIABIkCgRwZWFrGAQgASgLMhQuQ2hhbGxlbmdlUGVha0RhdGFQ", + "YkgAQhAKDmNoYWxsZW5nZV90eXBlKlEKFUNoYWxsZW5nZUxpbmV1cFR5cGVQ", + "YhIICgROb25lEAASDgoKQ2hhbGxlbmdlMRABEg4KCkNoYWxsZW5nZTIQAxIO", + "CgpDaGFsbGVuZ2UzEARCKaoCJkVnZ0xpbmsuRGFuaGVuZ1NlcnZlci5Qcm90", + "by5TZXJ2ZXJTaWRlYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb), }, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb), global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb.Parser, new[]{ "X", "Y", "Z" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EggLink.DanhengServer.Proto.ServerSide.ChallengeMemoryDataPb), global::EggLink.DanhengServer.Proto.ServerSide.ChallengeMemoryDataPb.Parser, new[]{ "ChallengeMazeId", "StartPos", "StartRot", "CurrentStage", "CurStatus", "DeadAvatarNum", "SavedMp", "CurrentExtraLineup", "RoundsLeft", "Stars" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EggLink.DanhengServer.Proto.ServerSide.ChallengeStoryDataPb), global::EggLink.DanhengServer.Proto.ServerSide.ChallengeStoryDataPb.Parser, new[]{ "ChallengeMazeId", "StartPos", "StartRot", "CurrentStage", "CurStatus", "SavedMp", "CurrentExtraLineup", "Stars", "ScoreStage1", "ScoreStage2", "Buffs" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EggLink.DanhengServer.Proto.ServerSide.ChallengeBossDataPb), global::EggLink.DanhengServer.Proto.ServerSide.ChallengeBossDataPb.Parser, new[]{ "ChallengeMazeId", "StartPos", "StartRot", "CurrentStage", "CurStatus", "SavedMp", "CurrentExtraLineup", "Stars", "ScoreStage1", "ScoreStage2", "Buffs" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EggLink.DanhengServer.Proto.ServerSide.ChallengePeakDataPb), global::EggLink.DanhengServer.Proto.ServerSide.ChallengePeakDataPb.Parser, new[]{ "CurrentPeakLevelId", "Buffs", "CurStatus", "StartPos", "StartRot", "SavedMp", "Stars", "CurrentExtraLineup", "IsHard" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EggLink.DanhengServer.Proto.ServerSide.ChallengeDataPb), global::EggLink.DanhengServer.Proto.ServerSide.ChallengeDataPb.Parser, new[]{ "Memory", "Story", "Boss", "Peak" }, new[]{ "ChallengeType" }, null, null, null) + })); + } + #endregion + + } + #region Enums + public enum ChallengeLineupTypePb { + [pbr::OriginalName("None")] None = 0, + [pbr::OriginalName("Challenge1")] Challenge1 = 1, + [pbr::OriginalName("Challenge2")] Challenge2 = 3, + [pbr::OriginalName("Challenge3")] Challenge3 = 4, + } + + #endregion + + #region Messages + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class Vector3Pb : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Vector3Pb()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::EggLink.DanhengServer.Proto.ServerSide.ChallengeDataReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Vector3Pb() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Vector3Pb(Vector3Pb other) : this() { + x_ = other.x_; + y_ = other.y_; + z_ = other.z_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Vector3Pb Clone() { + return new Vector3Pb(this); + } + + /// Field number for the "x" field. + public const int XFieldNumber = 1; + private int x_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int X { + get { return x_; } + set { + x_ = value; + } + } + + /// Field number for the "y" field. + public const int YFieldNumber = 2; + private int y_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Y { + get { return y_; } + set { + y_ = value; + } + } + + /// Field number for the "z" field. + public const int ZFieldNumber = 3; + private int z_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Z { + get { return z_; } + set { + z_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Vector3Pb); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Vector3Pb other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (X != other.X) return false; + if (Y != other.Y) return false; + if (Z != other.Z) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (X != 0) hash ^= X.GetHashCode(); + if (Y != 0) hash ^= Y.GetHashCode(); + if (Z != 0) hash ^= Z.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (X != 0) { + output.WriteRawTag(8); + output.WriteInt32(X); + } + if (Y != 0) { + output.WriteRawTag(16); + output.WriteInt32(Y); + } + if (Z != 0) { + output.WriteRawTag(24); + output.WriteInt32(Z); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (X != 0) { + output.WriteRawTag(8); + output.WriteInt32(X); + } + if (Y != 0) { + output.WriteRawTag(16); + output.WriteInt32(Y); + } + if (Z != 0) { + output.WriteRawTag(24); + output.WriteInt32(Z); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (X != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(X); + } + if (Y != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Y); + } + if (Z != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Z); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Vector3Pb other) { + if (other == null) { + return; + } + if (other.X != 0) { + X = other.X; + } + if (other.Y != 0) { + Y = other.Y; + } + if (other.Z != 0) { + Z = other.Z; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + X = input.ReadInt32(); + break; + } + case 16: { + Y = input.ReadInt32(); + break; + } + case 24: { + Z = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + X = input.ReadInt32(); + break; + } + case 16: { + Y = input.ReadInt32(); + break; + } + case 24: { + Z = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class ChallengeMemoryDataPb : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChallengeMemoryDataPb()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::EggLink.DanhengServer.Proto.ServerSide.ChallengeDataReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChallengeMemoryDataPb() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChallengeMemoryDataPb(ChallengeMemoryDataPb other) : this() { + challengeMazeId_ = other.challengeMazeId_; + startPos_ = other.startPos_ != null ? other.startPos_.Clone() : null; + startRot_ = other.startRot_ != null ? other.startRot_.Clone() : null; + currentStage_ = other.currentStage_; + curStatus_ = other.curStatus_; + deadAvatarNum_ = other.deadAvatarNum_; + savedMp_ = other.savedMp_; + currentExtraLineup_ = other.currentExtraLineup_; + roundsLeft_ = other.roundsLeft_; + stars_ = other.stars_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChallengeMemoryDataPb Clone() { + return new ChallengeMemoryDataPb(this); + } + + /// Field number for the "ChallengeMazeId" field. + public const int ChallengeMazeIdFieldNumber = 1; + private uint challengeMazeId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint ChallengeMazeId { + get { return challengeMazeId_; } + set { + challengeMazeId_ = value; + } + } + + /// Field number for the "StartPos" field. + public const int StartPosFieldNumber = 2; + private global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb startPos_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb StartPos { + get { return startPos_; } + set { + startPos_ = value; + } + } + + /// Field number for the "StartRot" field. + public const int StartRotFieldNumber = 3; + private global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb startRot_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb StartRot { + get { return startRot_; } + set { + startRot_ = value; + } + } + + /// Field number for the "CurrentStage" field. + public const int CurrentStageFieldNumber = 4; + private uint currentStage_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint CurrentStage { + get { return currentStage_; } + set { + currentStage_ = value; + } + } + + /// Field number for the "CurStatus" field. + public const int CurStatusFieldNumber = 5; + private uint curStatus_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint CurStatus { + get { return curStatus_; } + set { + curStatus_ = value; + } + } + + /// Field number for the "DeadAvatarNum" field. + public const int DeadAvatarNumFieldNumber = 6; + private uint deadAvatarNum_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint DeadAvatarNum { + get { return deadAvatarNum_; } + set { + deadAvatarNum_ = value; + } + } + + /// Field number for the "SavedMp" field. + public const int SavedMpFieldNumber = 7; + private uint savedMp_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint SavedMp { + get { return savedMp_; } + set { + savedMp_ = value; + } + } + + /// Field number for the "CurrentExtraLineup" field. + public const int CurrentExtraLineupFieldNumber = 8; + private global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb currentExtraLineup_ = global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb CurrentExtraLineup { + get { return currentExtraLineup_; } + set { + currentExtraLineup_ = value; + } + } + + /// Field number for the "RoundsLeft" field. + public const int RoundsLeftFieldNumber = 9; + private uint roundsLeft_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint RoundsLeft { + get { return roundsLeft_; } + set { + roundsLeft_ = value; + } + } + + /// Field number for the "Stars" field. + public const int StarsFieldNumber = 10; + private uint stars_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint Stars { + get { return stars_; } + set { + stars_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ChallengeMemoryDataPb); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ChallengeMemoryDataPb other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChallengeMazeId != other.ChallengeMazeId) return false; + if (!object.Equals(StartPos, other.StartPos)) return false; + if (!object.Equals(StartRot, other.StartRot)) return false; + if (CurrentStage != other.CurrentStage) return false; + if (CurStatus != other.CurStatus) return false; + if (DeadAvatarNum != other.DeadAvatarNum) return false; + if (SavedMp != other.SavedMp) return false; + if (CurrentExtraLineup != other.CurrentExtraLineup) return false; + if (RoundsLeft != other.RoundsLeft) return false; + if (Stars != other.Stars) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (ChallengeMazeId != 0) hash ^= ChallengeMazeId.GetHashCode(); + if (startPos_ != null) hash ^= StartPos.GetHashCode(); + if (startRot_ != null) hash ^= StartRot.GetHashCode(); + if (CurrentStage != 0) hash ^= CurrentStage.GetHashCode(); + if (CurStatus != 0) hash ^= CurStatus.GetHashCode(); + if (DeadAvatarNum != 0) hash ^= DeadAvatarNum.GetHashCode(); + if (SavedMp != 0) hash ^= SavedMp.GetHashCode(); + if (CurrentExtraLineup != global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None) hash ^= CurrentExtraLineup.GetHashCode(); + if (RoundsLeft != 0) hash ^= RoundsLeft.GetHashCode(); + if (Stars != 0) hash ^= Stars.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ChallengeMazeId != 0) { + output.WriteRawTag(8); + output.WriteUInt32(ChallengeMazeId); + } + if (startPos_ != null) { + output.WriteRawTag(18); + output.WriteMessage(StartPos); + } + if (startRot_ != null) { + output.WriteRawTag(26); + output.WriteMessage(StartRot); + } + if (CurrentStage != 0) { + output.WriteRawTag(32); + output.WriteUInt32(CurrentStage); + } + if (CurStatus != 0) { + output.WriteRawTag(40); + output.WriteUInt32(CurStatus); + } + if (DeadAvatarNum != 0) { + output.WriteRawTag(48); + output.WriteUInt32(DeadAvatarNum); + } + if (SavedMp != 0) { + output.WriteRawTag(56); + output.WriteUInt32(SavedMp); + } + if (CurrentExtraLineup != global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None) { + output.WriteRawTag(64); + output.WriteEnum((int) CurrentExtraLineup); + } + if (RoundsLeft != 0) { + output.WriteRawTag(72); + output.WriteUInt32(RoundsLeft); + } + if (Stars != 0) { + output.WriteRawTag(80); + output.WriteUInt32(Stars); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ChallengeMazeId != 0) { + output.WriteRawTag(8); + output.WriteUInt32(ChallengeMazeId); + } + if (startPos_ != null) { + output.WriteRawTag(18); + output.WriteMessage(StartPos); + } + if (startRot_ != null) { + output.WriteRawTag(26); + output.WriteMessage(StartRot); + } + if (CurrentStage != 0) { + output.WriteRawTag(32); + output.WriteUInt32(CurrentStage); + } + if (CurStatus != 0) { + output.WriteRawTag(40); + output.WriteUInt32(CurStatus); + } + if (DeadAvatarNum != 0) { + output.WriteRawTag(48); + output.WriteUInt32(DeadAvatarNum); + } + if (SavedMp != 0) { + output.WriteRawTag(56); + output.WriteUInt32(SavedMp); + } + if (CurrentExtraLineup != global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None) { + output.WriteRawTag(64); + output.WriteEnum((int) CurrentExtraLineup); + } + if (RoundsLeft != 0) { + output.WriteRawTag(72); + output.WriteUInt32(RoundsLeft); + } + if (Stars != 0) { + output.WriteRawTag(80); + output.WriteUInt32(Stars); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (ChallengeMazeId != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(ChallengeMazeId); + } + if (startPos_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(StartPos); + } + if (startRot_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(StartRot); + } + if (CurrentStage != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(CurrentStage); + } + if (CurStatus != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(CurStatus); + } + if (DeadAvatarNum != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(DeadAvatarNum); + } + if (SavedMp != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(SavedMp); + } + if (CurrentExtraLineup != global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) CurrentExtraLineup); + } + if (RoundsLeft != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(RoundsLeft); + } + if (Stars != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Stars); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ChallengeMemoryDataPb other) { + if (other == null) { + return; + } + if (other.ChallengeMazeId != 0) { + ChallengeMazeId = other.ChallengeMazeId; + } + if (other.startPos_ != null) { + if (startPos_ == null) { + StartPos = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + StartPos.MergeFrom(other.StartPos); + } + if (other.startRot_ != null) { + if (startRot_ == null) { + StartRot = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + StartRot.MergeFrom(other.StartRot); + } + if (other.CurrentStage != 0) { + CurrentStage = other.CurrentStage; + } + if (other.CurStatus != 0) { + CurStatus = other.CurStatus; + } + if (other.DeadAvatarNum != 0) { + DeadAvatarNum = other.DeadAvatarNum; + } + if (other.SavedMp != 0) { + SavedMp = other.SavedMp; + } + if (other.CurrentExtraLineup != global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None) { + CurrentExtraLineup = other.CurrentExtraLineup; + } + if (other.RoundsLeft != 0) { + RoundsLeft = other.RoundsLeft; + } + if (other.Stars != 0) { + Stars = other.Stars; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ChallengeMazeId = input.ReadUInt32(); + break; + } + case 18: { + if (startPos_ == null) { + StartPos = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + input.ReadMessage(StartPos); + break; + } + case 26: { + if (startRot_ == null) { + StartRot = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + input.ReadMessage(StartRot); + break; + } + case 32: { + CurrentStage = input.ReadUInt32(); + break; + } + case 40: { + CurStatus = input.ReadUInt32(); + break; + } + case 48: { + DeadAvatarNum = input.ReadUInt32(); + break; + } + case 56: { + SavedMp = input.ReadUInt32(); + break; + } + case 64: { + CurrentExtraLineup = (global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb) input.ReadEnum(); + break; + } + case 72: { + RoundsLeft = input.ReadUInt32(); + break; + } + case 80: { + Stars = input.ReadUInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + ChallengeMazeId = input.ReadUInt32(); + break; + } + case 18: { + if (startPos_ == null) { + StartPos = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + input.ReadMessage(StartPos); + break; + } + case 26: { + if (startRot_ == null) { + StartRot = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + input.ReadMessage(StartRot); + break; + } + case 32: { + CurrentStage = input.ReadUInt32(); + break; + } + case 40: { + CurStatus = input.ReadUInt32(); + break; + } + case 48: { + DeadAvatarNum = input.ReadUInt32(); + break; + } + case 56: { + SavedMp = input.ReadUInt32(); + break; + } + case 64: { + CurrentExtraLineup = (global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb) input.ReadEnum(); + break; + } + case 72: { + RoundsLeft = input.ReadUInt32(); + break; + } + case 80: { + Stars = input.ReadUInt32(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class ChallengeStoryDataPb : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChallengeStoryDataPb()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::EggLink.DanhengServer.Proto.ServerSide.ChallengeDataReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChallengeStoryDataPb() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChallengeStoryDataPb(ChallengeStoryDataPb other) : this() { + challengeMazeId_ = other.challengeMazeId_; + startPos_ = other.startPos_ != null ? other.startPos_.Clone() : null; + startRot_ = other.startRot_ != null ? other.startRot_.Clone() : null; + currentStage_ = other.currentStage_; + curStatus_ = other.curStatus_; + savedMp_ = other.savedMp_; + currentExtraLineup_ = other.currentExtraLineup_; + stars_ = other.stars_; + scoreStage1_ = other.scoreStage1_; + scoreStage2_ = other.scoreStage2_; + buffs_ = other.buffs_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChallengeStoryDataPb Clone() { + return new ChallengeStoryDataPb(this); + } + + /// Field number for the "ChallengeMazeId" field. + public const int ChallengeMazeIdFieldNumber = 1; + private uint challengeMazeId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint ChallengeMazeId { + get { return challengeMazeId_; } + set { + challengeMazeId_ = value; + } + } + + /// Field number for the "StartPos" field. + public const int StartPosFieldNumber = 2; + private global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb startPos_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb StartPos { + get { return startPos_; } + set { + startPos_ = value; + } + } + + /// Field number for the "StartRot" field. + public const int StartRotFieldNumber = 3; + private global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb startRot_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb StartRot { + get { return startRot_; } + set { + startRot_ = value; + } + } + + /// Field number for the "CurrentStage" field. + public const int CurrentStageFieldNumber = 4; + private uint currentStage_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint CurrentStage { + get { return currentStage_; } + set { + currentStage_ = value; + } + } + + /// Field number for the "CurStatus" field. + public const int CurStatusFieldNumber = 5; + private uint curStatus_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint CurStatus { + get { return curStatus_; } + set { + curStatus_ = value; + } + } + + /// Field number for the "SavedMp" field. + public const int SavedMpFieldNumber = 6; + private uint savedMp_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint SavedMp { + get { return savedMp_; } + set { + savedMp_ = value; + } + } + + /// Field number for the "CurrentExtraLineup" field. + public const int CurrentExtraLineupFieldNumber = 7; + private global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb currentExtraLineup_ = global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb CurrentExtraLineup { + get { return currentExtraLineup_; } + set { + currentExtraLineup_ = value; + } + } + + /// Field number for the "Stars" field. + public const int StarsFieldNumber = 8; + private uint stars_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint Stars { + get { return stars_; } + set { + stars_ = value; + } + } + + /// Field number for the "ScoreStage1" field. + public const int ScoreStage1FieldNumber = 9; + private uint scoreStage1_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint ScoreStage1 { + get { return scoreStage1_; } + set { + scoreStage1_ = value; + } + } + + /// Field number for the "ScoreStage2" field. + public const int ScoreStage2FieldNumber = 10; + private uint scoreStage2_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint ScoreStage2 { + get { return scoreStage2_; } + set { + scoreStage2_ = value; + } + } + + /// Field number for the "Buffs" field. + public const int BuffsFieldNumber = 11; + private static readonly pb::FieldCodec _repeated_buffs_codec + = pb::FieldCodec.ForUInt32(90); + private readonly pbc::RepeatedField buffs_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Buffs { + get { return buffs_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ChallengeStoryDataPb); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ChallengeStoryDataPb other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChallengeMazeId != other.ChallengeMazeId) return false; + if (!object.Equals(StartPos, other.StartPos)) return false; + if (!object.Equals(StartRot, other.StartRot)) return false; + if (CurrentStage != other.CurrentStage) return false; + if (CurStatus != other.CurStatus) return false; + if (SavedMp != other.SavedMp) return false; + if (CurrentExtraLineup != other.CurrentExtraLineup) return false; + if (Stars != other.Stars) return false; + if (ScoreStage1 != other.ScoreStage1) return false; + if (ScoreStage2 != other.ScoreStage2) return false; + if(!buffs_.Equals(other.buffs_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (ChallengeMazeId != 0) hash ^= ChallengeMazeId.GetHashCode(); + if (startPos_ != null) hash ^= StartPos.GetHashCode(); + if (startRot_ != null) hash ^= StartRot.GetHashCode(); + if (CurrentStage != 0) hash ^= CurrentStage.GetHashCode(); + if (CurStatus != 0) hash ^= CurStatus.GetHashCode(); + if (SavedMp != 0) hash ^= SavedMp.GetHashCode(); + if (CurrentExtraLineup != global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None) hash ^= CurrentExtraLineup.GetHashCode(); + if (Stars != 0) hash ^= Stars.GetHashCode(); + if (ScoreStage1 != 0) hash ^= ScoreStage1.GetHashCode(); + if (ScoreStage2 != 0) hash ^= ScoreStage2.GetHashCode(); + hash ^= buffs_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ChallengeMazeId != 0) { + output.WriteRawTag(8); + output.WriteUInt32(ChallengeMazeId); + } + if (startPos_ != null) { + output.WriteRawTag(18); + output.WriteMessage(StartPos); + } + if (startRot_ != null) { + output.WriteRawTag(26); + output.WriteMessage(StartRot); + } + if (CurrentStage != 0) { + output.WriteRawTag(32); + output.WriteUInt32(CurrentStage); + } + if (CurStatus != 0) { + output.WriteRawTag(40); + output.WriteUInt32(CurStatus); + } + if (SavedMp != 0) { + output.WriteRawTag(48); + output.WriteUInt32(SavedMp); + } + if (CurrentExtraLineup != global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None) { + output.WriteRawTag(56); + output.WriteEnum((int) CurrentExtraLineup); + } + if (Stars != 0) { + output.WriteRawTag(64); + output.WriteUInt32(Stars); + } + if (ScoreStage1 != 0) { + output.WriteRawTag(72); + output.WriteUInt32(ScoreStage1); + } + if (ScoreStage2 != 0) { + output.WriteRawTag(80); + output.WriteUInt32(ScoreStage2); + } + buffs_.WriteTo(output, _repeated_buffs_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ChallengeMazeId != 0) { + output.WriteRawTag(8); + output.WriteUInt32(ChallengeMazeId); + } + if (startPos_ != null) { + output.WriteRawTag(18); + output.WriteMessage(StartPos); + } + if (startRot_ != null) { + output.WriteRawTag(26); + output.WriteMessage(StartRot); + } + if (CurrentStage != 0) { + output.WriteRawTag(32); + output.WriteUInt32(CurrentStage); + } + if (CurStatus != 0) { + output.WriteRawTag(40); + output.WriteUInt32(CurStatus); + } + if (SavedMp != 0) { + output.WriteRawTag(48); + output.WriteUInt32(SavedMp); + } + if (CurrentExtraLineup != global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None) { + output.WriteRawTag(56); + output.WriteEnum((int) CurrentExtraLineup); + } + if (Stars != 0) { + output.WriteRawTag(64); + output.WriteUInt32(Stars); + } + if (ScoreStage1 != 0) { + output.WriteRawTag(72); + output.WriteUInt32(ScoreStage1); + } + if (ScoreStage2 != 0) { + output.WriteRawTag(80); + output.WriteUInt32(ScoreStage2); + } + buffs_.WriteTo(ref output, _repeated_buffs_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (ChallengeMazeId != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(ChallengeMazeId); + } + if (startPos_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(StartPos); + } + if (startRot_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(StartRot); + } + if (CurrentStage != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(CurrentStage); + } + if (CurStatus != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(CurStatus); + } + if (SavedMp != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(SavedMp); + } + if (CurrentExtraLineup != global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) CurrentExtraLineup); + } + if (Stars != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Stars); + } + if (ScoreStage1 != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(ScoreStage1); + } + if (ScoreStage2 != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(ScoreStage2); + } + size += buffs_.CalculateSize(_repeated_buffs_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ChallengeStoryDataPb other) { + if (other == null) { + return; + } + if (other.ChallengeMazeId != 0) { + ChallengeMazeId = other.ChallengeMazeId; + } + if (other.startPos_ != null) { + if (startPos_ == null) { + StartPos = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + StartPos.MergeFrom(other.StartPos); + } + if (other.startRot_ != null) { + if (startRot_ == null) { + StartRot = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + StartRot.MergeFrom(other.StartRot); + } + if (other.CurrentStage != 0) { + CurrentStage = other.CurrentStage; + } + if (other.CurStatus != 0) { + CurStatus = other.CurStatus; + } + if (other.SavedMp != 0) { + SavedMp = other.SavedMp; + } + if (other.CurrentExtraLineup != global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None) { + CurrentExtraLineup = other.CurrentExtraLineup; + } + if (other.Stars != 0) { + Stars = other.Stars; + } + if (other.ScoreStage1 != 0) { + ScoreStage1 = other.ScoreStage1; + } + if (other.ScoreStage2 != 0) { + ScoreStage2 = other.ScoreStage2; + } + buffs_.Add(other.buffs_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ChallengeMazeId = input.ReadUInt32(); + break; + } + case 18: { + if (startPos_ == null) { + StartPos = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + input.ReadMessage(StartPos); + break; + } + case 26: { + if (startRot_ == null) { + StartRot = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + input.ReadMessage(StartRot); + break; + } + case 32: { + CurrentStage = input.ReadUInt32(); + break; + } + case 40: { + CurStatus = input.ReadUInt32(); + break; + } + case 48: { + SavedMp = input.ReadUInt32(); + break; + } + case 56: { + CurrentExtraLineup = (global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb) input.ReadEnum(); + break; + } + case 64: { + Stars = input.ReadUInt32(); + break; + } + case 72: { + ScoreStage1 = input.ReadUInt32(); + break; + } + case 80: { + ScoreStage2 = input.ReadUInt32(); + break; + } + case 90: + case 88: { + buffs_.AddEntriesFrom(input, _repeated_buffs_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + ChallengeMazeId = input.ReadUInt32(); + break; + } + case 18: { + if (startPos_ == null) { + StartPos = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + input.ReadMessage(StartPos); + break; + } + case 26: { + if (startRot_ == null) { + StartRot = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + input.ReadMessage(StartRot); + break; + } + case 32: { + CurrentStage = input.ReadUInt32(); + break; + } + case 40: { + CurStatus = input.ReadUInt32(); + break; + } + case 48: { + SavedMp = input.ReadUInt32(); + break; + } + case 56: { + CurrentExtraLineup = (global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb) input.ReadEnum(); + break; + } + case 64: { + Stars = input.ReadUInt32(); + break; + } + case 72: { + ScoreStage1 = input.ReadUInt32(); + break; + } + case 80: { + ScoreStage2 = input.ReadUInt32(); + break; + } + case 90: + case 88: { + buffs_.AddEntriesFrom(ref input, _repeated_buffs_codec); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class ChallengeBossDataPb : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChallengeBossDataPb()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::EggLink.DanhengServer.Proto.ServerSide.ChallengeDataReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChallengeBossDataPb() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChallengeBossDataPb(ChallengeBossDataPb other) : this() { + challengeMazeId_ = other.challengeMazeId_; + startPos_ = other.startPos_ != null ? other.startPos_.Clone() : null; + startRot_ = other.startRot_ != null ? other.startRot_.Clone() : null; + currentStage_ = other.currentStage_; + curStatus_ = other.curStatus_; + savedMp_ = other.savedMp_; + currentExtraLineup_ = other.currentExtraLineup_; + stars_ = other.stars_; + scoreStage1_ = other.scoreStage1_; + scoreStage2_ = other.scoreStage2_; + buffs_ = other.buffs_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChallengeBossDataPb Clone() { + return new ChallengeBossDataPb(this); + } + + /// Field number for the "ChallengeMazeId" field. + public const int ChallengeMazeIdFieldNumber = 1; + private uint challengeMazeId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint ChallengeMazeId { + get { return challengeMazeId_; } + set { + challengeMazeId_ = value; + } + } + + /// Field number for the "StartPos" field. + public const int StartPosFieldNumber = 2; + private global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb startPos_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb StartPos { + get { return startPos_; } + set { + startPos_ = value; + } + } + + /// Field number for the "StartRot" field. + public const int StartRotFieldNumber = 3; + private global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb startRot_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb StartRot { + get { return startRot_; } + set { + startRot_ = value; + } + } + + /// Field number for the "CurrentStage" field. + public const int CurrentStageFieldNumber = 4; + private uint currentStage_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint CurrentStage { + get { return currentStage_; } + set { + currentStage_ = value; + } + } + + /// Field number for the "CurStatus" field. + public const int CurStatusFieldNumber = 5; + private uint curStatus_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint CurStatus { + get { return curStatus_; } + set { + curStatus_ = value; + } + } + + /// Field number for the "SavedMp" field. + public const int SavedMpFieldNumber = 6; + private uint savedMp_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint SavedMp { + get { return savedMp_; } + set { + savedMp_ = value; + } + } + + /// Field number for the "CurrentExtraLineup" field. + public const int CurrentExtraLineupFieldNumber = 7; + private global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb currentExtraLineup_ = global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb CurrentExtraLineup { + get { return currentExtraLineup_; } + set { + currentExtraLineup_ = value; + } + } + + /// Field number for the "Stars" field. + public const int StarsFieldNumber = 8; + private uint stars_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint Stars { + get { return stars_; } + set { + stars_ = value; + } + } + + /// Field number for the "ScoreStage1" field. + public const int ScoreStage1FieldNumber = 9; + private uint scoreStage1_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint ScoreStage1 { + get { return scoreStage1_; } + set { + scoreStage1_ = value; + } + } + + /// Field number for the "ScoreStage2" field. + public const int ScoreStage2FieldNumber = 10; + private uint scoreStage2_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint ScoreStage2 { + get { return scoreStage2_; } + set { + scoreStage2_ = value; + } + } + + /// Field number for the "Buffs" field. + public const int BuffsFieldNumber = 11; + private static readonly pb::FieldCodec _repeated_buffs_codec + = pb::FieldCodec.ForUInt32(90); + private readonly pbc::RepeatedField buffs_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Buffs { + get { return buffs_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ChallengeBossDataPb); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ChallengeBossDataPb other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ChallengeMazeId != other.ChallengeMazeId) return false; + if (!object.Equals(StartPos, other.StartPos)) return false; + if (!object.Equals(StartRot, other.StartRot)) return false; + if (CurrentStage != other.CurrentStage) return false; + if (CurStatus != other.CurStatus) return false; + if (SavedMp != other.SavedMp) return false; + if (CurrentExtraLineup != other.CurrentExtraLineup) return false; + if (Stars != other.Stars) return false; + if (ScoreStage1 != other.ScoreStage1) return false; + if (ScoreStage2 != other.ScoreStage2) return false; + if(!buffs_.Equals(other.buffs_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (ChallengeMazeId != 0) hash ^= ChallengeMazeId.GetHashCode(); + if (startPos_ != null) hash ^= StartPos.GetHashCode(); + if (startRot_ != null) hash ^= StartRot.GetHashCode(); + if (CurrentStage != 0) hash ^= CurrentStage.GetHashCode(); + if (CurStatus != 0) hash ^= CurStatus.GetHashCode(); + if (SavedMp != 0) hash ^= SavedMp.GetHashCode(); + if (CurrentExtraLineup != global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None) hash ^= CurrentExtraLineup.GetHashCode(); + if (Stars != 0) hash ^= Stars.GetHashCode(); + if (ScoreStage1 != 0) hash ^= ScoreStage1.GetHashCode(); + if (ScoreStage2 != 0) hash ^= ScoreStage2.GetHashCode(); + hash ^= buffs_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (ChallengeMazeId != 0) { + output.WriteRawTag(8); + output.WriteUInt32(ChallengeMazeId); + } + if (startPos_ != null) { + output.WriteRawTag(18); + output.WriteMessage(StartPos); + } + if (startRot_ != null) { + output.WriteRawTag(26); + output.WriteMessage(StartRot); + } + if (CurrentStage != 0) { + output.WriteRawTag(32); + output.WriteUInt32(CurrentStage); + } + if (CurStatus != 0) { + output.WriteRawTag(40); + output.WriteUInt32(CurStatus); + } + if (SavedMp != 0) { + output.WriteRawTag(48); + output.WriteUInt32(SavedMp); + } + if (CurrentExtraLineup != global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None) { + output.WriteRawTag(56); + output.WriteEnum((int) CurrentExtraLineup); + } + if (Stars != 0) { + output.WriteRawTag(64); + output.WriteUInt32(Stars); + } + if (ScoreStage1 != 0) { + output.WriteRawTag(72); + output.WriteUInt32(ScoreStage1); + } + if (ScoreStage2 != 0) { + output.WriteRawTag(80); + output.WriteUInt32(ScoreStage2); + } + buffs_.WriteTo(output, _repeated_buffs_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (ChallengeMazeId != 0) { + output.WriteRawTag(8); + output.WriteUInt32(ChallengeMazeId); + } + if (startPos_ != null) { + output.WriteRawTag(18); + output.WriteMessage(StartPos); + } + if (startRot_ != null) { + output.WriteRawTag(26); + output.WriteMessage(StartRot); + } + if (CurrentStage != 0) { + output.WriteRawTag(32); + output.WriteUInt32(CurrentStage); + } + if (CurStatus != 0) { + output.WriteRawTag(40); + output.WriteUInt32(CurStatus); + } + if (SavedMp != 0) { + output.WriteRawTag(48); + output.WriteUInt32(SavedMp); + } + if (CurrentExtraLineup != global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None) { + output.WriteRawTag(56); + output.WriteEnum((int) CurrentExtraLineup); + } + if (Stars != 0) { + output.WriteRawTag(64); + output.WriteUInt32(Stars); + } + if (ScoreStage1 != 0) { + output.WriteRawTag(72); + output.WriteUInt32(ScoreStage1); + } + if (ScoreStage2 != 0) { + output.WriteRawTag(80); + output.WriteUInt32(ScoreStage2); + } + buffs_.WriteTo(ref output, _repeated_buffs_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (ChallengeMazeId != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(ChallengeMazeId); + } + if (startPos_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(StartPos); + } + if (startRot_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(StartRot); + } + if (CurrentStage != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(CurrentStage); + } + if (CurStatus != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(CurStatus); + } + if (SavedMp != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(SavedMp); + } + if (CurrentExtraLineup != global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) CurrentExtraLineup); + } + if (Stars != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Stars); + } + if (ScoreStage1 != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(ScoreStage1); + } + if (ScoreStage2 != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(ScoreStage2); + } + size += buffs_.CalculateSize(_repeated_buffs_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ChallengeBossDataPb other) { + if (other == null) { + return; + } + if (other.ChallengeMazeId != 0) { + ChallengeMazeId = other.ChallengeMazeId; + } + if (other.startPos_ != null) { + if (startPos_ == null) { + StartPos = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + StartPos.MergeFrom(other.StartPos); + } + if (other.startRot_ != null) { + if (startRot_ == null) { + StartRot = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + StartRot.MergeFrom(other.StartRot); + } + if (other.CurrentStage != 0) { + CurrentStage = other.CurrentStage; + } + if (other.CurStatus != 0) { + CurStatus = other.CurStatus; + } + if (other.SavedMp != 0) { + SavedMp = other.SavedMp; + } + if (other.CurrentExtraLineup != global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None) { + CurrentExtraLineup = other.CurrentExtraLineup; + } + if (other.Stars != 0) { + Stars = other.Stars; + } + if (other.ScoreStage1 != 0) { + ScoreStage1 = other.ScoreStage1; + } + if (other.ScoreStage2 != 0) { + ScoreStage2 = other.ScoreStage2; + } + buffs_.Add(other.buffs_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ChallengeMazeId = input.ReadUInt32(); + break; + } + case 18: { + if (startPos_ == null) { + StartPos = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + input.ReadMessage(StartPos); + break; + } + case 26: { + if (startRot_ == null) { + StartRot = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + input.ReadMessage(StartRot); + break; + } + case 32: { + CurrentStage = input.ReadUInt32(); + break; + } + case 40: { + CurStatus = input.ReadUInt32(); + break; + } + case 48: { + SavedMp = input.ReadUInt32(); + break; + } + case 56: { + CurrentExtraLineup = (global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb) input.ReadEnum(); + break; + } + case 64: { + Stars = input.ReadUInt32(); + break; + } + case 72: { + ScoreStage1 = input.ReadUInt32(); + break; + } + case 80: { + ScoreStage2 = input.ReadUInt32(); + break; + } + case 90: + case 88: { + buffs_.AddEntriesFrom(input, _repeated_buffs_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + ChallengeMazeId = input.ReadUInt32(); + break; + } + case 18: { + if (startPos_ == null) { + StartPos = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + input.ReadMessage(StartPos); + break; + } + case 26: { + if (startRot_ == null) { + StartRot = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + input.ReadMessage(StartRot); + break; + } + case 32: { + CurrentStage = input.ReadUInt32(); + break; + } + case 40: { + CurStatus = input.ReadUInt32(); + break; + } + case 48: { + SavedMp = input.ReadUInt32(); + break; + } + case 56: { + CurrentExtraLineup = (global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb) input.ReadEnum(); + break; + } + case 64: { + Stars = input.ReadUInt32(); + break; + } + case 72: { + ScoreStage1 = input.ReadUInt32(); + break; + } + case 80: { + ScoreStage2 = input.ReadUInt32(); + break; + } + case 90: + case 88: { + buffs_.AddEntriesFrom(ref input, _repeated_buffs_codec); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class ChallengePeakDataPb : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChallengePeakDataPb()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::EggLink.DanhengServer.Proto.ServerSide.ChallengeDataReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChallengePeakDataPb() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChallengePeakDataPb(ChallengePeakDataPb other) : this() { + currentPeakLevelId_ = other.currentPeakLevelId_; + buffs_ = other.buffs_.Clone(); + curStatus_ = other.curStatus_; + startPos_ = other.startPos_ != null ? other.startPos_.Clone() : null; + startRot_ = other.startRot_ != null ? other.startRot_.Clone() : null; + savedMp_ = other.savedMp_; + stars_ = other.stars_; + currentExtraLineup_ = other.currentExtraLineup_; + isHard_ = other.isHard_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChallengePeakDataPb Clone() { + return new ChallengePeakDataPb(this); + } + + /// Field number for the "CurrentPeakLevelId" field. + public const int CurrentPeakLevelIdFieldNumber = 2; + private uint currentPeakLevelId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint CurrentPeakLevelId { + get { return currentPeakLevelId_; } + set { + currentPeakLevelId_ = value; + } + } + + /// Field number for the "Buffs" field. + public const int BuffsFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_buffs_codec + = pb::FieldCodec.ForUInt32(26); + private readonly pbc::RepeatedField buffs_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Buffs { + get { return buffs_; } + } + + /// Field number for the "CurStatus" field. + public const int CurStatusFieldNumber = 4; + private uint curStatus_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint CurStatus { + get { return curStatus_; } + set { + curStatus_ = value; + } + } + + /// Field number for the "StartPos" field. + public const int StartPosFieldNumber = 5; + private global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb startPos_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb StartPos { + get { return startPos_; } + set { + startPos_ = value; + } + } + + /// Field number for the "StartRot" field. + public const int StartRotFieldNumber = 6; + private global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb startRot_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb StartRot { + get { return startRot_; } + set { + startRot_ = value; + } + } + + /// Field number for the "SavedMp" field. + public const int SavedMpFieldNumber = 7; + private uint savedMp_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint SavedMp { + get { return savedMp_; } + set { + savedMp_ = value; + } + } + + /// Field number for the "Stars" field. + public const int StarsFieldNumber = 8; + private uint stars_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint Stars { + get { return stars_; } + set { + stars_ = value; + } + } + + /// Field number for the "CurrentExtraLineup" field. + public const int CurrentExtraLineupFieldNumber = 9; + private global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb currentExtraLineup_ = global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb CurrentExtraLineup { + get { return currentExtraLineup_; } + set { + currentExtraLineup_ = value; + } + } + + /// Field number for the "IsHard" field. + public const int IsHardFieldNumber = 10; + private bool isHard_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool IsHard { + get { return isHard_; } + set { + isHard_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ChallengePeakDataPb); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ChallengePeakDataPb other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (CurrentPeakLevelId != other.CurrentPeakLevelId) return false; + if(!buffs_.Equals(other.buffs_)) return false; + if (CurStatus != other.CurStatus) return false; + if (!object.Equals(StartPos, other.StartPos)) return false; + if (!object.Equals(StartRot, other.StartRot)) return false; + if (SavedMp != other.SavedMp) return false; + if (Stars != other.Stars) return false; + if (CurrentExtraLineup != other.CurrentExtraLineup) return false; + if (IsHard != other.IsHard) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (CurrentPeakLevelId != 0) hash ^= CurrentPeakLevelId.GetHashCode(); + hash ^= buffs_.GetHashCode(); + if (CurStatus != 0) hash ^= CurStatus.GetHashCode(); + if (startPos_ != null) hash ^= StartPos.GetHashCode(); + if (startRot_ != null) hash ^= StartRot.GetHashCode(); + if (SavedMp != 0) hash ^= SavedMp.GetHashCode(); + if (Stars != 0) hash ^= Stars.GetHashCode(); + if (CurrentExtraLineup != global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None) hash ^= CurrentExtraLineup.GetHashCode(); + if (IsHard != false) hash ^= IsHard.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (CurrentPeakLevelId != 0) { + output.WriteRawTag(16); + output.WriteUInt32(CurrentPeakLevelId); + } + buffs_.WriteTo(output, _repeated_buffs_codec); + if (CurStatus != 0) { + output.WriteRawTag(32); + output.WriteUInt32(CurStatus); + } + if (startPos_ != null) { + output.WriteRawTag(42); + output.WriteMessage(StartPos); + } + if (startRot_ != null) { + output.WriteRawTag(50); + output.WriteMessage(StartRot); + } + if (SavedMp != 0) { + output.WriteRawTag(56); + output.WriteUInt32(SavedMp); + } + if (Stars != 0) { + output.WriteRawTag(64); + output.WriteUInt32(Stars); + } + if (CurrentExtraLineup != global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None) { + output.WriteRawTag(72); + output.WriteEnum((int) CurrentExtraLineup); + } + if (IsHard != false) { + output.WriteRawTag(80); + output.WriteBool(IsHard); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (CurrentPeakLevelId != 0) { + output.WriteRawTag(16); + output.WriteUInt32(CurrentPeakLevelId); + } + buffs_.WriteTo(ref output, _repeated_buffs_codec); + if (CurStatus != 0) { + output.WriteRawTag(32); + output.WriteUInt32(CurStatus); + } + if (startPos_ != null) { + output.WriteRawTag(42); + output.WriteMessage(StartPos); + } + if (startRot_ != null) { + output.WriteRawTag(50); + output.WriteMessage(StartRot); + } + if (SavedMp != 0) { + output.WriteRawTag(56); + output.WriteUInt32(SavedMp); + } + if (Stars != 0) { + output.WriteRawTag(64); + output.WriteUInt32(Stars); + } + if (CurrentExtraLineup != global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None) { + output.WriteRawTag(72); + output.WriteEnum((int) CurrentExtraLineup); + } + if (IsHard != false) { + output.WriteRawTag(80); + output.WriteBool(IsHard); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (CurrentPeakLevelId != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(CurrentPeakLevelId); + } + size += buffs_.CalculateSize(_repeated_buffs_codec); + if (CurStatus != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(CurStatus); + } + if (startPos_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(StartPos); + } + if (startRot_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(StartRot); + } + if (SavedMp != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(SavedMp); + } + if (Stars != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Stars); + } + if (CurrentExtraLineup != global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) CurrentExtraLineup); + } + if (IsHard != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ChallengePeakDataPb other) { + if (other == null) { + return; + } + if (other.CurrentPeakLevelId != 0) { + CurrentPeakLevelId = other.CurrentPeakLevelId; + } + buffs_.Add(other.buffs_); + if (other.CurStatus != 0) { + CurStatus = other.CurStatus; + } + if (other.startPos_ != null) { + if (startPos_ == null) { + StartPos = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + StartPos.MergeFrom(other.StartPos); + } + if (other.startRot_ != null) { + if (startRot_ == null) { + StartRot = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + StartRot.MergeFrom(other.StartRot); + } + if (other.SavedMp != 0) { + SavedMp = other.SavedMp; + } + if (other.Stars != 0) { + Stars = other.Stars; + } + if (other.CurrentExtraLineup != global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb.None) { + CurrentExtraLineup = other.CurrentExtraLineup; + } + if (other.IsHard != false) { + IsHard = other.IsHard; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 16: { + CurrentPeakLevelId = input.ReadUInt32(); + break; + } + case 26: + case 24: { + buffs_.AddEntriesFrom(input, _repeated_buffs_codec); + break; + } + case 32: { + CurStatus = input.ReadUInt32(); + break; + } + case 42: { + if (startPos_ == null) { + StartPos = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + input.ReadMessage(StartPos); + break; + } + case 50: { + if (startRot_ == null) { + StartRot = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + input.ReadMessage(StartRot); + break; + } + case 56: { + SavedMp = input.ReadUInt32(); + break; + } + case 64: { + Stars = input.ReadUInt32(); + break; + } + case 72: { + CurrentExtraLineup = (global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb) input.ReadEnum(); + break; + } + case 80: { + IsHard = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 16: { + CurrentPeakLevelId = input.ReadUInt32(); + break; + } + case 26: + case 24: { + buffs_.AddEntriesFrom(ref input, _repeated_buffs_codec); + break; + } + case 32: { + CurStatus = input.ReadUInt32(); + break; + } + case 42: { + if (startPos_ == null) { + StartPos = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + input.ReadMessage(StartPos); + break; + } + case 50: { + if (startRot_ == null) { + StartRot = new global::EggLink.DanhengServer.Proto.ServerSide.Vector3Pb(); + } + input.ReadMessage(StartRot); + break; + } + case 56: { + SavedMp = input.ReadUInt32(); + break; + } + case 64: { + Stars = input.ReadUInt32(); + break; + } + case 72: { + CurrentExtraLineup = (global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb) input.ReadEnum(); + break; + } + case 80: { + IsHard = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class ChallengeDataPb : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ChallengeDataPb()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::EggLink.DanhengServer.Proto.ServerSide.ChallengeDataReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChallengeDataPb() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChallengeDataPb(ChallengeDataPb other) : this() { + switch (other.ChallengeTypeCase) { + case ChallengeTypeOneofCase.Memory: + Memory = other.Memory.Clone(); + break; + case ChallengeTypeOneofCase.Story: + Story = other.Story.Clone(); + break; + case ChallengeTypeOneofCase.Boss: + Boss = other.Boss.Clone(); + break; + case ChallengeTypeOneofCase.Peak: + Peak = other.Peak.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChallengeDataPb Clone() { + return new ChallengeDataPb(this); + } + + /// Field number for the "memory" field. + public const int MemoryFieldNumber = 1; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::EggLink.DanhengServer.Proto.ServerSide.ChallengeMemoryDataPb Memory { + get { return challengeTypeCase_ == ChallengeTypeOneofCase.Memory ? (global::EggLink.DanhengServer.Proto.ServerSide.ChallengeMemoryDataPb) challengeType_ : null; } + set { + challengeType_ = value; + challengeTypeCase_ = value == null ? ChallengeTypeOneofCase.None : ChallengeTypeOneofCase.Memory; + } + } + + /// Field number for the "story" field. + public const int StoryFieldNumber = 2; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::EggLink.DanhengServer.Proto.ServerSide.ChallengeStoryDataPb Story { + get { return challengeTypeCase_ == ChallengeTypeOneofCase.Story ? (global::EggLink.DanhengServer.Proto.ServerSide.ChallengeStoryDataPb) challengeType_ : null; } + set { + challengeType_ = value; + challengeTypeCase_ = value == null ? ChallengeTypeOneofCase.None : ChallengeTypeOneofCase.Story; + } + } + + /// Field number for the "boss" field. + public const int BossFieldNumber = 3; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::EggLink.DanhengServer.Proto.ServerSide.ChallengeBossDataPb Boss { + get { return challengeTypeCase_ == ChallengeTypeOneofCase.Boss ? (global::EggLink.DanhengServer.Proto.ServerSide.ChallengeBossDataPb) challengeType_ : null; } + set { + challengeType_ = value; + challengeTypeCase_ = value == null ? ChallengeTypeOneofCase.None : ChallengeTypeOneofCase.Boss; + } + } + + /// Field number for the "peak" field. + public const int PeakFieldNumber = 4; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::EggLink.DanhengServer.Proto.ServerSide.ChallengePeakDataPb Peak { + get { return challengeTypeCase_ == ChallengeTypeOneofCase.Peak ? (global::EggLink.DanhengServer.Proto.ServerSide.ChallengePeakDataPb) challengeType_ : null; } + set { + challengeType_ = value; + challengeTypeCase_ = value == null ? ChallengeTypeOneofCase.None : ChallengeTypeOneofCase.Peak; + } + } + + private object challengeType_; + /// Enum of possible cases for the "challenge_type" oneof. + public enum ChallengeTypeOneofCase { + None = 0, + Memory = 1, + Story = 2, + Boss = 3, + Peak = 4, + } + private ChallengeTypeOneofCase challengeTypeCase_ = ChallengeTypeOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ChallengeTypeOneofCase ChallengeTypeCase { + get { return challengeTypeCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearChallengeType() { + challengeTypeCase_ = ChallengeTypeOneofCase.None; + challengeType_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as ChallengeDataPb); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(ChallengeDataPb other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Memory, other.Memory)) return false; + if (!object.Equals(Story, other.Story)) return false; + if (!object.Equals(Boss, other.Boss)) return false; + if (!object.Equals(Peak, other.Peak)) return false; + if (ChallengeTypeCase != other.ChallengeTypeCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (challengeTypeCase_ == ChallengeTypeOneofCase.Memory) hash ^= Memory.GetHashCode(); + if (challengeTypeCase_ == ChallengeTypeOneofCase.Story) hash ^= Story.GetHashCode(); + if (challengeTypeCase_ == ChallengeTypeOneofCase.Boss) hash ^= Boss.GetHashCode(); + if (challengeTypeCase_ == ChallengeTypeOneofCase.Peak) hash ^= Peak.GetHashCode(); + hash ^= (int) challengeTypeCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (challengeTypeCase_ == ChallengeTypeOneofCase.Memory) { + output.WriteRawTag(10); + output.WriteMessage(Memory); + } + if (challengeTypeCase_ == ChallengeTypeOneofCase.Story) { + output.WriteRawTag(18); + output.WriteMessage(Story); + } + if (challengeTypeCase_ == ChallengeTypeOneofCase.Boss) { + output.WriteRawTag(26); + output.WriteMessage(Boss); + } + if (challengeTypeCase_ == ChallengeTypeOneofCase.Peak) { + output.WriteRawTag(34); + output.WriteMessage(Peak); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (challengeTypeCase_ == ChallengeTypeOneofCase.Memory) { + output.WriteRawTag(10); + output.WriteMessage(Memory); + } + if (challengeTypeCase_ == ChallengeTypeOneofCase.Story) { + output.WriteRawTag(18); + output.WriteMessage(Story); + } + if (challengeTypeCase_ == ChallengeTypeOneofCase.Boss) { + output.WriteRawTag(26); + output.WriteMessage(Boss); + } + if (challengeTypeCase_ == ChallengeTypeOneofCase.Peak) { + output.WriteRawTag(34); + output.WriteMessage(Peak); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (challengeTypeCase_ == ChallengeTypeOneofCase.Memory) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Memory); + } + if (challengeTypeCase_ == ChallengeTypeOneofCase.Story) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Story); + } + if (challengeTypeCase_ == ChallengeTypeOneofCase.Boss) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Boss); + } + if (challengeTypeCase_ == ChallengeTypeOneofCase.Peak) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Peak); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(ChallengeDataPb other) { + if (other == null) { + return; + } + switch (other.ChallengeTypeCase) { + case ChallengeTypeOneofCase.Memory: + if (Memory == null) { + Memory = new global::EggLink.DanhengServer.Proto.ServerSide.ChallengeMemoryDataPb(); + } + Memory.MergeFrom(other.Memory); + break; + case ChallengeTypeOneofCase.Story: + if (Story == null) { + Story = new global::EggLink.DanhengServer.Proto.ServerSide.ChallengeStoryDataPb(); + } + Story.MergeFrom(other.Story); + break; + case ChallengeTypeOneofCase.Boss: + if (Boss == null) { + Boss = new global::EggLink.DanhengServer.Proto.ServerSide.ChallengeBossDataPb(); + } + Boss.MergeFrom(other.Boss); + break; + case ChallengeTypeOneofCase.Peak: + if (Peak == null) { + Peak = new global::EggLink.DanhengServer.Proto.ServerSide.ChallengePeakDataPb(); + } + Peak.MergeFrom(other.Peak); + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + global::EggLink.DanhengServer.Proto.ServerSide.ChallengeMemoryDataPb subBuilder = new global::EggLink.DanhengServer.Proto.ServerSide.ChallengeMemoryDataPb(); + if (challengeTypeCase_ == ChallengeTypeOneofCase.Memory) { + subBuilder.MergeFrom(Memory); + } + input.ReadMessage(subBuilder); + Memory = subBuilder; + break; + } + case 18: { + global::EggLink.DanhengServer.Proto.ServerSide.ChallengeStoryDataPb subBuilder = new global::EggLink.DanhengServer.Proto.ServerSide.ChallengeStoryDataPb(); + if (challengeTypeCase_ == ChallengeTypeOneofCase.Story) { + subBuilder.MergeFrom(Story); + } + input.ReadMessage(subBuilder); + Story = subBuilder; + break; + } + case 26: { + global::EggLink.DanhengServer.Proto.ServerSide.ChallengeBossDataPb subBuilder = new global::EggLink.DanhengServer.Proto.ServerSide.ChallengeBossDataPb(); + if (challengeTypeCase_ == ChallengeTypeOneofCase.Boss) { + subBuilder.MergeFrom(Boss); + } + input.ReadMessage(subBuilder); + Boss = subBuilder; + break; + } + case 34: { + global::EggLink.DanhengServer.Proto.ServerSide.ChallengePeakDataPb subBuilder = new global::EggLink.DanhengServer.Proto.ServerSide.ChallengePeakDataPb(); + if (challengeTypeCase_ == ChallengeTypeOneofCase.Peak) { + subBuilder.MergeFrom(Peak); + } + input.ReadMessage(subBuilder); + Peak = subBuilder; + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + global::EggLink.DanhengServer.Proto.ServerSide.ChallengeMemoryDataPb subBuilder = new global::EggLink.DanhengServer.Proto.ServerSide.ChallengeMemoryDataPb(); + if (challengeTypeCase_ == ChallengeTypeOneofCase.Memory) { + subBuilder.MergeFrom(Memory); + } + input.ReadMessage(subBuilder); + Memory = subBuilder; + break; + } + case 18: { + global::EggLink.DanhengServer.Proto.ServerSide.ChallengeStoryDataPb subBuilder = new global::EggLink.DanhengServer.Proto.ServerSide.ChallengeStoryDataPb(); + if (challengeTypeCase_ == ChallengeTypeOneofCase.Story) { + subBuilder.MergeFrom(Story); + } + input.ReadMessage(subBuilder); + Story = subBuilder; + break; + } + case 26: { + global::EggLink.DanhengServer.Proto.ServerSide.ChallengeBossDataPb subBuilder = new global::EggLink.DanhengServer.Proto.ServerSide.ChallengeBossDataPb(); + if (challengeTypeCase_ == ChallengeTypeOneofCase.Boss) { + subBuilder.MergeFrom(Boss); + } + input.ReadMessage(subBuilder); + Boss = subBuilder; + break; + } + case 34: { + global::EggLink.DanhengServer.Proto.ServerSide.ChallengePeakDataPb subBuilder = new global::EggLink.DanhengServer.Proto.ServerSide.ChallengePeakDataPb(); + if (challengeTypeCase_ == ChallengeTypeOneofCase.Peak) { + subBuilder.MergeFrom(Peak); + } + input.ReadMessage(subBuilder); + Peak = subBuilder; + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/ServerSideProto/ProtoFile/ChallengeData.proto b/ServerSideProto/ProtoFile/ChallengeData.proto new file mode 100644 index 00000000..83248679 --- /dev/null +++ b/ServerSideProto/ProtoFile/ChallengeData.proto @@ -0,0 +1,78 @@ +syntax = "proto3"; + +option csharp_namespace = "EggLink.DanhengServer.Proto.ServerSide"; + +enum ChallengeLineupTypePb { + None = 0; + Challenge1 = 1; + Challenge2 = 3; + Challenge3 = 4; +} + +message Vector3Pb { + int32 x = 1; + int32 y = 2; + int32 z = 3; +} + +message ChallengeMemoryDataPb { + uint32 ChallengeMazeId = 1; + Vector3Pb StartPos = 2; + Vector3Pb StartRot = 3; + uint32 CurrentStage = 4; + uint32 CurStatus = 5; + uint32 DeadAvatarNum = 6; + uint32 SavedMp = 7; + ChallengeLineupTypePb CurrentExtraLineup = 8; + uint32 RoundsLeft = 9; + uint32 Stars = 10; +} + +message ChallengeStoryDataPb { + uint32 ChallengeMazeId = 1; + Vector3Pb StartPos = 2; + Vector3Pb StartRot = 3; + uint32 CurrentStage = 4; + uint32 CurStatus = 5; + uint32 SavedMp = 6; + ChallengeLineupTypePb CurrentExtraLineup = 7; + uint32 Stars = 8; + uint32 ScoreStage1 = 9; + uint32 ScoreStage2 = 10; + repeated uint32 Buffs = 11; +} + +message ChallengeBossDataPb { + uint32 ChallengeMazeId = 1; + Vector3Pb StartPos = 2; + Vector3Pb StartRot = 3; + uint32 CurrentStage = 4; + uint32 CurStatus = 5; + uint32 SavedMp = 6; + ChallengeLineupTypePb CurrentExtraLineup = 7; + uint32 Stars = 8; + uint32 ScoreStage1 = 9; + uint32 ScoreStage2 = 10; + repeated uint32 Buffs = 11; +} + +message ChallengePeakDataPb { + uint32 CurrentPeakLevelId = 2; + repeated uint32 Buffs = 3; + uint32 CurStatus = 4; + Vector3Pb StartPos = 5; + Vector3Pb StartRot = 6; + uint32 SavedMp = 7; + uint32 Stars = 8; + ChallengeLineupTypePb CurrentExtraLineup = 9; + bool IsHard = 10; +} + +message ChallengeDataPb { + oneof challenge_type { + ChallengeMemoryDataPb memory = 1; + ChallengeStoryDataPb story = 2; + ChallengeBossDataPb boss = 3; + ChallengePeakDataPb peak = 4; + } +} \ No newline at end of file diff --git a/ServerSideProto/RefreshProto.bat b/ServerSideProto/RefreshProto.bat new file mode 100644 index 00000000..ed58d859 --- /dev/null +++ b/ServerSideProto/RefreshProto.bat @@ -0,0 +1,4 @@ +@echo off +del /s /f .\*.cs +cd ProtoFile +protoc ".\*" --csharp_out=..\ \ No newline at end of file diff --git a/ServerSideProto/ServerSideProto.csproj b/ServerSideProto/ServerSideProto.csproj new file mode 100644 index 00000000..bc563847 --- /dev/null +++ b/ServerSideProto/ServerSideProto.csproj @@ -0,0 +1,15 @@ + + + + net8.0 + enable + enable + EggLink.DanhengServer.Proto.ServerSide + DanhengSProto + + + + + + +