From 6f50033729c13bfe31427727ec1bf0fb4c9bc66d Mon Sep 17 00:00:00 2001 From: rfi Date: Fri, 23 Feb 2024 16:53:15 +0700 Subject: [PATCH] 2.1.0 version config --- AscNet.GameServer/Handlers/AccountModule.cs | 8 ++++ AscNet.GameServer/Handlers/ArenaModule.cs | 49 +++++++++++++++++++++ AscNet.GameServer/Handlers/FightModule.cs | 38 ++++++++++++++++ Resources/Configs/version_config.json | 7 +++ 4 files changed, 102 insertions(+) create mode 100644 AscNet.GameServer/Handlers/ArenaModule.cs diff --git a/AscNet.GameServer/Handlers/AccountModule.cs b/AscNet.GameServer/Handlers/AccountModule.cs index 0e1bacbb..859263c8 100644 --- a/AscNet.GameServer/Handlers/AccountModule.cs +++ b/AscNet.GameServer/Handlers/AccountModule.cs @@ -234,6 +234,14 @@ namespace AscNet.GameServer.Handlers }, BossInfo = new() }); + session.SendPush(new NotifyTaskData() + { + TaskData = new() + { + NewbieHonorReward = false, + NewbieUnlockPeriod = 7 + } + }); #region DisclamerMail NotifyMails notifyMails = new(); diff --git a/AscNet.GameServer/Handlers/ArenaModule.cs b/AscNet.GameServer/Handlers/ArenaModule.cs new file mode 100644 index 00000000..864646c9 --- /dev/null +++ b/AscNet.GameServer/Handlers/ArenaModule.cs @@ -0,0 +1,49 @@ +using MessagePack; + +namespace AscNet.GameServer.Handlers +{ + #region MsgPackScheme +#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. + [MessagePackObject(true)] + public class JoinActivityResponse + { + public int Code; + public int ChallengeId; + } + + [MessagePackObject(true)] + public class ScoreQueryResponse + { + public int Code; + public int WaveRate; + public List GroupPlayerList; + public List TeamPlayerList; + public int ChallengeId; + public int ActivityNo; + public int ArenaLevel; + public int ContributeScore; + } +#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. + #endregion + + internal class ArenaModule + { + [RequestPacketHandler("JoinActivityRequest")] + public static void JoinActivityRequestHandler(Session session, Packet.Request packet) + { + session.SendResponse(new JoinActivityResponse() + { + ChallengeId = 3 + }, packet.Id); + } + + [RequestPacketHandler("ScoreQueryRequest")] + public static void ScoreQueryRequestHandler(Session session, Packet.Request packet) + { + session.SendResponse(new ScoreQueryResponse() + { + ChallengeId = 3 + }, packet.Id); + } + } +} diff --git a/AscNet.GameServer/Handlers/FightModule.cs b/AscNet.GameServer/Handlers/FightModule.cs index ae404679..084529d7 100644 --- a/AscNet.GameServer/Handlers/FightModule.cs +++ b/AscNet.GameServer/Handlers/FightModule.cs @@ -131,6 +131,18 @@ namespace AscNet.GameServer.Handlers public FightSettleResult Result { get; set; } } + [MessagePackObject(true)] + public class EnterStoryRequest + { + public int StageId { get; set; } + } + + [MessagePackObject(true)] + public class EnterStoryResponse + { + public int Code { get; set; } + } + [MessagePackObject(true)] public class FightRebootRequest { @@ -277,6 +289,32 @@ namespace AscNet.GameServer.Handlers session.SendResponse(new FightRebootResponse(), packet.Id); } + [RequestPacketHandler("EnterStoryRequest")] + public static void HandleEnterStoryRequestHandler(Session session, Packet.Request packet) + { + EnterStoryRequest req = packet.Deserialize(); + + StageDatum stageData = new() + { + StageId = req.StageId, + StarsMark = 7, + Passed = true, + PassTimesToday = 0, + PassTimesTotal = 1, + BuyCount = 0, + Score = 0, + LastPassTime = (uint)DateTimeOffset.Now.ToUnixTimeSeconds(), + RefreshTime = (uint)DateTimeOffset.Now.ToUnixTimeSeconds(), + CreateTime = (uint)DateTimeOffset.Now.ToUnixTimeSeconds(), + BestRecordTime = 0, + LastRecordTime = 0 + }; + session.stage.AddStage(stageData); + + session.SendPush(new NotifyStageData() { StageList = [stageData] }); + session.SendResponse(new EnterStoryResponse(), packet.Id); + } + [RequestPacketHandler("TeamSetTeamRequest")] public static void HandleTeamSetTeamRequestHandler(Session session, Packet.Request packet) { diff --git a/Resources/Configs/version_config.json b/Resources/Configs/version_config.json index 6c8d57b4..a02cf485 100644 --- a/Resources/Configs/version_config.json +++ b/Resources/Configs/version_config.json @@ -27,6 +27,13 @@ "IndexSha1": "7ae82c13f9427d1f120f76abb4e559bad283d3e1", "LaunchIndexSha1": "297287965d68643bad0d54c8cb2f5ae76a18b26c" }, + "2.1.0": { + "DocumentVersion": "2.1.7", + "LaunchModuleVersion": "2.1.7", + "IndexMd5": "c5d4baac85a6e37b8109ea43dc045d31", + "IndexSha1": "d51fd6de97fe900480d0d1d98eea2b433ba94c5d", + "LaunchIndexSha1": "7855b646445a6336900448425e480028623395a5" + }, "2.9.0": { "DocumentVersion": "2.9.15", "LaunchModuleVersion": "2.9.15",