From 71ef1cf17458f1d96d0613a19d76fae7aca64b9b Mon Sep 17 00:00:00 2001 From: SELEKCJONER Date: Fri, 15 Nov 2024 16:10:02 +0100 Subject: [PATCH] Basic Anomaly intercept implementation --- .../Msgs/Gacha/CheckGachaDailyEvent.cs | 2 +- EpinelPS/LobbyServer/Msgs/GetGacha.cs | 13 +++--------- .../Msgs/Intercept/AnomalousData.cs | 21 +++++++++++++++++++ .../Msgs/Intercept/AnomalousEnter.cs | 17 +++++++++++++++ .../Msgs/Intercept/AnomalousFastClear.cs | 17 +++++++++++++++ .../Msgs/Intercept/AnomalousFinish.cs | 17 +++++++++++++++ .../LobbyServer/Msgs/User/GetContentsData.cs | 3 ++- 7 files changed, 78 insertions(+), 12 deletions(-) create mode 100644 EpinelPS/LobbyServer/Msgs/Intercept/AnomalousData.cs create mode 100644 EpinelPS/LobbyServer/Msgs/Intercept/AnomalousEnter.cs create mode 100644 EpinelPS/LobbyServer/Msgs/Intercept/AnomalousFastClear.cs create mode 100644 EpinelPS/LobbyServer/Msgs/Intercept/AnomalousFinish.cs diff --git a/EpinelPS/LobbyServer/Msgs/Gacha/CheckGachaDailyEvent.cs b/EpinelPS/LobbyServer/Msgs/Gacha/CheckGachaDailyEvent.cs index 1c5c5c2..cac347c 100644 --- a/EpinelPS/LobbyServer/Msgs/Gacha/CheckGachaDailyEvent.cs +++ b/EpinelPS/LobbyServer/Msgs/Gacha/CheckGachaDailyEvent.cs @@ -12,7 +12,7 @@ namespace EpinelPS.LobbyServer.Msgs.Gacha var response = new ResCheckDailyFreeGacha(); // TODO implement - response.FreeCount = 0; + response.FreeCount = 1; response.EventData = new NetEventData() { Id = 1 }; await WriteDataAsync(response); diff --git a/EpinelPS/LobbyServer/Msgs/GetGacha.cs b/EpinelPS/LobbyServer/Msgs/GetGacha.cs index 4e226f9..6f74fdb 100644 --- a/EpinelPS/LobbyServer/Msgs/GetGacha.cs +++ b/EpinelPS/LobbyServer/Msgs/GetGacha.cs @@ -19,16 +19,9 @@ namespace EpinelPS.LobbyServer.Msgs response.Gacha.Add(new NetUserGachaData() { GachaType = 3, PlayCount = 1 }); } - // Now let's loop through gachaTypes and add those with "type" == "GachaPickup" - foreach (var gacha in GameData.Instance.gachaTypes.Values) // We're looping through the dictionary's values - { - if (gacha.type == "GachaPickup") - { - // Add this GachaType ID to the response - response.Gacha.Add(new NetUserGachaData() { GachaType = gacha.id, PlayCount = 1 }); - } - } - + response.Gacha.Add(new NetUserGachaData() { GachaType = 9, PlayCount = 0 }); //type 9 = pickup gacha + response.GachaEventData.Add(new NetGachaEvent() {FreeCount = 1, GachaTypeId = 9 } ); + response.MultipleCustom.Add(new NetGachaCustomData() {Type = 9, Tid = 451101}); // Write the response back await WriteDataAsync(response); } diff --git a/EpinelPS/LobbyServer/Msgs/Intercept/AnomalousData.cs b/EpinelPS/LobbyServer/Msgs/Intercept/AnomalousData.cs new file mode 100644 index 0000000..fab40a7 --- /dev/null +++ b/EpinelPS/LobbyServer/Msgs/Intercept/AnomalousData.cs @@ -0,0 +1,21 @@ +using EpinelPS.Utils; + +namespace EpinelPS.LobbyServer.Msgs.Intercept +{ + [PacketPath("/intercept/Anomalous/Data")] + public class GetAnomalousData : LobbyMsgHandler + { + protected override async Task HandleAsync() + { + var req = await ReadData(); + + var response = new ResInterceptAnomalousData + { + LastEnteredInterceptAnomalousId = 1, + RemainingTickets = 5 + }; + response.ClearedInterceptAnomalousIds.Add(new[] { 1, 2, 3, 4, 5 }); + await WriteDataAsync(response); + } + } +} diff --git a/EpinelPS/LobbyServer/Msgs/Intercept/AnomalousEnter.cs b/EpinelPS/LobbyServer/Msgs/Intercept/AnomalousEnter.cs new file mode 100644 index 0000000..0a7a34f --- /dev/null +++ b/EpinelPS/LobbyServer/Msgs/Intercept/AnomalousEnter.cs @@ -0,0 +1,17 @@ +using EpinelPS.Utils; + +namespace EpinelPS.LobbyServer.Msgs.Intercept +{ + [PacketPath("/intercept/Anomalous/Enter")] + public class EnterAnomalousIntercept : LobbyMsgHandler + { + protected override async Task HandleAsync() + { + var req = await ReadData(); + + var response = new ResEnterInterceptAnomalous(); + + await WriteDataAsync(response); + } + } +} diff --git a/EpinelPS/LobbyServer/Msgs/Intercept/AnomalousFastClear.cs b/EpinelPS/LobbyServer/Msgs/Intercept/AnomalousFastClear.cs new file mode 100644 index 0000000..1cc1af8 --- /dev/null +++ b/EpinelPS/LobbyServer/Msgs/Intercept/AnomalousFastClear.cs @@ -0,0 +1,17 @@ +using EpinelPS.Utils; + +namespace EpinelPS.LobbyServer.Msgs.Intercept +{ + [PacketPath("/intercept/Anomalous/FastClear")] + public class AnomalousFastClear : LobbyMsgHandler + { + protected override async Task HandleAsync() + { + var req = await ReadData(); + + var response = new ResFastClearInterceptAnomalous(); + + await WriteDataAsync(response); + } + } +} diff --git a/EpinelPS/LobbyServer/Msgs/Intercept/AnomalousFinish.cs b/EpinelPS/LobbyServer/Msgs/Intercept/AnomalousFinish.cs new file mode 100644 index 0000000..ac2305c --- /dev/null +++ b/EpinelPS/LobbyServer/Msgs/Intercept/AnomalousFinish.cs @@ -0,0 +1,17 @@ +using EpinelPS.Utils; + +namespace EpinelPS.LobbyServer.Msgs.Intercept +{ + [PacketPath("/intercept/Anomalous/Finish")] + public class FinishAnomalousIntercept : LobbyMsgHandler + { + protected override async Task HandleAsync() + { + var req = await ReadData(); + + var response = new ResFinishInterceptAnomalous(); + + await WriteDataAsync(response); + } + } +} diff --git a/EpinelPS/LobbyServer/Msgs/User/GetContentsData.cs b/EpinelPS/LobbyServer/Msgs/User/GetContentsData.cs index 9ae7471..7439f1d 100644 --- a/EpinelPS/LobbyServer/Msgs/User/GetContentsData.cs +++ b/EpinelPS/LobbyServer/Msgs/User/GetContentsData.cs @@ -12,7 +12,7 @@ namespace EpinelPS.LobbyServer.Msgs.User // this request returns a list of "special" stages that mark when something is unlocked, ex: the shop or interception - List specialStages = [6003003, 6002008, 6002016, 6005003, 6003021, 6011018, 6007021, 6004018, 6005013, 6003009, 6003012, 6009017, 6016039, 6001004, 6000003, 6000001, 6002001, 6004023, 6005026, 6020050, 6006004, 6006023]; + List specialStages = [6003003, 6002008, 6002016, 6005003, 6003021, 6011018, 6007021, 6004018, 6005013, 6003009, 6003012, 6009017, 6016039, 6001004, 6000003, 6000001, 6002001, 6004023, 6005026, 6020050, 6006004, 6006023,6022049]; var response = new ResGetContentsOpenData(); foreach (var field in user.FieldInfoNew.Values) @@ -24,6 +24,7 @@ namespace EpinelPS.LobbyServer.Msgs.User } } response.MaxGachaCount = 10; + response.MaxGachaPremiumCount = 10; // todo tutorial playcount of gacha response.TutorialGachaPlayCount = user.GachaTutorialPlayCount;