diff --git a/Elisa/Data/JSON.cs b/Elisa.Common/Data/JSON.cs similarity index 96% rename from Elisa/Data/JSON.cs rename to Elisa.Common/Data/JSON.cs index 867db5a..fa5e849 100644 --- a/Elisa/Data/JSON.cs +++ b/Elisa.Common/Data/JSON.cs @@ -1,6 +1,6 @@ using System.Text.Json; -namespace Elisa.Data; +namespace Elisa.Common.Data; public static class JSON { diff --git a/Elisa/Data/Table.cs b/Elisa.Common/Data/Table.cs similarity index 98% rename from Elisa/Data/Table.cs rename to Elisa.Common/Data/Table.cs index 65f4fbc..e1a6071 100644 --- a/Elisa/Data/Table.cs +++ b/Elisa.Common/Data/Table.cs @@ -1,10 +1,10 @@ -using Elisa.Data.Tables; +using Elisa.Common.Data.Tables; using Serilog; using System.Collections; using System.Reflection; using System.Text.Json; -namespace Elisa.Data; +namespace Elisa.Common.Data; public enum LoadDataType { @@ -33,7 +33,7 @@ public static class Table [LoadData("daily.json", LoadDataType.STC)] public static List daily { get; private set; } = null!; - + [LoadData("equip.json", LoadDataType.STC)] public static List equip { get; private set; } = null!; @@ -45,7 +45,7 @@ public static class Table [LoadData("gift_item.json", LoadDataType.STC)] public static List gift_item { get; private set; } = null!; - + [LoadData("gun.json", LoadDataType.STC)] public static List gun { get; private set; } = null!; @@ -57,7 +57,7 @@ public static class Table [LoadData("present.json", LoadDataType.STC)] public static List present { get; private set; } = null!; - + [LoadData("prize.json", LoadDataType.STC)] public static List prize { get; private set; } = null!; @@ -66,13 +66,13 @@ public static class Table [LoadData("skin.json", LoadDataType.STC)] public static List skin { get; private set; } = null!; - + [LoadData("spot.json", LoadDataType.STC)] public static List spot { get; private set; } = null!; [LoadData("squad.json", LoadDataType.STC)] public static List squad { get; private set; } = null!; - + [LoadData("vehicle.json", LoadDataType.STC)] public static List vehicle { get; private set; } = null!; @@ -81,7 +81,7 @@ public static class Table [LoadData("weekly.json", LoadDataType.STC)] public static List weekly { get; private set; } = null!; - + #endregion public static void Load() diff --git a/Elisa/Data/Tables/CatchData.cs b/Elisa.Common/Data/Tables/CatchData.cs similarity index 67% rename from Elisa/Data/Tables/CatchData.cs rename to Elisa.Common/Data/Tables/CatchData.cs index 2c32491..847a035 100644 --- a/Elisa/Data/Tables/CatchData.cs +++ b/Elisa.Common/Data/Tables/CatchData.cs @@ -1,4 +1,4 @@ -namespace Elisa.Data.Tables; +namespace Elisa.Common.Data.Tables; public class GunExpInfo : Model { diff --git a/Elisa/Data/Tables/STC.cs b/Elisa.Common/Data/Tables/STC.cs similarity index 99% rename from Elisa/Data/Tables/STC.cs rename to Elisa.Common/Data/Tables/STC.cs index e06cd29..9a4be8e 100644 --- a/Elisa/Data/Tables/STC.cs +++ b/Elisa.Common/Data/Tables/STC.cs @@ -1,4 +1,4 @@ -namespace Elisa.Data.Tables; +namespace Elisa.Common.Data.Tables; public class Daily : Model { diff --git a/Elisa.Common/Data/Tables/Text.cs b/Elisa.Common/Data/Tables/Text.cs new file mode 100644 index 0000000..dd50a1a --- /dev/null +++ b/Elisa.Common/Data/Tables/Text.cs @@ -0,0 +1 @@ +namespace Elisa.Common.Data.Tables; diff --git a/Elisa.Common/Elisa.Common.csproj b/Elisa.Common/Elisa.Common.csproj new file mode 100644 index 0000000..88535a5 --- /dev/null +++ b/Elisa.Common/Elisa.Common.csproj @@ -0,0 +1,18 @@ + + + + net8.0 + enable + enable + + + + + + + + + + + + diff --git a/Elisa/Messages/BattlePass.cs b/Elisa.Common/Messages/BattlePass.cs similarity index 87% rename from Elisa/Messages/BattlePass.cs rename to Elisa.Common/Messages/BattlePass.cs index 156adc8..321b1fd 100644 --- a/Elisa/Messages/BattlePass.cs +++ b/Elisa.Common/Messages/BattlePass.cs @@ -1,6 +1,6 @@ -using Elisa.Models; +using Elisa.Common.Models; -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class GetAllBonusRequest { diff --git a/Elisa/Messages/Chess.cs b/Elisa.Common/Messages/Chess.cs similarity index 81% rename from Elisa/Messages/Chess.cs rename to Elisa.Common/Messages/Chess.cs index 6bd52ed..324bb92 100644 --- a/Elisa/Messages/Chess.cs +++ b/Elisa.Common/Messages/Chess.cs @@ -1,4 +1,4 @@ -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class ChessGashaDrawRequest { diff --git a/Elisa/Messages/Chip.cs b/Elisa.Common/Messages/Chip.cs similarity index 92% rename from Elisa/Messages/Chip.cs rename to Elisa.Common/Messages/Chip.cs index 28b2804..50de727 100644 --- a/Elisa/Messages/Chip.cs +++ b/Elisa.Common/Messages/Chip.cs @@ -1,6 +1,6 @@ -using Elisa.Models; +using Elisa.Common.Models; -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class ChipEnhanceRequest { diff --git a/Elisa/Messages/Development.cs b/Elisa.Common/Messages/Development.cs similarity index 98% rename from Elisa/Messages/Development.cs rename to Elisa.Common/Messages/Development.cs index f5b845f..dbcbe0f 100644 --- a/Elisa/Messages/Development.cs +++ b/Elisa.Common/Messages/Development.cs @@ -1,6 +1,6 @@ -using Elisa.Models; +using Elisa.Common.Models; -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class EquipDevelopMultiRequest { diff --git a/Elisa/Messages/Dorm.cs b/Elisa.Common/Messages/Dorm.cs similarity index 97% rename from Elisa/Messages/Dorm.cs rename to Elisa.Common/Messages/Dorm.cs index 3db6033..6adb2ab 100644 --- a/Elisa/Messages/Dorm.cs +++ b/Elisa.Common/Messages/Dorm.cs @@ -1,6 +1,6 @@ -using Elisa.Models; +using Elisa.Common.Models; -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class ChangeSkinRequest { diff --git a/Elisa/Messages/Equipment.cs b/Elisa.Common/Messages/Equipment.cs similarity index 95% rename from Elisa/Messages/Equipment.cs rename to Elisa.Common/Messages/Equipment.cs index 5efd0be..7144154 100644 --- a/Elisa/Messages/Equipment.cs +++ b/Elisa.Common/Messages/Equipment.cs @@ -1,4 +1,4 @@ -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class AdjustRequest { diff --git a/Elisa/Messages/Event.cs b/Elisa.Common/Messages/Event.cs similarity index 54% rename from Elisa/Messages/Event.cs rename to Elisa.Common/Messages/Event.cs index 14fc1ef..114e353 100644 --- a/Elisa/Messages/Event.cs +++ b/Elisa.Common/Messages/Event.cs @@ -1,4 +1,4 @@ -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class BikiniVoteResultResponse { diff --git a/Elisa/Messages/Exploration.cs b/Elisa.Common/Messages/Exploration.cs similarity index 93% rename from Elisa/Messages/Exploration.cs rename to Elisa.Common/Messages/Exploration.cs index 9ac25e0..a0602d8 100644 --- a/Elisa/Messages/Exploration.cs +++ b/Elisa.Common/Messages/Exploration.cs @@ -1,6 +1,6 @@ -using Elisa.Models; +using Elisa.Common.Models; -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class GetAdaptiveTeamResponse { diff --git a/Elisa/Messages/Fairy.cs b/Elisa.Common/Messages/Fairy.cs similarity index 86% rename from Elisa/Messages/Fairy.cs rename to Elisa.Common/Messages/Fairy.cs index 5446a0b..2cad527 100644 --- a/Elisa/Messages/Fairy.cs +++ b/Elisa.Common/Messages/Fairy.cs @@ -1,4 +1,4 @@ -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class FairySkillUpgradeRequest { diff --git a/Elisa.Common/Messages/Favor.cs b/Elisa.Common/Messages/Favor.cs new file mode 100644 index 0000000..702e3e8 --- /dev/null +++ b/Elisa.Common/Messages/Favor.cs @@ -0,0 +1 @@ +namespace Elisa.Common.Messages; diff --git a/Elisa/Messages/Fetter.cs b/Elisa.Common/Messages/Fetter.cs similarity index 95% rename from Elisa/Messages/Fetter.cs rename to Elisa.Common/Messages/Fetter.cs index b22f872..3516f01 100644 --- a/Elisa/Messages/Fetter.cs +++ b/Elisa.Common/Messages/Fetter.cs @@ -1,4 +1,4 @@ -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class ReadStoryRequest { diff --git a/Elisa/Messages/Friend.cs b/Elisa.Common/Messages/Friend.cs similarity index 78% rename from Elisa/Messages/Friend.cs rename to Elisa.Common/Messages/Friend.cs index c3be7a9..004cc7d 100644 --- a/Elisa/Messages/Friend.cs +++ b/Elisa.Common/Messages/Friend.cs @@ -1,6 +1,6 @@ -using Elisa.Models; +using Elisa.Common.Models; -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class TeamGunsResponse { diff --git a/Elisa.Common/Messages/Guide.cs b/Elisa.Common/Messages/Guide.cs new file mode 100644 index 0000000..702e3e8 --- /dev/null +++ b/Elisa.Common/Messages/Guide.cs @@ -0,0 +1 @@ +namespace Elisa.Common.Messages; diff --git a/Elisa/Messages/Gun.cs b/Elisa.Common/Messages/Gun.cs similarity index 96% rename from Elisa/Messages/Gun.cs rename to Elisa.Common/Messages/Gun.cs index f62945c..ff36fc3 100644 --- a/Elisa/Messages/Gun.cs +++ b/Elisa.Common/Messages/Gun.cs @@ -1,4 +1,4 @@ -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class GunCombineGunRequest { diff --git a/Elisa/Messages/Home.cs b/Elisa.Common/Messages/Home.cs similarity index 94% rename from Elisa/Messages/Home.cs rename to Elisa.Common/Messages/Home.cs index ec4b5cd..8f68ca9 100644 --- a/Elisa/Messages/Home.cs +++ b/Elisa.Common/Messages/Home.cs @@ -1,6 +1,6 @@ -using Elisa.Models; +using Elisa.Common.Models; -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class ChangeAdjutantRequest { diff --git a/Elisa/Messages/Index.cs b/Elisa.Common/Messages/Index.cs similarity index 75% rename from Elisa/Messages/Index.cs rename to Elisa.Common/Messages/Index.cs index 085afa2..54e0b9d 100644 --- a/Elisa/Messages/Index.cs +++ b/Elisa.Common/Messages/Index.cs @@ -1,6 +1,6 @@ -using Elisa.Models; +using Elisa.Common.Models; -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class IndexRequest { diff --git a/Elisa.Common/Messages/Item.cs b/Elisa.Common/Messages/Item.cs new file mode 100644 index 0000000..702e3e8 --- /dev/null +++ b/Elisa.Common/Messages/Item.cs @@ -0,0 +1 @@ +namespace Elisa.Common.Messages; diff --git a/Elisa/Messages/Mail.cs b/Elisa.Common/Messages/Mail.cs similarity index 92% rename from Elisa/Messages/Mail.cs rename to Elisa.Common/Messages/Mail.cs index 73252fa..6eaed68 100644 --- a/Elisa/Messages/Mail.cs +++ b/Elisa.Common/Messages/Mail.cs @@ -1,5 +1,6 @@ -using Elisa.Models; -namespace Elisa.Messages; +using Elisa.Common.Models; + +namespace Elisa.Common.Messages; public class GetResourceInMailQuickRequest { diff --git a/Elisa/Messages/Mission.cs b/Elisa.Common/Messages/Mission.cs similarity index 99% rename from Elisa/Messages/Mission.cs rename to Elisa.Common/Messages/Mission.cs index 45e3bb9..b771bbf 100644 --- a/Elisa/Messages/Mission.cs +++ b/Elisa.Common/Messages/Mission.cs @@ -1,6 +1,6 @@ -using Elisa.Models; +using Elisa.Common.Models; -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class AbortMissionResponse { diff --git a/Elisa/Messages/Operation.cs b/Elisa.Common/Messages/Operation.cs similarity index 91% rename from Elisa/Messages/Operation.cs rename to Elisa.Common/Messages/Operation.cs index c9a9845..0dd2b8f 100644 --- a/Elisa/Messages/Operation.cs +++ b/Elisa.Common/Messages/Operation.cs @@ -1,4 +1,4 @@ -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class AbortOperationRequest { diff --git a/Elisa/Messages/Outhouse.cs b/Elisa.Common/Messages/Outhouse.cs similarity index 90% rename from Elisa/Messages/Outhouse.cs rename to Elisa.Common/Messages/Outhouse.cs index 8e542ba..0a3270a 100644 --- a/Elisa/Messages/Outhouse.cs +++ b/Elisa.Common/Messages/Outhouse.cs @@ -1,6 +1,6 @@ -using Elisa.Models; +using Elisa.Common.Models; -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class EstablishBuildFinishRequest { diff --git a/Elisa/Messages/Prize.cs b/Elisa.Common/Messages/Prize.cs similarity index 83% rename from Elisa/Messages/Prize.cs rename to Elisa.Common/Messages/Prize.cs index 4e31314..8223857 100644 --- a/Elisa/Messages/Prize.cs +++ b/Elisa.Common/Messages/Prize.cs @@ -1,4 +1,4 @@ -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class GetEventPrizeRequest { diff --git a/Elisa/Messages/Quest.cs b/Elisa.Common/Messages/Quest.cs similarity index 95% rename from Elisa/Messages/Quest.cs rename to Elisa.Common/Messages/Quest.cs index 0be74fb..4ead35c 100644 --- a/Elisa/Messages/Quest.cs +++ b/Elisa.Common/Messages/Quest.cs @@ -1,6 +1,6 @@ -using Elisa.Models; +using Elisa.Common.Models; -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class AccomplishAllQuestsResponse { diff --git a/Elisa/Messages/Rank.cs b/Elisa.Common/Messages/Rank.cs similarity index 85% rename from Elisa/Messages/Rank.cs rename to Elisa.Common/Messages/Rank.cs index e482c16..d245944 100644 --- a/Elisa/Messages/Rank.cs +++ b/Elisa.Common/Messages/Rank.cs @@ -1,6 +1,6 @@ -using Elisa.Models; +using Elisa.Common.Models; -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class GetRankRequest { diff --git a/Elisa/Messages/Sangvis.cs b/Elisa.Common/Messages/Sangvis.cs similarity index 97% rename from Elisa/Messages/Sangvis.cs rename to Elisa.Common/Messages/Sangvis.cs index 4f7d6b8..41b5da0 100644 --- a/Elisa/Messages/Sangvis.cs +++ b/Elisa.Common/Messages/Sangvis.cs @@ -1,6 +1,6 @@ -using Elisa.Models; +using Elisa.Common.Models; -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class SangvisAdvanceRequest { diff --git a/Elisa/Messages/Settings.cs b/Elisa.Common/Messages/Settings.cs similarity index 51% rename from Elisa/Messages/Settings.cs rename to Elisa.Common/Messages/Settings.cs index 053c304..961ee95 100644 --- a/Elisa/Messages/Settings.cs +++ b/Elisa.Common/Messages/Settings.cs @@ -1,6 +1,6 @@ -using Elisa.Models; +using Elisa.Common.Models; -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class GameSettingRequest { diff --git a/Elisa/Messages/Squad.cs b/Elisa.Common/Messages/Squad.cs similarity index 95% rename from Elisa/Messages/Squad.cs rename to Elisa.Common/Messages/Squad.cs index 2851e51..3b11a8f 100644 --- a/Elisa/Messages/Squad.cs +++ b/Elisa.Common/Messages/Squad.cs @@ -1,6 +1,6 @@ -using Elisa.Models; +using Elisa.Common.Models; -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class AddSquadProgressRequest { diff --git a/Elisa/Messages/Theater.cs b/Elisa.Common/Messages/Theater.cs similarity index 89% rename from Elisa/Messages/Theater.cs rename to Elisa.Common/Messages/Theater.cs index 424f92f..fadd070 100644 --- a/Elisa/Messages/Theater.cs +++ b/Elisa.Common/Messages/Theater.cs @@ -1,6 +1,6 @@ -using Elisa.Models; +using Elisa.Common.Models; -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class TheaterDataRequest { diff --git a/Elisa.Common/Messages/User.cs b/Elisa.Common/Messages/User.cs new file mode 100644 index 0000000..702e3e8 --- /dev/null +++ b/Elisa.Common/Messages/User.cs @@ -0,0 +1 @@ +namespace Elisa.Common.Messages; diff --git a/Elisa/Messages/Vehicle.cs b/Elisa.Common/Messages/Vehicle.cs similarity index 54% rename from Elisa/Messages/Vehicle.cs rename to Elisa.Common/Messages/Vehicle.cs index ec84661..1b77f75 100644 --- a/Elisa/Messages/Vehicle.cs +++ b/Elisa.Common/Messages/Vehicle.cs @@ -1,6 +1,6 @@ -using Elisa.Models; +using Elisa.Common.Models; -namespace Elisa.Messages; +namespace Elisa.Common.Messages; public class VehicleUnlockResponse { diff --git a/Elisa.Common/Models/BattlePass.cs b/Elisa.Common/Models/BattlePass.cs new file mode 100644 index 0000000..2652340 --- /dev/null +++ b/Elisa.Common/Models/BattlePass.cs @@ -0,0 +1 @@ +namespace Elisa.Common.Models; diff --git a/Elisa/Models/Chess.cs b/Elisa.Common/Models/Chess.cs similarity index 89% rename from Elisa/Models/Chess.cs rename to Elisa.Common/Models/Chess.cs index 95ca271..b27067a 100644 --- a/Elisa/Models/Chess.cs +++ b/Elisa.Common/Models/Chess.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class ChessInfo { diff --git a/Elisa/Models/Chip.cs b/Elisa.Common/Models/Chip.cs similarity index 94% rename from Elisa/Models/Chip.cs rename to Elisa.Common/Models/Chip.cs index b43f3fc..ba1dc1d 100644 --- a/Elisa/Models/Chip.cs +++ b/Elisa.Common/Models/Chip.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; // TODO: check public class Chip diff --git a/Elisa/Models/Development.cs b/Elisa.Common/Models/Development.cs similarity index 98% rename from Elisa/Models/Development.cs rename to Elisa.Common/Models/Development.cs index cf43af5..87994e0 100644 --- a/Elisa/Models/Development.cs +++ b/Elisa.Common/Models/Development.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class DataAnalysisAct { diff --git a/Elisa/Models/Dorm.cs b/Elisa.Common/Models/Dorm.cs similarity index 71% rename from Elisa/Models/Dorm.cs rename to Elisa.Common/Models/Dorm.cs index 044374d..03008c1 100644 --- a/Elisa/Models/Dorm.cs +++ b/Elisa.Common/Models/Dorm.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class DorFurniture { diff --git a/Elisa/Models/Equipment.cs b/Elisa.Common/Models/Equipment.cs similarity index 95% rename from Elisa/Models/Equipment.cs rename to Elisa.Common/Models/Equipment.cs index fcb4732..db595c7 100644 --- a/Elisa/Models/Equipment.cs +++ b/Elisa.Common/Models/Equipment.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; // TODO: check public class Equip diff --git a/Elisa/Models/Event.cs b/Elisa.Common/Models/Event.cs similarity index 81% rename from Elisa/Models/Event.cs rename to Elisa.Common/Models/Event.cs index f38507d..821a100 100644 --- a/Elisa/Models/Event.cs +++ b/Elisa.Common/Models/Event.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class EventInfo { diff --git a/Elisa/Models/Exploration.cs b/Elisa.Common/Models/Exploration.cs similarity index 91% rename from Elisa/Models/Exploration.cs rename to Elisa.Common/Models/Exploration.cs index 9fbcb89..03e32b7 100644 --- a/Elisa/Models/Exploration.cs +++ b/Elisa.Common/Models/Exploration.cs @@ -1,6 +1,6 @@ -using Elisa.Messages; +using Elisa.Common.Messages; -namespace Elisa.Models; +namespace Elisa.Common.Models; public class ExploreAct { diff --git a/Elisa/Models/Fairy.cs b/Elisa.Common/Models/Fairy.cs similarity index 95% rename from Elisa/Models/Fairy.cs rename to Elisa.Common/Models/Fairy.cs index 2111242..237277c 100644 --- a/Elisa/Models/Fairy.cs +++ b/Elisa.Common/Models/Fairy.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; // TODO: check public class Fairy diff --git a/Elisa/Models/Favor.cs b/Elisa.Common/Models/Favor.cs similarity index 93% rename from Elisa/Models/Favor.cs rename to Elisa.Common/Models/Favor.cs index 6411527..d30da55 100644 --- a/Elisa/Models/Favor.cs +++ b/Elisa.Common/Models/Favor.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class AllFavorupGun { diff --git a/Elisa/Models/Fetter.cs b/Elisa.Common/Models/Fetter.cs similarity index 89% rename from Elisa/Models/Fetter.cs rename to Elisa.Common/Models/Fetter.cs index 3aa46bf..7ecfe09 100644 --- a/Elisa/Models/Fetter.cs +++ b/Elisa.Common/Models/Fetter.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class FetterBounty { diff --git a/Elisa/Models/Friend.cs b/Elisa.Common/Models/Friend.cs similarity index 97% rename from Elisa/Models/Friend.cs rename to Elisa.Common/Models/Friend.cs index 6caac4b..82e3433 100644 --- a/Elisa/Models/Friend.cs +++ b/Elisa.Common/Models/Friend.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class FriendAct { diff --git a/Elisa/Models/Guide.cs b/Elisa.Common/Models/Guide.cs similarity index 81% rename from Elisa/Models/Guide.cs rename to Elisa.Common/Models/Guide.cs index df781d1..0841f09 100644 --- a/Elisa/Models/Guide.cs +++ b/Elisa.Common/Models/Guide.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class Guide { diff --git a/Elisa/Models/Gun.cs b/Elisa.Common/Models/Gun.cs similarity index 96% rename from Elisa/Models/Gun.cs rename to Elisa.Common/Models/Gun.cs index aeb4208..571c969 100644 --- a/Elisa/Models/Gun.cs +++ b/Elisa.Common/Models/Gun.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class FixAct { diff --git a/Elisa.Common/Models/Home.cs b/Elisa.Common/Models/Home.cs new file mode 100644 index 0000000..2652340 --- /dev/null +++ b/Elisa.Common/Models/Home.cs @@ -0,0 +1 @@ +namespace Elisa.Common.Models; diff --git a/Elisa/Models/Index.cs b/Elisa.Common/Models/Index.cs similarity index 98% rename from Elisa/Models/Index.cs rename to Elisa.Common/Models/Index.cs index c7b41a3..ea3e125 100644 --- a/Elisa/Models/Index.cs +++ b/Elisa.Common/Models/Index.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class Index { diff --git a/Elisa/Models/Item.cs b/Elisa.Common/Models/Item.cs similarity index 96% rename from Elisa/Models/Item.cs rename to Elisa.Common/Models/Item.cs index 8584897..2b3e0c5 100644 --- a/Elisa/Models/Item.cs +++ b/Elisa.Common/Models/Item.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; // TODO: check public class CommanderUniform diff --git a/Elisa/Models/Mail.cs b/Elisa.Common/Models/Mail.cs similarity index 95% rename from Elisa/Models/Mail.cs rename to Elisa.Common/Models/Mail.cs index 524e066..5e44dce 100644 --- a/Elisa/Models/Mail.cs +++ b/Elisa.Common/Models/Mail.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class IndexMail { diff --git a/Elisa/Models/Mission.cs b/Elisa.Common/Models/Mission.cs similarity index 99% rename from Elisa/Models/Mission.cs rename to Elisa.Common/Models/Mission.cs index d00b642..03dad80 100644 --- a/Elisa/Models/Mission.cs +++ b/Elisa.Common/Models/Mission.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class Airbone { diff --git a/Elisa/Models/Operation.cs b/Elisa.Common/Models/Operation.cs similarity index 84% rename from Elisa/Models/Operation.cs rename to Elisa.Common/Models/Operation.cs index 47e856a..45aee34 100644 --- a/Elisa/Models/Operation.cs +++ b/Elisa.Common/Models/Operation.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class OperationAct { diff --git a/Elisa/Models/Outhouse.cs b/Elisa.Common/Models/Outhouse.cs similarity index 95% rename from Elisa/Models/Outhouse.cs rename to Elisa.Common/Models/Outhouse.cs index af77b60..9aa920a 100644 --- a/Elisa/Models/Outhouse.cs +++ b/Elisa.Common/Models/Outhouse.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class OuthouseFurniture { diff --git a/Elisa/Models/Prize.cs b/Elisa.Common/Models/Prize.cs similarity index 98% rename from Elisa/Models/Prize.cs rename to Elisa.Common/Models/Prize.cs index 49f9dea..2bc1d03 100644 --- a/Elisa/Models/Prize.cs +++ b/Elisa.Common/Models/Prize.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class AddEquip { diff --git a/Elisa/Models/Quest.cs b/Elisa.Common/Models/Quest.cs similarity index 99% rename from Elisa/Models/Quest.cs rename to Elisa.Common/Models/Quest.cs index 9ead0b3..1d528ca 100644 --- a/Elisa/Models/Quest.cs +++ b/Elisa.Common/Models/Quest.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class AccomplishQuestList { diff --git a/Elisa/Models/Rank.cs b/Elisa.Common/Models/Rank.cs similarity index 91% rename from Elisa/Models/Rank.cs rename to Elisa.Common/Models/Rank.cs index dd6403d..a27c7c7 100644 --- a/Elisa/Models/Rank.cs +++ b/Elisa.Common/Models/Rank.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class RankUserInfo { diff --git a/Elisa/Models/Sangvis.cs b/Elisa.Common/Models/Sangvis.cs similarity index 98% rename from Elisa/Models/Sangvis.cs rename to Elisa.Common/Models/Sangvis.cs index 7471415..11c1137 100644 --- a/Elisa/Models/Sangvis.cs +++ b/Elisa.Common/Models/Sangvis.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; // tODO: check public class Sangvis diff --git a/Elisa/Models/Settings.cs b/Elisa.Common/Models/Settings.cs similarity index 96% rename from Elisa/Models/Settings.cs rename to Elisa.Common/Models/Settings.cs index ebc86f9..93d5755 100644 --- a/Elisa/Models/Settings.cs +++ b/Elisa.Common/Models/Settings.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class GameConfigInfo { diff --git a/Elisa/Models/Squad.cs b/Elisa.Common/Models/Squad.cs similarity index 97% rename from Elisa/Models/Squad.cs rename to Elisa.Common/Models/Squad.cs index 6e2e8ef..cb5407a 100644 --- a/Elisa/Models/Squad.cs +++ b/Elisa.Common/Models/Squad.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; // TODO: check public class Squad diff --git a/Elisa/Models/Theater.cs b/Elisa.Common/Models/Theater.cs similarity index 98% rename from Elisa/Models/Theater.cs rename to Elisa.Common/Models/Theater.cs index 4789076..e12965a 100644 --- a/Elisa/Models/Theater.cs +++ b/Elisa.Common/Models/Theater.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class SquadInTheaterInfo { diff --git a/Elisa/Models/User.cs b/Elisa.Common/Models/User.cs similarity index 98% rename from Elisa/Models/User.cs rename to Elisa.Common/Models/User.cs index a558c70..aff3660 100644 --- a/Elisa/Models/User.cs +++ b/Elisa.Common/Models/User.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class UserInfo { diff --git a/Elisa/Models/Vehicle.cs b/Elisa.Common/Models/Vehicle.cs similarity index 97% rename from Elisa/Models/Vehicle.cs rename to Elisa.Common/Models/Vehicle.cs index dfa2194..46ab779 100644 --- a/Elisa/Models/Vehicle.cs +++ b/Elisa.Common/Models/Vehicle.cs @@ -1,4 +1,4 @@ -namespace Elisa.Models; +namespace Elisa.Common.Models; public class Vehicle { diff --git a/Elisa/Utils/Crypto.cs b/Elisa.Common/Utils/Crypto.cs similarity index 93% rename from Elisa/Utils/Crypto.cs rename to Elisa.Common/Utils/Crypto.cs index 8411959..e530dd9 100644 --- a/Elisa/Utils/Crypto.cs +++ b/Elisa.Common/Utils/Crypto.cs @@ -3,7 +3,7 @@ using System.IO.Compression; using System.Security.Cryptography; using System.Text; -namespace Elisa.Utils; +namespace Elisa.Common.Utils; public static class Crypto { @@ -15,7 +15,7 @@ public static class Crypto if (string.IsNullOrEmpty(body) || string.IsNullOrEmpty(key)) return string.Empty; - if (body.Length == 1 || body.StartsWith("error:") || (body.StartsWith("{") && body.EndsWith("}"))) + if (body.Length == 1 || body.StartsWith("error:") || body.StartsWith("{") && body.EndsWith("}")) return body; try @@ -27,13 +27,13 @@ public static class Crypto { body = body.Substring(1); - return GZipDecompress(RC4(ConvertFromBase64String(body), pwd).Skip(26).ToArray()); + return GZipDecompress(RC4(ConvertFromBase64String(body), pwd).Skip(26).ToArray()); } byte[] bytes = RC4(ConvertFromBase64String(body), pwd); string @string = Encoding.UTF8.GetString(bytes); - return (@string.Length > 26) ? @string.Substring(26) : string.Empty; + return @string.Length > 26 ? @string.Substring(26) : string.Empty; } catch { @@ -52,7 +52,7 @@ public static class Crypto string text2 = MD5(text.Substring(16, 16)); string pwd = text2 + MD5(text2); byte[] bytes = Encoding.UTF8.GetBytes(string.Format("{0}", Math.Round(GetCurrentSec()) + 3600.0)); - string s2 = MD5(array.Concat(Encoding.UTF8.GetBytes(s)).ToArray()).Substring(0, 16); + string s2 = MD5(array.Concat(Encoding.UTF8.GetBytes(s)).ToArray()).Substring(0, 16); byte[] array2 = new byte[array.Length + 26]; Array.Copy(bytes, 0, array2, 0, bytes.Length); @@ -134,11 +134,11 @@ public static class Crypto for (i = 0; i < 256; i++) { - array[i] = (int)pwd[i % pwd.Length]; + array[i] = pwd[i % pwd.Length]; array2[i] = i; } - for (i = (num = 0); i < 256; i++) + for (i = num = 0; i < 256; i++) { int num2 = array2[i]; @@ -148,7 +148,7 @@ public static class Crypto } int num3; - num = (num3 = (i = 0)); + num = num3 = i = 0; while (i < data.Length) { @@ -162,7 +162,7 @@ public static class Crypto array2[num] = num2; int num4 = array2[(array2[num3] + array2[num]) % 256]; - array3[i] = (byte)((int)data[i] ^ num4); + array3[i] = (byte)(data[i] ^ num4); i++; } diff --git a/Elisa/Utils/RNG.cs b/Elisa.Common/Utils/RNG.cs similarity index 91% rename from Elisa/Utils/RNG.cs rename to Elisa.Common/Utils/RNG.cs index 4b1d85e..b569c4a 100644 --- a/Elisa/Utils/RNG.cs +++ b/Elisa.Common/Utils/RNG.cs @@ -1,4 +1,4 @@ -namespace Elisa.Utils; +namespace Elisa.Common.Utils; public static class RNG { @@ -14,7 +14,7 @@ public static class RNG { double range = (double)max - min; double sample = random.NextDouble(); - double scaled = (sample * range) + min; + double scaled = sample * range + min; return (float)scaled; } diff --git a/Elisa/Utils/Singleton.cs b/Elisa.Common/Utils/Singleton.cs similarity index 90% rename from Elisa/Utils/Singleton.cs rename to Elisa.Common/Utils/Singleton.cs index e1e94a3..f903c54 100644 --- a/Elisa/Utils/Singleton.cs +++ b/Elisa.Common/Utils/Singleton.cs @@ -1,4 +1,4 @@ -namespace Elisa.Utils; +namespace Elisa.Common.Utils; public abstract class Singleton where T : new() { diff --git a/Elisa/Utils/Time.cs b/Elisa.Common/Utils/Time.cs similarity index 90% rename from Elisa/Utils/Time.cs rename to Elisa.Common/Utils/Time.cs index 56c905e..b1b3d48 100644 --- a/Elisa/Utils/Time.cs +++ b/Elisa.Common/Utils/Time.cs @@ -1,4 +1,4 @@ -namespace Elisa.Utils; +namespace Elisa.Common.Utils; public static class Time { @@ -12,7 +12,7 @@ public static class Time => new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1, 0, 0, 0, DateTimeKind.Utc).AddMonths(1).ToUnixSeconds(); } -internal static class DateTimeExtensions +public static class DateTimeExtensions { public static long ToUnixSeconds(this DateTime dateTime) => (long)(dateTime - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds; diff --git a/Elisa/Commands/Command.cs b/Elisa.GameServer/Commands/Command.cs similarity index 96% rename from Elisa/Commands/Command.cs rename to Elisa.GameServer/Commands/Command.cs index cfc514d..43a6bd7 100644 --- a/Elisa/Commands/Command.cs +++ b/Elisa.GameServer/Commands/Command.cs @@ -1,7 +1,7 @@ using Serilog; using System.Reflection; -namespace Elisa.Commands; +namespace Elisa.GameServer.Commands; [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] public class CommandHandler(string name, string description, string example) : Attribute @@ -140,7 +140,7 @@ public static class CommandHandlerFactory if (connection is not null) { - if (!(commandFunctionsUser).TryGetValue(parts[0], out var command)) + if (!commandFunctionsUser.TryGetValue(parts[0], out var command)) { Log.Warning($"Unknown command: {parts[0]}"); return; @@ -150,7 +150,7 @@ public static class CommandHandlerFactory } else { - if (!(commandFunctions).TryGetValue(parts[0], out var command)) + if (!commandFunctions.TryGetValue(parts[0], out var command)) { Log.Warning($"Unknown command: {parts[0]}"); return; diff --git a/Elisa/Commands/HelpCommand.cs b/Elisa.GameServer/Commands/HelpCommand.cs similarity index 96% rename from Elisa/Commands/HelpCommand.cs rename to Elisa.GameServer/Commands/HelpCommand.cs index 7100f2b..6fd33af 100644 --- a/Elisa/Commands/HelpCommand.cs +++ b/Elisa.GameServer/Commands/HelpCommand.cs @@ -1,7 +1,7 @@ using System.Reflection; using System.Text; -namespace Elisa.Commands; +namespace Elisa.GameServer.Commands; [CommandHandler("help", "Print out all commands with their description and example", "help")] public class HelpCommand : Command diff --git a/Elisa/Commands/TestCommand.cs b/Elisa.GameServer/Commands/TestCommand.cs similarity index 92% rename from Elisa/Commands/TestCommand.cs rename to Elisa.GameServer/Commands/TestCommand.cs index 5d9442e..d540e41 100644 --- a/Elisa/Commands/TestCommand.cs +++ b/Elisa.GameServer/Commands/TestCommand.cs @@ -1,7 +1,7 @@ -using Elisa.Utils; +using Elisa.Common.Utils; using Serilog; -namespace Elisa.Commands; +namespace Elisa.GameServer.Commands; [CommandHandler("test", "Command to test various functions", "test type=encrypt value=asdf")] public class tESTcOMMAND : Command diff --git a/Elisa.GameServer/Controllers/CommandController.cs b/Elisa.GameServer/Controllers/CommandController.cs new file mode 100644 index 0000000..e4837e6 --- /dev/null +++ b/Elisa.GameServer/Controllers/CommandController.cs @@ -0,0 +1,17 @@ +using Elisa.GameServer.Commands; +using Microsoft.AspNetCore.Mvc; + +namespace Elisa.Controllers; + +[ApiController] +[Route("/")] +public class CommandController : ControllerBase +{ + [HttpGet("command")] + public async Task Command([FromQuery] string command) + { + CommandHandlerFactory.HandleCommand(command); + + return Results.Text("Command executed"); + } +} diff --git a/Elisa.GameServer/Controllers/IndexController.cs b/Elisa.GameServer/Controllers/IndexController.cs new file mode 100644 index 0000000..f591230 --- /dev/null +++ b/Elisa.GameServer/Controllers/IndexController.cs @@ -0,0 +1,47 @@ +using Elisa.Common.Utils; +using Microsoft.AspNetCore.Mvc; + +namespace Elisa.GameServer.Controllers; + +public class IndexController : Controller +{ + [HttpPost("index.php", Name = "ServerList")] + public async Task ServerList() + { + return Results.Text(System.IO.File.ReadAllText(@"Resources\serverList.xml")); + } + + [HttpGet("index.php/1001/index/version", Name = "Version")] + public async Task Version([FromQuery] string req_id) + { + return Results.Json(new + { + now = DateTime.Now.ToUnixSeconds(), + tomorrow_zero = Time.GetTomorrowZero(), + month_zero = Time.GetCurrentMonthZero(), + next_month_zero = Time.GetNextMonthZero(), + timezone = "PST8PDT", + data_version = GameServer.DataVersion, + client_version = GameServer.ClientVersion, + ab_version = GameServer.ABVersion, + is_kick = "0", + weekday = 1, + authentication_url = $"http://realauth.ucenter.ppgame.com/authoriz.html?appid={0}&openid={1}&accounttype=1&language=zh" + }); + } + + [HttpGet("image/imageconfig.txt", Name = "ImageConfig")] + public async Task ImageConfig() + { + return Results.Text(System.IO.File.ReadAllText(@"Resources\image\ImageConfig.txt")); + } + + /* + [Route("{*url}")] + public async Task HandleAll(string url) + { + Log.Information("Handling unmatched request for URL: {Url}", url); + return Content($"Handled by catch-all route: {url}"); + } + */ +} diff --git a/Elisa/Elisa.csproj b/Elisa.GameServer/Elisa.GameServer.csproj similarity index 60% rename from Elisa/Elisa.csproj rename to Elisa.GameServer/Elisa.GameServer.csproj index b9ec5df..4740ae2 100644 --- a/Elisa/Elisa.csproj +++ b/Elisa.GameServer/Elisa.GameServer.csproj @@ -1,4 +1,4 @@ - + Exe @@ -12,12 +12,21 @@ + + PreserveNewest + PreserveNewest + + PreserveNewest + PreserveNewest + + PreserveNewest + PreserveNewest @@ -29,10 +38,15 @@ + - - + + + + + + diff --git a/Elisa.GameServer/GameServer.cs b/Elisa.GameServer/GameServer.cs new file mode 100644 index 0000000..d8deac6 --- /dev/null +++ b/Elisa.GameServer/GameServer.cs @@ -0,0 +1,54 @@ +using Elisa.Common.Data; +using Elisa.GameServer.Commands; +using Elisa.GameServer.Services; +using Serilog; +using System.Diagnostics; +using System.Reflection; +using System.Text.Encodings.Web; + +namespace Elisa.GameServer; + +public static class GameServer +{ + public static string ClientVersion = 30400.ToString(); + public static string DataVersion = "d630eea53a1b869fa4d7d1479a3d09e7"; + public static string ABVersion = 2024051417.ToString(); + + public static void Main(string[] args) + { + WebApplicationBuilder builder = WebApplication.CreateBuilder(args); + builder.Host.UseSerilog((context, configuration) => configuration.ReadFrom.Configuration(context.Configuration)); + builder.Services.AddHttpClient(); + builder.Services.AddControllers() + .AddJsonOptions(options => options.JsonSerializerOptions.Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping); + builder.Services.AddEndpointsApiExplorer(); + builder.Services.AddSwaggerGen(); + builder.Services.AddHostedService(provider => new ProxyBackgroundService("127.0.0.1")); + + WebApplication app = builder.Build(); + app.UseSerilogRequestLogging(); + app.UseAuthorization(); + app.MapControllers(); + if (app.Environment.IsDevelopment()) + { + app.UseSwagger(); + app.UseSwaggerUI(); + } + + Log.Information($"Version {Assembly.GetEntryAssembly()?.GetCustomAttribute()?.InformationalVersion}"); + Log.Information($"Client Version: {ClientVersion}"); + Log.Information($"Data Version: {DataVersion}"); + Log.Information($"AB Version: {ABVersion}"); + Log.Information($"Starting {Assembly.GetEntryAssembly()?.GetName().Name.Split('.')[0]}..."); + + Stopwatch stopwatch = Stopwatch.StartNew(); + { + CommandHandlerFactory.RegisterCommands(Assembly.GetExecutingAssembly()); + Table.Load(); + } + stopwatch.Stop(); + Log.Information($"Done! Loaded in {stopwatch.ElapsedMilliseconds}ms"); + + app.Run(); + } +} diff --git a/Elisa.GameServer/Properties/launchSettings.json b/Elisa.GameServer/Properties/launchSettings.json new file mode 100644 index 0000000..edc61ef --- /dev/null +++ b/Elisa.GameServer/Properties/launchSettings.json @@ -0,0 +1,40 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:3505", + "sslPort": 44376 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "launchUrl": "swagger", + "applicationUrl": "http://127.0.0.1", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7010;http://localhost:5208", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/Elisa.GameServer/ProxyControl.cs b/Elisa.GameServer/ProxyControl.cs new file mode 100644 index 0000000..8029dc2 --- /dev/null +++ b/Elisa.GameServer/ProxyControl.cs @@ -0,0 +1,55 @@ +using Serilog; +using System.Text.RegularExpressions; +using Titanium.Web.Proxy; +using Titanium.Web.Proxy.EventArguments; +using Titanium.Web.Proxy.Models; + +namespace Elisa.GameServer; + +public class ProxyControl +{ + static readonly Regex HostFilter = new Regex("(.*).(girlfrontline\\.co\\.kr|ppgame\\.com|txwy\\.tw|sunborngame\\.com|aihelp.net.cn).*"); + readonly string forwardIpAddress; + readonly ProxyServer proxyServer; + readonly ExplicitProxyEndPoint explicitEndPoint; + + public ProxyControl(string forwardIpAddress, int port = 9000) + { + this.forwardIpAddress = forwardIpAddress; + proxyServer = new ProxyServer(); + explicitEndPoint = new ExplicitProxyEndPoint(System.Net.IPAddress.Any, port, true); + + proxyServer.BeforeRequest += OnRequest; + } + + public void Start() + { + proxyServer.AddEndPoint(explicitEndPoint); + proxyServer.Start(); + + // proxyServer.SetAsSystemHttpProxy(explicitEndPoint); + // proxyServer.SetAsSystemHttpsProxy(explicitEndPoint); + } + + public void Stop() + { + proxyServer.BeforeRequest -= OnRequest; + proxyServer.Stop(); + } + + private async Task OnRequest(object sender, SessionEventArgs e) + { + Uri requestUri = e.HttpClient.Request.RequestUri; + if (HostFilter.IsMatch(requestUri.Host)) + { + Log.Information($"Forwarding request for {requestUri} to {forwardIpAddress}"); + + Uri newUri = new Uri("http://" + forwardIpAddress + requestUri.PathAndQuery, UriKind.Absolute); + Log.Information($"Forwarded request to {newUri}"); + + e.HttpClient.Request.RequestUri = newUri; + + // Bubble it out to user + } + } +} diff --git a/Elisa/Resources/catchdata/gun_exp_info.json b/Elisa.GameServer/Resources/catchdata/gun_exp_info.json similarity index 100% rename from Elisa/Resources/catchdata/gun_exp_info.json rename to Elisa.GameServer/Resources/catchdata/gun_exp_info.json diff --git a/Elisa.GameServer/Resources/image/ImageConfig.txt b/Elisa.GameServer/Resources/image/ImageConfig.txt new file mode 100644 index 0000000..48eecec --- /dev/null +++ b/Elisa.GameServer/Resources/image/ImageConfig.txt @@ -0,0 +1,11 @@ +//类型名|是否会保存到本地|资源名 +//HotUpdateBackground|true|Background161101.png +HotUpdateBackground|true|1ff934568eb9d2a6_draw_221213175434.png +LoginBackground|true|201805 + +HomeBackground|true| +attendance1|true| +attendance2|true|d3d1b3e115da2221_draw_240507142255.jpg +CDKey2|true| +SevenSupply1|true|c30482012b01a83a_draw_181106004.png +FirstPurchase1|true| \ No newline at end of file diff --git a/Elisa.GameServer/Resources/serverList.xml b/Elisa.GameServer/Resources/serverList.xml new file mode 100644 index 0000000..9838810 --- /dev/null +++ b/Elisa.GameServer/Resources/serverList.xml @@ -0,0 +1,101 @@ + + + + + GRIFFIN + http://127.0.0.1/ + 1001 + 0 + 0 + 0 + 0 + 2024051417 + 1714705161 + 1 + + + + http://127.0.0.1/pages/notice + http://127.0.0.1/pages/update_url + 2018-05-16 20:00:43 + 2036-09-01 00:00:00 + 30400 + https://play.google.com/store/apps/details?id=com.sunborn.girlsfrontline.en + 20410 + + v.3.0400 Update Content: + + [Mobile Armor System Optimizations] + + 1. Optimized: The "Mobile Armor" combat results screen now shows the remaining HP and other such info of the Mobile Armor units in question. An option to "Armor Enhancement" has been added to the Mission Failed screen. + + 2. Optimized: If a Mobile Armor 4unit is not "In Combat", Fire Support Units assigned to the armor in question can be independently deployed as normal. + + 3. Optimized: The "Tech Tree" display of the Mobile Armor system now features a before and after display of effects when activating certain nodes. + + 4. Optimized: Mobile Armor support skills are now labelled with the [Support] tag. + + 5. Optimized: The Armor Design Shop's item preview function now adds an indication that an item is being previewed, as well as showing if a certain mobile armor design will clash with others. You can also instantly purchase a desired item after trying it out. Changing an armor's degisn blueprint no longer clears out equipped designs. + + The "Armor Design" set display mode has also been added. You may use this function to preview the look of a scerain set of armor designs as well as purchase it immediately. + + The "Armor Design" purchase screen has been made easier to use. + + The arrangement of items in the "Armor Design" blueprint display screen has been improved. + + 6. Optimized: Information display for non-generic components has been improved and the equip screen has been mae easier to use. + + 7. Optimized: Information display and filtering for generic components has been improved. + + + [Other New Content] + + 1. Added: "Armored Assault" mode in "Gray Zone Exploration" now has the "Sweep" function. If you have already cleared up to a certain point in the stage, you can click "Sweep" to expend attempts to directly obtain the stage rewards. + + 2. Added: The "Gray Zone Exploration" system now features a new Proxy Planning function. At the "Echelon Formation" or the "Gray Zone Exploration" difficulty select, you can click the newly-added "Echelon Pre-Select" button to enter the echelon pre-selection screen. + On this screen, you can edit and select echelons for use in Proxy Battle mode, as well as deciding whether the echelons in question will take part in day or night battles. + Once you have finished editing, selected and activated your pre-selected echelons, the system will only use these echelons or units during Proxy Battle mode. + + 3. Added: Combat Simulations now have the "Sweep" function. During "EXP Mode", "Data Mode", "Capsule Mode", "Neural Cloud Corridor" and "Coalition Drill, you can select the number of times you want to sweep the simulation in question and press the "Sweep" button to expend the corresponding amount of attempts and gain the appropriate materials as rewards. + + 4. Added: The "Echelon Formation" screen now has a Share function. By clicking the "Share" button, you can convert your current echelon's data into a bar code or QR code which can be shared with other Commanders. This code can be used by other Commanders to reproduce your echelon. + This function is not currently available for vehicle echelons. + + 5. Added: The "Search" function has ben aded to the unit display screen. You can enter keywords to search for units which meet the criteria. + + 6. Added: The "Favorite" function has been added to unit detail pages. By clicking it, you can favorite the unit in question, which enables the filter option "Only show favorited" units. + + 7. Added: The armor components "Vehicle Shotgun", "Mini Mortar", "Laser Rangefinder", "Camouflage Netting", "Top Slat Armor" can be obtained through exploring the "Vitrified - Hell" region during "Gray Zone Exploration". + + [Other Optimizations] + + 1. Optimized: The "Repair All " option now includes Fire Support Units and Mobile Armors. + + 2. Optimized: Mid-battle nformation display for Fire Support Units has been improved. You can view information on Fire Support Units and Mobile Armors units by clicking and holding on them. + + 3. Optimized: The post-mission reward display screen in Gray Zone Exploration has been tweaked. + + 4. Optimized: The overall functional experience of the Proxy Battle system in Gray Zone Exploration has been improved. + + 5. Optimized: The Chip Enhancement system for Fire Support Units has been improved. The Chip Enhancement screen now has options to "Max-Enhance One Chip" and "Max-Enhance Multiple Chips". + + 6. Optimized: Data display for "Equipment" has been improved. A special equipment buff tab has been added for the equipment detail display screen. + + 7. Optimized: The Echelon Formation screen now gives the option to select multiple echelons at once. Also, certain Fire Support Units selection screens allow you to select multiple Fire Support Units at once. + + 8. Optimized: The maximum amount of Surplus EXP that can be held at one time has been increased. Kalina's speed of writing combat reports has also been increased. + + 9. Optimized: Alerts have been added for the addition of new Career Missions. + + 10. Optimized: Unit selection displays have been improved. The option to select units based on their Repair, Move Speed and other stats has also been added. + + 11. Optimized: The potential dropped items display for missions ahas been improved. It now has popups for unlock conditions and the layout has been improved. + + 12. Optimized: Planning Mode AP expenditures now display extra APs for echelons and vehicle fuel supply status. + + 13. Optimized: A problem where one could not drag or shrink unit CGs when inspecting them in the Unit Details screen. + + 14. Optimized: A problem where the rewards screen would be displayed multiple times after certain Ranking Mode stages were made permanently available in the campaign tab. + + + diff --git a/Elisa/Resources/stc/daily.json b/Elisa.GameServer/Resources/stc/daily.json similarity index 100% rename from Elisa/Resources/stc/daily.json rename to Elisa.GameServer/Resources/stc/daily.json diff --git a/Elisa/Resources/stc/equip.json b/Elisa.GameServer/Resources/stc/equip.json similarity index 100% rename from Elisa/Resources/stc/equip.json rename to Elisa.GameServer/Resources/stc/equip.json diff --git a/Elisa/Resources/stc/fairy.json b/Elisa.GameServer/Resources/stc/fairy.json similarity index 100% rename from Elisa/Resources/stc/fairy.json rename to Elisa.GameServer/Resources/stc/fairy.json diff --git a/Elisa/Resources/stc/furniture.json b/Elisa.GameServer/Resources/stc/furniture.json similarity index 100% rename from Elisa/Resources/stc/furniture.json rename to Elisa.GameServer/Resources/stc/furniture.json diff --git a/Elisa/Resources/stc/gift_item.json b/Elisa.GameServer/Resources/stc/gift_item.json similarity index 100% rename from Elisa/Resources/stc/gift_item.json rename to Elisa.GameServer/Resources/stc/gift_item.json diff --git a/Elisa/Resources/stc/gun.json b/Elisa.GameServer/Resources/stc/gun.json similarity index 100% rename from Elisa/Resources/stc/gun.json rename to Elisa.GameServer/Resources/stc/gun.json diff --git a/Elisa/Resources/stc/item.json b/Elisa.GameServer/Resources/stc/item.json similarity index 100% rename from Elisa/Resources/stc/item.json rename to Elisa.GameServer/Resources/stc/item.json diff --git a/Elisa/Resources/stc/mission.json b/Elisa.GameServer/Resources/stc/mission.json similarity index 100% rename from Elisa/Resources/stc/mission.json rename to Elisa.GameServer/Resources/stc/mission.json diff --git a/Elisa/Resources/stc/present.json b/Elisa.GameServer/Resources/stc/present.json similarity index 100% rename from Elisa/Resources/stc/present.json rename to Elisa.GameServer/Resources/stc/present.json diff --git a/Elisa/Resources/stc/prize.json b/Elisa.GameServer/Resources/stc/prize.json similarity index 100% rename from Elisa/Resources/stc/prize.json rename to Elisa.GameServer/Resources/stc/prize.json diff --git a/Elisa/Resources/stc/sangvis.json b/Elisa.GameServer/Resources/stc/sangvis.json similarity index 100% rename from Elisa/Resources/stc/sangvis.json rename to Elisa.GameServer/Resources/stc/sangvis.json diff --git a/Elisa/Resources/stc/skin.json b/Elisa.GameServer/Resources/stc/skin.json similarity index 100% rename from Elisa/Resources/stc/skin.json rename to Elisa.GameServer/Resources/stc/skin.json diff --git a/Elisa/Resources/stc/spot.json b/Elisa.GameServer/Resources/stc/spot.json similarity index 100% rename from Elisa/Resources/stc/spot.json rename to Elisa.GameServer/Resources/stc/spot.json diff --git a/Elisa/Resources/stc/squad.json b/Elisa.GameServer/Resources/stc/squad.json similarity index 100% rename from Elisa/Resources/stc/squad.json rename to Elisa.GameServer/Resources/stc/squad.json diff --git a/Elisa/Resources/stc/vehicle.json b/Elisa.GameServer/Resources/stc/vehicle.json similarity index 100% rename from Elisa/Resources/stc/vehicle.json rename to Elisa.GameServer/Resources/stc/vehicle.json diff --git a/Elisa/Resources/stc/vehicle_component.json b/Elisa.GameServer/Resources/stc/vehicle_component.json similarity index 100% rename from Elisa/Resources/stc/vehicle_component.json rename to Elisa.GameServer/Resources/stc/vehicle_component.json diff --git a/Elisa/Resources/stc/weekly.json b/Elisa.GameServer/Resources/stc/weekly.json similarity index 100% rename from Elisa/Resources/stc/weekly.json rename to Elisa.GameServer/Resources/stc/weekly.json diff --git a/Elisa.GameServer/Services/ProxyBackgroundService.cs b/Elisa.GameServer/Services/ProxyBackgroundService.cs new file mode 100644 index 0000000..d8f0bf0 --- /dev/null +++ b/Elisa.GameServer/Services/ProxyBackgroundService.cs @@ -0,0 +1,25 @@ +namespace Elisa.GameServer.Services; + +public class ProxyBackgroundService : BackgroundService +{ + readonly ProxyControl proxyControl; + + public ProxyBackgroundService(string forwardIpAddress) + { + proxyControl = new ProxyControl(forwardIpAddress); + } + + protected override async Task ExecuteAsync(CancellationToken stoppingToken) + { + proxyControl.Start(); + stoppingToken.Register(() => proxyControl.Stop()); + + while (!stoppingToken.IsCancellationRequested) + await Task.Delay(1000, stoppingToken); + } + + public override async Task StopAsync(CancellationToken stoppingToken) + { + await base.StopAsync(stoppingToken); + } +} diff --git a/Elisa.GameServer/appsettings.Development.json b/Elisa.GameServer/appsettings.Development.json new file mode 100644 index 0000000..52c6844 --- /dev/null +++ b/Elisa.GameServer/appsettings.Development.json @@ -0,0 +1,39 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Information" + } + }, + "AllowedHosts": "*", + "Serilog": { + "Using": ["Serilog", "Serilog.Sinks.Console", "Serilog.Sinks.File", "Serilog.Sinks.Async"], + "MinimumLevel": { + "Default": "Debug", + "Override": { + "Microsoft": "Information", + "System": "Information" + } + }, + "WriteTo": [ + { + "Name": "Async", + "Args": { + "configure": [ + { + "Name": "Console" + }, + { + "Name": "File", + "Args": { + "path": "Logs/log-.txt", + "rollingInterval": "Day" + } + } + ] + } + } + ], + "Enrich": ["FromLogContext", "WithThreadId", "WithMemoryUsage"] + } +} \ No newline at end of file diff --git a/Elisa.GameServer/appsettings.json b/Elisa.GameServer/appsettings.json new file mode 100644 index 0000000..5b39755 --- /dev/null +++ b/Elisa.GameServer/appsettings.json @@ -0,0 +1,10 @@ +{ + "Urls": "http://localhost:80", + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/Elisa.sln b/Elisa.sln index d590b6a..596a59e 100644 --- a/Elisa.sln +++ b/Elisa.sln @@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.8.34316.72 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elisa", "Elisa\Elisa.csproj", "{AE240F77-1DA8-42B0-9D81-E42B8E7B7D77}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elisa.Common", "Elisa.Common\Elisa.Common.csproj", "{41B9435A-3D9D-44BF-B1F5-60FBA8557A1A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elisa.GameServer", "Elisa.GameServer\Elisa.GameServer.csproj", "{D7C3C727-8AB9-4C4A-91AE-7A416F452A96}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -11,10 +13,14 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AE240F77-1DA8-42B0-9D81-E42B8E7B7D77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AE240F77-1DA8-42B0-9D81-E42B8E7B7D77}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AE240F77-1DA8-42B0-9D81-E42B8E7B7D77}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AE240F77-1DA8-42B0-9D81-E42B8E7B7D77}.Release|Any CPU.Build.0 = Release|Any CPU + {41B9435A-3D9D-44BF-B1F5-60FBA8557A1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {41B9435A-3D9D-44BF-B1F5-60FBA8557A1A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {41B9435A-3D9D-44BF-B1F5-60FBA8557A1A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {41B9435A-3D9D-44BF-B1F5-60FBA8557A1A}.Release|Any CPU.Build.0 = Release|Any CPU + {D7C3C727-8AB9-4C4A-91AE-7A416F452A96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D7C3C727-8AB9-4C4A-91AE-7A416F452A96}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D7C3C727-8AB9-4C4A-91AE-7A416F452A96}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D7C3C727-8AB9-4C4A-91AE-7A416F452A96}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Elisa/Controllers/IndexController.cs b/Elisa/Controllers/IndexController.cs deleted file mode 100644 index dfcc1c0..0000000 --- a/Elisa/Controllers/IndexController.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Elisa.Utils; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; - -namespace Elisa.Controllers; - -[ApiController] -[Route("/Index")] -public class IndexController : ControllerBase -{ - [HttpGet("version")] - public async Task Version([FromQuery] string req_id) - { - return Results.Json(new - { - now = DateTime.Now.ToUnixSeconds(), - tomorrow_zero = Time.GetTomorrowZero(), - month_zero = Time.GetCurrentMonthZero(), - next_month_zero = Time.GetNextMonthZero(), - timezone = "PST8PDT", - data_version = Program.DataVersion, - client_version = Program.ClientVersion, - ab_version = Program.ABVersion, - is_kick = "0", - weekday = 1, - authentication_url = $"http://realauth.ucenter.ppgame.com/authoriz.html?appid={0}&openid={1}&accounttype=1&language=zh" - }); - } -} diff --git a/Elisa/Data/Tables/Text.cs b/Elisa/Data/Tables/Text.cs deleted file mode 100644 index 05e6f4d..0000000 --- a/Elisa/Data/Tables/Text.cs +++ /dev/null @@ -1 +0,0 @@ -namespace Elisa.Data.Tables; diff --git a/Elisa/GameServer.cs b/Elisa/GameServer.cs deleted file mode 100644 index d3d7e6a..0000000 --- a/Elisa/GameServer.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Server.Kestrel.Core; -using Microsoft.Extensions.DependencyInjection; -using Serilog; - -namespace Elisa; - -public static class GameServer -{ - public static async Task Start() - { - WebApplicationBuilder builder = WebApplication.CreateBuilder(Environment.GetCommandLineArgs()); - builder.Host.UseSerilog(); - builder.Services.Configure(options => - { - options.AllowSynchronousIO = true; - }); - builder.Services.AddControllers(); - - WebApplication app = builder.Build(); - app.UseAuthorization(); - app.UseSerilogRequestLogging(); - app.Map("/", HandleRequest); - app.MapControllers(); - app.Run(); - } - - static async Task HandleRequest(HttpContext context) - { - // Is this even necessary? - if (context.Request.Method == "CONNECT") - context.Response.StatusCode = StatusCodes.Status200OK; - else - { - context.Response.StatusCode = StatusCodes.Status405MethodNotAllowed; - await context.Response.WriteAsync("Error 405: Method Not Allowed"); - } - } -} diff --git a/Elisa/InputSystem.cs b/Elisa/InputSystem.cs deleted file mode 100644 index e4b9a14..0000000 --- a/Elisa/InputSystem.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Elisa.Commands; - -namespace Elisa; - -public static class InputSystem -{ - public static void Start() - { - while (true) - { - string? command = Console.ReadLine(); - - if (string.IsNullOrEmpty(command)) - continue; - - CommandHandlerFactory.HandleCommand(command); - } - } -} diff --git a/Elisa/Messages/Favor.cs b/Elisa/Messages/Favor.cs deleted file mode 100644 index 2cb876a..0000000 --- a/Elisa/Messages/Favor.cs +++ /dev/null @@ -1 +0,0 @@ -namespace Elisa.Messages; diff --git a/Elisa/Messages/Guide.cs b/Elisa/Messages/Guide.cs deleted file mode 100644 index 2cb876a..0000000 --- a/Elisa/Messages/Guide.cs +++ /dev/null @@ -1 +0,0 @@ -namespace Elisa.Messages; diff --git a/Elisa/Messages/Item.cs b/Elisa/Messages/Item.cs deleted file mode 100644 index 2cb876a..0000000 --- a/Elisa/Messages/Item.cs +++ /dev/null @@ -1 +0,0 @@ -namespace Elisa.Messages; diff --git a/Elisa/Messages/User.cs b/Elisa/Messages/User.cs deleted file mode 100644 index 2cb876a..0000000 --- a/Elisa/Messages/User.cs +++ /dev/null @@ -1 +0,0 @@ -namespace Elisa.Messages; diff --git a/Elisa/Models/BattlePass.cs b/Elisa/Models/BattlePass.cs deleted file mode 100644 index ad6e04c..0000000 --- a/Elisa/Models/BattlePass.cs +++ /dev/null @@ -1 +0,0 @@ -namespace Elisa.Models; diff --git a/Elisa/Models/Home.cs b/Elisa/Models/Home.cs deleted file mode 100644 index ad6e04c..0000000 --- a/Elisa/Models/Home.cs +++ /dev/null @@ -1 +0,0 @@ -namespace Elisa.Models; diff --git a/Elisa/Program.cs b/Elisa/Program.cs deleted file mode 100644 index 538c744..0000000 --- a/Elisa/Program.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Elisa.Commands; -using Elisa.Data; -using Microsoft.Extensions.Configuration; -using Serilog; -using Serilog.Events; -using Serilog.Sinks.SystemConsole.Themes; -using System.Diagnostics; -using System.Reflection; - -namespace Elisa; - -internal static class Program -{ - public static string ClientVersion = 30400.ToString(); - public static string DataVersion = "d630eea53a1b869fa4d7d1479a3d09e7"; - public static string ABVersion = 2024051417.ToString(); - - static IConfiguration config = null!; - - public static void Main(string[] args) - { - SetupConfig(); - SetupSerilog(); - - Log.Information($"Version {Assembly.GetEntryAssembly()?.GetCustomAttribute()?.InformationalVersion}"); - Log.Information($"Client Version: {ClientVersion}"); - Log.Information($"Data Version: {DataVersion}"); - Log.Information($"AB Version: {ABVersion}"); - Log.Information($"Starting {Assembly.GetEntryAssembly()?.GetName().Name}..."); - - Stopwatch stopwatch = Stopwatch.StartNew(); - { - CommandHandlerFactory.RegisterCommands(Assembly.GetExecutingAssembly()); - Table.Load(); - } - stopwatch.Stop(); - Log.Information($"Done! Loaded in {stopwatch.ElapsedMilliseconds}ms"); - - Task.Run(InputSystem.Start); - Task.Run(Proxy.Start); - Task.Run(GameServer.Start).Wait(); - } - - private static void SetupConfig() - { - config = new ConfigurationBuilder() - .SetBasePath(Path.GetDirectoryName(AppContext.BaseDirectory)!) - .AddJsonFile("appsettings.json") - .Build(); - } - - static void SetupSerilog() - { - var logFilePath = Path.Combine(Path.GetDirectoryName(AppContext.BaseDirectory)!, "Logs", "log.txt"); - - if (File.Exists(logFilePath)) - { - string prevLogFilePath = Path.Combine(Path.GetDirectoryName(logFilePath)!, "log-prev.txt"); - - if (File.Exists(prevLogFilePath)) - File.Delete(prevLogFilePath); - - File.Move(logFilePath, prevLogFilePath); - } - - Log.Logger = new LoggerConfiguration() - .WriteTo.Console(theme: AnsiConsoleTheme.Literate) - .WriteTo.File(logFilePath, restrictedToMinimumLevel: LogEventLevel.Verbose, shared: true) - .ReadFrom.Configuration(config) - .CreateBootstrapLogger(); - } -} diff --git a/Elisa/Proxy.cs b/Elisa/Proxy.cs deleted file mode 100644 index a2a6987..0000000 --- a/Elisa/Proxy.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Serilog; -using System.Net; -using System.Net.Sockets; -using System.Text; - -namespace Elisa; - -public static class Proxy -{ - static int port = 9000; - static string serverUrl = "localhost"; - - public static async Task Start() - { - Log.Information("Starting Proxy"); - - TcpListener listener = new TcpListener(IPAddress.Any, port); - listener.Start(); - Log.Information($"Proxy: Listening on port {port}"); - - while (true) - { - TcpClient client = await listener.AcceptTcpClientAsync(); - string clientAddress = ((IPEndPoint)client.Client.RemoteEndPoint).Address.ToString(); - Log.Information($"Proxy: Accepted client connection from {clientAddress}"); - - using (TcpClient server = new TcpClient()) - { - await server.ConnectAsync(serverUrl, 80); - Log.Information($"Proxy: Connected to Elisa"); - - using (NetworkStream clientStream = client.GetStream()) - using (NetworkStream serverStream = server.GetStream()) - { - byte[] buffer = new byte[256 * 256]; - int bytesRead; - while ((bytesRead = await clientStream.ReadAsync(buffer, 0, buffer.Length)) > 0) - { - string data = Encoding.UTF8.GetString(buffer, 0, bytesRead).Trim(); - Log.Information($"Received data from client: {data}"); - } - - Task c2sTask = clientStream.CopyToAsync(serverStream); - Task s2cTask = serverStream.CopyToAsync(clientStream); - await Task.WhenAll(c2sTask, s2cTask); - } - } - - client.Close(); - Log.Information($"Proxy: Closed client connection"); - } - } -} diff --git a/Elisa/appsettings.json b/Elisa/appsettings.json deleted file mode 100644 index ebff94b..0000000 --- a/Elisa/appsettings.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "Kestrel": { - "EndPoints": { - "Http": { - "Url": "http://0.0.0.0:80" - } - } - }, - "Serilog": { - "MinimumLevel": { - "Default": "Debug", - "Override": { - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - } - }, - "AllowedHosts": "*" -}