From 4a721d37dfe5447c7c76764035c7a8292dcd40df Mon Sep 17 00:00:00 2001 From: StopWuyu Date: Sun, 26 Oct 2025 12:06:07 +0800 Subject: [PATCH] feat: grid fight basic feature --- Command/Command/Cmd/CommandGrid.cs | 73 + .../Data/Excel/GridFightPlayerLevelExcel.cs | 29 + Common/Data/Excel/GridFightRoleStarExcel.cs | 19 + Common/Data/Excel/GridFightShopPriceExcel.cs | 30 + Common/Data/GameData.cs | 3 + GameServer/Game/Battle/BattleInstance.cs | 105 +- GameServer/Game/Battle/BattleManager.cs | 37 + .../Battle/Custom/BattleGridFightOptions.cs | 77 + .../Component/GridFightAvatarComponent.cs | 151 +- .../Component/GridFightBasicComponent.cs | 106 +- .../Component/GridFightLevelComponent.cs | 33 +- .../Component/GridFightShopComponent.cs | 244 ++ .../Game/GridFight/GridFightInstance.cs | 33 +- GameServer/Game/GridFight/GridFightManager.cs | 2 +- .../GridFight/Sync/BaseGridFightSyncData.cs | 9 + .../Sync/GridFightBuyExpCostSyncData.cs | 15 + .../GridFight/Sync/GridFightGoldSyncData.cs | 15 + .../GridFight/Sync/GridFightLevelSyncData.cs | 23 + .../Sync/GridFightMaxAvatarNumSyncData.cs | 15 + .../Sync/GridFightPlayerLevelSyncData.cs | 19 + .../Sync/GridFightRoleAddSyncData.cs | 16 + .../Sync/GridFightRoleRemoveSyncData.cs | 15 + .../Sync/GridFightRoleUpdateSyncData.cs | 16 + .../GridFight/Sync/GridFightShopSyncData.cs | 16 + .../GridFight/HandlerGridFightBuyExpCsReq.cs | 23 + .../HandlerGridFightBuyGoodsCsReq.cs | 27 + .../HandlerGridFightEnterBattleStageCsReq.cs | 24 + .../HandlerGridFightLockShopCsReq.cs | 26 + .../HandlerGridFightRecycleRoleCsReq.cs | 26 + .../HandlerGridFightRefreshShopCsReq.cs | 23 + .../HandlerGridFightUpdatePosCsReq.cs | 28 + .../GridFight/PacketGridFightBuyGoodsScRsp.cs | 17 + .../GridFight/PacketGridFightDataScNotify.cs | 23 + .../PacketGridFightEndBattleStageNotify.cs | 30 + .../PacketGridFightEnterBattleStageScRsp.cs | 22 + ...PacketGridFightSyncUpdateResultScNotify.cs | 39 + .../PacketGridFightUpdatePosScRsp.cs | 19 + ServerSideProto/ChallengeData.cs | 18 +- ServerSideProto/GridFightData.cs | 2415 +++++++++++++++++ ServerSideProto/ProtoFile/ChallengeData.proto | 8 +- ServerSideProto/ProtoFile/GridFightData.proto | 59 + ServerSideProto/ServerSideProto.sln | 24 + 42 files changed, 3857 insertions(+), 95 deletions(-) create mode 100644 Command/Command/Cmd/CommandGrid.cs create mode 100644 Common/Data/Excel/GridFightPlayerLevelExcel.cs create mode 100644 Common/Data/Excel/GridFightRoleStarExcel.cs create mode 100644 Common/Data/Excel/GridFightShopPriceExcel.cs create mode 100644 GameServer/Game/Battle/Custom/BattleGridFightOptions.cs create mode 100644 GameServer/Game/GridFight/Component/GridFightShopComponent.cs create mode 100644 GameServer/Game/GridFight/Sync/BaseGridFightSyncData.cs create mode 100644 GameServer/Game/GridFight/Sync/GridFightBuyExpCostSyncData.cs create mode 100644 GameServer/Game/GridFight/Sync/GridFightGoldSyncData.cs create mode 100644 GameServer/Game/GridFight/Sync/GridFightLevelSyncData.cs create mode 100644 GameServer/Game/GridFight/Sync/GridFightMaxAvatarNumSyncData.cs create mode 100644 GameServer/Game/GridFight/Sync/GridFightPlayerLevelSyncData.cs create mode 100644 GameServer/Game/GridFight/Sync/GridFightRoleAddSyncData.cs create mode 100644 GameServer/Game/GridFight/Sync/GridFightRoleRemoveSyncData.cs create mode 100644 GameServer/Game/GridFight/Sync/GridFightRoleUpdateSyncData.cs create mode 100644 GameServer/Game/GridFight/Sync/GridFightShopSyncData.cs create mode 100644 GameServer/Server/Packet/Recv/GridFight/HandlerGridFightBuyExpCsReq.cs create mode 100644 GameServer/Server/Packet/Recv/GridFight/HandlerGridFightBuyGoodsCsReq.cs create mode 100644 GameServer/Server/Packet/Recv/GridFight/HandlerGridFightEnterBattleStageCsReq.cs create mode 100644 GameServer/Server/Packet/Recv/GridFight/HandlerGridFightLockShopCsReq.cs create mode 100644 GameServer/Server/Packet/Recv/GridFight/HandlerGridFightRecycleRoleCsReq.cs create mode 100644 GameServer/Server/Packet/Recv/GridFight/HandlerGridFightRefreshShopCsReq.cs create mode 100644 GameServer/Server/Packet/Recv/GridFight/HandlerGridFightUpdatePosCsReq.cs create mode 100644 GameServer/Server/Packet/Send/GridFight/PacketGridFightBuyGoodsScRsp.cs create mode 100644 GameServer/Server/Packet/Send/GridFight/PacketGridFightDataScNotify.cs create mode 100644 GameServer/Server/Packet/Send/GridFight/PacketGridFightEndBattleStageNotify.cs create mode 100644 GameServer/Server/Packet/Send/GridFight/PacketGridFightEnterBattleStageScRsp.cs create mode 100644 GameServer/Server/Packet/Send/GridFight/PacketGridFightSyncUpdateResultScNotify.cs create mode 100644 GameServer/Server/Packet/Send/GridFight/PacketGridFightUpdatePosScRsp.cs create mode 100644 ServerSideProto/GridFightData.cs create mode 100644 ServerSideProto/ProtoFile/GridFightData.proto create mode 100644 ServerSideProto/ServerSideProto.sln diff --git a/Command/Command/Cmd/CommandGrid.cs b/Command/Command/Cmd/CommandGrid.cs new file mode 100644 index 00000000..6de88b87 --- /dev/null +++ b/Command/Command/Cmd/CommandGrid.cs @@ -0,0 +1,73 @@ +using EggLink.DanhengServer.Data; +using EggLink.DanhengServer.GameServer.Game.GridFight.Component; +using EggLink.DanhengServer.Internationalization; +using EggLink.DanhengServer.Proto; + +namespace EggLink.DanhengServer.Command.Command.Cmd; + +[CommandInfo("grid", "Game.Command.Grid.Desc", "Game.Command.Grid.Usage")] +public class CommandGrid : ICommand +{ + [CommandMethod("role")] + public async ValueTask AddRole(CommandArg arg) + { + if (arg.Target == null) + { + await arg.SendMsg(I18NManager.Translate("Game.Command.Notice.PlayerNotFound")); + return; + } + + var inst = arg.Target.Player!.GridFightManager?.GridFightInstance; + if (inst == null) + { + await arg.SendMsg(I18NManager.Translate("Game.Command.Grid.NotInGame")); + return; + } + + if (arg.BasicArgs.Count < 2) + { + await arg.SendMsg(I18NManager.Translate("Game.Command.Notice.InvalidArguments")); + return; + } + + var roleId = (uint)arg.GetInt(0); + var tier = (uint)arg.GetInt(1); + + if (!GameData.GridFightRoleStarData.ContainsKey(roleId << 2 | tier)) + { + await arg.SendMsg(I18NManager.Translate("Game.Command.Grid.InvalidRole")); + return; + } + + await inst.GetComponent().AddAvatar(roleId, tier); + await arg.SendMsg(I18NManager.Translate("Game.Command.Grid.AddedRole")); + } + + [CommandMethod("gold")] + public async ValueTask UpdateGold(CommandArg arg) + { + if (arg.Target == null) + { + await arg.SendMsg(I18NManager.Translate("Game.Command.Notice.PlayerNotFound")); + return; + } + + var inst = arg.Target.Player!.GridFightManager?.GridFightInstance; + if (inst == null) + { + await arg.SendMsg(I18NManager.Translate("Game.Command.Grid.NotInGame")); + return; + } + + if (arg.BasicArgs.Count < 1) + { + await arg.SendMsg(I18NManager.Translate("Game.Command.Notice.InvalidArguments")); + return; + } + + var gold = arg.GetInt(0); + + await inst.GetComponent().UpdateGoldNum(gold, true, GridFightSrc.KGridFightSrcNone); + await arg.SendMsg(I18NManager.Translate("Game.Command.Grid.UpdateGold", gold.ToString())); + } +} \ No newline at end of file diff --git a/Common/Data/Excel/GridFightPlayerLevelExcel.cs b/Common/Data/Excel/GridFightPlayerLevelExcel.cs new file mode 100644 index 00000000..d11ca94f --- /dev/null +++ b/Common/Data/Excel/GridFightPlayerLevelExcel.cs @@ -0,0 +1,29 @@ +using Newtonsoft.Json; + +namespace EggLink.DanhengServer.Data.Excel; + +[ResourceEntity("GridFightPlayerLevel.json")] +public class GridFightPlayerLevelExcel : ExcelResource +{ + public uint PlayerLevel { get; set; } + public uint LevelUpExp { get; set; } + public uint AvatarMaxNumber { get; set; } + public uint Rarity1Weight { get; set; } + public uint Rarity2Weight { get; set; } + public uint Rarity3Weight { get; set; } + public uint Rarity4Weight { get; set; } + public uint Rarity5Weight { get; set; } + + [JsonIgnore] public List RarityWeights => + [Rarity1Weight, Rarity2Weight, Rarity3Weight, Rarity4Weight, Rarity5Weight]; + + public override int GetId() + { + return (int)PlayerLevel; + } + + public override void Loaded() + { + GameData.GridFightPlayerLevelData.TryAdd(PlayerLevel, this); + } +} \ No newline at end of file diff --git a/Common/Data/Excel/GridFightRoleStarExcel.cs b/Common/Data/Excel/GridFightRoleStarExcel.cs new file mode 100644 index 00000000..1197fbe1 --- /dev/null +++ b/Common/Data/Excel/GridFightRoleStarExcel.cs @@ -0,0 +1,19 @@ +namespace EggLink.DanhengServer.Data.Excel; + +[ResourceEntity("GridFightRoleStar.json")] +public class GridFightRoleStarExcel : ExcelResource +{ + public uint ID { get; set; } + public uint Star { get; set; } + public uint BEID { get; set; } + + public override int GetId() + { + return (int)ID; + } + + public override void Loaded() + { + GameData.GridFightRoleStarData.TryAdd(ID << 2 | Star, this); + } +} \ No newline at end of file diff --git a/Common/Data/Excel/GridFightShopPriceExcel.cs b/Common/Data/Excel/GridFightShopPriceExcel.cs new file mode 100644 index 00000000..ed402d09 --- /dev/null +++ b/Common/Data/Excel/GridFightShopPriceExcel.cs @@ -0,0 +1,30 @@ +using Newtonsoft.Json; + +namespace EggLink.DanhengServer.Data.Excel; + +[ResourceEntity("GridFightShopPrice.json")] +public class GridFightShopPriceExcel : ExcelResource +{ + public uint Rarity { get; set; } + public uint BuyGoldStar1 { get; set; } + public uint BuyGoldStar2 { get; set; } + public uint BuyGoldStar3 { get; set; } + public uint BuyGoldStar4 { get; set; } + public uint SellGoldStar1 { get; set; } + public uint SellGoldStar2 { get; set; } + public uint SellGoldStar3 { get; set; } + public uint SellGoldStar4 { get; set; } + + [JsonIgnore] public List BuyGoldList => [BuyGoldStar1, BuyGoldStar2, BuyGoldStar3, BuyGoldStar4]; + [JsonIgnore] public List SellGoldList => [SellGoldStar1, SellGoldStar2, SellGoldStar3, SellGoldStar4]; + + public override int GetId() + { + return (int)Rarity; + } + + public override void Loaded() + { + GameData.GridFightShopPriceData.TryAdd(Rarity, this); + } +} \ No newline at end of file diff --git a/Common/Data/GameData.cs b/Common/Data/GameData.cs index 0e15795b..f7140217 100644 --- a/Common/Data/GameData.cs +++ b/Common/Data/GameData.cs @@ -105,10 +105,13 @@ public static class GameData #region GridFight public static Dictionary GridFightRoleBasicInfoData { get; private set; } = []; + public static Dictionary GridFightRoleStarData { get; private set; } = []; public static Dictionary GridFightDivisionInfoData { get; private set; } = []; public static Dictionary GridFightEquipmentData { get; private set; } = []; public static Dictionary GridFightConsumablesData { get; private set; } = []; public static Dictionary GridFightCampData { get; private set; } = []; + public static Dictionary GridFightShopPriceData { get; private set; } = []; + public static Dictionary GridFightPlayerLevelData { get; private set; } = []; public static Dictionary GridFightMonsterData { get; private set; } = []; public static Dictionary GridFightAugmentData { get; private set; } = []; public static Dictionary GridFightPortalBuffData { get; private set; } = []; diff --git a/GameServer/Game/Battle/BattleInstance.cs b/GameServer/Game/Battle/BattleInstance.cs index bdf621cb..5ad0e1d8 100644 --- a/GameServer/Game/Battle/BattleInstance.cs +++ b/GameServer/Game/Battle/BattleInstance.cs @@ -4,6 +4,7 @@ using EggLink.DanhengServer.Database; using EggLink.DanhengServer.Database.Avatar; using EggLink.DanhengServer.Database.Inventory; using EggLink.DanhengServer.Enums.Avatar; +using EggLink.DanhengServer.GameServer.Game.Battle.Custom; using EggLink.DanhengServer.GameServer.Game.Lineup; using EggLink.DanhengServer.GameServer.Game.Player; using EggLink.DanhengServer.GameServer.Game.Scene; @@ -67,6 +68,7 @@ public class BattleInstance(PlayerInstance player, LineupInfo lineup, List BattleTargets { get; set; } = []; public BattleCollegeConfigExcel? CollegeConfigExcel { get; set; } public PVEBattleResultCsReq? BattleResult { get; set; } + public BattleGridFightOptions? GridFightOptions { get; set; } public bool IsTournRogue { get; set; } public ItemList GetDropItemList() @@ -214,62 +216,69 @@ public class BattleInstance(PlayerInstance player, LineupInfo lineup, List wave.ToProto())) + if (GridFightOptions != null) { - if (CustomLevel > 0) - foreach (var item in protoWave) - item.MonsterParam.Level = (uint)CustomLevel; - - proto.MonsterWaveList.AddRange(protoWave); + GridFightOptions.HandleProto(proto, this); // grid fight will handle the proto itself } - - if (Player.BattleManager!.NextBattleMonsterIds.Count > 0) + else { - var ids = Player.BattleManager!.NextBattleMonsterIds; - // split every 5 - for (var i = 0; i < (ids.Count - 1) / 5 + 1; i++) + if (MagicInfo != null) proto.BattleRogueMagicInfo = MagicInfo; + + foreach (var protoWave in Stages.Select(wave => wave.ToProto())) { - var count = Math.Min(5, ids.Count - i * 5); - var waveIds = ids.GetRange(i * 5, count); + if (CustomLevel > 0) + foreach (var item in protoWave) + item.MonsterParam.Level = (uint)CustomLevel; - proto.MonsterWaveList.Add(new SceneMonsterWave - { - BattleStageId = (uint)(Stages.FirstOrDefault()?.StageID ?? 0), - BattleWaveId = (uint)(proto.MonsterWaveList.Count + 1), - MonsterParam = new SceneMonsterWaveParam(), - MonsterList = - { - waveIds.Select(x => new SceneMonster - { - MonsterId = (uint)x - }) - } - }); + proto.MonsterWaveList.AddRange(protoWave); } + + if (Player.BattleManager!.NextBattleMonsterIds.Count > 0) + { + var ids = Player.BattleManager!.NextBattleMonsterIds; + // split every 5 + for (var i = 0; i < (ids.Count - 1) / 5 + 1; i++) + { + var count = Math.Min(5, ids.Count - i * 5); + var waveIds = ids.GetRange(i * 5, count); + + proto.MonsterWaveList.Add(new SceneMonsterWave + { + BattleStageId = (uint)(Stages.FirstOrDefault()?.StageID ?? 0), + BattleWaveId = (uint)(proto.MonsterWaveList.Count + 1), + MonsterParam = new SceneMonsterWaveParam(), + MonsterList = + { + waveIds.Select(x => new SceneMonster + { + MonsterId = (uint)x + }) + } + }); + } + } + + var avatars = GetBattleAvatars(); + foreach (var avatar in avatars) + proto.BattleAvatarList.Add(avatar.AvatarInfo.ToBattleProto( + new PlayerDataCollection(Player.Data, Player.InventoryManager!.Data, Lineup), avatar.AvatarType)); + + System.Threading.Tasks.Task.Run(async () => + { + foreach (var monster in EntityMonsters) await monster.ApplyBuff(this); + + foreach (var avatar in AvatarInfo) + if (avatars.Select(x => x.AvatarInfo).FirstOrDefault(x => + x.BaseAvatarId == avatar.AvatarInfo.BaseAvatarId) != + null) // if avatar is in lineup + await avatar.ApplyBuff(this); + }).Wait(); + + foreach (var buff in Buffs.Clone()) + if (Enum.IsDefined(typeof(DamageTypeEnum), buff.BuffID)) + Buffs.RemoveAll(x => x.BuffID == buff.BuffID && x.DynamicValues.Count == 0); } - var avatars = GetBattleAvatars(); - foreach (var avatar in avatars) - proto.BattleAvatarList.Add(avatar.AvatarInfo.ToBattleProto( - new PlayerDataCollection(Player.Data, Player.InventoryManager!.Data, Lineup), avatar.AvatarType)); - - System.Threading.Tasks.Task.Run(async () => - { - foreach (var monster in EntityMonsters) await monster.ApplyBuff(this); - - foreach (var avatar in AvatarInfo) - if (avatars.Select(x => x.AvatarInfo).FirstOrDefault(x => - x.BaseAvatarId == avatar.AvatarInfo.BaseAvatarId) != - null) // if avatar is in lineup - await avatar.ApplyBuff(this); - }).Wait(); - - foreach (var buff in Buffs.Clone()) - if (Enum.IsDefined(typeof(DamageTypeEnum), buff.BuffID)) - Buffs.RemoveAll(x => x.BuffID == buff.BuffID && x.DynamicValues.Count == 0); - foreach (var eventInstance in BattleEvents.Values) proto.BattleEvent.Add(eventInstance.ToProto()); for (var i = 1; i <= 5; i++) diff --git a/GameServer/Game/Battle/BattleManager.cs b/GameServer/Game/Battle/BattleManager.cs index 68664123..e2fd3936 100644 --- a/GameServer/Game/Battle/BattleManager.cs +++ b/GameServer/Game/Battle/BattleManager.cs @@ -2,6 +2,9 @@ using EggLink.DanhengServer.Data.Excel; using EggLink.DanhengServer.Database.Avatar; using EggLink.DanhengServer.Database.Inventory; +using EggLink.DanhengServer.GameServer.Game.Battle.Custom; +using EggLink.DanhengServer.GameServer.Game.GridFight; +using EggLink.DanhengServer.GameServer.Game.GridFight.Component; using EggLink.DanhengServer.GameServer.Game.Player; using EggLink.DanhengServer.GameServer.Game.RogueMagic; using EggLink.DanhengServer.GameServer.Game.Scene; @@ -292,6 +295,34 @@ public class BattleManager(PlayerInstance player) : BasePlayerManager(player) return (Retcode.RetSucc, battleInstance); } + public BattleInstance? StartGridFightBattle(GridFightInstance inst) + { + if (Player.BattleInstance != null) return null; + + var levelComponent = inst.GetComponent(); + + var curSection = levelComponent.CurrentSection; + + var stageConfigId = curSection.Excel.StageID; + GameData.StageConfigData.TryGetValue((int)stageConfigId, out var stageConfig); + if (stageConfig == null) return null; + + BattleInstance battleInstance = new(Player, Player.LineupManager!.GetCurLineup()!, [stageConfig]) + { + WorldLevel = Player.Data.WorldLevel, + AvatarInfo = [], + GridFightOptions = new BattleGridFightOptions(curSection, inst, Player) + }; + + Player.BattleInstance = battleInstance; + + Player.QuestManager!.OnBattleStart(battleInstance); + + InvokeOnPlayerEnterBattle(Player, battleInstance); + + return battleInstance; + } + public async ValueTask EndBattle(PVEBattleResultCsReq req) { InvokeOnPlayerQuitBattle(Player, req); @@ -383,6 +414,12 @@ public class BattleManager(PlayerInstance player) : BasePlayerManager(player) if (Player.ActivityManager!.TrialActivityInstance != null && req.EndStatus == BattleEndStatus.BattleEndWin) await Player.ActivityManager.TrialActivityInstance.EndActivity(TrialActivityStatus.Finish); + if (Player.GridFightManager?.GridFightInstance != null && + battle.GridFightOptions != null) + { + await Player.GridFightManager!.GridFightInstance!.EndBattle(battle); + } + await Player.SendPacket(new PacketPVEBattleResultScRsp(req, Player, battle)); } } \ No newline at end of file diff --git a/GameServer/Game/Battle/Custom/BattleGridFightOptions.cs b/GameServer/Game/Battle/Custom/BattleGridFightOptions.cs new file mode 100644 index 00000000..ceeae38f --- /dev/null +++ b/GameServer/Game/Battle/Custom/BattleGridFightOptions.cs @@ -0,0 +1,77 @@ +using EggLink.DanhengServer.Data; +using EggLink.DanhengServer.Database.Avatar; +using EggLink.DanhengServer.GameServer.Game.GridFight; +using EggLink.DanhengServer.GameServer.Game.GridFight.Component; +using EggLink.DanhengServer.GameServer.Game.Player; +using EggLink.DanhengServer.Proto; +using EggLink.DanhengServer.Util; + +namespace EggLink.DanhengServer.GameServer.Game.Battle.Custom; + +public class BattleGridFightOptions(GridFightGameSectionInfo curSection, GridFightInstance inst, PlayerInstance player) +{ + public GridFightGameEncounterInfo Encounter { get; set; } = curSection.Encounters.RandomElement(); + public GridFightInstance Inst { get; set; } = inst; + public GridFightAvatarComponent AvatarComponent { get; set; } = inst.GetComponent(); + public GridFightBasicComponent BasicComponent { get; set; } = inst.GetComponent(); + public GridFightGameSectionInfo CurSection { get; set; } = curSection; + public PlayerInstance Player { get; set; } = player; + + public void HandleProto(SceneBattleInfo proto, BattleInstance battle) + { + var avatars = AvatarComponent.GetForegroundAvatarInfos(); + + var formatted = avatars.Select(x => + x.ToBattleProto( + new PlayerDataCollection(Player.Data, Player.InventoryManager!.Data, + Player.LineupManager!.GetCurLineup()!), AvatarType.AvatarGridFightType)).ToList(); + + proto.BattleAvatarList.Add(formatted); + + foreach (var wave in Encounter.MonsterWaves) + { + proto.MonsterWaveList.Add(new SceneMonsterWave + { + BattleStageId = proto.StageId, + BattleWaveId = wave.Wave, + MonsterParam = new SceneMonsterWaveParam + { + Level = 89 + }, + MonsterList = + { + wave.Monsters.Select(x => new SceneMonster + { + MonsterId = x.MonsterID + }) + } + }); + } + + foreach (var role in AvatarComponent.Data.Roles) + { + if (!GameData.GridFightRoleStarData.TryGetValue(role.RoleId << 2 | role.Tier, out var roleConf)) continue; + battle.BattleEvents.TryAdd((int)roleConf.BEID, new BattleEventInstance((int)roleConf.BEID, 5000)); + } + + proto.BattleGridFightInfo = new BattleGridFightInfo + { + GridGameAvatarList = + { + AvatarComponent.Data.Roles.Where(x => x.Pos <= 4).Select(x => x.ToBattleInfo()) + }, + BattleWaveId = 1, + GridFightCurLevel = BasicComponent.Data.CurLevel, + GridFightLineupHp = BasicComponent.Data.CurHp, + GridFightAvatarList = { formatted }, + GridFightStageInfo = new BattleGridFightStageInfo + { + ChapterId = CurSection.ChapterId, + RouteId = CurSection.Excel.ID, + SectionId = CurSection.SectionId + }, + IsOverlock = Inst.IsOverLock, + Season = Inst.Season + }; + } +} \ No newline at end of file diff --git a/GameServer/Game/GridFight/Component/GridFightAvatarComponent.cs b/GameServer/Game/GridFight/Component/GridFightAvatarComponent.cs index af4c9499..3ca38064 100644 --- a/GameServer/Game/GridFight/Component/GridFightAvatarComponent.cs +++ b/GameServer/Game/GridFight/Component/GridFightAvatarComponent.cs @@ -1,22 +1,124 @@ using EggLink.DanhengServer.Data; -using EggLink.DanhengServer.Data.Excel; -using EggLink.DanhengServer.Enums.GridFight; +using EggLink.DanhengServer.Database.Avatar; +using EggLink.DanhengServer.GameServer.Game.GridFight.Sync; +using EggLink.DanhengServer.GameServer.Server.Packet.Send.GridFight; using EggLink.DanhengServer.Proto; +using EggLink.DanhengServer.Proto.ServerSide; namespace EggLink.DanhengServer.GameServer.Game.GridFight.Component; public class GridFightAvatarComponent(GridFightInstance inst) : BaseGridFightComponent(inst) { - public List Avatars { get; set; } = []; - private uint _curUniqueId; + public GridFightAvatarInfoPb Data { get; set; } = new(); - public async ValueTask AddAvatar(uint roleId, uint tier = 1) + public async ValueTask> AddAvatar(uint roleId, uint tier = 1, bool sendPacket = true) { - var info = new GridFightAvatarInfo(roleId, ++_curUniqueId, tier); - Avatars.Add(info); + var pos = 1u; + // get first empty pos + var usedPos = Data.Roles.Select(x => x.Pos).ToHashSet(); + for (var i = 1u; i <= 20u; i++) + { + if (usedPos.Contains(i)) continue; + pos = i; + break; + } - // TODO sync - await ValueTask.CompletedTask; + var info = new GridFightRoleInfoPb + { + RoleId = roleId, + UniqueId = ++Data.CurUniqueId, + Tier = tier, + Pos = pos + }; + + Data.Roles.Add(info); + + List syncs = [new GridFightRoleAddSyncData(GridFightSrc.KGridFightSrcBuyGoods, info)]; + if (sendPacket) + { + await Inst.Player.SendPacket(new PacketGridFightSyncUpdateResultScNotify(syncs)); + } + + return syncs; + } + + public async ValueTask> SellAvatar(uint uniqueId, bool sendPacket = true) + { + var role = Data.Roles.FirstOrDefault(x => x.UniqueId == uniqueId); + if (role == null) + { + return []; + } + + Data.Roles.Remove(role); + + var tier = role.Tier; + var rarity = GameData.GridFightRoleBasicInfoData[role.RoleId].Rarity; + + var sellPrice = GameData.GridFightShopPriceData.GetValueOrDefault(rarity) + ?.SellGoldList[(int)(tier - 1)] ?? 1; + + var basicComp = Inst.GetComponent(); + await basicComp.UpdateGoldNum((int)sellPrice, false, GridFightSrc.KGridFightSrcRecycleRole); + + List syncs = + [ + new GridFightRoleRemoveSyncData(GridFightSrc.KGridFightSrcRecycleRole, role), + new GridFightGoldSyncData(GridFightSrc.KGridFightSrcRecycleRole, basicComp.Data) + ]; + + if (sendPacket) + { + await Inst.Player.SendPacket(new PacketGridFightSyncUpdateResultScNotify(syncs)); + } + + return syncs; + } + + public List GetForegroundAvatarInfos() + { + var foreground = Data.Roles.Where(x => x.Pos <= 4).ToList(); + List res = []; + + foreach (var role in foreground) + { + var excel = GameData.GridFightRoleBasicInfoData[role.RoleId]; + // get formal or special + var formal = Inst.Player.AvatarManager!.GetFormalAvatar((int)excel.AvatarID); + if (formal != null) + { + res.Add(formal); + } + else + { + var special = Inst.Player.AvatarManager.GetTrialAvatar((int)excel.SpecialAvatarID); + if (special != null) + { + res.Add(special); + } + } + } + + return res; + } + + public async ValueTask UpdatePos(List posList) + { + List syncs = []; + foreach (var pos in posList) + { + var role = Data.Roles.FirstOrDefault(x => x.UniqueId == pos.UniqueId); + if (role != null) + { + role.Pos = pos.Pos; + syncs.Add(new GridFightRoleUpdateSyncData(GridFightSrc.KGridFightSrcCopyRole, role)); + } + } + + if (syncs.Count > 0) + { + await Inst.Player.SendPacket(new PacketGridFightSyncUpdateResultScNotify(syncs)); + } } public override GridFightGameInfo ToProto() @@ -25,27 +127,34 @@ public class GridFightAvatarComponent(GridFightInstance inst) : BaseGridFightCom { GridAvatarGameInfo = new GridFightGameAvatarInfo { - GridGameAvatarList = { Avatars.Select(x => x.ToProto()) } + GridGameAvatarList = { Data.Roles.Select(x => x.ToProto()) } } }; } } -public class GridFightAvatarInfo(uint roleId, uint uniqueId, uint tier = 1) +public static class GridFightRoleInfoPbExtensions { - public GridFightRoleBasicInfoExcel RoleInfo { get; set; } = GameData.GridFightRoleBasicInfoData[roleId]; - public GridFightRolePositionEnum Pos { get; set; } = GridFightRolePositionEnum.Foreground; - public uint Tier { get; set; } = tier; - public uint UniqueId { get; set; } = uniqueId; - - public GridGameAvatarInfo ToProto() + public static GridGameAvatarInfo ToProto(this GridFightRoleInfoPb info) { return new GridGameAvatarInfo { - Id = RoleInfo.ID, - Pos = (uint)Pos, - Tier = Tier, - UniqueId = UniqueId + Id = info.RoleId, + UniqueId = info.UniqueId, + Tier = info.Tier, + Pos = info.Pos + }; + } + + public static BattleGridFightRoleInfo ToBattleInfo(this GridFightRoleInfoPb info) + { + return new BattleGridFightRoleInfo + { + RoleBasicId = info.RoleId, + UniqueId = info.UniqueId, + Tier = info.Tier, + Pos = info.Pos, + AvatarId = GameData.GridFightRoleBasicInfoData[info.RoleId].AvatarID }; } } \ No newline at end of file diff --git a/GameServer/Game/GridFight/Component/GridFightBasicComponent.cs b/GameServer/Game/GridFight/Component/GridFightBasicComponent.cs index bed7e383..854c761c 100644 --- a/GameServer/Game/GridFight/Component/GridFightBasicComponent.cs +++ b/GameServer/Game/GridFight/Component/GridFightBasicComponent.cs @@ -1,29 +1,117 @@ +using EggLink.DanhengServer.Data; +using EggLink.DanhengServer.GameServer.Game.GridFight.Sync; +using EggLink.DanhengServer.GameServer.Server.Packet.Send.GridFight; using EggLink.DanhengServer.Proto; +using EggLink.DanhengServer.Proto.ServerSide; namespace EggLink.DanhengServer.GameServer.Game.GridFight.Component; public class GridFightBasicComponent(GridFightInstance inst) : BaseGridFightComponent(inst) { + public GridFightBasicInfoPb Data { get; set; } = new() + { + CurHp = 100, + CurLevel = 1, + CurOnGroundAvatarCount = 1, + BuyLevelCost = 1, + CurGold = 5 + }; + + public async ValueTask UpdateGoldNum(int changeNum, bool sendPacket = true, GridFightSrc src = GridFightSrc.KGridFightSrcManualRefreshGoods) + { + if (changeNum < 0 && -changeNum > Data.CurGold) + { + return Retcode.RetGridFightCoinNotEnough; + } + + Data.CurGold = (uint)(Data.CurGold + changeNum); + + if (sendPacket) + { + await Inst.Player.SendPacket(new PacketGridFightSyncUpdateResultScNotify(new GridFightGoldSyncData(src, Data))); + } + + return Retcode.RetSucc; + } + + public async ValueTask BuyLevelExp(bool sendPacket = true) + { + if (!GameData.GridFightPlayerLevelData.TryGetValue(Data.CurLevel, out var levelConf) || levelConf.LevelUpExp == 0) + return Retcode.RetGridFightGameplayLevelMax; + + // COST + if (await UpdateGoldNum((int)-Data.BuyLevelCost, false) != Retcode.RetSucc) + return Retcode.RetGridFightCoinNotEnough; + + Data.LevelExp += 1; + + // LEVEL UP + if (Data.LevelExp >= levelConf.LevelUpExp) + { + await UpgradeLevel(1, false); + } + + if (sendPacket) + { + await Inst.Player.SendPacket(new PacketGridFightSyncUpdateResultScNotify( + new GridFightGoldSyncData(GridFightSrc.KGridFightSrcBuyGoods, Data), + new GridFightPlayerLevelSyncData(GridFightSrc.KGridFightSrcBuyGoods, Data), + new GridFightMaxAvatarNumSyncData(GridFightSrc.KGridFightSrcBuyGoods, Data), + new GridFightBuyExpCostSyncData(GridFightSrc.KGridFightSrcBuyGoods, Data))); + } + + return Retcode.RetSucc; + } + + public async ValueTask UpgradeLevel(uint level, bool sendPacket = true) + { + if (!GameData.GridFightPlayerLevelData.TryGetValue(level + Data.CurLevel, out var levelConf)) + return Retcode.RetGridFightGameplayLevelMax; + + Data.CurLevel += level; + Data.LevelExp = 0; + Data.BuyLevelCost = (uint)Math.Ceiling(Data.CurLevel / 2f); + Data.CurOnGroundAvatarCount = levelConf.AvatarMaxNumber; + + if (sendPacket) + { + await Inst.Player.SendPacket(new PacketGridFightSyncUpdateResultScNotify( + new GridFightGoldSyncData(GridFightSrc.KGridFightSrcBuyGoods, Data), + new GridFightPlayerLevelSyncData(GridFightSrc.KGridFightSrcBuyGoods, Data), + new GridFightMaxAvatarNumSyncData(GridFightSrc.KGridFightSrcBuyGoods, Data), + new GridFightBuyExpCostSyncData(GridFightSrc.KGridFightSrcBuyGoods, Data))); + } + + return Retcode.RetSucc; + } + + public uint GetFieldCount() + { + return 4 + 6; + } + public override GridFightGameInfo ToProto() { return new GridFightGameInfo { GridBasicInfo = new GridFightGameBasicInfo { - GridFightCurLevel = 1, - GridFightCurLevelExp = 1, - GridFightLevelCost = 1, - GridFightMaxAvatarCount = 2, - GridFightOffFieldMaxCount = 9, - GridFightMaxFieldCount = 13, - GridFightLineupHp = 100, - GridFightCurGold = 200, + GridFightCurLevel = Data.CurLevel, + GridFightCurLevelExp = Data.LevelExp, + GridFightLevelCost = Data.BuyLevelCost, + GridFightMaxAvatarCount = Data.CurOnGroundAvatarCount, + GridFightOffFieldMaxCount = 6, + GridFightMaxFieldCount = 8, + GridFightLineupHp = Data.CurHp, + GridFightCurGold = Data.CurGold, GridFightMaxGold = 2000, OCMGMEHECBB = new OPIBBPCHFII { IJDIAOMINLB = new BHJALAPDBLH() }, - CALCJMHAKPF = new OLEIDBLBILD() + CALCJMHAKPF = new OLEIDBLBILD + { + } } }; } diff --git a/GameServer/Game/GridFight/Component/GridFightLevelComponent.cs b/GameServer/Game/GridFight/Component/GridFightLevelComponent.cs index 4f67483f..bb254c3a 100644 --- a/GameServer/Game/GridFight/Component/GridFightLevelComponent.cs +++ b/GameServer/Game/GridFight/Component/GridFightLevelComponent.cs @@ -1,6 +1,8 @@ using EggLink.DanhengServer.Data; using EggLink.DanhengServer.Data.Excel; using EggLink.DanhengServer.Enums.GridFight; +using EggLink.DanhengServer.GameServer.Game.GridFight.Sync; +using EggLink.DanhengServer.GameServer.Server.Packet.Send.GridFight; using EggLink.DanhengServer.Proto; using EggLink.DanhengServer.Util; @@ -36,6 +38,34 @@ public class GridFightLevelComponent : BaseGridFightComponent } } + public async ValueTask> EnterNextSection(bool sendPacket = true) + { + // if last section of chapter + if (_curSectionId >= Sections[_curChapterId].Count) + { + if (_curChapterId >= Sections.Count) + { + // end of game + return []; + } + + _curChapterId++; + _curSectionId = 1; + } + else + { + _curSectionId++; + } + + List syncs = [new GridFightLevelSyncData(GridFightSrc.KGridFightSrcBattleEnd, this)]; + if (sendPacket) + { + await Inst.Player.SendPacket(new PacketGridFightSyncUpdateResultScNotify(syncs)); + } + + return syncs; + } + public List GetBossMonsters() { // get every chapter last section camp @@ -91,9 +121,8 @@ public class GridFightLevelComponent : BaseGridFightComponent Sections.Values.SelectMany(x => x).Select(s => s.ToProto()) } }, - CGAIJCCLKBH = new() + LevelSttInfo = new GridFightLevelSttInfo { - DILHFEHBGDN = new ACHJGEEKCAH() } } }; diff --git a/GameServer/Game/GridFight/Component/GridFightShopComponent.cs b/GameServer/Game/GridFight/Component/GridFightShopComponent.cs new file mode 100644 index 00000000..f7e609a6 --- /dev/null +++ b/GameServer/Game/GridFight/Component/GridFightShopComponent.cs @@ -0,0 +1,244 @@ +using EggLink.DanhengServer.Data; +using EggLink.DanhengServer.GameServer.Game.GridFight.Sync; +using EggLink.DanhengServer.GameServer.Server.Packet.Send.GridFight; +using EggLink.DanhengServer.Proto; +using EggLink.DanhengServer.Proto.ServerSide; +using EggLink.DanhengServer.Util; + +namespace EggLink.DanhengServer.GameServer.Game.GridFight.Component; + +public class GridFightShopComponent(GridFightInstance inst) : BaseGridFightComponent(inst) +{ + public GridFightShopInfoPb Data { get; set; } = new() + { + RefreshCost = 3, + FreeRefreshCount = 1 + }; + + public static uint GetGoodsPrice(uint rarity, uint tier) + { + return GameData.GridFightShopPriceData.GetValueOrDefault(rarity) + ?.BuyGoldList[(int)(tier - 1)] ?? 1; + } + + public async ValueTask LockGoods(bool locked, bool sendPacket = true) + { + var curLevel = Inst.GetComponent().Data.CurLevel; + Data.ShopLocked = locked; + + if (sendPacket) + { + await Inst.Player.SendPacket(new PacketGridFightSyncUpdateResultScNotify(new GridFightShopSyncData(GridFightSrc.KGridFightSrcNone, Data, curLevel))); + } + } + + public async ValueTask BuyGoods(List indexes, bool sendPacket = true) + { + var curLevel = Inst.GetComponent().Data.CurLevel; + + var targetGoods = indexes + .Where(x => x < Data.ShopItems.Count) + .Select(x => Data.ShopItems[(int)x]) + .ToList(); + + var totalCost = (uint)targetGoods.Select(x => GetGoodsPrice(x.Rarity, x.RoleItem.Tier)).Sum(x => x); + + // COST + var code = await Inst.GetComponent().UpdateGoldNum((int)-totalCost, false); + if (code != Retcode.RetSucc) + { + return code; + } + + // GIVE ITEMS + List syncs = []; + var avatarComp = Inst.GetComponent(); + foreach (var item in targetGoods) + { + if (item.ItemTypeCase == GridFightShopItemPb.ItemTypeOneofCase.RoleItem) + { + syncs.AddRange(await avatarComp.AddAvatar(item.RoleItem.RoleId, item.RoleItem.Tier, false)); + } + else + { + // TODO other item types + } + } + + // REMOVE ITEMS FROM SHOP + foreach (var index in indexes) + { + Data.ShopItems.RemoveAt((int)index); + } + + if (sendPacket) + { + syncs.Insert(0, new GridFightGoldSyncData(GridFightSrc.KGridFightSrcBuyGoods, Inst.GetComponent().Data)); + syncs.Add(new GridFightShopSyncData(GridFightSrc.KGridFightSrcBuyGoods, Data, curLevel)); + + await Inst.Player.SendPacket(new PacketGridFightSyncUpdateResultScNotify(syncs)); + } + + return Retcode.RetSucc; + } + + public async ValueTask RefreshShop(bool isEnterSection, bool sendPacket = true) + { + if (!isEnterSection) + { + if (Data.FreeRefreshCount > 0) + Data.FreeRefreshCount--; + else + { + // cost + var code = await Inst.GetComponent().UpdateGoldNum((int)-Data.RefreshCost); + if (code != Retcode.RetSucc) + { + return code; + } + + Data.RefreshCost += 2; + } + } + else + { + Data.RefreshCost = 3; + Data.FreeRefreshCount++; + if (Data.ShopLocked) + { + await LockGoods(false, false); + return Retcode.RetGridFightShopLocked; + } + } + + // refresh + var curLevel = Inst.GetComponent().Data.CurLevel; + var rules = GameData.GridFightPlayerLevelData.GetValueOrDefault(curLevel)?.RarityWeights ?? + [100, 0, 0, 0, 0]; + + Data.ShopItems.Clear(); + + List usedIds = []; + // generate items + for (var i = 0; i < 5; i++) + { + // select rarity + var rand = (uint)Random.Shared.Next(1, 101); + var targetRarity = 0; + for (var j = 0; j < 5; j++) + { + if (rand <= rules[j]) + { + targetRarity = j + 1; + break; + } + rand -= rules[j]; + } + + // get item pool + var pool = GameData.GridFightRoleBasicInfoData.Values + .Where(x => !usedIds.Contains(x.ID) && x.IsInPool && x.Rarity == targetRarity).ToList(); + + var target = pool.RandomElement(); + usedIds.Add(target.ID); + + var tier = 1u; + Data.ShopItems.Add(new GridFightShopItemPb + { + Rarity = target.Rarity, + RoleItem = new GridFightShopRoleItemPb + { + RoleId = target.ID, + Tier = tier + } + }); + } + + if (sendPacket) + { + await Inst.Player.SendPacket(new PacketGridFightSyncUpdateResultScNotify(new GridFightShopSyncData(GridFightSrc.KGridFightSrcManualRefreshGoods, Data, curLevel))); + } + + return Retcode.RetSucc; + } + + public override GridFightGameInfo ToProto() + { + var rarity = 1u; + var rules = GameData.GridFightPlayerLevelData + .GetValueOrDefault(Inst.GetComponent().Data.CurLevel)?.RarityWeights ?? + [100, 0, 0, 0, 0]; + + return new GridFightGameInfo + { + GridShopInfo = new GridFightGameShopInfo + { + ShopIsLocked = Data.ShopLocked, + GridFightShopRandomRule = new GridFightShopRandomRuleInfo + { + GridFightShopRuleList = { rules.Select(x => new GridFightShopRandomRule + { + ShopItemWeight = x, + ShopItemRarity = rarity++ + }) } + }, + ShopGoodsList = { Data.ShopItems.Select(x => x.ToProto()) }, + ShopFreeRefreshCount = Data.FreeRefreshCount, + ShopRefreshCost = Data.RefreshCost + } + }; + } +} + +public static class GridFightShopInfoPbExtensions +{ + public static GridFightShopGoodsInfo ToProto(this GridFightShopItemPb info) + { + var proto = new GridFightShopGoodsInfo(); + + if (info.ItemTypeCase == GridFightShopItemPb.ItemTypeOneofCase.RoleItem) + { + proto.ShopGoodsPrice = GameData.GridFightShopPriceData.GetValueOrDefault(info.Rarity) + ?.BuyGoldList[(int)(info.RoleItem.Tier - 1)] ?? 1; + + proto.RoleGoodsInfo = new GridFightRoleGoodsInfo + { + RoleBasicId = info.RoleItem.RoleId, + Tier = info.RoleItem.Tier + }; + } + else + { + // TODO + } + + return proto; + } + + public static GridFightShopSyncInfo ToSyncInfo(this GridFightShopInfoPb info, uint level) + { + var rarity = 1u; + var rules = GameData.GridFightPlayerLevelData + .GetValueOrDefault(level)?.RarityWeights ?? + [100, 0, 0, 0, 0]; + + return new GridFightShopSyncInfo + { + ShopIsLocked = info.ShopLocked, + GridFightShopRandomRule = new GridFightShopRandomRuleInfo + { + GridFightShopRuleList = + { + rules.Select(x => new GridFightShopRandomRule + { + ShopItemWeight = x, + ShopItemRarity = rarity++ + }) + } + }, + ShopGoodsList = { info.ShopItems.Select(x => x.ToProto()) }, + ShopFreeRefreshCount = info.FreeRefreshCount, + ShopRefreshCost = info.RefreshCost + }; + } +} \ No newline at end of file diff --git a/GameServer/Game/GridFight/GridFightInstance.cs b/GameServer/Game/GridFight/GridFightInstance.cs index 3bce147f..6b75d2a2 100644 --- a/GameServer/Game/GridFight/GridFightInstance.cs +++ b/GameServer/Game/GridFight/GridFightInstance.cs @@ -1,23 +1,52 @@ +using EggLink.DanhengServer.GameServer.Game.Battle; using EggLink.DanhengServer.GameServer.Game.GridFight.Component; +using EggLink.DanhengServer.GameServer.Game.GridFight.Sync; +using EggLink.DanhengServer.GameServer.Game.Player; +using EggLink.DanhengServer.GameServer.Server.Packet.Send.GridFight; using EggLink.DanhengServer.Proto; namespace EggLink.DanhengServer.GameServer.Game.GridFight; -public class GridFightInstance(uint season, uint divisionId, bool isOverLock, uint uniqueId) +public class GridFightInstance(PlayerInstance player, uint season, uint divisionId, bool isOverLock, uint uniqueId) { public uint Season { get; } = season; public uint DivisionId { get; } = divisionId; public bool IsOverLock { get; } = isOverLock; public uint UniqueId { get; } = uniqueId; public List Components { get; } = []; + public PlayerInstance Player { get; } = player; + + public BattleInstance? StartBattle() + { + return Player.BattleManager!.StartGridFightBattle(this); + } + + public async ValueTask EndBattle(BattleInstance battle) + { + if (battle.BattleEndStatus != BattleEndStatus.BattleEndWin) return; + + List syncs = []; + + await Player.SendPacket(new PacketGridFightEndBattleStageNotify(this)); + + var basicComp = GetComponent(); + await basicComp.UpdateGoldNum(5, false, GridFightSrc.KGridFightSrcNone); + + syncs.Add(new GridFightGoldSyncData(GridFightSrc.KGridFightSrcBattleEnd, basicComp.Data)); + syncs.AddRange(await GetComponent().EnterNextSection(false)); + + await Player.SendPacket(new PacketGridFightSyncUpdateResultScNotify(syncs)); + } public void InitializeComponents() { Components.Add(new GridFightBasicComponent(this)); + Components.Add(new GridFightShopComponent(this)); Components.Add(new GridFightLevelComponent(this)); Components.Add(new GridFightAvatarComponent(this)); - _ = GetComponent().AddAvatar(1414, 3); // TODO test + _ = GetComponent().AddAvatar(1414, 3, false); // TODO test + _ = GetComponent().RefreshShop(true, false); } public T GetComponent() where T : BaseGridFightComponent diff --git a/GameServer/Game/GridFight/GridFightManager.cs b/GameServer/Game/GridFight/GridFightManager.cs index f14b4bd5..b8eae914 100644 --- a/GameServer/Game/GridFight/GridFightManager.cs +++ b/GameServer/Game/GridFight/GridFightManager.cs @@ -21,7 +21,7 @@ public class GridFightManager(PlayerInstance player) : BasePlayerManager(player) if (GridFightInstance != null) return (Retcode.RetGridFightAlreadyInGameplay, GridFightInstance); - GridFightInstance = new GridFightInstance(season, divisionId, isOverLock, ++CurUniqueId); + GridFightInstance = new GridFightInstance(Player, season, divisionId, isOverLock, ++CurUniqueId); GridFightInstance.InitializeComponents(); await ValueTask.CompletedTask; diff --git a/GameServer/Game/GridFight/Sync/BaseGridFightSyncData.cs b/GameServer/Game/GridFight/Sync/BaseGridFightSyncData.cs new file mode 100644 index 00000000..92a210ab --- /dev/null +++ b/GameServer/Game/GridFight/Sync/BaseGridFightSyncData.cs @@ -0,0 +1,9 @@ +using EggLink.DanhengServer.Proto; + +namespace EggLink.DanhengServer.GameServer.Game.GridFight.Sync; + +public abstract class BaseGridFightSyncData(GridFightSrc src) +{ + public GridFightSrc Src { get; set; } = src; + public abstract GridFightSyncData ToProto(); +} \ No newline at end of file diff --git a/GameServer/Game/GridFight/Sync/GridFightBuyExpCostSyncData.cs b/GameServer/Game/GridFight/Sync/GridFightBuyExpCostSyncData.cs new file mode 100644 index 00000000..3fc709f0 --- /dev/null +++ b/GameServer/Game/GridFight/Sync/GridFightBuyExpCostSyncData.cs @@ -0,0 +1,15 @@ +using EggLink.DanhengServer.Proto; +using EggLink.DanhengServer.Proto.ServerSide; + +namespace EggLink.DanhengServer.GameServer.Game.GridFight.Sync; + +public class GridFightBuyExpCostSyncData(GridFightSrc src, GridFightBasicInfoPb info) : BaseGridFightSyncData(src) +{ + public override GridFightSyncData ToProto() + { + return new GridFightSyncData + { + GridFightLevelCost = info.BuyLevelCost + }; + } +} \ No newline at end of file diff --git a/GameServer/Game/GridFight/Sync/GridFightGoldSyncData.cs b/GameServer/Game/GridFight/Sync/GridFightGoldSyncData.cs new file mode 100644 index 00000000..feaf3bab --- /dev/null +++ b/GameServer/Game/GridFight/Sync/GridFightGoldSyncData.cs @@ -0,0 +1,15 @@ +using EggLink.DanhengServer.Proto; +using EggLink.DanhengServer.Proto.ServerSide; + +namespace EggLink.DanhengServer.GameServer.Game.GridFight.Sync; + +public class GridFightGoldSyncData(GridFightSrc src, GridFightBasicInfoPb basic) : BaseGridFightSyncData(src) +{ + public override GridFightSyncData ToProto() + { + return new GridFightSyncData + { + ItemValue = basic.CurGold + }; + } +} \ No newline at end of file diff --git a/GameServer/Game/GridFight/Sync/GridFightLevelSyncData.cs b/GameServer/Game/GridFight/Sync/GridFightLevelSyncData.cs new file mode 100644 index 00000000..9a1fa15c --- /dev/null +++ b/GameServer/Game/GridFight/Sync/GridFightLevelSyncData.cs @@ -0,0 +1,23 @@ +using EggLink.DanhengServer.GameServer.Game.GridFight.Component; +using EggLink.DanhengServer.Proto; + +namespace EggLink.DanhengServer.GameServer.Game.GridFight.Sync; + +public class GridFightLevelSyncData(GridFightSrc src, GridFightLevelComponent level) : BaseGridFightSyncData(src) +{ + public override GridFightSyncData ToProto() + { + return new GridFightSyncData + { + LevelSyncInfo = new GridFightLevelSyncInfo + { + SectionId = level.CurrentSection.SectionId, + ChapterId = level.CurrentSection.ChapterId, + GridFightLayerInfo = new GridFightLayerInfo + { + RouteInfo = level.CurrentSection.ToRouteInfo() + } + } + }; + } +} \ No newline at end of file diff --git a/GameServer/Game/GridFight/Sync/GridFightMaxAvatarNumSyncData.cs b/GameServer/Game/GridFight/Sync/GridFightMaxAvatarNumSyncData.cs new file mode 100644 index 00000000..7a5c3640 --- /dev/null +++ b/GameServer/Game/GridFight/Sync/GridFightMaxAvatarNumSyncData.cs @@ -0,0 +1,15 @@ +using EggLink.DanhengServer.Proto; +using EggLink.DanhengServer.Proto.ServerSide; + +namespace EggLink.DanhengServer.GameServer.Game.GridFight.Sync; + +public class GridFightMaxAvatarNumSyncData(GridFightSrc src, GridFightBasicInfoPb info) : BaseGridFightSyncData(src) +{ + public override GridFightSyncData ToProto() + { + return new GridFightSyncData + { + GridFightMaxAvatarCount = info.CurOnGroundAvatarCount + }; + } +} \ No newline at end of file diff --git a/GameServer/Game/GridFight/Sync/GridFightPlayerLevelSyncData.cs b/GameServer/Game/GridFight/Sync/GridFightPlayerLevelSyncData.cs new file mode 100644 index 00000000..463f96b3 --- /dev/null +++ b/GameServer/Game/GridFight/Sync/GridFightPlayerLevelSyncData.cs @@ -0,0 +1,19 @@ +using EggLink.DanhengServer.Proto; +using EggLink.DanhengServer.Proto.ServerSide; + +namespace EggLink.DanhengServer.GameServer.Game.GridFight.Sync; + +public class GridFightPlayerLevelSyncData(GridFightSrc src, GridFightBasicInfoPb info) : BaseGridFightSyncData(src) +{ + public override GridFightSyncData ToProto() + { + return new GridFightSyncData + { + PlayerLevel = new GridFightPlayerLevelSyncInfo + { + Exp = info.LevelExp, + Level = info.CurLevel + } + }; + } +} \ No newline at end of file diff --git a/GameServer/Game/GridFight/Sync/GridFightRoleAddSyncData.cs b/GameServer/Game/GridFight/Sync/GridFightRoleAddSyncData.cs new file mode 100644 index 00000000..87d680e3 --- /dev/null +++ b/GameServer/Game/GridFight/Sync/GridFightRoleAddSyncData.cs @@ -0,0 +1,16 @@ +using EggLink.DanhengServer.GameServer.Game.GridFight.Component; +using EggLink.DanhengServer.Proto; +using EggLink.DanhengServer.Proto.ServerSide; + +namespace EggLink.DanhengServer.GameServer.Game.GridFight.Sync; + +public class GridFightRoleAddSyncData(GridFightSrc src, GridFightRoleInfoPb role) : BaseGridFightSyncData(src) +{ + public override GridFightSyncData ToProto() + { + return new GridFightSyncData + { + AddRoleInfo = role.ToProto() + }; + } +} \ No newline at end of file diff --git a/GameServer/Game/GridFight/Sync/GridFightRoleRemoveSyncData.cs b/GameServer/Game/GridFight/Sync/GridFightRoleRemoveSyncData.cs new file mode 100644 index 00000000..3d5a44db --- /dev/null +++ b/GameServer/Game/GridFight/Sync/GridFightRoleRemoveSyncData.cs @@ -0,0 +1,15 @@ +using EggLink.DanhengServer.Proto; +using EggLink.DanhengServer.Proto.ServerSide; + +namespace EggLink.DanhengServer.GameServer.Game.GridFight.Sync; + +public class GridFightRoleRemoveSyncData(GridFightSrc src, GridFightRoleInfoPb role) : BaseGridFightSyncData(src) +{ + public override GridFightSyncData ToProto() + { + return new GridFightSyncData + { + RemoveRoleUniqueId = role.UniqueId + }; + } +} \ No newline at end of file diff --git a/GameServer/Game/GridFight/Sync/GridFightRoleUpdateSyncData.cs b/GameServer/Game/GridFight/Sync/GridFightRoleUpdateSyncData.cs new file mode 100644 index 00000000..78d31ee2 --- /dev/null +++ b/GameServer/Game/GridFight/Sync/GridFightRoleUpdateSyncData.cs @@ -0,0 +1,16 @@ +using EggLink.DanhengServer.GameServer.Game.GridFight.Component; +using EggLink.DanhengServer.Proto; +using EggLink.DanhengServer.Proto.ServerSide; + +namespace EggLink.DanhengServer.GameServer.Game.GridFight.Sync; + +public class GridFightRoleUpdateSyncData(GridFightSrc src, GridFightRoleInfoPb role) : BaseGridFightSyncData(src) +{ + public override GridFightSyncData ToProto() + { + return new GridFightSyncData + { + UpdateRoleInfo = role.ToProto() + }; + } +} \ No newline at end of file diff --git a/GameServer/Game/GridFight/Sync/GridFightShopSyncData.cs b/GameServer/Game/GridFight/Sync/GridFightShopSyncData.cs new file mode 100644 index 00000000..62b20641 --- /dev/null +++ b/GameServer/Game/GridFight/Sync/GridFightShopSyncData.cs @@ -0,0 +1,16 @@ +using EggLink.DanhengServer.GameServer.Game.GridFight.Component; +using EggLink.DanhengServer.Proto; +using EggLink.DanhengServer.Proto.ServerSide; + +namespace EggLink.DanhengServer.GameServer.Game.GridFight.Sync; + +public class GridFightShopSyncData(GridFightSrc src, GridFightShopInfoPb data, uint level) : BaseGridFightSyncData(src) +{ + public override GridFightSyncData ToProto() + { + return new GridFightSyncData + { + ShopSyncInfo = data.ToSyncInfo(level) + }; + } +} \ No newline at end of file diff --git a/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightBuyExpCsReq.cs b/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightBuyExpCsReq.cs new file mode 100644 index 00000000..06fe86ba --- /dev/null +++ b/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightBuyExpCsReq.cs @@ -0,0 +1,23 @@ +using EggLink.DanhengServer.GameServer.Game.GridFight.Component; +using EggLink.DanhengServer.Kcp; + +namespace EggLink.DanhengServer.GameServer.Server.Packet.Recv.GridFight; + +[Opcode(CmdIds.GridFightBuyExpCsReq)] +public class HandlerGridFightBuyExpCsReq : Handler +{ + public override async Task OnHandle(Connection connection, byte[] header, byte[] data) + { + var gridFight = connection.Player?.GridFightManager?.GridFightInstance; + if (gridFight == null) + { + await connection.SendPacket(CmdIds.GridFightBuyExpScRsp); + return; + } + + var basicComp = gridFight.GetComponent(); + await basicComp.BuyLevelExp(); + + await connection.SendPacket(CmdIds.GridFightBuyExpScRsp); + } +} \ No newline at end of file diff --git a/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightBuyGoodsCsReq.cs b/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightBuyGoodsCsReq.cs new file mode 100644 index 00000000..fc3d640b --- /dev/null +++ b/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightBuyGoodsCsReq.cs @@ -0,0 +1,27 @@ +using EggLink.DanhengServer.GameServer.Game.GridFight.Component; +using EggLink.DanhengServer.GameServer.Server.Packet.Send.GridFight; +using EggLink.DanhengServer.Kcp; +using EggLink.DanhengServer.Proto; + +namespace EggLink.DanhengServer.GameServer.Server.Packet.Recv.GridFight; + +[Opcode(CmdIds.GridFightBuyGoodsCsReq)] +public class HandlerGridFightBuyGoodsCsReq : Handler +{ + public override async Task OnHandle(Connection connection, byte[] header, byte[] data) + { + var req = GridFightBuyGoodsCsReq.Parser.ParseFrom(data); + + var gridFight = connection.Player?.GridFightManager?.GridFightInstance; + if (gridFight == null) + { + await connection.SendPacket(new PacketGridFightBuyGoodsScRsp(Retcode.RetGridFightNotInGameplay)); + return; + } + + var shopComp = gridFight.GetComponent(); + var code = await shopComp.BuyGoods(req.BuyGoodsIndexList.ToList()); + + await connection.SendPacket(new PacketGridFightBuyGoodsScRsp(code)); + } +} \ No newline at end of file diff --git a/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightEnterBattleStageCsReq.cs b/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightEnterBattleStageCsReq.cs new file mode 100644 index 00000000..f9f4939f --- /dev/null +++ b/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightEnterBattleStageCsReq.cs @@ -0,0 +1,24 @@ +using EggLink.DanhengServer.GameServer.Server.Packet.Send.GridFight; +using EggLink.DanhengServer.Kcp; +using EggLink.DanhengServer.Proto; + +namespace EggLink.DanhengServer.GameServer.Server.Packet.Recv.GridFight; + +[Opcode(CmdIds.GridFightEnterBattleStageCsReq)] +public class HandlerGridFightEnterBattleStageCsReq : Handler +{ + public override async Task OnHandle(Connection connection, byte[] header, byte[] data) + { + var gridFight = connection.Player?.GridFightManager?.GridFightInstance; + if (gridFight == null) + { + await connection.SendPacket( + new PacketGridFightEnterBattleStageScRsp(Retcode.RetGridFightNotInGameplay)); + return; + } + + var battle = gridFight.StartBattle(); + await connection.SendPacket( + new PacketGridFightEnterBattleStageScRsp(Retcode.RetSucc, battle)); + } +} \ No newline at end of file diff --git a/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightLockShopCsReq.cs b/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightLockShopCsReq.cs new file mode 100644 index 00000000..b6b7af5e --- /dev/null +++ b/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightLockShopCsReq.cs @@ -0,0 +1,26 @@ +using EggLink.DanhengServer.GameServer.Game.GridFight.Component; +using EggLink.DanhengServer.Kcp; +using EggLink.DanhengServer.Proto; + +namespace EggLink.DanhengServer.GameServer.Server.Packet.Recv.GridFight; + +[Opcode(CmdIds.GridFightLockShopCsReq)] +public class HandlerGridFightLockShopCsReq : Handler +{ + public override async Task OnHandle(Connection connection, byte[] header, byte[] data) + { + var req = GridFightLockShopCsReq.Parser.ParseFrom(data); + + var gridFight = connection.Player?.GridFightManager?.GridFightInstance; + if (gridFight == null) + { + await connection.SendPacket(CmdIds.GridFightRefreshShopScRsp); + return; + } + + var shopComp = gridFight.GetComponent(); + await shopComp.LockGoods(req.IsProtected); + + await connection.SendPacket(CmdIds.GridFightRefreshShopScRsp); + } +} \ No newline at end of file diff --git a/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightRecycleRoleCsReq.cs b/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightRecycleRoleCsReq.cs new file mode 100644 index 00000000..25b6fc5e --- /dev/null +++ b/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightRecycleRoleCsReq.cs @@ -0,0 +1,26 @@ +using EggLink.DanhengServer.GameServer.Game.GridFight.Component; +using EggLink.DanhengServer.Kcp; +using EggLink.DanhengServer.Proto; + +namespace EggLink.DanhengServer.GameServer.Server.Packet.Recv.GridFight; + +[Opcode(CmdIds.GridFightRecycleRoleCsReq)] +public class HandlerGridFightRecycleRoleCsReq : Handler +{ + public override async Task OnHandle(Connection connection, byte[] header, byte[] data) + { + var req = GridFightRecycleRoleCsReq.Parser.ParseFrom(data); + + var gridFight = connection.Player?.GridFightManager?.GridFightInstance; + if (gridFight == null) + { + await connection.SendPacket(CmdIds.GridFightRecycleRoleScRsp); + return; + } + + var roleComp = gridFight.GetComponent(); + await roleComp.SellAvatar(req.UniqueId); + + await connection.SendPacket(CmdIds.GridFightRecycleRoleScRsp); + } +} \ No newline at end of file diff --git a/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightRefreshShopCsReq.cs b/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightRefreshShopCsReq.cs new file mode 100644 index 00000000..4aeb27aa --- /dev/null +++ b/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightRefreshShopCsReq.cs @@ -0,0 +1,23 @@ +using EggLink.DanhengServer.GameServer.Game.GridFight.Component; +using EggLink.DanhengServer.Kcp; + +namespace EggLink.DanhengServer.GameServer.Server.Packet.Recv.GridFight; + +[Opcode(CmdIds.GridFightRefreshShopCsReq)] +public class HandlerGridFightRefreshShopCsReq : Handler +{ + public override async Task OnHandle(Connection connection, byte[] header, byte[] data) + { + var gridFight = connection.Player?.GridFightManager?.GridFightInstance; + if (gridFight == null) + { + await connection.SendPacket(CmdIds.GridFightRefreshShopScRsp); + return; + } + + var shopComp = gridFight.GetComponent(); + await shopComp.RefreshShop(false); + + await connection.SendPacket(CmdIds.GridFightRefreshShopScRsp); + } +} \ No newline at end of file diff --git a/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightUpdatePosCsReq.cs b/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightUpdatePosCsReq.cs new file mode 100644 index 00000000..32d2e656 --- /dev/null +++ b/GameServer/Server/Packet/Recv/GridFight/HandlerGridFightUpdatePosCsReq.cs @@ -0,0 +1,28 @@ +using EggLink.DanhengServer.GameServer.Game.GridFight.Component; +using EggLink.DanhengServer.GameServer.Server.Packet.Send.GridFight; +using EggLink.DanhengServer.Kcp; +using EggLink.DanhengServer.Proto; + +namespace EggLink.DanhengServer.GameServer.Server.Packet.Recv.GridFight; + +[Opcode(CmdIds.GridFightUpdatePosCsReq)] +public class HandlerGridFightUpdatePosCsReq : Handler +{ + public override async Task OnHandle(Connection connection, byte[] header, byte[] data) + { + var req = GridFightUpdatePosCsReq.Parser.ParseFrom(data); + + if (connection.Player!.GridFightManager!.GridFightInstance == null) + { + await connection.SendPacket( + new PacketGridFightUpdatePosScRsp(Retcode.RetGridFightNotInGameplay, req.GridFightPosInfoList)); + return; + } + + var gridFight = connection.Player.GridFightManager.GridFightInstance; + await gridFight.GetComponent().UpdatePos(req.GridFightPosInfoList.ToList()); + + await connection.SendPacket( + new PacketGridFightUpdatePosScRsp(Retcode.RetSucc, req.GridFightPosInfoList)); + } +} \ No newline at end of file diff --git a/GameServer/Server/Packet/Send/GridFight/PacketGridFightBuyGoodsScRsp.cs b/GameServer/Server/Packet/Send/GridFight/PacketGridFightBuyGoodsScRsp.cs new file mode 100644 index 00000000..dfd6c404 --- /dev/null +++ b/GameServer/Server/Packet/Send/GridFight/PacketGridFightBuyGoodsScRsp.cs @@ -0,0 +1,17 @@ +using EggLink.DanhengServer.Kcp; +using EggLink.DanhengServer.Proto; + +namespace EggLink.DanhengServer.GameServer.Server.Packet.Send.GridFight; + +public class PacketGridFightBuyGoodsScRsp : BasePacket +{ + public PacketGridFightBuyGoodsScRsp(Retcode retcode) : base(CmdIds.GridFightBuyGoodsScRsp) + { + var rsp = new GridFightBuyGoodsScRsp + { + Retcode = (uint)retcode + }; + + SetData(rsp); + } +} \ No newline at end of file diff --git a/GameServer/Server/Packet/Send/GridFight/PacketGridFightDataScNotify.cs b/GameServer/Server/Packet/Send/GridFight/PacketGridFightDataScNotify.cs new file mode 100644 index 00000000..13381b79 --- /dev/null +++ b/GameServer/Server/Packet/Send/GridFight/PacketGridFightDataScNotify.cs @@ -0,0 +1,23 @@ +using EggLink.DanhengServer.GameServer.Game.GridFight.Sync; +using EggLink.DanhengServer.Kcp; +using EggLink.DanhengServer.Proto; + +namespace EggLink.DanhengServer.GameServer.Server.Packet.Send.GridFight; + +public class PacketGridFightDataScNotify : BasePacket +{ + public PacketGridFightDataScNotify(GridFightSrc src, List data) : base(CmdIds.GridFightDataScNotify) + { + var proto = new GridFightDataScNotify + { + GridUpdateSrc = src, + UpdateDynamicList = { data.Select(x => x.ToProto()) } + }; + + SetData(proto); + } + + public PacketGridFightDataScNotify(GridFightSrc src, params BaseGridFightSyncData[] data) : this(src, data.ToList()) + { + } +} \ No newline at end of file diff --git a/GameServer/Server/Packet/Send/GridFight/PacketGridFightEndBattleStageNotify.cs b/GameServer/Server/Packet/Send/GridFight/PacketGridFightEndBattleStageNotify.cs new file mode 100644 index 00000000..aa6f2046 --- /dev/null +++ b/GameServer/Server/Packet/Send/GridFight/PacketGridFightEndBattleStageNotify.cs @@ -0,0 +1,30 @@ +using EggLink.DanhengServer.GameServer.Game.GridFight; +using EggLink.DanhengServer.GameServer.Game.GridFight.Component; +using EggLink.DanhengServer.Kcp; +using EggLink.DanhengServer.Proto; + +namespace EggLink.DanhengServer.GameServer.Server.Packet.Send.GridFight; + +public class PacketGridFightEndBattleStageNotify : BasePacket +{ + public PacketGridFightEndBattleStageNotify(GridFightInstance inst) : base(CmdIds.GridFightEndBattleStageNotify) + { + var levelComp = inst.GetComponent(); + var curSec = levelComp.CurrentSection; + + var proto = new GridFightEndBattleStageNotify + { + SectionId = curSec.SectionId, + RouteId = curSec.Excel.ID, + ChapterId = curSec.ChapterId, + GridFightDamageSttInfo = new GridFightDamageSttInfo(), + EMLLKALLOPL = new HEHHADKPDOC + { + CGECGAAJLJM = new(), + NMMJMPNGIGD = new() + } + }; + + SetData(proto); + } +} \ No newline at end of file diff --git a/GameServer/Server/Packet/Send/GridFight/PacketGridFightEnterBattleStageScRsp.cs b/GameServer/Server/Packet/Send/GridFight/PacketGridFightEnterBattleStageScRsp.cs new file mode 100644 index 00000000..faac94ae --- /dev/null +++ b/GameServer/Server/Packet/Send/GridFight/PacketGridFightEnterBattleStageScRsp.cs @@ -0,0 +1,22 @@ +using EggLink.DanhengServer.GameServer.Game.Battle; +using EggLink.DanhengServer.Kcp; +using EggLink.DanhengServer.Proto; + +namespace EggLink.DanhengServer.GameServer.Server.Packet.Send.GridFight; + +public class PacketGridFightEnterBattleStageScRsp : BasePacket +{ + public PacketGridFightEnterBattleStageScRsp(Retcode code = Retcode.RetSucc, BattleInstance? inst = null) : base( + CmdIds.GridFightEnterBattleStageScRsp) + { + var proto = new GridFightEnterBattleStageScRsp + { + Retcode = (uint)code + }; + + if (inst != null) + proto.BattleInfo = inst.ToProto(); + + SetData(proto); + } +} \ No newline at end of file diff --git a/GameServer/Server/Packet/Send/GridFight/PacketGridFightSyncUpdateResultScNotify.cs b/GameServer/Server/Packet/Send/GridFight/PacketGridFightSyncUpdateResultScNotify.cs new file mode 100644 index 00000000..a0e31ebd --- /dev/null +++ b/GameServer/Server/Packet/Send/GridFight/PacketGridFightSyncUpdateResultScNotify.cs @@ -0,0 +1,39 @@ +using EggLink.DanhengServer.GameServer.Game.GridFight.Sync; +using EggLink.DanhengServer.Kcp; +using EggLink.DanhengServer.Proto; +using System.Linq; + +namespace EggLink.DanhengServer.GameServer.Server.Packet.Send.GridFight; + +public class PacketGridFightSyncUpdateResultScNotify : BasePacket +{ + public PacketGridFightSyncUpdateResultScNotify(List data) : base(CmdIds.GridFightSyncUpdateResultScNotify) + { + Dictionary> srcDict = []; + + foreach (var syncData in data) + { + srcDict.TryAdd(syncData.Src, []); + srcDict[syncData.Src].Add(syncData); + } + + var proto = new GridFightSyncUpdateResultScNotify + { + SyncResultDataList = + { + srcDict.Select(x => new GridFightSyncResultData + { + GridUpdateSrc = x.Key, + UpdateDynamicList = { x.Value.Select(j => j.ToProto()) }, + ONMDGNHMABO = { (uint)x.Value.Count } + }) + } + }; + + SetData(proto); + } + + public PacketGridFightSyncUpdateResultScNotify( params BaseGridFightSyncData[] data) : this(data.ToList()) + { + } +} \ No newline at end of file diff --git a/GameServer/Server/Packet/Send/GridFight/PacketGridFightUpdatePosScRsp.cs b/GameServer/Server/Packet/Send/GridFight/PacketGridFightUpdatePosScRsp.cs new file mode 100644 index 00000000..f956bb5b --- /dev/null +++ b/GameServer/Server/Packet/Send/GridFight/PacketGridFightUpdatePosScRsp.cs @@ -0,0 +1,19 @@ +using EggLink.DanhengServer.Kcp; +using EggLink.DanhengServer.Proto; +using Google.Protobuf.Collections; + +namespace EggLink.DanhengServer.GameServer.Server.Packet.Send.GridFight; + +public class PacketGridFightUpdatePosScRsp : BasePacket +{ + public PacketGridFightUpdatePosScRsp(Retcode code, RepeatedField list) : base(CmdIds.GridFightUpdatePosScRsp) + { + var proto = new GridFightUpdatePosScRsp + { + Retcode = (uint)code, + GridFightPosInfoList = { list } + }; + + SetData(proto); + } +} \ No newline at end of file diff --git a/ServerSideProto/ChallengeData.cs b/ServerSideProto/ChallengeData.cs index ee68f9a9..c686f7a6 100644 --- a/ServerSideProto/ChallengeData.cs +++ b/ServerSideProto/ChallengeData.cs @@ -55,10 +55,12 @@ namespace EggLink.DanhengServer.Proto.ServerSide { "Q2hhbGxlbmdlTWVtb3J5RGF0YVBiSAASJgoFc3RvcnkYAiABKAsyFS5DaGFs", "bGVuZ2VTdG9yeURhdGFQYkgAEiQKBGJvc3MYAyABKAsyFC5DaGFsbGVuZ2VC", "b3NzRGF0YVBiSAASJAoEcGVhaxgEIAEoCzIULkNoYWxsZW5nZVBlYWtEYXRh", - "UGJIAEIQCg5jaGFsbGVuZ2VfdHlwZSpRChVDaGFsbGVuZ2VMaW5ldXBUeXBl", - "UGISCAoETm9uZRAAEg4KCkNoYWxsZW5nZTEQARIOCgpDaGFsbGVuZ2UyEAMS", - "DgoKQ2hhbGxlbmdlMxAEQimqAiZFZ2dMaW5rLkRhbmhlbmdTZXJ2ZXIuUHJv", - "dG8uU2VydmVyU2lkZWIGcHJvdG8z")); + "UGJIAEIQCg5jaGFsbGVuZ2VfdHlwZSqpAQoVQ2hhbGxlbmdlTGluZXVwVHlw", + "ZVBiEh4KGkNoYWxsZW5nZUxpbmV1cFR5cGVQYl9Ob25lEAASJAogQ2hhbGxl", + "bmdlTGluZXVwVHlwZVBiX0NoYWxsZW5nZTEQARIkCiBDaGFsbGVuZ2VMaW5l", + "dXBUeXBlUGJfQ2hhbGxlbmdlMhADEiQKIENoYWxsZW5nZUxpbmV1cFR5cGVQ", + "Yl9DaGFsbGVuZ2UzEARCKaoCJkVnZ0xpbmsuRGFuaGVuZ1NlcnZlci5Qcm90", + "by5TZXJ2ZXJTaWRlYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::EggLink.DanhengServer.Proto.ServerSide.ChallengeLineupTypePb), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -75,10 +77,10 @@ namespace EggLink.DanhengServer.Proto.ServerSide { } #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, + [pbr::OriginalName("ChallengeLineupTypePb_None")] None = 0, + [pbr::OriginalName("ChallengeLineupTypePb_Challenge1")] Challenge1 = 1, + [pbr::OriginalName("ChallengeLineupTypePb_Challenge2")] Challenge2 = 3, + [pbr::OriginalName("ChallengeLineupTypePb_Challenge3")] Challenge3 = 4, } #endregion diff --git a/ServerSideProto/GridFightData.cs b/ServerSideProto/GridFightData.cs new file mode 100644 index 00000000..b24624ea --- /dev/null +++ b/ServerSideProto/GridFightData.cs @@ -0,0 +1,2415 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: GridFightData.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 GridFightData.proto + public static partial class GridFightDataReflection { + + #region Descriptor + /// File descriptor for GridFightData.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static GridFightDataReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChNHcmlkRmlnaHREYXRhLnByb3RvIjcKF0dyaWRGaWdodFNob3BSb2xlSXRl", + "bVBiEg4KBlJvbGVJZBgBIAEoDRIMCgRUaWVyGAIgASgNIl8KE0dyaWRGaWdo", + "dFNob3BJdGVtUGISLAoIUm9sZUl0ZW0YASABKAsyGC5HcmlkRmlnaHRTaG9w", + "Um9sZUl0ZW1QYkgAEg4KBlJhcml0eRgCIAEoDUIKCghJdGVtVHlwZSKBAQoT", + "R3JpZEZpZ2h0U2hvcEluZm9QYhISCgpTaG9wTG9ja2VkGAEgASgIEhgKEEZy", + "ZWVSZWZyZXNoQ291bnQYAiABKA0SEwoLUmVmcmVzaENvc3QYAyABKA0SJwoJ", + "U2hvcEl0ZW1zGAQgAygLMhQuR3JpZEZpZ2h0U2hvcEl0ZW1QYiKKAQoTR3Jp", + "ZEZpZ2h0R2FtZUluZm9QYhIQCghVbmlxdWVJZBgBIAEoDRISCgpEaXZpc2lv", + "bklkGAIgASgNEhIKCklzT3ZlckxvY2sYAyABKAgSDgoGU2Vhc29uGAQgASgN", + "EikKCkNvbXBvbmVudHMYBSADKAsyFS5HcmlkRmlnaHRDb21wb25lbnRQYiKQ", + "AQoUR3JpZEZpZ2h0QmFzaWNJbmZvUGISDwoHQ3VyR29sZBgBIAEoDRIQCghD", + "dXJMZXZlbBgCIAEoDRIQCghMZXZlbEV4cBgDIAEoDRIUCgxCdXlMZXZlbENv", + "c3QYBCABKA0SDQoFQ3VySHAYBSABKA0SHgoWQ3VyT25Hcm91bmRBdmF0YXJD", + "b3VudBgGIAEoDSJSChNHcmlkRmlnaHRSb2xlSW5mb1BiEg4KBlJvbGVJZBgB", + "IAEoDRIMCgRUaWVyGAIgASgNEgsKA1BvcxgDIAEoDRIQCghVbmlxdWVJZBgE", + "IAEoDSJRChVHcmlkRmlnaHRBdmF0YXJJbmZvUGISIwoFUm9sZXMYASADKAsy", + "FC5HcmlkRmlnaHRSb2xlSW5mb1BiEhMKC0N1clVuaXF1ZUlkGAIgASgNIqsB", + "ChRHcmlkRmlnaHRDb21wb25lbnRQYhIoCghTaG9wSW5mbxgBIAEoCzIULkdy", + "aWRGaWdodFNob3BJbmZvUGJIABIqCglCYXNpY0luZm8YAiABKAsyFS5Hcmlk", + "RmlnaHRCYXNpY0luZm9QYkgAEiwKCkF2YXRhckluZm8YAyABKAsyFi5Hcmlk", + "RmlnaHRBdmF0YXJJbmZvUGJIAEIPCg1Db21wb25lbnRUeXBlQimqAiZFZ2dM", + "aW5rLkRhbmhlbmdTZXJ2ZXIuUHJvdG8uU2VydmVyU2lkZWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::EggLink.DanhengServer.Proto.ServerSide.GridFightShopRoleItemPb), global::EggLink.DanhengServer.Proto.ServerSide.GridFightShopRoleItemPb.Parser, new[]{ "RoleId", "Tier" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EggLink.DanhengServer.Proto.ServerSide.GridFightShopItemPb), global::EggLink.DanhengServer.Proto.ServerSide.GridFightShopItemPb.Parser, new[]{ "RoleItem", "Rarity" }, new[]{ "ItemType" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EggLink.DanhengServer.Proto.ServerSide.GridFightShopInfoPb), global::EggLink.DanhengServer.Proto.ServerSide.GridFightShopInfoPb.Parser, new[]{ "ShopLocked", "FreeRefreshCount", "RefreshCost", "ShopItems" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EggLink.DanhengServer.Proto.ServerSide.GridFightGameInfoPb), global::EggLink.DanhengServer.Proto.ServerSide.GridFightGameInfoPb.Parser, new[]{ "UniqueId", "DivisionId", "IsOverLock", "Season", "Components" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EggLink.DanhengServer.Proto.ServerSide.GridFightBasicInfoPb), global::EggLink.DanhengServer.Proto.ServerSide.GridFightBasicInfoPb.Parser, new[]{ "CurGold", "CurLevel", "LevelExp", "BuyLevelCost", "CurHp", "CurOnGroundAvatarCount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EggLink.DanhengServer.Proto.ServerSide.GridFightRoleInfoPb), global::EggLink.DanhengServer.Proto.ServerSide.GridFightRoleInfoPb.Parser, new[]{ "RoleId", "Tier", "Pos", "UniqueId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EggLink.DanhengServer.Proto.ServerSide.GridFightAvatarInfoPb), global::EggLink.DanhengServer.Proto.ServerSide.GridFightAvatarInfoPb.Parser, new[]{ "Roles", "CurUniqueId" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::EggLink.DanhengServer.Proto.ServerSide.GridFightComponentPb), global::EggLink.DanhengServer.Proto.ServerSide.GridFightComponentPb.Parser, new[]{ "ShopInfo", "BasicInfo", "AvatarInfo" }, new[]{ "ComponentType" }, null, null, null) + })); + } + #endregion + + } + #region Messages + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class GridFightShopRoleItemPb : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GridFightShopRoleItemPb()); + 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.GridFightDataReflection.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 GridFightShopRoleItemPb() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GridFightShopRoleItemPb(GridFightShopRoleItemPb other) : this() { + roleId_ = other.roleId_; + tier_ = other.tier_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GridFightShopRoleItemPb Clone() { + return new GridFightShopRoleItemPb(this); + } + + /// Field number for the "RoleId" field. + public const int RoleIdFieldNumber = 1; + private uint roleId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint RoleId { + get { return roleId_; } + set { + roleId_ = value; + } + } + + /// Field number for the "Tier" field. + public const int TierFieldNumber = 2; + private uint tier_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint Tier { + get { return tier_; } + set { + tier_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GridFightShopRoleItemPb); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GridFightShopRoleItemPb other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (RoleId != other.RoleId) return false; + if (Tier != other.Tier) 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 (RoleId != 0) hash ^= RoleId.GetHashCode(); + if (Tier != 0) hash ^= Tier.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 (RoleId != 0) { + output.WriteRawTag(8); + output.WriteUInt32(RoleId); + } + if (Tier != 0) { + output.WriteRawTag(16); + output.WriteUInt32(Tier); + } + 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 (RoleId != 0) { + output.WriteRawTag(8); + output.WriteUInt32(RoleId); + } + if (Tier != 0) { + output.WriteRawTag(16); + output.WriteUInt32(Tier); + } + 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 (RoleId != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(RoleId); + } + if (Tier != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Tier); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GridFightShopRoleItemPb other) { + if (other == null) { + return; + } + if (other.RoleId != 0) { + RoleId = other.RoleId; + } + if (other.Tier != 0) { + Tier = other.Tier; + } + _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: { + RoleId = input.ReadUInt32(); + break; + } + case 16: { + Tier = 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: { + RoleId = input.ReadUInt32(); + break; + } + case 16: { + Tier = input.ReadUInt32(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class GridFightShopItemPb : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GridFightShopItemPb()); + 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.GridFightDataReflection.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 GridFightShopItemPb() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GridFightShopItemPb(GridFightShopItemPb other) : this() { + rarity_ = other.rarity_; + switch (other.ItemTypeCase) { + case ItemTypeOneofCase.RoleItem: + RoleItem = other.RoleItem.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GridFightShopItemPb Clone() { + return new GridFightShopItemPb(this); + } + + /// Field number for the "RoleItem" field. + public const int RoleItemFieldNumber = 1; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::EggLink.DanhengServer.Proto.ServerSide.GridFightShopRoleItemPb RoleItem { + get { return itemTypeCase_ == ItemTypeOneofCase.RoleItem ? (global::EggLink.DanhengServer.Proto.ServerSide.GridFightShopRoleItemPb) itemType_ : null; } + set { + itemType_ = value; + itemTypeCase_ = value == null ? ItemTypeOneofCase.None : ItemTypeOneofCase.RoleItem; + } + } + + /// Field number for the "Rarity" field. + public const int RarityFieldNumber = 2; + private uint rarity_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint Rarity { + get { return rarity_; } + set { + rarity_ = value; + } + } + + private object itemType_; + /// Enum of possible cases for the "ItemType" oneof. + public enum ItemTypeOneofCase { + None = 0, + RoleItem = 1, + } + private ItemTypeOneofCase itemTypeCase_ = ItemTypeOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ItemTypeOneofCase ItemTypeCase { + get { return itemTypeCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearItemType() { + itemTypeCase_ = ItemTypeOneofCase.None; + itemType_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GridFightShopItemPb); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GridFightShopItemPb other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(RoleItem, other.RoleItem)) return false; + if (Rarity != other.Rarity) return false; + if (ItemTypeCase != other.ItemTypeCase) 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 (itemTypeCase_ == ItemTypeOneofCase.RoleItem) hash ^= RoleItem.GetHashCode(); + if (Rarity != 0) hash ^= Rarity.GetHashCode(); + hash ^= (int) itemTypeCase_; + 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 (itemTypeCase_ == ItemTypeOneofCase.RoleItem) { + output.WriteRawTag(10); + output.WriteMessage(RoleItem); + } + if (Rarity != 0) { + output.WriteRawTag(16); + output.WriteUInt32(Rarity); + } + 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 (itemTypeCase_ == ItemTypeOneofCase.RoleItem) { + output.WriteRawTag(10); + output.WriteMessage(RoleItem); + } + if (Rarity != 0) { + output.WriteRawTag(16); + output.WriteUInt32(Rarity); + } + 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 (itemTypeCase_ == ItemTypeOneofCase.RoleItem) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(RoleItem); + } + if (Rarity != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Rarity); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GridFightShopItemPb other) { + if (other == null) { + return; + } + if (other.Rarity != 0) { + Rarity = other.Rarity; + } + switch (other.ItemTypeCase) { + case ItemTypeOneofCase.RoleItem: + if (RoleItem == null) { + RoleItem = new global::EggLink.DanhengServer.Proto.ServerSide.GridFightShopRoleItemPb(); + } + RoleItem.MergeFrom(other.RoleItem); + 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.GridFightShopRoleItemPb subBuilder = new global::EggLink.DanhengServer.Proto.ServerSide.GridFightShopRoleItemPb(); + if (itemTypeCase_ == ItemTypeOneofCase.RoleItem) { + subBuilder.MergeFrom(RoleItem); + } + input.ReadMessage(subBuilder); + RoleItem = subBuilder; + break; + } + case 16: { + Rarity = 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 10: { + global::EggLink.DanhengServer.Proto.ServerSide.GridFightShopRoleItemPb subBuilder = new global::EggLink.DanhengServer.Proto.ServerSide.GridFightShopRoleItemPb(); + if (itemTypeCase_ == ItemTypeOneofCase.RoleItem) { + subBuilder.MergeFrom(RoleItem); + } + input.ReadMessage(subBuilder); + RoleItem = subBuilder; + break; + } + case 16: { + Rarity = input.ReadUInt32(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class GridFightShopInfoPb : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GridFightShopInfoPb()); + 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.GridFightDataReflection.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 GridFightShopInfoPb() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GridFightShopInfoPb(GridFightShopInfoPb other) : this() { + shopLocked_ = other.shopLocked_; + freeRefreshCount_ = other.freeRefreshCount_; + refreshCost_ = other.refreshCost_; + shopItems_ = other.shopItems_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GridFightShopInfoPb Clone() { + return new GridFightShopInfoPb(this); + } + + /// Field number for the "ShopLocked" field. + public const int ShopLockedFieldNumber = 1; + private bool shopLocked_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool ShopLocked { + get { return shopLocked_; } + set { + shopLocked_ = value; + } + } + + /// Field number for the "FreeRefreshCount" field. + public const int FreeRefreshCountFieldNumber = 2; + private uint freeRefreshCount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint FreeRefreshCount { + get { return freeRefreshCount_; } + set { + freeRefreshCount_ = value; + } + } + + /// Field number for the "RefreshCost" field. + public const int RefreshCostFieldNumber = 3; + private uint refreshCost_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint RefreshCost { + get { return refreshCost_; } + set { + refreshCost_ = value; + } + } + + /// Field number for the "ShopItems" field. + public const int ShopItemsFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_shopItems_codec + = pb::FieldCodec.ForMessage(34, global::EggLink.DanhengServer.Proto.ServerSide.GridFightShopItemPb.Parser); + private readonly pbc::RepeatedField shopItems_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ShopItems { + get { return shopItems_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GridFightShopInfoPb); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GridFightShopInfoPb other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ShopLocked != other.ShopLocked) return false; + if (FreeRefreshCount != other.FreeRefreshCount) return false; + if (RefreshCost != other.RefreshCost) return false; + if(!shopItems_.Equals(other.shopItems_)) 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 (ShopLocked != false) hash ^= ShopLocked.GetHashCode(); + if (FreeRefreshCount != 0) hash ^= FreeRefreshCount.GetHashCode(); + if (RefreshCost != 0) hash ^= RefreshCost.GetHashCode(); + hash ^= shopItems_.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 (ShopLocked != false) { + output.WriteRawTag(8); + output.WriteBool(ShopLocked); + } + if (FreeRefreshCount != 0) { + output.WriteRawTag(16); + output.WriteUInt32(FreeRefreshCount); + } + if (RefreshCost != 0) { + output.WriteRawTag(24); + output.WriteUInt32(RefreshCost); + } + shopItems_.WriteTo(output, _repeated_shopItems_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 (ShopLocked != false) { + output.WriteRawTag(8); + output.WriteBool(ShopLocked); + } + if (FreeRefreshCount != 0) { + output.WriteRawTag(16); + output.WriteUInt32(FreeRefreshCount); + } + if (RefreshCost != 0) { + output.WriteRawTag(24); + output.WriteUInt32(RefreshCost); + } + shopItems_.WriteTo(ref output, _repeated_shopItems_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 (ShopLocked != false) { + size += 1 + 1; + } + if (FreeRefreshCount != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(FreeRefreshCount); + } + if (RefreshCost != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(RefreshCost); + } + size += shopItems_.CalculateSize(_repeated_shopItems_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GridFightShopInfoPb other) { + if (other == null) { + return; + } + if (other.ShopLocked != false) { + ShopLocked = other.ShopLocked; + } + if (other.FreeRefreshCount != 0) { + FreeRefreshCount = other.FreeRefreshCount; + } + if (other.RefreshCost != 0) { + RefreshCost = other.RefreshCost; + } + shopItems_.Add(other.shopItems_); + _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: { + ShopLocked = input.ReadBool(); + break; + } + case 16: { + FreeRefreshCount = input.ReadUInt32(); + break; + } + case 24: { + RefreshCost = input.ReadUInt32(); + break; + } + case 34: { + shopItems_.AddEntriesFrom(input, _repeated_shopItems_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: { + ShopLocked = input.ReadBool(); + break; + } + case 16: { + FreeRefreshCount = input.ReadUInt32(); + break; + } + case 24: { + RefreshCost = input.ReadUInt32(); + break; + } + case 34: { + shopItems_.AddEntriesFrom(ref input, _repeated_shopItems_codec); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class GridFightGameInfoPb : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GridFightGameInfoPb()); + 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.GridFightDataReflection.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 GridFightGameInfoPb() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GridFightGameInfoPb(GridFightGameInfoPb other) : this() { + uniqueId_ = other.uniqueId_; + divisionId_ = other.divisionId_; + isOverLock_ = other.isOverLock_; + season_ = other.season_; + components_ = other.components_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GridFightGameInfoPb Clone() { + return new GridFightGameInfoPb(this); + } + + /// Field number for the "UniqueId" field. + public const int UniqueIdFieldNumber = 1; + private uint uniqueId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint UniqueId { + get { return uniqueId_; } + set { + uniqueId_ = value; + } + } + + /// Field number for the "DivisionId" field. + public const int DivisionIdFieldNumber = 2; + private uint divisionId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint DivisionId { + get { return divisionId_; } + set { + divisionId_ = value; + } + } + + /// Field number for the "IsOverLock" field. + public const int IsOverLockFieldNumber = 3; + private bool isOverLock_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool IsOverLock { + get { return isOverLock_; } + set { + isOverLock_ = value; + } + } + + /// Field number for the "Season" field. + public const int SeasonFieldNumber = 4; + private uint season_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint Season { + get { return season_; } + set { + season_ = value; + } + } + + /// Field number for the "Components" field. + public const int ComponentsFieldNumber = 5; + private static readonly pb::FieldCodec _repeated_components_codec + = pb::FieldCodec.ForMessage(42, global::EggLink.DanhengServer.Proto.ServerSide.GridFightComponentPb.Parser); + private readonly pbc::RepeatedField components_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Components { + get { return components_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GridFightGameInfoPb); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GridFightGameInfoPb other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (UniqueId != other.UniqueId) return false; + if (DivisionId != other.DivisionId) return false; + if (IsOverLock != other.IsOverLock) return false; + if (Season != other.Season) return false; + if(!components_.Equals(other.components_)) 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 (UniqueId != 0) hash ^= UniqueId.GetHashCode(); + if (DivisionId != 0) hash ^= DivisionId.GetHashCode(); + if (IsOverLock != false) hash ^= IsOverLock.GetHashCode(); + if (Season != 0) hash ^= Season.GetHashCode(); + hash ^= components_.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 (UniqueId != 0) { + output.WriteRawTag(8); + output.WriteUInt32(UniqueId); + } + if (DivisionId != 0) { + output.WriteRawTag(16); + output.WriteUInt32(DivisionId); + } + if (IsOverLock != false) { + output.WriteRawTag(24); + output.WriteBool(IsOverLock); + } + if (Season != 0) { + output.WriteRawTag(32); + output.WriteUInt32(Season); + } + components_.WriteTo(output, _repeated_components_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 (UniqueId != 0) { + output.WriteRawTag(8); + output.WriteUInt32(UniqueId); + } + if (DivisionId != 0) { + output.WriteRawTag(16); + output.WriteUInt32(DivisionId); + } + if (IsOverLock != false) { + output.WriteRawTag(24); + output.WriteBool(IsOverLock); + } + if (Season != 0) { + output.WriteRawTag(32); + output.WriteUInt32(Season); + } + components_.WriteTo(ref output, _repeated_components_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 (UniqueId != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(UniqueId); + } + if (DivisionId != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(DivisionId); + } + if (IsOverLock != false) { + size += 1 + 1; + } + if (Season != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Season); + } + size += components_.CalculateSize(_repeated_components_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GridFightGameInfoPb other) { + if (other == null) { + return; + } + if (other.UniqueId != 0) { + UniqueId = other.UniqueId; + } + if (other.DivisionId != 0) { + DivisionId = other.DivisionId; + } + if (other.IsOverLock != false) { + IsOverLock = other.IsOverLock; + } + if (other.Season != 0) { + Season = other.Season; + } + components_.Add(other.components_); + _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: { + UniqueId = input.ReadUInt32(); + break; + } + case 16: { + DivisionId = input.ReadUInt32(); + break; + } + case 24: { + IsOverLock = input.ReadBool(); + break; + } + case 32: { + Season = input.ReadUInt32(); + break; + } + case 42: { + components_.AddEntriesFrom(input, _repeated_components_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: { + UniqueId = input.ReadUInt32(); + break; + } + case 16: { + DivisionId = input.ReadUInt32(); + break; + } + case 24: { + IsOverLock = input.ReadBool(); + break; + } + case 32: { + Season = input.ReadUInt32(); + break; + } + case 42: { + components_.AddEntriesFrom(ref input, _repeated_components_codec); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class GridFightBasicInfoPb : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GridFightBasicInfoPb()); + 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.GridFightDataReflection.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 GridFightBasicInfoPb() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GridFightBasicInfoPb(GridFightBasicInfoPb other) : this() { + curGold_ = other.curGold_; + curLevel_ = other.curLevel_; + levelExp_ = other.levelExp_; + buyLevelCost_ = other.buyLevelCost_; + curHp_ = other.curHp_; + curOnGroundAvatarCount_ = other.curOnGroundAvatarCount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GridFightBasicInfoPb Clone() { + return new GridFightBasicInfoPb(this); + } + + /// Field number for the "CurGold" field. + public const int CurGoldFieldNumber = 1; + private uint curGold_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint CurGold { + get { return curGold_; } + set { + curGold_ = value; + } + } + + /// Field number for the "CurLevel" field. + public const int CurLevelFieldNumber = 2; + private uint curLevel_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint CurLevel { + get { return curLevel_; } + set { + curLevel_ = value; + } + } + + /// Field number for the "LevelExp" field. + public const int LevelExpFieldNumber = 3; + private uint levelExp_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint LevelExp { + get { return levelExp_; } + set { + levelExp_ = value; + } + } + + /// Field number for the "BuyLevelCost" field. + public const int BuyLevelCostFieldNumber = 4; + private uint buyLevelCost_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint BuyLevelCost { + get { return buyLevelCost_; } + set { + buyLevelCost_ = value; + } + } + + /// Field number for the "CurHp" field. + public const int CurHpFieldNumber = 5; + private uint curHp_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint CurHp { + get { return curHp_; } + set { + curHp_ = value; + } + } + + /// Field number for the "CurOnGroundAvatarCount" field. + public const int CurOnGroundAvatarCountFieldNumber = 6; + private uint curOnGroundAvatarCount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint CurOnGroundAvatarCount { + get { return curOnGroundAvatarCount_; } + set { + curOnGroundAvatarCount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GridFightBasicInfoPb); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GridFightBasicInfoPb other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (CurGold != other.CurGold) return false; + if (CurLevel != other.CurLevel) return false; + if (LevelExp != other.LevelExp) return false; + if (BuyLevelCost != other.BuyLevelCost) return false; + if (CurHp != other.CurHp) return false; + if (CurOnGroundAvatarCount != other.CurOnGroundAvatarCount) 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 (CurGold != 0) hash ^= CurGold.GetHashCode(); + if (CurLevel != 0) hash ^= CurLevel.GetHashCode(); + if (LevelExp != 0) hash ^= LevelExp.GetHashCode(); + if (BuyLevelCost != 0) hash ^= BuyLevelCost.GetHashCode(); + if (CurHp != 0) hash ^= CurHp.GetHashCode(); + if (CurOnGroundAvatarCount != 0) hash ^= CurOnGroundAvatarCount.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 (CurGold != 0) { + output.WriteRawTag(8); + output.WriteUInt32(CurGold); + } + if (CurLevel != 0) { + output.WriteRawTag(16); + output.WriteUInt32(CurLevel); + } + if (LevelExp != 0) { + output.WriteRawTag(24); + output.WriteUInt32(LevelExp); + } + if (BuyLevelCost != 0) { + output.WriteRawTag(32); + output.WriteUInt32(BuyLevelCost); + } + if (CurHp != 0) { + output.WriteRawTag(40); + output.WriteUInt32(CurHp); + } + if (CurOnGroundAvatarCount != 0) { + output.WriteRawTag(48); + output.WriteUInt32(CurOnGroundAvatarCount); + } + 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 (CurGold != 0) { + output.WriteRawTag(8); + output.WriteUInt32(CurGold); + } + if (CurLevel != 0) { + output.WriteRawTag(16); + output.WriteUInt32(CurLevel); + } + if (LevelExp != 0) { + output.WriteRawTag(24); + output.WriteUInt32(LevelExp); + } + if (BuyLevelCost != 0) { + output.WriteRawTag(32); + output.WriteUInt32(BuyLevelCost); + } + if (CurHp != 0) { + output.WriteRawTag(40); + output.WriteUInt32(CurHp); + } + if (CurOnGroundAvatarCount != 0) { + output.WriteRawTag(48); + output.WriteUInt32(CurOnGroundAvatarCount); + } + 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 (CurGold != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(CurGold); + } + if (CurLevel != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(CurLevel); + } + if (LevelExp != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(LevelExp); + } + if (BuyLevelCost != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(BuyLevelCost); + } + if (CurHp != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(CurHp); + } + if (CurOnGroundAvatarCount != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(CurOnGroundAvatarCount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GridFightBasicInfoPb other) { + if (other == null) { + return; + } + if (other.CurGold != 0) { + CurGold = other.CurGold; + } + if (other.CurLevel != 0) { + CurLevel = other.CurLevel; + } + if (other.LevelExp != 0) { + LevelExp = other.LevelExp; + } + if (other.BuyLevelCost != 0) { + BuyLevelCost = other.BuyLevelCost; + } + if (other.CurHp != 0) { + CurHp = other.CurHp; + } + if (other.CurOnGroundAvatarCount != 0) { + CurOnGroundAvatarCount = other.CurOnGroundAvatarCount; + } + _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: { + CurGold = input.ReadUInt32(); + break; + } + case 16: { + CurLevel = input.ReadUInt32(); + break; + } + case 24: { + LevelExp = input.ReadUInt32(); + break; + } + case 32: { + BuyLevelCost = input.ReadUInt32(); + break; + } + case 40: { + CurHp = input.ReadUInt32(); + break; + } + case 48: { + CurOnGroundAvatarCount = 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: { + CurGold = input.ReadUInt32(); + break; + } + case 16: { + CurLevel = input.ReadUInt32(); + break; + } + case 24: { + LevelExp = input.ReadUInt32(); + break; + } + case 32: { + BuyLevelCost = input.ReadUInt32(); + break; + } + case 40: { + CurHp = input.ReadUInt32(); + break; + } + case 48: { + CurOnGroundAvatarCount = input.ReadUInt32(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class GridFightRoleInfoPb : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GridFightRoleInfoPb()); + 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.GridFightDataReflection.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 GridFightRoleInfoPb() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GridFightRoleInfoPb(GridFightRoleInfoPb other) : this() { + roleId_ = other.roleId_; + tier_ = other.tier_; + pos_ = other.pos_; + uniqueId_ = other.uniqueId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GridFightRoleInfoPb Clone() { + return new GridFightRoleInfoPb(this); + } + + /// Field number for the "RoleId" field. + public const int RoleIdFieldNumber = 1; + private uint roleId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint RoleId { + get { return roleId_; } + set { + roleId_ = value; + } + } + + /// Field number for the "Tier" field. + public const int TierFieldNumber = 2; + private uint tier_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint Tier { + get { return tier_; } + set { + tier_ = value; + } + } + + /// Field number for the "Pos" field. + public const int PosFieldNumber = 3; + private uint pos_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint Pos { + get { return pos_; } + set { + pos_ = value; + } + } + + /// Field number for the "UniqueId" field. + public const int UniqueIdFieldNumber = 4; + private uint uniqueId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint UniqueId { + get { return uniqueId_; } + set { + uniqueId_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GridFightRoleInfoPb); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GridFightRoleInfoPb other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (RoleId != other.RoleId) return false; + if (Tier != other.Tier) return false; + if (Pos != other.Pos) return false; + if (UniqueId != other.UniqueId) 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 (RoleId != 0) hash ^= RoleId.GetHashCode(); + if (Tier != 0) hash ^= Tier.GetHashCode(); + if (Pos != 0) hash ^= Pos.GetHashCode(); + if (UniqueId != 0) hash ^= UniqueId.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 (RoleId != 0) { + output.WriteRawTag(8); + output.WriteUInt32(RoleId); + } + if (Tier != 0) { + output.WriteRawTag(16); + output.WriteUInt32(Tier); + } + if (Pos != 0) { + output.WriteRawTag(24); + output.WriteUInt32(Pos); + } + if (UniqueId != 0) { + output.WriteRawTag(32); + output.WriteUInt32(UniqueId); + } + 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 (RoleId != 0) { + output.WriteRawTag(8); + output.WriteUInt32(RoleId); + } + if (Tier != 0) { + output.WriteRawTag(16); + output.WriteUInt32(Tier); + } + if (Pos != 0) { + output.WriteRawTag(24); + output.WriteUInt32(Pos); + } + if (UniqueId != 0) { + output.WriteRawTag(32); + output.WriteUInt32(UniqueId); + } + 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 (RoleId != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(RoleId); + } + if (Tier != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Tier); + } + if (Pos != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Pos); + } + if (UniqueId != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(UniqueId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GridFightRoleInfoPb other) { + if (other == null) { + return; + } + if (other.RoleId != 0) { + RoleId = other.RoleId; + } + if (other.Tier != 0) { + Tier = other.Tier; + } + if (other.Pos != 0) { + Pos = other.Pos; + } + if (other.UniqueId != 0) { + UniqueId = other.UniqueId; + } + _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: { + RoleId = input.ReadUInt32(); + break; + } + case 16: { + Tier = input.ReadUInt32(); + break; + } + case 24: { + Pos = input.ReadUInt32(); + break; + } + case 32: { + UniqueId = 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: { + RoleId = input.ReadUInt32(); + break; + } + case 16: { + Tier = input.ReadUInt32(); + break; + } + case 24: { + Pos = input.ReadUInt32(); + break; + } + case 32: { + UniqueId = input.ReadUInt32(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class GridFightAvatarInfoPb : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GridFightAvatarInfoPb()); + 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.GridFightDataReflection.Descriptor.MessageTypes[6]; } + } + + [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 GridFightAvatarInfoPb() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GridFightAvatarInfoPb(GridFightAvatarInfoPb other) : this() { + roles_ = other.roles_.Clone(); + curUniqueId_ = other.curUniqueId_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GridFightAvatarInfoPb Clone() { + return new GridFightAvatarInfoPb(this); + } + + /// Field number for the "Roles" field. + public const int RolesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_roles_codec + = pb::FieldCodec.ForMessage(10, global::EggLink.DanhengServer.Proto.ServerSide.GridFightRoleInfoPb.Parser); + private readonly pbc::RepeatedField roles_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Roles { + get { return roles_; } + } + + /// Field number for the "CurUniqueId" field. + public const int CurUniqueIdFieldNumber = 2; + private uint curUniqueId_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public uint CurUniqueId { + get { return curUniqueId_; } + set { + curUniqueId_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GridFightAvatarInfoPb); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GridFightAvatarInfoPb other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!roles_.Equals(other.roles_)) return false; + if (CurUniqueId != other.CurUniqueId) 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; + hash ^= roles_.GetHashCode(); + if (CurUniqueId != 0) hash ^= CurUniqueId.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 + roles_.WriteTo(output, _repeated_roles_codec); + if (CurUniqueId != 0) { + output.WriteRawTag(16); + output.WriteUInt32(CurUniqueId); + } + 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) { + roles_.WriteTo(ref output, _repeated_roles_codec); + if (CurUniqueId != 0) { + output.WriteRawTag(16); + output.WriteUInt32(CurUniqueId); + } + 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; + size += roles_.CalculateSize(_repeated_roles_codec); + if (CurUniqueId != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(CurUniqueId); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GridFightAvatarInfoPb other) { + if (other == null) { + return; + } + roles_.Add(other.roles_); + if (other.CurUniqueId != 0) { + CurUniqueId = other.CurUniqueId; + } + _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: { + roles_.AddEntriesFrom(input, _repeated_roles_codec); + break; + } + case 16: { + CurUniqueId = 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 10: { + roles_.AddEntriesFrom(ref input, _repeated_roles_codec); + break; + } + case 16: { + CurUniqueId = input.ReadUInt32(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class GridFightComponentPb : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GridFightComponentPb()); + 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.GridFightDataReflection.Descriptor.MessageTypes[7]; } + } + + [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 GridFightComponentPb() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GridFightComponentPb(GridFightComponentPb other) : this() { + switch (other.ComponentTypeCase) { + case ComponentTypeOneofCase.ShopInfo: + ShopInfo = other.ShopInfo.Clone(); + break; + case ComponentTypeOneofCase.BasicInfo: + BasicInfo = other.BasicInfo.Clone(); + break; + case ComponentTypeOneofCase.AvatarInfo: + AvatarInfo = other.AvatarInfo.Clone(); + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public GridFightComponentPb Clone() { + return new GridFightComponentPb(this); + } + + /// Field number for the "ShopInfo" field. + public const int ShopInfoFieldNumber = 1; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::EggLink.DanhengServer.Proto.ServerSide.GridFightShopInfoPb ShopInfo { + get { return componentTypeCase_ == ComponentTypeOneofCase.ShopInfo ? (global::EggLink.DanhengServer.Proto.ServerSide.GridFightShopInfoPb) componentType_ : null; } + set { + componentType_ = value; + componentTypeCase_ = value == null ? ComponentTypeOneofCase.None : ComponentTypeOneofCase.ShopInfo; + } + } + + /// Field number for the "BasicInfo" field. + public const int BasicInfoFieldNumber = 2; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::EggLink.DanhengServer.Proto.ServerSide.GridFightBasicInfoPb BasicInfo { + get { return componentTypeCase_ == ComponentTypeOneofCase.BasicInfo ? (global::EggLink.DanhengServer.Proto.ServerSide.GridFightBasicInfoPb) componentType_ : null; } + set { + componentType_ = value; + componentTypeCase_ = value == null ? ComponentTypeOneofCase.None : ComponentTypeOneofCase.BasicInfo; + } + } + + /// Field number for the "AvatarInfo" field. + public const int AvatarInfoFieldNumber = 3; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::EggLink.DanhengServer.Proto.ServerSide.GridFightAvatarInfoPb AvatarInfo { + get { return componentTypeCase_ == ComponentTypeOneofCase.AvatarInfo ? (global::EggLink.DanhengServer.Proto.ServerSide.GridFightAvatarInfoPb) componentType_ : null; } + set { + componentType_ = value; + componentTypeCase_ = value == null ? ComponentTypeOneofCase.None : ComponentTypeOneofCase.AvatarInfo; + } + } + + private object componentType_; + /// Enum of possible cases for the "ComponentType" oneof. + public enum ComponentTypeOneofCase { + None = 0, + ShopInfo = 1, + BasicInfo = 2, + AvatarInfo = 3, + } + private ComponentTypeOneofCase componentTypeCase_ = ComponentTypeOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ComponentTypeOneofCase ComponentTypeCase { + get { return componentTypeCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearComponentType() { + componentTypeCase_ = ComponentTypeOneofCase.None; + componentType_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as GridFightComponentPb); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(GridFightComponentPb other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(ShopInfo, other.ShopInfo)) return false; + if (!object.Equals(BasicInfo, other.BasicInfo)) return false; + if (!object.Equals(AvatarInfo, other.AvatarInfo)) return false; + if (ComponentTypeCase != other.ComponentTypeCase) 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 (componentTypeCase_ == ComponentTypeOneofCase.ShopInfo) hash ^= ShopInfo.GetHashCode(); + if (componentTypeCase_ == ComponentTypeOneofCase.BasicInfo) hash ^= BasicInfo.GetHashCode(); + if (componentTypeCase_ == ComponentTypeOneofCase.AvatarInfo) hash ^= AvatarInfo.GetHashCode(); + hash ^= (int) componentTypeCase_; + 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 (componentTypeCase_ == ComponentTypeOneofCase.ShopInfo) { + output.WriteRawTag(10); + output.WriteMessage(ShopInfo); + } + if (componentTypeCase_ == ComponentTypeOneofCase.BasicInfo) { + output.WriteRawTag(18); + output.WriteMessage(BasicInfo); + } + if (componentTypeCase_ == ComponentTypeOneofCase.AvatarInfo) { + output.WriteRawTag(26); + output.WriteMessage(AvatarInfo); + } + 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 (componentTypeCase_ == ComponentTypeOneofCase.ShopInfo) { + output.WriteRawTag(10); + output.WriteMessage(ShopInfo); + } + if (componentTypeCase_ == ComponentTypeOneofCase.BasicInfo) { + output.WriteRawTag(18); + output.WriteMessage(BasicInfo); + } + if (componentTypeCase_ == ComponentTypeOneofCase.AvatarInfo) { + output.WriteRawTag(26); + output.WriteMessage(AvatarInfo); + } + 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 (componentTypeCase_ == ComponentTypeOneofCase.ShopInfo) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(ShopInfo); + } + if (componentTypeCase_ == ComponentTypeOneofCase.BasicInfo) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(BasicInfo); + } + if (componentTypeCase_ == ComponentTypeOneofCase.AvatarInfo) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(AvatarInfo); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(GridFightComponentPb other) { + if (other == null) { + return; + } + switch (other.ComponentTypeCase) { + case ComponentTypeOneofCase.ShopInfo: + if (ShopInfo == null) { + ShopInfo = new global::EggLink.DanhengServer.Proto.ServerSide.GridFightShopInfoPb(); + } + ShopInfo.MergeFrom(other.ShopInfo); + break; + case ComponentTypeOneofCase.BasicInfo: + if (BasicInfo == null) { + BasicInfo = new global::EggLink.DanhengServer.Proto.ServerSide.GridFightBasicInfoPb(); + } + BasicInfo.MergeFrom(other.BasicInfo); + break; + case ComponentTypeOneofCase.AvatarInfo: + if (AvatarInfo == null) { + AvatarInfo = new global::EggLink.DanhengServer.Proto.ServerSide.GridFightAvatarInfoPb(); + } + AvatarInfo.MergeFrom(other.AvatarInfo); + 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.GridFightShopInfoPb subBuilder = new global::EggLink.DanhengServer.Proto.ServerSide.GridFightShopInfoPb(); + if (componentTypeCase_ == ComponentTypeOneofCase.ShopInfo) { + subBuilder.MergeFrom(ShopInfo); + } + input.ReadMessage(subBuilder); + ShopInfo = subBuilder; + break; + } + case 18: { + global::EggLink.DanhengServer.Proto.ServerSide.GridFightBasicInfoPb subBuilder = new global::EggLink.DanhengServer.Proto.ServerSide.GridFightBasicInfoPb(); + if (componentTypeCase_ == ComponentTypeOneofCase.BasicInfo) { + subBuilder.MergeFrom(BasicInfo); + } + input.ReadMessage(subBuilder); + BasicInfo = subBuilder; + break; + } + case 26: { + global::EggLink.DanhengServer.Proto.ServerSide.GridFightAvatarInfoPb subBuilder = new global::EggLink.DanhengServer.Proto.ServerSide.GridFightAvatarInfoPb(); + if (componentTypeCase_ == ComponentTypeOneofCase.AvatarInfo) { + subBuilder.MergeFrom(AvatarInfo); + } + input.ReadMessage(subBuilder); + AvatarInfo = 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.GridFightShopInfoPb subBuilder = new global::EggLink.DanhengServer.Proto.ServerSide.GridFightShopInfoPb(); + if (componentTypeCase_ == ComponentTypeOneofCase.ShopInfo) { + subBuilder.MergeFrom(ShopInfo); + } + input.ReadMessage(subBuilder); + ShopInfo = subBuilder; + break; + } + case 18: { + global::EggLink.DanhengServer.Proto.ServerSide.GridFightBasicInfoPb subBuilder = new global::EggLink.DanhengServer.Proto.ServerSide.GridFightBasicInfoPb(); + if (componentTypeCase_ == ComponentTypeOneofCase.BasicInfo) { + subBuilder.MergeFrom(BasicInfo); + } + input.ReadMessage(subBuilder); + BasicInfo = subBuilder; + break; + } + case 26: { + global::EggLink.DanhengServer.Proto.ServerSide.GridFightAvatarInfoPb subBuilder = new global::EggLink.DanhengServer.Proto.ServerSide.GridFightAvatarInfoPb(); + if (componentTypeCase_ == ComponentTypeOneofCase.AvatarInfo) { + subBuilder.MergeFrom(AvatarInfo); + } + input.ReadMessage(subBuilder); + AvatarInfo = subBuilder; + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/ServerSideProto/ProtoFile/ChallengeData.proto b/ServerSideProto/ProtoFile/ChallengeData.proto index ca8ba595..80047fe6 100644 --- a/ServerSideProto/ProtoFile/ChallengeData.proto +++ b/ServerSideProto/ProtoFile/ChallengeData.proto @@ -3,10 +3,10 @@ syntax = "proto3"; option csharp_namespace = "EggLink.DanhengServer.Proto.ServerSide"; enum ChallengeLineupTypePb { - None = 0; - Challenge1 = 1; - Challenge2 = 3; - Challenge3 = 4; + ChallengeLineupTypePb_None = 0; + ChallengeLineupTypePb_Challenge1 = 1; + ChallengeLineupTypePb_Challenge2 = 3; + ChallengeLineupTypePb_Challenge3 = 4; } message Vector3Pb { diff --git a/ServerSideProto/ProtoFile/GridFightData.proto b/ServerSideProto/ProtoFile/GridFightData.proto new file mode 100644 index 00000000..626bebc7 --- /dev/null +++ b/ServerSideProto/ProtoFile/GridFightData.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; + +option csharp_namespace = "EggLink.DanhengServer.Proto.ServerSide"; + +message GridFightShopRoleItemPb { + uint32 RoleId = 1; + uint32 Tier = 2; +} + +message GridFightShopItemPb { + oneof ItemType { + GridFightShopRoleItemPb RoleItem = 1; + } + uint32 Rarity = 2; +} + +message GridFightShopInfoPb { + bool ShopLocked = 1; + uint32 FreeRefreshCount = 2; + uint32 RefreshCost = 3; + repeated GridFightShopItemPb ShopItems = 4; +} + +message GridFightGameInfoPb { + uint32 UniqueId = 1; + uint32 DivisionId = 2; + bool IsOverLock = 3; + uint32 Season = 4; + repeated GridFightComponentPb Components = 5; +} + +message GridFightBasicInfoPb { + uint32 CurGold = 1; + uint32 CurLevel = 2; + uint32 LevelExp = 3; + uint32 BuyLevelCost = 4; + uint32 CurHp = 5; + uint32 CurOnGroundAvatarCount = 6; +} + +message GridFightRoleInfoPb { + uint32 RoleId = 1; + uint32 Tier = 2; + uint32 Pos = 3; + uint32 UniqueId = 4; +} + +message GridFightAvatarInfoPb { + repeated GridFightRoleInfoPb Roles = 1; + uint32 CurUniqueId = 2; +} + +message GridFightComponentPb { + oneof ComponentType { + GridFightShopInfoPb ShopInfo = 1; + GridFightBasicInfoPb BasicInfo = 2; + GridFightAvatarInfoPb AvatarInfo = 3; + } +} \ No newline at end of file diff --git a/ServerSideProto/ServerSideProto.sln b/ServerSideProto/ServerSideProto.sln new file mode 100644 index 00000000..ff5ca43a --- /dev/null +++ b/ServerSideProto/ServerSideProto.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.2.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServerSideProto", "ServerSideProto.csproj", "{A82F6F83-1D15-A42D-FE70-06D6029F1524}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A82F6F83-1D15-A42D-FE70-06D6029F1524}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A82F6F83-1D15-A42D-FE70-06D6029F1524}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A82F6F83-1D15-A42D-FE70-06D6029F1524}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A82F6F83-1D15-A42D-FE70-06D6029F1524}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {239E7A80-377D-46D8-B82D-54CDFBA24AF1} + EndGlobalSection +EndGlobal