feat: grid fight in-game panel

This commit is contained in:
StopWuyu
2025-10-19 12:47:59 +08:00
parent 0070d71086
commit e1f7da7f9f
28 changed files with 706 additions and 36 deletions

View File

@@ -45,6 +45,27 @@ public class CommandUnlockAll : ICommand
arg.Target!.Stop();
}
[CommandMethod("0 quest")]
public async ValueTask UnlockAllQuests(CommandArg arg)
{
if (arg.Target == null)
{
await arg.SendMsg(I18NManager.Translate("Game.Command.Notice.PlayerNotFound"));
return;
}
var player = arg.Target!.Player!;
var questManager = player.QuestManager!;
foreach (var quest in GameData.QuestDataData.Values)
await questManager.FinishQuest(quest.QuestID, false);
await questManager.SyncQuest();
await arg.SendMsg(I18NManager.Translate("Game.Command.UnlockAll.UnlockedAll",
I18NManager.Translate("Word.Quest")));
}
[CommandMethod("0 tutorial")]
public async ValueTask UnlockAllTutorial(CommandArg arg)
{

View File

@@ -0,0 +1,23 @@
using EggLink.DanhengServer.Enums.GridFight;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace EggLink.DanhengServer.Data.Excel;
[ResourceEntity("GridFightAugment.json")]
public class GridFightAugmentExcel : ExcelResource
{
public uint ID { get; set; }
public uint CategoryID { get; set; }
[JsonConverter(typeof(StringEnumConverter))] public GridFightAugmentQualityEnum Quality { get; set; }
public override int GetId()
{
return (int)ID;
}
public override void Loaded()
{
GameData.GridFightAugmentData.TryAdd(ID, this);
}
}

View File

@@ -0,0 +1,38 @@
using Newtonsoft.Json;
namespace EggLink.DanhengServer.Data.Excel;
[ResourceEntity("GridFightCamp.json")]
public class GridFightCampExcel : ExcelResource
{
public uint ID { get; set; }
public uint SeasonID { get; set; }
public uint BossBattleArea { get; set; }
public uint IfRandomEnabled { get; set; }
public uint InitialRandomCode { get; set; }
public List<uint> BattleAreaList { get; set; } = [];
public List<uint> MonsterList { get; set; } = [];
[JsonIgnore] public List<GridFightMonsterExcel> Monsters { get; set; } = [];
public override int GetId()
{
return (int)ID;
}
public override void Loaded()
{
GameData.GridFightCampData.TryAdd(ID, this);
}
public override void AfterAllDone()
{
foreach (var monsterId in MonsterList)
{
if (GameData.GridFightMonsterData.TryGetValue(monsterId, out var monster))
{
Monsters.Add(monster);
}
}
}
}

View File

@@ -0,0 +1,20 @@
namespace EggLink.DanhengServer.Data.Excel;
[ResourceEntity("GridFightDivisionInfo.json")]
public class GridFightDivisionInfoExcel : ExcelResource
{
public uint ID { get; set; }
public uint SeasonID { get; set; }
public uint Progress { get; set; }
public uint DivisionLevel { get; set; }
public override int GetId()
{
return (int)ID;
}
public override void Loaded()
{
GameData.GridFightDivisionInfoData.TryAdd(ID, this);
}
}

View File

@@ -0,0 +1,22 @@
namespace EggLink.DanhengServer.Data.Excel;
[ResourceEntity("GridFightMonster.json")]
public class GridFightMonsterExcel : ExcelResource
{
public uint MonsterID { get; set; }
public uint Star3EliteGroup3 { get; set; }
public uint MonsterTier { get; set; }
public uint Star1EliteGroup3 { get; set; }
public uint Star4EliteGroup3 { get; set; }
public uint Star2EliteGroup3 { get; set; }
public override int GetId()
{
return (int)MonsterID;
}
public override void Loaded()
{
GameData.GridFightMonsterData.TryAdd(MonsterID, this);
}
}

View File

@@ -0,0 +1,18 @@
namespace EggLink.DanhengServer.Data.Excel;
[ResourceEntity("GridFightPortalBuff.json")]
public class GridFightPortalBuffExcel : ExcelResource
{
public uint ID { get; set; }
public bool IfInBook { get; set; }
public override int GetId()
{
return (int)ID;
}
public override void Loaded()
{
GameData.GridFightPortalBuffData.TryAdd(ID, this);
}
}

View File

@@ -0,0 +1,19 @@
namespace EggLink.DanhengServer.Data.Excel;
[ResourceEntity("GridFightSeasonTalent.json")]
public class GridFightSeasonTalentExcel : ExcelResource
{
public uint ID { get; set; }
public uint Cost { get; set; }
public uint SeasonID { get; set; }
public List<uint> PreTalentIDList { get; set; } = [];
public override int GetId()
{
return (int)ID;
}
public override void Loaded()
{
GameData.GridFightSeasonTalentData.TryAdd(ID, this);
}
}

View File

@@ -0,0 +1,30 @@
using EggLink.DanhengServer.Enums.GridFight;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace EggLink.DanhengServer.Data.Excel;
[ResourceEntity("GridFightStageRoute.json")]
public class GridFightStageRouteExcel : ExcelResource
{
public uint SectionID { get; set; }
public uint ChapterID { get; set; }
public uint ID { get; set; }
public uint StageID { get; set; }
public uint NodeTemplateID { get; set; }
public uint BasicGoldRewardNum { get; set; }
[JsonConverter(typeof(StringEnumConverter))]
public GridFightNodeTypeEnum NodeType { get; set; }
public override int GetId()
{
return (int)ID;
}
public override void Loaded()
{
GameData.GridFightStageRouteData.TryAdd(ID, []);
GameData.GridFightStageRouteData[ID][ChapterID << 8 | SectionID] = this;
}
}

View File

@@ -0,0 +1,19 @@
namespace EggLink.DanhengServer.Data.Excel;
[ResourceEntity("GridFightTalent.json")]
public class GridFightTalentExcel : ExcelResource
{
public uint ID { get; set; }
public uint Cost { get; set; }
public List<uint> PreTalentIDList { get; set; } = [];
public override int GetId()
{
return (int)ID;
}
public override void Loaded()
{
GameData.GridFightTalentData.TryAdd(ID, this);
}
}

View File

@@ -7,8 +7,8 @@ namespace EggLink.DanhengServer.Data.Excel;
[ResourceEntity("RogueBuffGroup.json")]
public class RogueBuffGroupExcel : BaseRogueBuffGroupExcel
{
[JsonProperty("IDLBMIHBAPB")] public int GroupID { get; set; }
[JsonProperty("GNGDPDOMDFH")] public List<int> BuffTagList { get; set; } = [];
[JsonProperty("GroupID")] public int GroupID { get; set; }
[JsonProperty("BuffTagList")] public List<int> BuffTagList { get; set; } = [];
public override int GetId()
{

View File

@@ -105,9 +105,17 @@ public static class GameData
#region GridFight
public static Dictionary<uint, GridFightRoleBasicInfoExcel> GridFightRoleBasicInfoData { get; private set; } = [];
public static Dictionary<uint, GridFightDivisionInfoExcel> GridFightDivisionInfoData { get; private set; } = [];
public static Dictionary<uint, GridFightEquipmentExcel> GridFightEquipmentData { get; private set; } = [];
public static Dictionary<uint, GridFightConsumablesExcel> GridFightConsumablesData { get; private set; } = [];
public static Dictionary<uint, GridFightCampExcel> GridFightCampData { get; private set; } = [];
public static Dictionary<uint, GridFightMonsterExcel> GridFightMonsterData { get; private set; } = [];
public static Dictionary<uint, GridFightAugmentExcel> GridFightAugmentData { get; private set; } = [];
public static Dictionary<uint, GridFightPortalBuffExcel> GridFightPortalBuffData { get; private set; } = [];
public static Dictionary<uint, GridFightItemsExcel> GridFightItemsData { get; private set; } = [];
public static Dictionary<uint, GridFightTalentExcel> GridFightTalentData { get; private set; } = [];
public static Dictionary<uint, GridFightSeasonTalentExcel> GridFightSeasonTalentData { get; private set; } = [];
public static Dictionary<uint, Dictionary<uint, GridFightStageRouteExcel>> GridFightStageRouteData { get; private set; } = [];
#endregion

View File

@@ -0,0 +1,9 @@
namespace EggLink.DanhengServer.Enums.GridFight;
public enum GridFightAugmentQualityEnum
{
None = 0,
Silver = 1,
Gold = 2,
Prismatic = 3,
}

View File

@@ -0,0 +1,11 @@
namespace EggLink.DanhengServer.Enums.GridFight;
public enum GridFightNodeTypeEnum
{
GridFightNodeNone = 0,
Monster = 1,
CampMonster = 2,
EliteBranch = 3,
Boss = 4,
Supply = 5
}

View File

@@ -0,0 +1,9 @@
namespace EggLink.DanhengServer.Enums.GridFight;
public enum GridFightRolePositionEnum
{
None = 0,
Foreground = 1,
Background = 2,
Ready = 3
}

View File

@@ -778,4 +778,15 @@ public enum MissionFinishTypeEnum
GridFightSettleEnemyDifficulty = 370050,
GridFightSettlePlayerLevel = 370051,
GridFightBattleWinWithEnemyDifficulty = 370052,
GridFightSettleBattleObjCnt = 370053,
GridFightTraitSelectEnhanceGainAll = 370054,
GridFightGainSpecialGoods = 370055,
GridFightGainFrontTraitJoinTraitNumEnterBattle = 370056,
GridFightArcherMakeEquip = 370057,
GridFightTraitBonusThreshold = 370058,
GridFightSettleWinWithRoleId = 370059,
GridFightSettleRoleWithFullEquips = 370060,
GridFightSettleWithNpcCnt = 370061,
GridFightSettleWithEquipCnt = 370062,
GridFightSettleWinWithTraitLayerAndRoleRarityNum = 370063,
}

View File

@@ -215,7 +215,7 @@ public class BattleManager(PlayerInstance player) : BasePlayerManager(player)
GameData.CocoonConfigData.TryGetValue(cocoonId * 100 + worldLevel, out var config);
if (config == null) return null;
wave = Math.Min(Math.Max(wave, 1), config.MaxWave);
wave = Math.Max(wave, 1);
var cost = config.StaminaCost * wave;
if (Player.Data.Stamina < cost) return null;

View File

@@ -0,0 +1,9 @@
using EggLink.DanhengServer.Proto;
namespace EggLink.DanhengServer.GameServer.Game.GridFight.Component;
public abstract class BaseGridFightComponent(GridFightInstance inst)
{
public GridFightInstance Inst { get; } = inst;
public abstract GridFightGameInfo ToProto();
}

View File

@@ -0,0 +1,51 @@
using EggLink.DanhengServer.Data;
using EggLink.DanhengServer.Data.Excel;
using EggLink.DanhengServer.Enums.GridFight;
using EggLink.DanhengServer.Proto;
namespace EggLink.DanhengServer.GameServer.Game.GridFight.Component;
public class GridFightAvatarComponent(GridFightInstance inst) : BaseGridFightComponent(inst)
{
public List<GridFightAvatarInfo> Avatars { get; set; } = [];
private uint _curUniqueId;
public async ValueTask AddAvatar(uint roleId, uint tier = 1)
{
var info = new GridFightAvatarInfo(roleId, ++_curUniqueId, tier);
Avatars.Add(info);
// TODO sync
await ValueTask.CompletedTask;
}
public override GridFightGameInfo ToProto()
{
return new GridFightGameInfo
{
GridAvatarGameInfo = new GridFightGameAvatarInfo
{
GridGameAvatarList = { Avatars.Select(x => x.ToProto()) }
}
};
}
}
public class GridFightAvatarInfo(uint roleId, uint uniqueId, uint tier = 1)
{
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()
{
return new GridGameAvatarInfo
{
Id = RoleInfo.ID,
Pos = (uint)Pos,
Tier = Tier,
UniqueId = UniqueId
};
}
}

View File

@@ -0,0 +1,30 @@
using EggLink.DanhengServer.Proto;
namespace EggLink.DanhengServer.GameServer.Game.GridFight.Component;
public class GridFightBasicComponent(GridFightInstance inst) : BaseGridFightComponent(inst)
{
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,
GridFightMaxGold = 2000,
OCMGMEHECBB = new OPIBBPCHFII
{
IJDIAOMINLB = new BHJALAPDBLH()
},
CALCJMHAKPF = new OLEIDBLBILD()
}
};
}
}

View File

@@ -0,0 +1,203 @@
using EggLink.DanhengServer.Data;
using EggLink.DanhengServer.Data.Excel;
using EggLink.DanhengServer.Enums.GridFight;
using EggLink.DanhengServer.Proto;
using EggLink.DanhengServer.Util;
namespace EggLink.DanhengServer.GameServer.Game.GridFight.Component;
public class GridFightLevelComponent : BaseGridFightComponent
{
private uint _curChapterId = 1;
private uint _curSectionId = 1;
public Dictionary<uint, List<GridFightGameSectionInfo>> Sections { get; } = [];
public GridFightGameSectionInfo CurrentSection => Sections[_curChapterId][(int)(_curSectionId - 1)];
public GridFightLevelComponent(GridFightInstance inst) : base(inst)
{
// TODO: randomly select a base route id
List<uint> chapterIds = [1100];
List<GridFightCampExcel> campPool = GameData.GridFightCampData.Values.ToList();
foreach (var chapterId in Enumerable.Range(1, 3))
{
var chapters = chapterIds.Count >= chapterId
? [GameData.GridFightStageRouteData[chapterIds[chapterId - 1]]]
: GameData.GridFightStageRouteData.Values.Where(x => x.Any(j => j.Value.ChapterID == chapterId))
.ToList();
if (chapters.Count == 0)
continue;
var select = chapters.RandomElement();
var camp = campPool.RandomElement(); // cannot the same
campPool.Remove(camp);
// create section infos
Sections[(uint)chapterId] = [..select.Values.Select(x => new GridFightGameSectionInfo(x, camp))];
}
}
public List<GridFightMonsterInfo> GetBossMonsters()
{
// get every chapter last section camp
List<GridFightMonsterInfo> bosses = [];
foreach (var chapter in Sections.Values)
{
var lastSection = chapter.Last();
var bossMonsters = lastSection.MonsterCamp.Monsters.Where(x => x.MonsterTier == 5).ToList();
if (bossMonsters.Count == 0)
continue;
var boss = bossMonsters.RandomElement();
bosses.Add(new GridFightMonsterInfo
{
MonsterId = boss.MonsterID,
Tier = boss.MonsterTier,
MonsterCampId = lastSection.MonsterCamp.ID
});
}
return bosses;
}
public override GridFightGameInfo ToProto()
{
return new GridFightGameInfo
{
GridLevelInfo = new GridFightLevelInfo
{
ChapterId = CurrentSection.ChapterId,
SectionId = CurrentSection.SectionId,
RouteId = CurrentSection.Excel.ID,
GridFightLayerInfo = new GridFightLayerInfo
{
RouteInfo = CurrentSection.ToRouteInfo()
},
BossInfo = new GridFightBossInfo
{
BossMonsters = { GetBossMonsters() }
},
GridFightCampList =
{
Sections.Values.SelectMany(x => x).Select(h => h.MonsterCamp.ID).ToHashSet().Select(s =>
new GridFightGameCampInfo
{
MonsterCampId = s,
})
},
GridChapterInfo = new GridFightChapterInfo
{
SectionInfo =
{
Sections.Values.SelectMany(x => x).Select(s => s.ToProto())
}
},
CGAIJCCLKBH = new()
{
DILHFEHBGDN = new ACHJGEEKCAH()
}
}
};
}
}
public class GridFightGameSectionInfo
{
public GridFightStageRouteExcel Excel { get; }
public uint ChapterId { get; }
public uint SectionId { get; }
public GridFightCampExcel MonsterCamp { get; set; }
public List<GridFightGameEncounterInfo> Encounters { get; } = [];
public GridFightGameSectionInfo(GridFightStageRouteExcel excel, GridFightCampExcel camp)
{
Excel = excel;
ChapterId = excel.ChapterID;
SectionId = excel.SectionID;
MonsterCamp = camp;
Encounters.Add(new GridFightGameEncounterInfo(1, 1, this));
}
public GridFightRouteInfo ToRouteInfo()
{
return new GridFightRouteInfo
{
FightCampId = MonsterCamp.ID,
EliteBranchId = 0,
RouteEncounterList = { Encounters.Select(x => x.ToProto()) }
};
}
public GridFightSectionInfo ToProto()
{
return new GridFightSectionInfo
{
ChapterId = ChapterId,
SectionId = SectionId
};
}
}
public class GridFightGameEncounterInfo
{
public GridFightGameEncounterInfo(uint index, uint difficulty, GridFightGameSectionInfo section)
{
EncounterIndex = index;
EncounterDifficulty = difficulty;
ParentSection = section;
if (ParentSection.Excel.NodeType != GridFightNodeTypeEnum.Monster) return;
var monsterPool = ParentSection.MonsterCamp.Monsters.Where(x => x.MonsterTier <= 3).OrderBy(_ => Guid.NewGuid()).ToList();
List<GridFightMonsterExcel> monsters = [];
foreach (var _ in Enumerable.Range(0, Random.Shared.Next(1, 5)))
{
monsters.Add(monsterPool.RandomElement());
}
MonsterWaves.Add(new GridFightGameMonsterWaveInfo(1, monsters, ParentSection.MonsterCamp.ID));
}
public uint EncounterIndex { get; set; }
public uint EncounterDifficulty { get; set; }
public GridFightGameSectionInfo ParentSection { get; }
public List<GridFightGameMonsterWaveInfo> MonsterWaves { get; } = [];
public GridFightEncounterInfo ToProto()
{
return new GridFightEncounterInfo
{
EncounterIndex = EncounterIndex,
EncounterExtraDifficultyLevel = EncounterDifficulty,
EncounterDropInfo = new GridFightDropInfo(),
MonsterWaveList = { MonsterWaves.Select(x => x.ToProto()) }
};
}
}
public class GridFightGameMonsterWaveInfo(uint wave, List<GridFightMonsterExcel> monsters, uint campId)
{
public uint Wave { get; set; } = wave;
public uint CampId { get; set; } = campId;
public List<GridFightMonsterExcel> Monsters { get; } = monsters;
public GridEncounterMonsterWave ToProto()
{
return new GridEncounterMonsterWave
{
EncounterWave = Wave,
FightMonsterList =
{
Monsters.Select(x => new GridFightMonsterInfo
{
MonsterId = x.MonsterID,
MonsterCampId = CampId,
Tier = x.MonsterTier
})
}
};
}
}

View File

@@ -0,0 +1,51 @@
using EggLink.DanhengServer.GameServer.Game.GridFight.Component;
using EggLink.DanhengServer.Proto;
namespace EggLink.DanhengServer.GameServer.Game.GridFight;
public class GridFightInstance(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<BaseGridFightComponent> Components { get; } = [];
public void InitializeComponents()
{
Components.Add(new GridFightBasicComponent(this));
Components.Add(new GridFightLevelComponent(this));
Components.Add(new GridFightAvatarComponent(this));
_ = GetComponent<GridFightAvatarComponent>().AddAvatar(1414, 3); // TODO test
}
public T GetComponent<T>() where T : BaseGridFightComponent
{
return (T)Components.First(c => c is T);
}
public GridFightCurrentInfo ToProto()
{
return new GridFightCurrentInfo
{
DivisionId = DivisionId,
Season = Season,
IsOverlock = IsOverLock,
UniqueId = UniqueId,
PendingAction = new GridFightPendingAction(),
GridFightGameData = ToGameDataInfo(),
RogueCurrentGameInfo = { ToGameInfos() }
};
}
public List<GridFightGameInfo> ToGameInfos()
{
return (from c in Components select c.ToProto()).ToList();
}
public GridFightGameData ToGameDataInfo()
{
return new GridFightGameData();
}
}

View File

@@ -7,6 +7,32 @@ namespace EggLink.DanhengServer.GameServer.Game.GridFight;
public class GridFightManager(PlayerInstance player) : BasePlayerManager(player)
{
public const uint CurSeasonId = 1;
public uint CurUniqueId { get; set; }
public GridFightInstance? GridFightInstance { get; set; }
#region Game
public async ValueTask<(Retcode code, GridFightInstance? inst)> StartGamePlay(uint season, uint divisionId, bool isOverLock)
{
if (season != CurSeasonId)
return (Retcode.RetGridFightConfMiss, null);
if (GridFightInstance != null)
return (Retcode.RetGridFightAlreadyInGameplay, GridFightInstance);
GridFightInstance = new GridFightInstance(season, divisionId, isOverLock, ++CurUniqueId);
GridFightInstance.InitializeComponents();
await ValueTask.CompletedTask;
return (Retcode.RetSucc, GridFightInstance);
}
#endregion
#region Serialization
public GridFightQueryInfo ToProto()
{
return new GridFightQueryInfo
@@ -16,18 +42,6 @@ public class GridFightManager(PlayerInstance player) : BasePlayerManager(player)
};
}
public GridFightCurrentInfo ToCurrentInfo()
{
return new GridFightCurrentInfo
{
GridFightGameData = new GridFightGameData(),
Season = 1,
DivisionId = 1,
UniqueId = 1,
PendingAction = new GridFightPendingAction()
};
}
public GridFightRewardInfo ToRewardInfo()
{
var time = RogueManager.GetCurrentRogueTime();
@@ -36,12 +50,13 @@ public class GridFightManager(PlayerInstance player) : BasePlayerManager(player)
{
GridFightTalentInfo = new GridFightTalentInfo
{
JMOJEOALCLO = { 1011 }
DeployIdList = { GameData.GridFightTalentData.Keys }
},
//GridFightWeeklyReward = new GridFightTakeWeeklyRewardInfo
//{
// EndTime = time.Item2,
//}
GridFightWeeklyReward = new GridFightTakeWeeklyRewardInfo
{
EndTime = time.Item2,
//FeatureBeginTime = time.Item1
}
};
}
@@ -51,18 +66,18 @@ public class GridFightManager(PlayerInstance player) : BasePlayerManager(player)
{
GridFightTalentInfo = new GridFightTalentInfo
{
JMOJEOALCLO = { }
DeployIdList = { GameData.GridFightSeasonTalentData.Keys }
},
DivisionId = 10920,
DivisionId = GameData.GridFightDivisionInfoData.Where(x => x.Value.SeasonID == CurSeasonId)
.Select(x => x.Key).Max(),
GridFightGameValueInfo = ToFightGameValueInfo(),
Exp = new ()
Exp = new GridFightExpInfo
{
BNCBPJIBHGI = 1,
GDDHBECJECP = 1
GridFightLevel = 1,
GridWeeklyExtraExp = 1
},
MGGGAJJBAMN = 1,
ECMBJBBGHGG = 1,
IFEHBIMEMEC = 10
SubSeasonId = 1
};
}
@@ -78,9 +93,21 @@ public class GridFightManager(PlayerInstance player) : BasePlayerManager(player)
{
GridFightItemList = { GameData.GridFightItemsData.Keys }
},
IADIEGJKNHA = new(),
OCKCODILEOP = new(),
PJBEPNCFGDJ = new()
GridFightCampInfo = new GridFightCampInfo
{
GridFightCampList = { GameData.GridFightCampData.Keys }
},
GridFightAugmentInfo = new GridFightAugmentInfo
{
GridFightAugmentList = { GameData.GridFightAugmentData.Keys }
},
GridFightPortalBuffInfo = new GridFightPortalBuffInfo
{
GridFightPortalBuffList =
{ GameData.GridFightPortalBuffData.Values.Where(x => x.IfInBook).Select(x => x.ID) }
}
};
}
#endregion
}

View File

@@ -161,7 +161,7 @@ public class MissionManager(PlayerInstance player) : BasePlayerManager(player)
});
if (sendPacket) await Player.SendPacket(new PacketPlayerSyncScNotify(sync));
Player.SceneInstance!.SyncGroupInfo();
Player.SceneInstance?.SyncGroupInfo();
if (mission.SubMissionInfo != null)
try
{

View File

@@ -11,12 +11,12 @@ public class HandlerQuickStartCocoonStageCsReq : Handler
{
var req = QuickStartCocoonStageCsReq.Parser.ParseFrom(data);
var battle =
await connection.Player!.BattleManager!.StartCocoonStage((int)req.CocoonId, (int)req.Wave,
await connection.Player!.BattleManager!.StartCocoonStage((int)req.CocoonId, (int)req.CocoonChallengeTimes,
(int)req.WorldLevel);
connection.Player.SceneInstance?.OnEnterStage();
if (battle != null)
await connection.SendPacket(new PacketQuickStartCocoonStageScRsp(battle, (int)req.CocoonId, (int)req.Wave));
await connection.SendPacket(new PacketQuickStartCocoonStageScRsp(battle, (int)req.CocoonId, (int)req.CocoonChallengeTimes));
else
await connection.SendPacket(new PacketQuickStartCocoonStageScRsp());
}

View File

@@ -0,0 +1,18 @@
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.GridFightStartGamePlayCsReq)]
public class HandlerGridFightStartGamePlayCsReq : Handler
{
public override async Task OnHandle(Connection connection, byte[] header, byte[] data)
{
var req = GridFightStartGamePlayCsReq.Parser.ParseFrom(data);
var res = await connection.Player!.GridFightManager!.StartGamePlay(req.Season, req.DivisionId, req.IsOverlock);
await connection.SendPacket(new PacketGridFightStartGamePlayScRsp(res.code, res.inst));
}
}

View File

@@ -22,7 +22,7 @@ public class PacketQuickStartCocoonStageScRsp : BasePacket
var rsp = new QuickStartCocoonStageScRsp
{
CocoonId = (uint)cocoonId,
Wave = (uint)wave,
CocoonChallengeTimes = (uint)wave,
BattleInfo = battle.ToProto()
};

View File

@@ -10,10 +10,12 @@ public class PacketGridFightGetDataScRsp : BasePacket
{
var proto = new GridFightGetDataScRsp
{
RogueGetInfo = player.GridFightManager!.ToProto(),
//FightCurrentInfo = player.GridFightManager!.ToCurrentInfo()
RogueGetInfo = player.GridFightManager!.ToProto()
};
if (player.GridFightManager!.GridFightInstance != null)
proto.FightCurrentInfo = player.GridFightManager!.GridFightInstance.ToProto();
SetData(proto);
}
}

View File

@@ -0,0 +1,21 @@
using EggLink.DanhengServer.GameServer.Game.GridFight;
using EggLink.DanhengServer.Kcp;
using EggLink.DanhengServer.Proto;
namespace EggLink.DanhengServer.GameServer.Server.Packet.Send.GridFight;
public class PacketGridFightStartGamePlayScRsp : BasePacket
{
public PacketGridFightStartGamePlayScRsp(Retcode ret, GridFightInstance? inst) : base(CmdIds.GridFightStartGamePlayScRsp)
{
var rsp = new GridFightStartGamePlayScRsp
{
Retcode = (uint)ret
};
if (inst != null)
rsp.FightCurrentInfo = inst.ToProto();
SetData(rsp);
}
}