From cacb10f12f329b944692631e04ffaedd74425804 Mon Sep 17 00:00:00 2001 From: Albert <62834423+Xannix246@users.noreply.github.com> Date: Fri, 7 Mar 2025 23:23:13 +0300 Subject: [PATCH 01/58] Create README_ru-RU.md --- docs/README_ru-RU.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 docs/README_ru-RU.md diff --git a/docs/README_ru-RU.md b/docs/README_ru-RU.md new file mode 100644 index 0000000..2b3b1b2 --- /dev/null +++ b/docs/README_ru-RU.md @@ -0,0 +1,32 @@ +# Campofinale +[EN](/README.md) | [IT](./README_it-IT.md) | [RU](./README_ru-RU.md) | [CN](./README_zh-CN.md) | [NL](./README_nl-NL.md) + +![Logo]() + +Campofinale - экспериментальная реализация сервера для кое-какой игры по постройке фабрик. + +## Текущие возможности + +* Переключение персонажей; +* Переключение отрядов; +* Переключение сцен; +* Сохранение данных с помощью MongoDB; +* Система боёвки; + +## Дополнительно + +Описание всех команд сервера вы можете найти [здесь](./CommandList/commands_ru-RU.md).
+Список всех сцен находится [тут](./LevelsTable.md).
+Список всех врагов - [тут](./EnemiesTable.md).
+Список всех персонажей - [тут](./CharactersTable.md).
+Список всех предметов - [тут](./ItemsTable.md).
+ +Вы можете открыть внутриигровую консоль, перейдя во вкладку `Settings -> Platform & Account -> Account Settings (кнопка Access Account)`. Чтобы просмотреть доступные команды, пропишите `help`. + +## Discord поддержка + +Если вы хотите обсудить проект или помочь в его разработке, присоединяйтесь к нашему [Discord серверу](https://discord.gg/gPvqhfdMU6)! + +## Примечание + +Этот проект разрабатывается независимо от чего-либо, все права на ассеты из оригинальной игры и вся интеллектуальная собственность принадлежит их правообладателям. From 99fad8bfd516e2fbea7280f706a955dbb044e102 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sat, 8 Mar 2025 12:47:15 +0100 Subject: [PATCH 02/58] tutorial disclaimer --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 5daec0c..cc4c295 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,9 @@ The list of all characters is [here](docs/CharactersTable.md).
The list of all items is [here](docs/ItemsTable.md).
If you want to open the in-game console, go to `Settings -> Platform & Account -> Account Settings (Access Account button)`. To view available commands, type `help`. +## Tutorial + +New tutorial will be added in the next days on the wiki, in the meanwhile you can ask help in the Discord server ## Discord for support From 69d2dbaa0edad73bd5a62da91c65a8a0842195d6 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sat, 8 Mar 2025 12:51:48 +0100 Subject: [PATCH 03/58] discord tutorial fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cc4c295..03cbf29 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ New tutorial will be added in the next days on the wiki, in the meanwhile you ca ## Discord for support -If you want to discuss, ask for support or help with this project, join our [Discord Server](https://discord.gg/gPvqhfdMU6)! +If you want to discuss, ask for support or help with this project, join our [Discord Server](https://discord.gg/wbqqFYaNzD)! ## Note From 5f488b67d9ca82b20389cdebf53f0babe8862cc7 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sat, 8 Mar 2025 15:26:54 +0100 Subject: [PATCH 04/58] saving player gender --- Campofinale/Database/Database.cs | 4 +++- Campofinale/Packets/Cs/HandleCsLogin.cs | 11 ++++++++++- Campofinale/Packets/Sc/PacketScSyncBaseData.cs | 2 +- Campofinale/Player.cs | 5 ++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Campofinale/Database/Database.cs b/Campofinale/Database/Database.cs index 3ef9d80..91b655f 100644 --- a/Campofinale/Database/Database.cs +++ b/Campofinale/Database/Database.cs @@ -42,6 +42,7 @@ namespace Campofinale.Database public List scenes = new(); public Dictionary> bitsets = new(); public PlayerSafeZoneInfo savedSafeZone = new(); + public Gender gender = Gender.GenFemale; } public class Account { @@ -141,7 +142,8 @@ namespace Campofinale.Database noSpawnAnymore = player.noSpawnAnymore, scenes=player.sceneManager.scenes, bitsets=player.bitsetManager.bitsets, - savedSafeZone = player.savedSaveZone + savedSafeZone = player.savedSaveZone, + gender=player.gender, }; UpsertPlayerData(data); } diff --git a/Campofinale/Packets/Cs/HandleCsLogin.cs b/Campofinale/Packets/Cs/HandleCsLogin.cs index bc40444..52b957f 100644 --- a/Campofinale/Packets/Cs/HandleCsLogin.cs +++ b/Campofinale/Packets/Cs/HandleCsLogin.cs @@ -65,9 +65,18 @@ namespace Campofinale.Packets.Cs session.Disconnect(); return; } - session.Load(account.id); + bool exist=session.Load(account.id); rsp.Uid = ""+session.accountId; + if (!exist) + { + rsp.IsFirstLogin = true; + //session.gender = Gender.GenInvalid; + + //session.Send(ScMsgId.ScLogin, rsp); + //session.Send(new PacketScSyncBaseData(session)); + //return; + } session.Send(ScMsgId.ScLogin, rsp); } diff --git a/Campofinale/Packets/Sc/PacketScSyncBaseData.cs b/Campofinale/Packets/Sc/PacketScSyncBaseData.cs index dfb2763..672afa2 100644 --- a/Campofinale/Packets/Sc/PacketScSyncBaseData.cs +++ b/Campofinale/Packets/Sc/PacketScSyncBaseData.cs @@ -20,7 +20,7 @@ namespace Campofinale.Packets.Sc Level = client.level, Exp=client.xp, RoleName = client.nickname, - Gender = Gender.GenFemale, + Gender = client.gender, ShortId="1", }; diff --git a/Campofinale/Player.cs b/Campofinale/Player.cs index 59d1e66..0109fb4 100644 --- a/Campofinale/Player.cs +++ b/Campofinale/Player.cs @@ -89,6 +89,7 @@ namespace Campofinale public string accountId = ""; public string nickname = "Endministrator"; public ulong roleId= 1; + public Gender gender=Gender.GenFemale; public uint level = 20; public uint xp = 0; // @@ -139,7 +140,7 @@ namespace Campofinale { return chars.FindAll(c=> teams[teamIndex].members.Contains(c.guid)); } - public void Load(string accountId) + public bool Load(string accountId) { this.accountId = accountId; PlayerData data = DatabaseManager.db.GetPlayerById(this.accountId); @@ -161,6 +162,7 @@ namespace Campofinale maxDashEnergy = data.maxDashEnergy; curStamina = data.curStamina; nextRecoverTime=data.nextRecoverTime; + if (data.gender > 0) gender = data.gender; LoadCharacters(); mails = DatabaseManager.db.LoadMails(roleId); inventoryManager.Load(); @@ -178,6 +180,7 @@ namespace Campofinale } sceneManager.Load(); factoryManager.Load(); + return (data != null); } public void LoadCharacters() { From d7ba6dcb6bde7dabdaa9d3ba429911072ce1a6d0 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sat, 8 Mar 2025 17:09:30 +0100 Subject: [PATCH 05/58] new config options --- Campofinale/ConfigFile.cs | 51 +++++++++++++++++++++++++++++++++------ Campofinale/Player.cs | 15 ++++++++++-- 2 files changed, 56 insertions(+), 10 deletions(-) diff --git a/Campofinale/ConfigFile.cs b/Campofinale/ConfigFile.cs index 009bcfa..7ce75cc 100644 --- a/Campofinale/ConfigFile.cs +++ b/Campofinale/ConfigFile.cs @@ -1,4 +1,5 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -8,61 +9,95 @@ namespace Campofinale { public class ConfigFile { + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public MongoDatabaseSettings mongoDatabase = new(); + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public DispatchServerSettings dispatchServer = new(); + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public GameserverSettings gameServer = new(); + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public ServerOptions serverOptions = new(); + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public LogSettings logOptions = new(); } - public struct ServerOptions + public class ServerOptions { + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public int defaultSceneNumId = 98; + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public int maxPlayers = 20; - + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] + public CharactersOptions defaultCharacters = new(); public ServerOptions() { } + public class CharactersOptions + { + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] + public int defaultLevel = 1; + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] + public bool giveAllCharacters = true; + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] + public List characters = new List() + { + "chr_0002_endminm", + "chr_0003_endminf", + "chr_0015_lifeng" + }; //used if giveAllCharacters is false + public CharactersOptions() { } + } /* public struct WelcomeMail { }*/ } - public struct LogSettings + public class LogSettings { + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public bool packets; + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public bool debugPrint=false; public LogSettings() { } } - public struct GameserverSettings + public class GameserverSettings { + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public string bindAddress = "127.0.0.1"; public int bindPort = 30000; + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public string accessAddress = "127.0.0.1"; + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public int accessPort = 30000; public GameserverSettings() { } } - public struct DispatchServerSettings + public class DispatchServerSettings { + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public string bindAddress = "127.0.0.1"; - + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public int bindPort = 5000; + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public string accessAddress = "127.0.0.1"; + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public int accessPort = 5000; + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public string emailFormat = "@campofinale.ps"; public DispatchServerSettings() { } } - public struct MongoDatabaseSettings + public class MongoDatabaseSettings { + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public string uri = "mongodb://localhost:27017"; + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public string collection = "Campofinale"; public MongoDatabaseSettings() { diff --git a/Campofinale/Player.cs b/Campofinale/Player.cs index 0109fb4..42afcc3 100644 --- a/Campofinale/Player.cs +++ b/Campofinale/Player.cs @@ -198,10 +198,21 @@ namespace Campofinale } public void Initialize() { - foreach (var item in ResourceManager.characterTable) + if (Server.config.serverOptions.defaultCharacters.giveAllCharacters) { - chars.Add(new Character(roleId,item.Key,20)); + foreach (var item in ResourceManager.characterTable) + { + chars.Add(new Character(roleId, item.Key, Server.config.serverOptions.defaultCharacters.defaultLevel)); + } } + else + { + foreach (var item in Server.config.serverOptions.defaultCharacters.characters) + { + chars.Add(new Character(roleId, item.Key, Server.config.serverOptions.defaultCharacters.defaultLevel)); + } + } + foreach(var item in itemTable) { if(item.Value.maxStackCount == -1) From 4ad771a690c67ff3297827e28f1bcbebc6638a80 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sat, 8 Mar 2025 17:10:21 +0100 Subject: [PATCH 06/58] fix --- Campofinale/Player.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Campofinale/Player.cs b/Campofinale/Player.cs index 42afcc3..f56b107 100644 --- a/Campofinale/Player.cs +++ b/Campofinale/Player.cs @@ -209,7 +209,7 @@ namespace Campofinale { foreach (var item in Server.config.serverOptions.defaultCharacters.characters) { - chars.Add(new Character(roleId, item.Key, Server.config.serverOptions.defaultCharacters.defaultLevel)); + chars.Add(new Character(roleId, item, Server.config.serverOptions.defaultCharacters.defaultLevel)); } } From 1277d16ec5a0724d366737e7443d2e179d9beb14 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sat, 8 Mar 2025 17:12:00 +0100 Subject: [PATCH 07/58] fix --- Campofinale/ConfigFile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Campofinale/ConfigFile.cs b/Campofinale/ConfigFile.cs index 7ce75cc..72412ba 100644 --- a/Campofinale/ConfigFile.cs +++ b/Campofinale/ConfigFile.cs @@ -26,7 +26,7 @@ namespace Campofinale public int defaultSceneNumId = 98; [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public int maxPlayers = 20; - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] public CharactersOptions defaultCharacters = new(); public ServerOptions() { From e6122f881704ce23e95d49a0c5b37ee9b073251f Mon Sep 17 00:00:00 2001 From: Smi1eDoge <109205348+Smi1eDoge@users.noreply.github.com> Date: Sun, 9 Mar 2025 12:30:02 +0800 Subject: [PATCH 08/58] Add README_zh-CN.md --- docs/README_zh-CN.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 docs/README_zh-CN.md diff --git a/docs/README_zh-CN.md b/docs/README_zh-CN.md new file mode 100644 index 0000000..d14cfd2 --- /dev/null +++ b/docs/README_zh-CN.md @@ -0,0 +1,41 @@ +# Campofinale +[EN](README.md) | [IT](docs/README_it-IT.md) | [RU](docs/README_ru-RU.md) | [CN](docs/README_zh-CN.md) | [NL](docs/README_nl-NL.md) + +![Logo]() + +Campofinale 是为某个工厂建造游戏提供的实验性本地服务器实现 + +## 当前功能 + +* 登录 +* 切换角色 +* 切换配队 +* 场景切换 +* 通过MongoDB保存存档 +* 战斗系统 + +## 补充信息 + +您可以在[这里](./CommandList/commands_zh-CN.md)找到所有服务端指令的详细说明。 + +所有场景的列表[在此](./LevelsTable.md)。 + +所有敌人的列表[在此](./EnemiesTable.md)。 + +所有干员的列表[在此](./CharactersTable.md)。 + +所有物品的列表[在此](./ItemsTable_zh-CN.md)。 + +如果你想使用游戏内控制台,请前往 `设置 → 平台与账号 → 账号设置("点击前往")`。要查看可用命令,请输入 `help`。 + +## 教程 + +新的教程将会在几天后添加到Wiki上,目前您可以在Discord服务器上寻求帮助 + +## 在Discord上寻求帮助 + +如果你想讨论、寻求帮助或者协助我们完善和改进此项目,请加入我们的[Discord服务器](https://discord.gg/wbqqFYaNzD)! + +## 附录 + +本项目为独立开发,所有原始游戏资产和知识产权均归其各自所有者所有 \ No newline at end of file From 6b3d648b5cecba24bbbe5feede221304ae60cf4e Mon Sep 17 00:00:00 2001 From: Smi1eDoge <109205348+Smi1eDoge@users.noreply.github.com> Date: Sun, 9 Mar 2025 12:30:11 +0800 Subject: [PATCH 09/58] quick fix --- docs/CommandList/commands_zh-CN.md | 2 +- docs/EnemiesTable.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/CommandList/commands_zh-CN.md b/docs/CommandList/commands_zh-CN.md index fdb8b19..fb53ad5 100644 --- a/docs/CommandList/commands_zh-CN.md +++ b/docs/CommandList/commands_zh-CN.md @@ -24,5 +24,5 @@ | idlist | 显示所有角色(chars)、敌人(enemies)和场景(scenes)的id | `` | 否 | idlist `` | idlist chars | --- -> [!WARNING]警告 +> [!WARNING] > `level` 指令: 如果你没有指定具体的`id`字段, 那么等级变化将会被应用在**所有**武器和干员身上 \ No newline at end of file diff --git a/docs/EnemiesTable.md b/docs/EnemiesTable.md index 5301683..3a4f1f3 100644 --- a/docs/EnemiesTable.md +++ b/docs/EnemiesTable.md @@ -25,7 +25,7 @@ | eny_0059_erhound | Blighted Tuskbeast| 侵蚀牙兽 | | eny_0060_lbmad | Blighted Klaw| 侵蚀爪牙 | | eny_0061_palecore | Marble Agellomoirai| 白垩界卫一阶段 | -| eny_0062_paletent | Marble Appendage| 白垩界卫一阶段触手 | +| eny_0062_paletent | Marble Appendage| 白垩附肢 | | eny_0063_agmelee2 | Ram α | 大角天使α | | eny_0064_agrange2 | Sting α | 针刺天使α | | eny_0065_lbmob2 | Elite Raider | 精锐劫掠者 | From ae32b92cb6250b222b4268cdf2eabc1691375ec3 Mon Sep 17 00:00:00 2001 From: Smi1eDoge <109205348+Smi1eDoge@users.noreply.github.com> Date: Sun, 9 Mar 2025 12:35:45 +0800 Subject: [PATCH 10/58] Markdown Links Fix --- docs/README_zh-CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README_zh-CN.md b/docs/README_zh-CN.md index d14cfd2..1e1c6e1 100644 --- a/docs/README_zh-CN.md +++ b/docs/README_zh-CN.md @@ -1,5 +1,5 @@ # Campofinale -[EN](README.md) | [IT](docs/README_it-IT.md) | [RU](docs/README_ru-RU.md) | [CN](docs/README_zh-CN.md) | [NL](docs/README_nl-NL.md) +[EN](../README.md) | [IT](./README_it-IT.md) | [RU](./README_ru-RU.md) | [CN](./README_zh-CN.md) | [NL](./README_nl-NL.md) ![Logo]() From aedf2a885d240d1118351463915496306065a2b1 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sun, 9 Mar 2025 16:24:46 +0100 Subject: [PATCH 11/58] some bug fix, new improved inventory manager (but still very bad but atleast you can give some items inside the bag) --- Campofinale/Commands/Handlers/CommandLevel.cs | 2 +- Campofinale/Game/Inventory/InventoryList.cs | 180 ++++++++++++++++++ .../Game/Inventory/InventoryManager.cs | 52 ++--- Campofinale/Game/Inventory/Item.cs | 11 +- Campofinale/Game/SceneManager.cs | 10 +- .../Packets/Sc/PacketScItemBagScopeModify.cs | 5 + .../Packets/Sc/PacketScItemBagScopeSync.cs | 18 +- Campofinale/Player.cs | 16 +- Campofinale/Resource/ResourceManager.cs | 13 ++ 9 files changed, 258 insertions(+), 49 deletions(-) create mode 100644 Campofinale/Game/Inventory/InventoryList.cs diff --git a/Campofinale/Commands/Handlers/CommandLevel.cs b/Campofinale/Commands/Handlers/CommandLevel.cs index 955a8c8..b91a550 100644 --- a/Campofinale/Commands/Handlers/CommandLevel.cs +++ b/Campofinale/Commands/Handlers/CommandLevel.cs @@ -61,7 +61,7 @@ namespace Campofinale.Game.Character } int updatedItemCount = 0; - foreach (var item in target.inventoryManager.items) + foreach (var item in target.inventoryManager.items.items) { if (item.id.StartsWith("wpn_")) { diff --git a/Campofinale/Game/Inventory/InventoryList.cs b/Campofinale/Game/Inventory/InventoryList.cs new file mode 100644 index 0000000..e7d4fa5 --- /dev/null +++ b/Campofinale/Game/Inventory/InventoryList.cs @@ -0,0 +1,180 @@ +using Campofinale.Packets.Sc; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Campofinale.Game.Inventory +{ + public class InventoryList + { + public List items = new(); + public Dictionary bag = new(); + public int maxBagSize = 30; + + public Player player; + public InventoryList(Player player) + { + this.player = player; + } + public enum FindType + { + Items, + FactoryDepots, + Bag + } + public void UpdateInventoryPacket() + { + + } + public void UpdateBagInventoryPacket() + { + player.Send(new PacketScItemBagScopeSync(this.player,Resource.ItemValuableDepotType.Invalid)); + + } + private void AddToBagAvailableSlot(Item item) + { + for (int i = 0; i < maxBagSize; i++) + { + if (!bag.ContainsKey(i)) + { + bag.Add(i, item); + return; + } + } + } + /// + ///Add a item directly to the bag if there is enough space or increment current stack value + /// + public bool AddToBag(Item item) + { + Item existOne = Find(i=>i.id == item.id && i.amount < item.GetItemTable().maxStackCount,FindType.Bag); + if (existOne != null) + { + + if(existOne.amount+item.amount > item.GetItemTable().maxStackCount) + { + int max = existOne.GetItemTable().maxStackCount; + int toAddInNewSlotAmount = existOne.amount + item.amount - max; + item.amount = toAddInNewSlotAmount; + if (SlotAvailableInBag()) + { + existOne.amount = max; + AddToBagAvailableSlot(item); + UpdateBagInventoryPacket(); + return true; + } + else + { + return false; + } + } + else + { + existOne.amount += item.amount; + UpdateBagInventoryPacket(); + return true; + } + } + else + { + if(bag.Count < maxBagSize) + { + AddToBagAvailableSlot(item); + UpdateBagInventoryPacket(); + return true; + } + else + { + return false; + } + } + } + public bool SlotAvailableInBag() + { + bool availableSlot = false; + for (int i = 0; i < maxBagSize; i++) + { + if (!bag.ContainsKey(i)) + { + return true; + } + } + return availableSlot; + } + public Item FindInAll(Predicate match) + { + var item = items.Find(match); + if (item != null) + { + return item; + } + var itemB = bag.Values.ToList().Find(match); + if (itemB != null) + { + return itemB; + } + return null; + } + public Item Find(Predicate match,FindType findType = FindType.Items) + { + switch (findType) + { + case FindType.Items: + var item = items.Find(match); + if (item != null) + { + return item; + } + break; + case FindType.FactoryDepots: + //TODO + break; + case FindType.Bag: + var itemB = bag.Values.ToList().Find(match); + if (itemB != null) + { + return itemB; + } + break; + } + + return null; + } + + /// + ///Add an item to the inventory (or increment it's amount if it's not an instance type, else add a new one or add to bag if it's a Factory item + /// + public Item Add(Item item) + { + if (item.StorageSpace() == Resource.ItemStorageSpace.BagAndFactoryDepot) + { + AddToBag(item); + return null; + } + if (item.InstanceType()) + { + items.Add(item); + return item; + } + else + { + Item exist=Find(i=>i.id==item.id); + if (exist != null) + { + exist.amount += item.amount; + return exist; + } + else + { + items.Add(item); + return item; + } + } + + } + + + } +} diff --git a/Campofinale/Game/Inventory/InventoryManager.cs b/Campofinale/Game/Inventory/InventoryManager.cs index 3ded7b1..03851f3 100644 --- a/Campofinale/Game/Inventory/InventoryManager.cs +++ b/Campofinale/Game/Inventory/InventoryManager.cs @@ -15,7 +15,7 @@ namespace Campofinale.Game.Inventory public class InventoryManager { public Player owner; - public List items= new List(); + public InventoryList items; public int item_diamond_amt { @@ -36,12 +36,12 @@ namespace Campofinale.Game.Inventory public Item GetItemById(string id) { - return items.Find(i => i.id == id); + return items.FindInAll(i => i.id == id); } public InventoryManager(Player o) { owner = o; - + items=new(o); } public void AddRewards(string rewardTemplateId, Vector3f pos, int sourceType=1) { @@ -110,55 +110,35 @@ namespace Campofinale.Game.Inventory } public void Save() { - foreach (Item item in items) + foreach (Item item in items.items) { DatabaseManager.db.UpsertItem(item); } } public void Load() { - items = DatabaseManager.db.LoadInventoryItems(owner.roleId); + items.items = DatabaseManager.db.LoadInventoryItems(owner.roleId); } - public Item AddItem(string id, int amt) + public Item AddItem(string id, int amt, bool notify=false) { - Item it = new() + Item item = new Item(owner.roleId, id, amt); + + Item itemNew = items.Add(item); + if (notify && itemNew != null) { - id = id, - }; - if(!it.InstanceType()) - { - - Item item = items.Find(i=>i.id == id); - if (item != null) - { - // Logger.Print(id + ": " + amt+" added to existing"); - item.amount += amt; - return item; - } - else - { - // Logger.Print(id + ": " + amt + " added to new"); - item = new Item(owner.roleId, id, amt); - items.Add(item); - return item; - } + this.owner.Send(new PacketScItemBagScopeModify(this.owner, itemNew)); } - else - { - //Logger.Print(id + ": " + amt + " added to new as instance"); - Item item = new Item(owner.roleId, id, amt); - items.Add(item); - return item; - } + return item; } public void RemoveItem(Item item,int amt) { item.amount -= amt; if(item.amount <= 0) { - items.Remove(item); + items.items.Remove(item); DatabaseManager.db.DeleteItem(item); } + this.owner.Send(new PacketScItemBagScopeModify(this.owner, item)); } public bool ConsumeItems(MapField costItemId2Count) @@ -211,11 +191,11 @@ namespace Campofinale.Game.Inventory public Dictionary GetInventoryChapter(string chapterId) { Dictionary dir= new Dictionary(); - List citems = items.FindAll(i=>!i.InstanceType()); + /*List citems = items.FindAll(i=>!i.InstanceType()); foreach (Item item in citems) { dir.Add((uint)ResourceManager.strIdNumTable.item_id.dic[item.id], item.amount); - } + }*/ return dir; } diff --git a/Campofinale/Game/Inventory/Item.cs b/Campofinale/Game/Inventory/Item.cs index 2a5bf89..d887947 100644 --- a/Campofinale/Game/Inventory/Item.cs +++ b/Campofinale/Game/Inventory/Item.cs @@ -48,6 +48,10 @@ namespace Campofinale.Game.Inventory this.level = level; guid = GetOwner().random.Next(); } + public ItemStorageSpace StorageSpace() + { + return ResourceManager.itemTypeTable[GetItemTable().type].storageSpace; + } public ulong GetDefaultLevel() { switch (ItemType) @@ -68,10 +72,15 @@ namespace Campofinale.Game.Inventory } public ItemValuableDepotType ItemType { - get{ + get + { return ResourceManager.GetItemTable(id).valuableTabType; } } + public ItemTable GetItemTable() + { + return ResourceManager.GetItemTable(id); + } public virtual ScdItemGrid ToProto() { try diff --git a/Campofinale/Game/SceneManager.cs b/Campofinale/Game/SceneManager.cs index 781ade0..1085781 100644 --- a/Campofinale/Game/SceneManager.cs +++ b/Campofinale/Game/SceneManager.cs @@ -379,7 +379,15 @@ namespace Campofinale.Game if (!en.spawned) { en.spawned = true; - GetOwner().Send(new PacketScObjectEnterView(GetOwner(), new List() { en })); + try + { + GetOwner().Send(new PacketScObjectEnterView(GetOwner(), new List() { en })); + } + catch(Exception e) + { + + } + } } else diff --git a/Campofinale/Packets/Sc/PacketScItemBagScopeModify.cs b/Campofinale/Packets/Sc/PacketScItemBagScopeModify.cs index abea4a1..2f3fc24 100644 --- a/Campofinale/Packets/Sc/PacketScItemBagScopeModify.cs +++ b/Campofinale/Packets/Sc/PacketScItemBagScopeModify.cs @@ -15,6 +15,11 @@ namespace Campofinale.Packets.Sc public PacketScItemBagScopeModify(Player client, Item item) { + if (item == null) + { + SetData(ScMsgId.ScItemBagScopeModify, new ScItemBagScopeModify()); + return; + } ScItemBagScopeModify proto = new ScItemBagScopeModify() { Depot = diff --git a/Campofinale/Packets/Sc/PacketScItemBagScopeSync.cs b/Campofinale/Packets/Sc/PacketScItemBagScopeSync.cs index 6b8584a..7cd2dfc 100644 --- a/Campofinale/Packets/Sc/PacketScItemBagScopeSync.cs +++ b/Campofinale/Packets/Sc/PacketScItemBagScopeSync.cs @@ -19,10 +19,10 @@ namespace Campofinale.Packets.Sc { Bag = new() { - GridLimit = 30, + GridLimit = client.inventoryManager.items.maxBagSize, Grids = { - new ScdItemGrid() + /*new ScdItemGrid() { GridIndex=0, Count=1, @@ -79,7 +79,7 @@ namespace Campofinale.Packets.Sc InstId=300000000004, }, - } + }*/ } }, FactoryDepot = @@ -114,7 +114,17 @@ namespace Campofinale.Packets.Sc proto.Bag = null; } proto.Depot.Add(i, new ScdItemDepot()); - List items = client.inventoryManager.items.FindAll(item => item.ItemType == (ItemValuableDepotType)i); + foreach (var item in client.inventoryManager.items.bag) + { + proto.Bag.Grids.Add(new ScdItemGrid() + { + Count=item.Value.amount, + GridIndex=item.Key, + Id=item.Value.id, + Inst=item.Value.ToProto().Inst, + }); + } + List items = client.inventoryManager.items.items.FindAll(item => item.ItemType == (ItemValuableDepotType)i); items.ForEach(item => { if (item.InstanceType()) diff --git a/Campofinale/Player.cs b/Campofinale/Player.cs index f56b107..382272d 100644 --- a/Campofinale/Player.cs +++ b/Campofinale/Player.cs @@ -215,15 +215,19 @@ namespace Campofinale foreach(var item in itemTable) { - if(item.Value.maxStackCount == -1) + if(item.Value.GetStorage()!= ItemStorageSpace.BagAndFactoryDepot) { - inventoryManager.items.Add(new Item(roleId, item.Value.id, 10000000)); - } - else - { - inventoryManager.items.Add(new Item(roleId, item.Value.id, item.Value.maxStackCount)); + if (item.Value.maxStackCount == -1) + { + inventoryManager.items.Add(new Item(roleId, item.Value.id, 10000000)); + } + else + { + inventoryManager.items.Add(new Item(roleId, item.Value.id, item.Value.maxStackCount)); + } } + } teams.Add(new Team() { diff --git a/Campofinale/Resource/ResourceManager.cs b/Campofinale/Resource/ResourceManager.cs index efeb9ca..ae726a4 100644 --- a/Campofinale/Resource/ResourceManager.cs +++ b/Campofinale/Resource/ResourceManager.cs @@ -67,6 +67,7 @@ namespace Campofinale.Resource public static Dictionary factoryBuildingTable = new(); public static Dictionary facSTTNodeTable = new(); public static Dictionary facSTTLayerTable = new(); + public static Dictionary itemTypeTable = new(); public static InteractiveTable interactiveTable = new(); public static List levelDatas = new(); public static List interactiveData = new(); @@ -134,6 +135,7 @@ namespace Campofinale.Resource factoryBuildingTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/FactoryBuildingTable.json")); facSTTNodeTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/FacSTTNodeTable.json")); facSTTLayerTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/FacSTTLayerTable.json")); + itemTypeTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/ItemTypeTable.json")); interactiveTable = JsonConvert.DeserializeObject(ReadJsonFile("Json/Interactive/InteractiveTable.json")); LoadInteractiveData(); LoadLevelDatas(); @@ -843,6 +845,11 @@ namespace Campofinale.Resource public string enemyId; public string templateId; } + public class ItemTypeTable + { + public int itemType; + public ItemStorageSpace storageSpace; + } public class ItemTable { public ItemValuableDepotType valuableTabType; @@ -850,6 +857,12 @@ namespace Campofinale.Resource public int maxStackCount; public bool backpackCanDiscard; public string modelKey; + public int type; + + public ItemStorageSpace GetStorage() + { + return ResourceManager.itemTypeTable[type].storageSpace; + } } public class WeaponBasicTable { From 0c268cb978af437abc08deab0ab1429b5c15c834 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sun, 9 Mar 2025 16:56:48 +0100 Subject: [PATCH 12/58] fix --- Campofinale/ConfigFile.cs | 6 +++--- Campofinale/Game/Character/Character.cs | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Campofinale/ConfigFile.cs b/Campofinale/ConfigFile.cs index 72412ba..49f4aff 100644 --- a/Campofinale/ConfigFile.cs +++ b/Campofinale/ConfigFile.cs @@ -34,11 +34,11 @@ namespace Campofinale public class CharactersOptions { - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] public int defaultLevel = 1; - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] public bool giveAllCharacters = true; - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] public List characters = new List() { "chr_0002_endminm", diff --git a/Campofinale/Game/Character/Character.cs b/Campofinale/Game/Character/Character.cs index b6d01bc..a9081fe 100644 --- a/Campofinale/Game/Character/Character.cs +++ b/Campofinale/Game/Character/Character.cs @@ -149,6 +149,11 @@ namespace Campofinale.Game.Character guid = GetOwner().random.Next(); this.weaponGuid = GetOwner().inventoryManager.AddWeapon(ResourceManager.charGrowthTable[id].defaultWeaponId, 1).guid; this.curHp = CalcAttributes()[AttributeType.MaxHp].val; + if (level < 20) breakNode = ""; + if (level >= 20 && level <= 40) breakNode = "charBreak20"; + if (level > 40 && level <= 60) breakNode = "charBreak40"; + if (level > 60 && level <= 70) breakNode = "charBreak60"; + if (level > 70) breakNode = "charBreak70"; } public int GetSkillMaxLevel() { From cd45f63bd9e5a2e0d64cc2b6579f5489bb68768f Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sun, 9 Mar 2025 17:01:52 +0100 Subject: [PATCH 13/58] fix --- Campofinale/ConfigFile.cs | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/Campofinale/ConfigFile.cs b/Campofinale/ConfigFile.cs index 49f4aff..9b443f7 100644 --- a/Campofinale/ConfigFile.cs +++ b/Campofinale/ConfigFile.cs @@ -9,24 +9,16 @@ namespace Campofinale { public class ConfigFile { - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public MongoDatabaseSettings mongoDatabase = new(); - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public DispatchServerSettings dispatchServer = new(); - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public GameserverSettings gameServer = new(); - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public ServerOptions serverOptions = new(); - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public LogSettings logOptions = new(); } public class ServerOptions { - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public int defaultSceneNumId = 98; - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public int maxPlayers = 20; - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] public CharactersOptions defaultCharacters = new(); public ServerOptions() { @@ -34,11 +26,8 @@ namespace Campofinale public class CharactersOptions { - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] public int defaultLevel = 1; - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] public bool giveAllCharacters = true; - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] public List characters = new List() { "chr_0002_endminm", @@ -54,9 +43,7 @@ namespace Campofinale } public class LogSettings { - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public bool packets; - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public bool debugPrint=false; public LogSettings() @@ -65,12 +52,9 @@ namespace Campofinale } public class GameserverSettings { - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public string bindAddress = "127.0.0.1"; public int bindPort = 30000; - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public string accessAddress = "127.0.0.1"; - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public int accessPort = 30000; public GameserverSettings() { @@ -78,15 +62,10 @@ namespace Campofinale } public class DispatchServerSettings { - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public string bindAddress = "127.0.0.1"; - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public int bindPort = 5000; - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public string accessAddress = "127.0.0.1"; - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public int accessPort = 5000; - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public string emailFormat = "@campofinale.ps"; public DispatchServerSettings() { @@ -95,9 +74,7 @@ namespace Campofinale } public class MongoDatabaseSettings { - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public string uri = "mongodb://localhost:27017"; - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public string collection = "Campofinale"; public MongoDatabaseSettings() { From 9c1f691fa3d19fe2998e0ae529f8a1e51713d437 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sun, 9 Mar 2025 17:02:38 +0100 Subject: [PATCH 14/58] another fix :( --- Campofinale/ConfigFile.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Campofinale/ConfigFile.cs b/Campofinale/ConfigFile.cs index 9b443f7..bfb403b 100644 --- a/Campofinale/ConfigFile.cs +++ b/Campofinale/ConfigFile.cs @@ -28,12 +28,7 @@ namespace Campofinale { public int defaultLevel = 1; public bool giveAllCharacters = true; - public List characters = new List() - { - "chr_0002_endminm", - "chr_0003_endminf", - "chr_0015_lifeng" - }; //used if giveAllCharacters is false + public List characters = new List(); //used if giveAllCharacters is false public CharactersOptions() { } } From dc3eace03b946f2a32c2f8612dd3db0758f92b85 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sun, 9 Mar 2025 18:56:45 +0100 Subject: [PATCH 15/58] some summary texts --- Campofinale/Logger.cs | 17 ++++- Campofinale/Network/Packet.cs | 71 +++++++++++-------- .../Packets/Sc/PacketScSelfSceneInfo.cs | 2 +- Campofinale/Player.cs | 12 +++- 4 files changed, 70 insertions(+), 32 deletions(-) diff --git a/Campofinale/Logger.cs b/Campofinale/Logger.cs index e634add..8669522 100644 --- a/Campofinale/Logger.cs +++ b/Campofinale/Logger.cs @@ -20,6 +20,10 @@ public static class Logger var method = frame?.GetMethod(); return method?.DeclaringType?.Name ?? "Server"; } + /// + /// Print a text in the console + /// + /// public static void Print(string text) { string className = GetCallingClassName(); @@ -27,6 +31,10 @@ public static class Logger string prefix = "<" + "INFO".Pastel("03fcce") + $":{className.Pastel("999")}>"; Console.WriteLine($"{prefix} " + text); } + /// + /// Print a text in the console as Error + /// + /// public static void PrintError(string text) { string className = GetCallingClassName(); @@ -34,6 +42,10 @@ public static class Logger string prefix = "<" + "ERROR".Pastel("eb4034") + $":{className.Pastel("999")}>"; Console.WriteLine($"{prefix} " + text.Pastel("917e7e")); } + /// + /// Print a text in the console as a Warn + /// + /// public static void PrintWarn(string text) { string className = GetCallingClassName(); @@ -54,7 +66,10 @@ public static class Logger Logger.hideLogs = hideLogs; logWriter = new StreamWriter("latest.log", false); } - + /// + /// Log a message + /// + /// public static void Log(string message) { if (!hideLogs) diff --git a/Campofinale/Network/Packet.cs b/Campofinale/Network/Packet.cs index d3a990e..b2c3208 100644 --- a/Campofinale/Network/Packet.cs +++ b/Campofinale/Network/Packet.cs @@ -61,6 +61,11 @@ namespace Campofinale.Network byte networkValue = buf[index]; return networkValue; } + /// + /// Parse the body using a specific IMessage proto class + /// + /// + /// public TBody DecodeBody() where TBody : IMessage, new() { return new MessageParser(() => new()).ParseFrom(finishedBody); @@ -76,35 +81,10 @@ namespace Campofinale.Network Buffer.BlockCopy(source, 0, destination, offset, source.Length); } - public static byte[] ToByteArray(IntPtr ptr, int length) - { - if (ptr == IntPtr.Zero) - { - throw new ArgumentException("Pointer cannot be null", nameof(ptr)); - } - - byte[] byteArray = new byte[length]; - Marshal.Copy(ptr, byteArray, 0, length); - return byteArray; - } - public static IntPtr ByteArrayToIntPtr(byte[] data) - { - if (data == null) throw new ArgumentNullException(nameof(data)); - - // Allocate unmanaged memory - IntPtr ptr = Marshal.AllocHGlobal(data.Length); - - // Copy the byte array to the unmanaged memory - Marshal.Copy(data, 0, ptr, data.Length); - - return ptr; - } public static byte[] EncryptWithPublicKey(byte[] data, string publicKey) { - // Crea un oggetto RSA using (RSA rsa = RSA.Create()) { - publicKey = publicKey.Replace("-----BEGIN PUBLIC KEY-----", ""); publicKey = publicKey.Replace("\r", ""); publicKey = publicKey.Replace("\n", ""); @@ -112,24 +92,44 @@ namespace Campofinale.Network publicKey = publicKey.Trim(); Logger.Print(publicKey); byte[] publicKey_ = Convert.FromBase64String(publicKey); - // Importa la chiave pubblica rsa.ImportSubjectPublicKeyInfo(publicKey_, out _); - - // Crittografa i dati return rsa.Encrypt(data, RSAEncryptionPadding.OaepSHA256); } } + /// + /// Set the data of the packet with the Message Id and the body + /// + /// + /// The proto message + /// The current Packet public Packet SetData(ScMsgId msgId, IMessage body) { set_body = body; cmdId = (int)msgId; return this; } + /// + /// Encode the packet using the Packet class + /// + /// The packet + /// the sequence id + /// the pack count + /// + /// public static byte[] EncodePacket(Packet packet,ulong seq = 0, uint totalPackCount = 1, uint currentPackIndex = 0) { return EncodePacket(packet.cmdId,packet.set_body,seq, totalPackCount, currentPackIndex); } public static ulong seqNext = 1; + /// + /// Encode the packet using the msgId and the body + /// + /// + /// + /// + /// + /// + /// public static byte[] EncodePacket(int msgId, IMessage body, ulong seqNext_ = 0, uint totalPackCount=1,uint currentPackIndex=0) { if (seqNext_ == 0) @@ -149,6 +149,15 @@ namespace Campofinale.Network return data; } + /// + /// Encode the packet with msgId and body as byte array + /// + /// + /// + /// + /// + /// + /// public static byte[] EncodePacket(int msgId, byte[] body, ulong seqNext_ = 0, uint totalPackCount = 1, uint currentPackIndex = 0) { if (seqNext_ == 0) @@ -172,6 +181,12 @@ namespace Campofinale.Network return data; } + /// + /// Read the byteArray as a valid packet + /// + /// + /// + /// The decoded packet public static Packet Read(Player client,byte[] byteArray) { byte headLength = GetByte(byteArray, 0); diff --git a/Campofinale/Packets/Sc/PacketScSelfSceneInfo.cs b/Campofinale/Packets/Sc/PacketScSelfSceneInfo.cs index c00f6ff..9e4fff3 100644 --- a/Campofinale/Packets/Sc/PacketScSelfSceneInfo.cs +++ b/Campofinale/Packets/Sc/PacketScSelfSceneInfo.cs @@ -74,7 +74,7 @@ namespace Campofinale.Packets.Sc ScriptId = l.scriptId, IsDone = false, State = 1, - + }; int i = 0; foreach (var item in l.properties) diff --git a/Campofinale/Player.cs b/Campofinale/Player.cs index 382272d..afc1eef 100644 --- a/Campofinale/Player.cs +++ b/Campofinale/Player.cs @@ -186,12 +186,20 @@ namespace Campofinale { chars = DatabaseManager.db.LoadCharacters(roleId); } - //Added in 1.0.7 + /// + /// Get the character using the guid *Added in 1.0.7* + /// + /// + /// public Character GetCharacter(ulong guid) { return chars.Find(c => c.guid == guid); } - + /// + /// Get the character using the template id + /// + /// + /// Character public Character GetCharacter(string templateId) { return chars.Find(c => c.id==templateId); From b0eb526818fa6e4b3d405516dd3c8b18b28c74aa Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sun, 9 Mar 2025 22:07:48 +0100 Subject: [PATCH 16/58] Working on a better resource loader --- Campofinale/Resource/ResourceLoader.cs | 116 ++++++++++++++++++ Campofinale/Resource/ResourceManager.cs | 69 +++-------- Campofinale/Resource/Table/BlocDataTable.cs | 3 +- Campofinale/Resource/Table/CharacterTable.cs | 20 +++ Campofinale/Resource/Table/DialogIdTable.cs | 14 +++ .../Resource/Table/InteractiveTable.cs | 19 +++ Campofinale/Resource/Table/ItemTypeTable.cs | 15 +++ Campofinale/Resource/Table/LevelGradeTable.cs | 3 +- .../Resource/Table/MissionAreaTable.cs | 3 +- Campofinale/Resource/Table/StrIdNumTable.cs | 24 ++++ Campofinale/Resource/Table/SystemJumpTable.cs | 14 +++ Campofinale/Resource/TableCfgResource.cs | 36 ++++++ 12 files changed, 281 insertions(+), 55 deletions(-) create mode 100644 Campofinale/Resource/ResourceLoader.cs create mode 100644 Campofinale/Resource/Table/CharacterTable.cs create mode 100644 Campofinale/Resource/Table/DialogIdTable.cs create mode 100644 Campofinale/Resource/Table/InteractiveTable.cs create mode 100644 Campofinale/Resource/Table/ItemTypeTable.cs create mode 100644 Campofinale/Resource/Table/StrIdNumTable.cs create mode 100644 Campofinale/Resource/Table/SystemJumpTable.cs create mode 100644 Campofinale/Resource/TableCfgResource.cs diff --git a/Campofinale/Resource/ResourceLoader.cs b/Campofinale/Resource/ResourceLoader.cs new file mode 100644 index 0000000..acb231f --- /dev/null +++ b/Campofinale/Resource/ResourceLoader.cs @@ -0,0 +1,116 @@ +using Newtonsoft.Json; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace Campofinale.Resource +{ + public class ResourceLoader + { + + public static void LoadTableCfg() + { + var tableCfgTypes = GetAllTableCfgTypes(); + + foreach (var type in tableCfgTypes) + { + var attr = type.GetCustomAttribute(); + string json = ReadJsonFile(attr.Name); + FieldInfo field = GetResourceField(type); + if (field != null && json.Length > 0) + { + object deserializedData = DeserializeJson(json, field.FieldType, type); + field.SetValue(null, deserializedData); + //Logger.Print($"Loaded {attr.Name} into {field.Name}"); + } + } + } + private static object DeserializeJson(string json, Type fieldType, Type valueType) + { + if (fieldType.IsGenericType) + { + var genericTypeDef = fieldType.GetGenericTypeDefinition(); + + if (genericTypeDef == typeof(Dictionary<,>)) + { + var keyType = fieldType.GetGenericArguments()[0]; // String + var valType = fieldType.GetGenericArguments()[1]; // Il tipo desiderato + return JsonConvert.DeserializeObject(json, typeof(Dictionary<,>).MakeGenericType(keyType, valType)); + } + else if (genericTypeDef == typeof(List<>)) + { + return JsonConvert.DeserializeObject(json, typeof(List<>).MakeGenericType(valueType)); + } + } + + // Oggetto singolo + return JsonConvert.DeserializeObject(json, valueType); + } + public static string ReadJsonFile(string path) + { + try + { + return File.ReadAllText(path); + } + catch (Exception e) + { + Logger.PrintError($"Error occured while loading {path} Err: {e.Message}"); + ResourceManager.missingResources = true; + return ""; + } + + } + + public static List GetAllTableCfgTypes() + { + return Assembly.GetExecutingAssembly() + .GetTypes() + .Where(t => t.IsClass && !t.IsAbstract && t.GetCustomAttribute() != null) + .ToList(); + } + public static FieldInfo GetResourceField(Type type) + { + var resourceManagerType = typeof(ResourceManager); + var fields = resourceManagerType.GetFields(BindingFlags.Public | BindingFlags.Static); + + foreach (var field in fields) + { + var fieldType = field.FieldType; + + if (fieldType.IsGenericType) + { + var genericTypeDef = fieldType.GetGenericTypeDefinition(); + + // Controlla se è un Dictionary e se TValue è del tipo richiesto + if (genericTypeDef == typeof(Dictionary<,>)) + { + var valueType = fieldType.GetGenericArguments()[1]; // Ottiene TValue + if (valueType == type) + { + return field; + } + } + // Controlla se è una List e se T è del tipo richiesto + else if (genericTypeDef == typeof(List<>) && fieldType.GetGenericArguments()[0] == type) + { + return field; + } + } + else + { + // Se il campo non è una collezione ma è direttamente del tipo richiesto + if (fieldType == type) + { + return field; + } + } + } + + return null; // Nessun campo trovato + } + } +} diff --git a/Campofinale/Resource/ResourceManager.cs b/Campofinale/Resource/ResourceManager.cs index ae726a4..f40fc32 100644 --- a/Campofinale/Resource/ResourceManager.cs +++ b/Campofinale/Resource/ResourceManager.cs @@ -28,19 +28,19 @@ namespace Campofinale.Resource public class ResourceManager { public static Dictionary sceneAreaTable = new(); - public static StrIdNumTable strIdNumTable = new StrIdNumTable(); - public static Dictionary characterTable = new(); - public static Dictionary systemJumpTable = new(); + public static StrIdNumTable strIdNumTable = new StrIdNumTable();// + public static Dictionary characterTable = new(); // + public static Dictionary systemJumpTable = new(); // public static Dictionary settlementBasicDataTable = new(); public static Dictionary blocMissionTable = new(); - public static MissionAreaTable missionAreaTable = new(); + public static MissionAreaTable missionAreaTable = new(); // public static Dictionary dialogTextTable = new(); public static Dictionary gameSystemConfigTable = new(); public static Dictionary wikiGroupTable = new(); public static Dictionary blocUnlockTable = new(); public static Dictionary gameMechanicTable = new(); public static Dictionary weaponBasicTable= new(); - public static Dictionary blocDataTable = new(); + public static Dictionary blocDataTable = new(); // public static Dictionary itemTable = new(); public static Dictionary domainDataTable = new(); public static Dictionary collectionTable = new(); @@ -59,16 +59,16 @@ namespace Campofinale.Resource public static Dictionary spaceShipCharBehaviourTable = new(); public static Dictionary spaceshipRoomInsTable = new(); public static Dictionary dungeonTable = new(); - public static Dictionary levelGradeTable = new(); + public static Dictionary levelGradeTable = new(); // public static Dictionary rewardTable = new(); public static Dictionary adventureTaskTable = new(); - public static StrIdNumTable dialogIdTable = new(); + public static DialogIdTable dialogIdTable = new();// public static Dictionary levelShortIdTable = new(); public static Dictionary factoryBuildingTable = new(); public static Dictionary facSTTNodeTable = new(); public static Dictionary facSTTLayerTable = new(); - public static Dictionary itemTypeTable = new(); - public static InteractiveTable interactiveTable = new(); + public static Dictionary itemTypeTable = new(); // + public static InteractiveTable interactiveTable = new(); // public static List levelDatas = new(); public static List interactiveData = new(); @@ -104,7 +104,7 @@ namespace Campofinale.Resource dialogTextTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/DialogTextTable.json")); gameSystemConfigTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/GameSystemConfigTable.json")); wikiGroupTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/WikiGroupTable.json")); - dialogIdTable = JsonConvert.DeserializeObject(ReadJsonFile("Json/GameplayConfig/DialogIdTable.json")); + dialogIdTable = JsonConvert.DeserializeObject(ReadJsonFile("Json/GameplayConfig/DialogIdTable.json")); blocUnlockTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/BlocUnlockTable.json")); gameMechanicTable= JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/GameMechanicTable.json")); weaponBasicTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/WeaponBasicTable.json")); @@ -138,8 +138,9 @@ namespace Campofinale.Resource itemTypeTable = JsonConvert.DeserializeObject>(ReadJsonFile("TableCfg/ItemTypeTable.json")); interactiveTable = JsonConvert.DeserializeObject(ReadJsonFile("Json/Interactive/InteractiveTable.json")); LoadInteractiveData(); - LoadLevelDatas(); - + LoadLevelDatas(); + ResourceLoader.LoadTableCfg(); + if (missingResources) { Logger.PrintWarn("Missing some resources. The gameserver will probably crash."); @@ -408,15 +409,7 @@ namespace Campofinale.Resource { public List list; } - public class InteractiveTable - { - public Dictionary interactiveDataDict = new(); - - public class InteractiveTemplate - { - public string templateId; - } - } + public class WikiGroup { public string groupId; @@ -785,19 +778,6 @@ namespace Campofinale.Resource public string settlementId; public string domainId; } - public class StrIdNumTable - { - public StrIdDic skill_group_id; - public StrIdDic item_id; - public Dictionary dialogStrToNum; - public StrIdDic chapter_map_id; - public StrIdDic char_voice_id; - public StrIdDic char_doc_id; - public StrIdDic area_id; - public StrIdDic map_mark_temp_id; - public StrIdDic wiki_id; - public StrIdDic client_game_var_string_id; - } public class GachaCharPoolTable { public string id; @@ -825,10 +805,7 @@ namespace Campofinale.Resource { } - public class SystemJumpTable - { - public int bindSystem; - } + public class StrIdDic { public Dictionary dic; @@ -845,11 +822,7 @@ namespace Campofinale.Resource public string enemyId; public string templateId; } - public class ItemTypeTable - { - public int itemType; - public ItemStorageSpace storageSpace; - } + public class ItemTable { public ItemValuableDepotType valuableTabType; @@ -921,15 +894,7 @@ namespace Campofinale.Resource public string id; public int count; } - public class CharacterTable - { - public List attributes; - public string charId; - public int weaponType; - public string engName; - public int rarity; - - } + public class Attributes { public int breakStage; diff --git a/Campofinale/Resource/Table/BlocDataTable.cs b/Campofinale/Resource/Table/BlocDataTable.cs index d8c910f..2068ba9 100644 --- a/Campofinale/Resource/Table/BlocDataTable.cs +++ b/Campofinale/Resource/Table/BlocDataTable.cs @@ -6,7 +6,8 @@ using System.Threading.Tasks; namespace Campofinale.Resource.Table { - public class BlocDataTable + [TableCfgType("TableCfg/BlocDataTable.json", LoadPriority.LOW)] + public class BlocDataTable : TableCfgResource { public string blocId; } diff --git a/Campofinale/Resource/Table/CharacterTable.cs b/Campofinale/Resource/Table/CharacterTable.cs new file mode 100644 index 0000000..0038c6d --- /dev/null +++ b/Campofinale/Resource/Table/CharacterTable.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using static Campofinale.Resource.ResourceManager; + +namespace Campofinale.Resource.Table +{ + [TableCfgType("TableCfg/CharacterTable.json", LoadPriority.LOW)] + public class CharacterTable : TableCfgResource + { + public List attributes; + public string charId; + public int weaponType; + public string engName; + public int rarity; + + } +} diff --git a/Campofinale/Resource/Table/DialogIdTable.cs b/Campofinale/Resource/Table/DialogIdTable.cs new file mode 100644 index 0000000..c492af4 --- /dev/null +++ b/Campofinale/Resource/Table/DialogIdTable.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using static Campofinale.Resource.ResourceManager; + +namespace Campofinale.Resource.Table +{ + [TableCfgType("Json/GameplayConfig/DialogIdTable.json", LoadPriority.LOW)] + public class DialogIdTable : StrIdNumTable + { + } +} diff --git a/Campofinale/Resource/Table/InteractiveTable.cs b/Campofinale/Resource/Table/InteractiveTable.cs new file mode 100644 index 0000000..0b015b6 --- /dev/null +++ b/Campofinale/Resource/Table/InteractiveTable.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Campofinale.Resource.Table +{ + [TableCfgType("Json/Interactive/InteractiveTable.json", LoadPriority.LOW)] + public class InteractiveTable : TableCfgResource + { + public Dictionary interactiveDataDict = new(); + + public class InteractiveTemplate + { + public string templateId; + } + } +} diff --git a/Campofinale/Resource/Table/ItemTypeTable.cs b/Campofinale/Resource/Table/ItemTypeTable.cs new file mode 100644 index 0000000..aa223d7 --- /dev/null +++ b/Campofinale/Resource/Table/ItemTypeTable.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Campofinale.Resource.Table +{ + [TableCfgType("TableCfg/ItemTypeTable.json", LoadPriority.LOW)] + public class ItemTypeTable + { + public int itemType; + public ItemStorageSpace storageSpace; + } +} diff --git a/Campofinale/Resource/Table/LevelGradeTable.cs b/Campofinale/Resource/Table/LevelGradeTable.cs index fe78c01..265fb44 100644 --- a/Campofinale/Resource/Table/LevelGradeTable.cs +++ b/Campofinale/Resource/Table/LevelGradeTable.cs @@ -6,7 +6,8 @@ using System.Threading.Tasks; namespace Campofinale.Resource.Table { - public class LevelGradeTable + [TableCfgType("TableCfg/LevelGradeTable.json", LoadPriority.LOW)] + public class LevelGradeTable : TableCfgResource { public string name; public List grades; diff --git a/Campofinale/Resource/Table/MissionAreaTable.cs b/Campofinale/Resource/Table/MissionAreaTable.cs index 54dc6a9..e60ea4c 100644 --- a/Campofinale/Resource/Table/MissionAreaTable.cs +++ b/Campofinale/Resource/Table/MissionAreaTable.cs @@ -6,7 +6,8 @@ using System.Threading.Tasks; namespace Campofinale.Resource.Table { - public class MissionAreaTable + [TableCfgType("Json/GameplayConfig/MissionAreaTable.json", LoadPriority.LOW)] + public class MissionAreaTable : TableCfgResource { public Dictionary> m_areas; } diff --git a/Campofinale/Resource/Table/StrIdNumTable.cs b/Campofinale/Resource/Table/StrIdNumTable.cs new file mode 100644 index 0000000..47a2e13 --- /dev/null +++ b/Campofinale/Resource/Table/StrIdNumTable.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using static Campofinale.Resource.ResourceManager; + +namespace Campofinale.Resource.Table +{ + [TableCfgType("TableCfg/StrIdNumTable.json", LoadPriority.LOW)] + public class StrIdNumTable : TableCfgResource + { + public StrIdDic skill_group_id; + public StrIdDic item_id; + public Dictionary dialogStrToNum; + public StrIdDic chapter_map_id; + public StrIdDic char_voice_id; + public StrIdDic char_doc_id; + public StrIdDic area_id; + public StrIdDic map_mark_temp_id; + public StrIdDic wiki_id; + public StrIdDic client_game_var_string_id; + } +} diff --git a/Campofinale/Resource/Table/SystemJumpTable.cs b/Campofinale/Resource/Table/SystemJumpTable.cs new file mode 100644 index 0000000..e9f9154 --- /dev/null +++ b/Campofinale/Resource/Table/SystemJumpTable.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Campofinale.Resource.Table +{ + [TableCfgType("TableCfg/SystemJumpTable.json", LoadPriority.LOW)] + public class SystemJumpTable + { + public int bindSystem; + } +} diff --git a/Campofinale/Resource/TableCfgResource.cs b/Campofinale/Resource/TableCfgResource.cs new file mode 100644 index 0000000..9f75734 --- /dev/null +++ b/Campofinale/Resource/TableCfgResource.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Campofinale.Resource +{ + public abstract class TableCfgResource + { + + public void OnLoad() + { + + } + } + [AttributeUsage(AttributeTargets.Class, Inherited = false)] + public class TableCfgTypeAttribute : Attribute + { + public string Name { get; } + public LoadPriority Priority { get; } + + public TableCfgTypeAttribute(string name, LoadPriority priority) + { + Name = name; + Priority = priority; + } + } + + public enum LoadPriority + { + HIGH, + MEDIUM, + LOW + } +} From c375fb9af7ac6ac68f7182385837a04d65f51840 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sun, 9 Mar 2025 22:08:29 +0100 Subject: [PATCH 17/58] remove comments --- Campofinale/Resource/ResourceLoader.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Campofinale/Resource/ResourceLoader.cs b/Campofinale/Resource/ResourceLoader.cs index acb231f..f2fa7a8 100644 --- a/Campofinale/Resource/ResourceLoader.cs +++ b/Campofinale/Resource/ResourceLoader.cs @@ -37,8 +37,8 @@ namespace Campofinale.Resource if (genericTypeDef == typeof(Dictionary<,>)) { - var keyType = fieldType.GetGenericArguments()[0]; // String - var valType = fieldType.GetGenericArguments()[1]; // Il tipo desiderato + var keyType = fieldType.GetGenericArguments()[0]; + var valType = fieldType.GetGenericArguments()[1]; return JsonConvert.DeserializeObject(json, typeof(Dictionary<,>).MakeGenericType(keyType, valType)); } else if (genericTypeDef == typeof(List<>)) @@ -47,7 +47,6 @@ namespace Campofinale.Resource } } - // Oggetto singolo return JsonConvert.DeserializeObject(json, valueType); } public static string ReadJsonFile(string path) @@ -85,16 +84,14 @@ namespace Campofinale.Resource { var genericTypeDef = fieldType.GetGenericTypeDefinition(); - // Controlla se è un Dictionary e se TValue è del tipo richiesto if (genericTypeDef == typeof(Dictionary<,>)) { - var valueType = fieldType.GetGenericArguments()[1]; // Ottiene TValue + var valueType = fieldType.GetGenericArguments()[1]; if (valueType == type) { return field; } } - // Controlla se è una List e se T è del tipo richiesto else if (genericTypeDef == typeof(List<>) && fieldType.GetGenericArguments()[0] == type) { return field; @@ -102,7 +99,6 @@ namespace Campofinale.Resource } else { - // Se il campo non è una collezione ma è direttamente del tipo richiesto if (fieldType == type) { return field; @@ -110,7 +106,7 @@ namespace Campofinale.Resource } } - return null; // Nessun campo trovato + return null; } } } From d0e91fdc7819ba3cc9a4c9568c81a35d414100d2 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sun, 9 Mar 2025 22:14:29 +0100 Subject: [PATCH 18/58] some summary comments --- Campofinale/Resource/ResourceLoader.cs | 22 +++++----------------- Campofinale/Resource/ResourceManager.cs | 5 +++++ Campofinale/Resource/TableCfgResource.cs | 10 +++++++++- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Campofinale/Resource/ResourceLoader.cs b/Campofinale/Resource/ResourceLoader.cs index f2fa7a8..e0607a3 100644 --- a/Campofinale/Resource/ResourceLoader.cs +++ b/Campofinale/Resource/ResourceLoader.cs @@ -11,7 +11,9 @@ namespace Campofinale.Resource { public class ResourceLoader { - + /// + /// Load table cfg automatically inside ResourceManager fields + /// public static void LoadTableCfg() { var tableCfgTypes = GetAllTableCfgTypes(); @@ -19,7 +21,7 @@ namespace Campofinale.Resource foreach (var type in tableCfgTypes) { var attr = type.GetCustomAttribute(); - string json = ReadJsonFile(attr.Name); + string json = ResourceManager.ReadJsonFile(attr.Name); FieldInfo field = GetResourceField(type); if (field != null && json.Length > 0) { @@ -49,21 +51,7 @@ namespace Campofinale.Resource return JsonConvert.DeserializeObject(json, valueType); } - public static string ReadJsonFile(string path) - { - try - { - return File.ReadAllText(path); - } - catch (Exception e) - { - Logger.PrintError($"Error occured while loading {path} Err: {e.Message}"); - ResourceManager.missingResources = true; - return ""; - } - - } - + public static List GetAllTableCfgTypes() { return Assembly.GetExecutingAssembly() diff --git a/Campofinale/Resource/ResourceManager.cs b/Campofinale/Resource/ResourceManager.cs index f40fc32..b1f1d2e 100644 --- a/Campofinale/Resource/ResourceManager.cs +++ b/Campofinale/Resource/ResourceManager.cs @@ -78,6 +78,11 @@ namespace Campofinale.Resource return levelDatas.Find(a => a.id == name).idNum; } public static bool missingResources = false; + /// + /// Utility method for read a json file + /// + /// The file path + /// Return the file content if the file exist, else it return an empty string public static string ReadJsonFile(string path) { try diff --git a/Campofinale/Resource/TableCfgResource.cs b/Campofinale/Resource/TableCfgResource.cs index 9f75734..15d7c48 100644 --- a/Campofinale/Resource/TableCfgResource.cs +++ b/Campofinale/Resource/TableCfgResource.cs @@ -8,7 +8,9 @@ namespace Campofinale.Resource { public abstract class TableCfgResource { - + /// + /// Not implemented yet + /// public void OnLoad() { @@ -17,7 +19,13 @@ namespace Campofinale.Resource [AttributeUsage(AttributeTargets.Class, Inherited = false)] public class TableCfgTypeAttribute : Attribute { + /// + /// Path of the Resource + /// public string Name { get; } + /// + /// Priority of load (still not implemented) + /// public LoadPriority Priority { get; } public TableCfgTypeAttribute(string name, LoadPriority priority) From 6a39a2960ea943e346de3952e8eadf94ac4bbd7f Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Mon, 10 Mar 2025 21:08:13 +0100 Subject: [PATCH 19/58] gift to chars work --- Campofinale/Game/Spaceship/SpaceshipChar.cs | 1 + .../Game/Spaceship/SpaceshipManager.cs | 34 +++++++++++++++++++ Campofinale/Packets/Cs/HandleCsLogin.cs | 2 +- .../Cs/HandleCsSpaceshipPresentGiftToChar.cs | 28 +++++++++++++++ .../Packets/Sc/PacketScSnsGetChatList.cs | 33 ++++++++++++++++++ Campofinale/Resource/ResourceManager.cs | 2 ++ Campofinale/Resource/Table/GiftItemTable.cs | 15 ++++++++ Campofinale/Resource/Table/SNSChatTable.cs | 16 +++++++++ 8 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 Campofinale/Packets/Cs/HandleCsSpaceshipPresentGiftToChar.cs create mode 100644 Campofinale/Packets/Sc/PacketScSnsGetChatList.cs create mode 100644 Campofinale/Resource/Table/GiftItemTable.cs create mode 100644 Campofinale/Resource/Table/SNSChatTable.cs diff --git a/Campofinale/Game/Spaceship/SpaceshipChar.cs b/Campofinale/Game/Spaceship/SpaceshipChar.cs index 22127f9..a81a463 100644 --- a/Campofinale/Game/Spaceship/SpaceshipChar.cs +++ b/Campofinale/Game/Spaceship/SpaceshipChar.cs @@ -46,6 +46,7 @@ namespace Campofinale.Game.Spaceship IsWorking = isWorking, PhysicalStrength = physicalStrength, StationedRoomId = stationedRoomId, + Skills = { new ScdSpaceshipCharSkill() diff --git a/Campofinale/Game/Spaceship/SpaceshipManager.cs b/Campofinale/Game/Spaceship/SpaceshipManager.cs index 441a2d8..521fffe 100644 --- a/Campofinale/Game/Spaceship/SpaceshipManager.cs +++ b/Campofinale/Game/Spaceship/SpaceshipManager.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using MongoDB.Bson.Serialization.IdGenerators; using static Campofinale.Resource.ResourceManager; using Campofinale.Resource; +using Campofinale.Resource.Table; namespace Campofinale.Game.Spaceship { @@ -84,6 +85,39 @@ namespace Campofinale.Game.Spaceship } } } + + public void GiftToChar(CsSpaceshipPresentGiftToChar req) + { + SpaceshipChar chara = GetChar(req.CharId); + if (chara != null) + { + foreach (var item in req.Gifts) + { + GiftItemTable giftItem = ResourceManager.giftItemTable[item.Id]; + chara.favorability += giftItem.favorablePoint * item.Count; + //TODO item consume + } + ScSpaceshipPresentGiftToChar confirm = new() + { + CurFav = chara.favorability, + CharId = chara.id, + RecvGiftCnt = req.Gifts.Count, + }; + //TODO packet class + /*ScSpaceshipCharFavorabilityChange change = new() + { + ChangeInfos = + { + new SpaceshipCharFavorabilityChangeInfo() + { + CharId = chara.id, + CurFav=chara.favorability, + } + } + };*/ + owner.Send(Protocol.ScMsgId.ScSpaceshipPresentGiftToChar, confirm); + } + } } diff --git a/Campofinale/Packets/Cs/HandleCsLogin.cs b/Campofinale/Packets/Cs/HandleCsLogin.cs index 52b957f..217092a 100644 --- a/Campofinale/Packets/Cs/HandleCsLogin.cs +++ b/Campofinale/Packets/Cs/HandleCsLogin.cs @@ -241,7 +241,7 @@ namespace Campofinale.Packets.Cs session.Send(new PacketScSpaceshipSync(session)); session.Send(new PacketScSyncFullDungeonStatus(session)); session.Send(new PacketScActivitySync(session)); - + session.Send(new PacketScSnsGetChatList(session)); session.Send(ScMsgId.ScSyncFullDataEnd, new ScSyncFullDataEnd()); session.EnterScene(); session.Initialized = true; diff --git a/Campofinale/Packets/Cs/HandleCsSpaceshipPresentGiftToChar.cs b/Campofinale/Packets/Cs/HandleCsSpaceshipPresentGiftToChar.cs new file mode 100644 index 0000000..bbdf214 --- /dev/null +++ b/Campofinale/Packets/Cs/HandleCsSpaceshipPresentGiftToChar.cs @@ -0,0 +1,28 @@ +using Campofinale.Network; +using Campofinale.Packets.Sc; +using Campofinale.Protocol; +using Google.Protobuf; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Sockets; +using System.Security.Cryptography; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace Campofinale.Packets.Cs +{ + public class HandleCsSpaceshipPresentGiftToChar + { + + [Server.Handler(CsMsgId.CsSpaceshipPresentGiftToChar)] + public static void Handle(Player session, CsMsgId cmdId, Packet packet) + { + CsSpaceshipPresentGiftToChar req = packet.DecodeBody(); + session.spaceshipManager.GiftToChar(req); + + } + + } +} diff --git a/Campofinale/Packets/Sc/PacketScSnsGetChatList.cs b/Campofinale/Packets/Sc/PacketScSnsGetChatList.cs new file mode 100644 index 0000000..3f96ca3 --- /dev/null +++ b/Campofinale/Packets/Sc/PacketScSnsGetChatList.cs @@ -0,0 +1,33 @@ +using Campofinale.Network; +using Campofinale.Protocol; +using Campofinale.Resource; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Cryptography; +using System.Text; +using System.Threading.Tasks; + +namespace Campofinale.Packets.Sc +{ + public class PacketScSnsGetChatList : Packet + { + public PacketScSnsGetChatList(Player player) { + ScSnsGetChatList proto = new ScSnsGetChatList() { + + }; + foreach (var chat in ResourceManager.snsChatTable) + { + var chatInfo = new SnsChatInfo() + { + ChatId = chat.Value.chatId, + ChatType = chat.Value.chatType, + Timestamp = DateTime.UtcNow.ToUnixTimestampMilliseconds(), + + }; + proto.ChatList.Add(chatInfo); + } + SetData(ScMsgId.ScSnsGetChatList, proto); + } + } +} diff --git a/Campofinale/Resource/ResourceManager.cs b/Campofinale/Resource/ResourceManager.cs index b1f1d2e..17c1cfe 100644 --- a/Campofinale/Resource/ResourceManager.cs +++ b/Campofinale/Resource/ResourceManager.cs @@ -68,6 +68,8 @@ namespace Campofinale.Resource public static Dictionary facSTTNodeTable = new(); public static Dictionary facSTTLayerTable = new(); public static Dictionary itemTypeTable = new(); // + public static Dictionary snsChatTable = new();// + public static Dictionary giftItemTable = new(); public static InteractiveTable interactiveTable = new(); // public static List levelDatas = new(); public static List interactiveData = new(); diff --git a/Campofinale/Resource/Table/GiftItemTable.cs b/Campofinale/Resource/Table/GiftItemTable.cs new file mode 100644 index 0000000..6cd6849 --- /dev/null +++ b/Campofinale/Resource/Table/GiftItemTable.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Campofinale.Resource.Table +{ + [TableCfgType("TableCfg/GiftItemTable.json", LoadPriority.LOW)] + public class GiftItemTable + { + public int favorablePoint; + public string id; + } +} diff --git a/Campofinale/Resource/Table/SNSChatTable.cs b/Campofinale/Resource/Table/SNSChatTable.cs new file mode 100644 index 0000000..b2101e5 --- /dev/null +++ b/Campofinale/Resource/Table/SNSChatTable.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Campofinale.Resource.Table +{ + [TableCfgType("TableCfg/SNSChatTable.json", LoadPriority.LOW)] + public class SNSChatTable + { + public string chatId; + public int chatType; + public int tagType; + } +} From cf91c97812d518bdfc844d2213a18af364ca738a Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Tue, 11 Mar 2025 17:12:12 +0100 Subject: [PATCH 20/58] server status api --- Campofinale/Http/Dispatch.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Campofinale/Http/Dispatch.cs b/Campofinale/Http/Dispatch.cs index b5df882..6fa4237 100644 --- a/Campofinale/Http/Dispatch.cs +++ b/Campofinale/Http/Dispatch.cs @@ -65,7 +65,17 @@ namespace Campofinale.Http await data(ctx); } + [StaticRoute(HttpServerLite.HttpMethod.GET, "/serverStatus")] + public static async Task serverStatus(HttpContext ctx) + { + string resp = "{\"maxPlayers\":" + Server.config.serverOptions.maxPlayers + ", \"players\":" + Server.clients.Count + ", \"status\":\"Online\"}"; + ctx.Response.StatusCode = 200; + ctx.Response.ContentLength = resp.Length; + ctx.Response.ContentType = "application/json"; + + await ctx.Response.SendAsync(resp); + } [StaticRoute(HttpServerLite.HttpMethod.POST, "/u8/pay/getAllProductList")] public static async Task getAllProductList(HttpContext ctx) { From 4b27010dddbb82bc68deb5ac8901f7c5eee1e609 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Tue, 11 Mar 2025 17:29:59 +0100 Subject: [PATCH 21/58] more server status info --- Campofinale/Http/Dispatch.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Campofinale/Http/Dispatch.cs b/Campofinale/Http/Dispatch.cs index 6fa4237..5338ef5 100644 --- a/Campofinale/Http/Dispatch.cs +++ b/Campofinale/Http/Dispatch.cs @@ -68,7 +68,7 @@ namespace Campofinale.Http [StaticRoute(HttpServerLite.HttpMethod.GET, "/serverStatus")] public static async Task serverStatus(HttpContext ctx) { - string resp = "{\"maxPlayers\":" + Server.config.serverOptions.maxPlayers + ", \"players\":" + Server.clients.Count + ", \"status\":\"Online\"}"; + string resp = "{\"maxPlayers\":" + Server.config.serverOptions.maxPlayers + ", \"players\":" + Server.clients.Count + ", \"status\":\"Online\", \"gameVersion\":" + GameConstants.GAME_VERSION + ", \"serverVersion\":" + Server.ServerVersion + "}"; ctx.Response.StatusCode = 200; ctx.Response.ContentLength = resp.Length; From 2e1b633682f64444184076d9447c2b222a366e24 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Tue, 11 Mar 2025 17:36:21 +0100 Subject: [PATCH 22/58] fix --- Campofinale/Http/Dispatch.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Campofinale/Http/Dispatch.cs b/Campofinale/Http/Dispatch.cs index 5338ef5..bcbfc1b 100644 --- a/Campofinale/Http/Dispatch.cs +++ b/Campofinale/Http/Dispatch.cs @@ -68,7 +68,7 @@ namespace Campofinale.Http [StaticRoute(HttpServerLite.HttpMethod.GET, "/serverStatus")] public static async Task serverStatus(HttpContext ctx) { - string resp = "{\"maxPlayers\":" + Server.config.serverOptions.maxPlayers + ", \"players\":" + Server.clients.Count + ", \"status\":\"Online\", \"gameVersion\":" + GameConstants.GAME_VERSION + ", \"serverVersion\":" + Server.ServerVersion + "}"; + string resp = "{\"maxPlayers\":" + Server.config.serverOptions.maxPlayers + ", \"players\":" + Server.clients.Count + ", \"status\":\"Online\", \"gameVersion\": \"" + GameConstants.GAME_VERSION + "\", \"serverVersion\": \"" + Server.ServerVersion + "\"}"; ctx.Response.StatusCode = 200; ctx.Response.ContentLength = resp.Length; From ed0d4252a70263ed8362e616143232f8a9de882f Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Tue, 11 Mar 2025 20:11:05 +0100 Subject: [PATCH 23/58] bag saving, grid move and drop --- Campofinale/Commands/Handlers/CommandAdd.cs | 5 +- Campofinale/Database/Database.cs | 2 + Campofinale/Database/DatabaseManager.cs | 3 + Campofinale/Game/Inventory/InventoryList.cs | 101 +++++++++++++++++- .../Game/Inventory/InventoryManager.cs | 90 ++++++++++++---- .../Packets/Cs/HandleCsCharPotentialUnlock.cs | 1 + .../Packets/Cs/HandleCsItemBagAbandonInBag.cs | 27 +++++ .../Packets/Cs/HandleCsItemBagMoveInBag.cs | 27 +++++ .../Packets/Sc/PacketScItemBagScopeSync.cs | 1 + Campofinale/Player.cs | 2 + 10 files changed, 231 insertions(+), 28 deletions(-) create mode 100644 Campofinale/Packets/Cs/HandleCsItemBagAbandonInBag.cs create mode 100644 Campofinale/Packets/Cs/HandleCsItemBagMoveInBag.cs diff --git a/Campofinale/Commands/Handlers/CommandAdd.cs b/Campofinale/Commands/Handlers/CommandAdd.cs index 8cb9fb3..e8337c1 100644 --- a/Campofinale/Commands/Handlers/CommandAdd.cs +++ b/Campofinale/Commands/Handlers/CommandAdd.cs @@ -28,15 +28,12 @@ public static class CommandAdd case "item": Item item=target.inventoryManager.AddItem(args[1], int.Parse(args[2])); message = $"Item {args[1]} was added to {target.nickname}"; - - target.Send(new PacketScItemBagScopeModify(target, item)); break; case "weapon": Item wep = target.inventoryManager.AddWeapon(args[1], Convert.ToUInt64(args[2])); message = $"Weapon {args[1]} was added to {target.nickname}"; - target.Send(new PacketScItemBagScopeModify(target, wep)); break; case "char": @@ -77,7 +74,7 @@ public static class CommandAdd return; } - target.inventoryManager.Save(); + CommandManager.SendMessage(sender, $"{message}."); } catch (Exception err) diff --git a/Campofinale/Database/Database.cs b/Campofinale/Database/Database.cs index 91b655f..21e0196 100644 --- a/Campofinale/Database/Database.cs +++ b/Campofinale/Database/Database.cs @@ -43,6 +43,7 @@ namespace Campofinale.Database public Dictionary> bitsets = new(); public PlayerSafeZoneInfo savedSafeZone = new(); public Gender gender = Gender.GenFemale; + public Dictionary bag = new(); } public class Account { @@ -144,6 +145,7 @@ namespace Campofinale.Database bitsets=player.bitsetManager.bitsets, savedSafeZone = player.savedSaveZone, gender=player.gender, + bag=player.inventoryManager.items.bag }; UpsertPlayerData(data); } diff --git a/Campofinale/Database/DatabaseManager.cs b/Campofinale/Database/DatabaseManager.cs index a267ddd..ba4f8f0 100644 --- a/Campofinale/Database/DatabaseManager.cs +++ b/Campofinale/Database/DatabaseManager.cs @@ -9,6 +9,7 @@ using MongoDB.Bson.IO; using MongoDB.Bson; using System.Reflection; using static Campofinale.Game.Factory.FactoryNode; +using Campofinale.Game.Inventory; namespace Campofinale.Database { @@ -68,6 +69,8 @@ namespace Campofinale.Database { BsonSerializer.RegisterSerializer(typeof(Dictionary), new CustomDictionarySerializer()); BsonSerializer.RegisterSerializer(typeof(Dictionary>), new CustomDictionarySerializer>()); + BsonSerializer.RegisterSerializer(typeof(Dictionary), new CustomDictionarySerializer()); + RegisterSubclasses(); Logger.Print("Connecting to MongoDB..."); try diff --git a/Campofinale/Game/Inventory/InventoryList.cs b/Campofinale/Game/Inventory/InventoryList.cs index e7d4fa5..77aaa4c 100644 --- a/Campofinale/Game/Inventory/InventoryList.cs +++ b/Campofinale/Game/Inventory/InventoryList.cs @@ -1,4 +1,5 @@ -using Campofinale.Packets.Sc; +using Campofinale.Database; +using Campofinale.Packets.Sc; using System; using System.Collections.Generic; using System.Linq; @@ -142,7 +143,27 @@ namespace Campofinale.Game.Inventory return null; } + public List FindAll(Predicate match, FindType findType = FindType.Items) + { + switch (findType) + { + case FindType.Items: + return items.FindAll(match); + break; + case FindType.FactoryDepots: + //TODO + break; + case FindType.Bag: + var itemB = bag.Values.ToList().FindAll(match); + if (itemB != null) + { + return itemB; + } + break; + } + return null; + } /// ///Add an item to the inventory (or increment it's amount if it's not an instance type, else add a new one or add to bag if it's a Factory item /// @@ -156,6 +177,7 @@ namespace Campofinale.Game.Inventory if (item.InstanceType()) { items.Add(item); + DatabaseManager.db.UpsertItem(item); return item; } else @@ -164,17 +186,92 @@ namespace Campofinale.Game.Inventory if (exist != null) { exist.amount += item.amount; + DatabaseManager.db.UpsertItem(exist); return exist; } else { items.Add(item); + DatabaseManager.db.UpsertItem(item); return item; } } } + /// + /// Get the item amount from all depots + /// + /// + /// + public int GetItemAmount(string id) + { + int amt = 0; + Item item=Find(i=>i.id==id); + if (item != null) + { + amt += item.amount; + } + List bagItems = FindAll(i=>i.id==id,FindType.Bag); + foreach (Item bagItem in bagItems) + { + amt += bagItem.amount; + } + + return amt; + } + public void Remove(Item item) + { + if (items.Remove(item)) + { + this.player.Send(new PacketScItemBagScopeModify(this.player, item)); + DatabaseManager.db.DeleteItem(item); + } + else if (RemoveFromBag(item)) + { + UpdateBagInventoryPacket(); + } + } - + private bool RemoveFromBag(Item item) + { + for (int i = 0; i < maxBagSize; i++) + { + Item bagItem = null; + if (bag.ContainsKey(i)) + { + bagItem = bag[i]; + if (bagItem.guid == item.guid) + { + bag.Remove(i); + return true; + } + } + } + return false; + } + /// + /// Move item from bag grid to another position + /// + /// + /// + public void MoveBagItem(int fromGrid, int toGrid) + { + Item item1 = bag[fromGrid]; + Item item2 = null; + if (bag.ContainsKey(toGrid)) + { + item2 = bag[toGrid]; + } + bag[toGrid] = item1; + if (item2 != null) + { + bag[fromGrid] = item2; + } + else + { + bag.Remove(fromGrid); + } + UpdateBagInventoryPacket(); + } } } diff --git a/Campofinale/Game/Inventory/InventoryManager.cs b/Campofinale/Game/Inventory/InventoryManager.cs index 03851f3..87b1780 100644 --- a/Campofinale/Game/Inventory/InventoryManager.cs +++ b/Campofinale/Game/Inventory/InventoryManager.cs @@ -5,6 +5,7 @@ using Google.Protobuf.Collections; using System; using System.Collections.Generic; using System.Linq; +using System.Reflection.Metadata; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; @@ -135,11 +136,47 @@ namespace Campofinale.Game.Inventory item.amount -= amt; if(item.amount <= 0) { - items.items.Remove(item); - DatabaseManager.db.DeleteItem(item); + items.Remove(item); + } + else + { + this.owner.Send(new PacketScItemBagScopeModify(this.owner, item)); + items.UpdateBagInventoryPacket(); + } + } + + public bool ConsumeItem(string id, int amt) + { + Item item=items.FindInAll(i=>i.id== id); + if (item != null) + { + if(item.amount >= amt) + { + item.amount -= amt; + + if(item.amount < 1) + { + items.Remove(item); + } + else + { + this.owner.Send(new PacketScItemBagScopeModify(this.owner, item)); + items.UpdateBagInventoryPacket(); + } + return true; + } + else + { + int toConsume = amt - item.amount; + item.amount = 0; + items.Remove(item); + return ConsumeItem(id, toConsume); + } + } + else + { + return false; } - - this.owner.Send(new PacketScItemBagScopeModify(this.owner, item)); } public bool ConsumeItems(MapField costItemId2Count) { @@ -159,16 +196,8 @@ namespace Campofinale.Game.Inventory bool found = true; foreach (ItemInfo item in items) { - Item i= GetItemById(item.ResId); - if (i != null) - { - if(i.amount < item.ResCount) - { - found = false; - break; - } - } - else + int amount = this.items.GetItemAmount(item.ResId); + if(amount < item.ResCount) { found = false; break; @@ -176,14 +205,7 @@ namespace Campofinale.Game.Inventory } foreach (ItemInfo item in items) { - Item i = GetItemById(item.ResId); - if (i != null) - { - if (i.amount >= item.ResCount) - { - RemoveItem(i,item.ResCount); - } - } + ConsumeItem(item.ResId, item.ResCount); } return found; } @@ -199,5 +221,29 @@ namespace Campofinale.Game.Inventory return dir; } + + public void DropItemsBag(CsItemBagAbandonInBag req) + { + if(req.TargetObjectId == 0) + { + foreach (var i in req.GridCut) + { + Item item = items.bag[i.Key]; + item.amount -= i.Value; + if(item.amount <= 0) + { + items.bag.Remove(i.Key); + } + owner.sceneManager.CreateDrop(owner.position, new RewardTable.ItemBundle() + { + count=i.Value, + id=item.id, + }); + + } + + } + items.UpdateBagInventoryPacket(); + } } } diff --git a/Campofinale/Packets/Cs/HandleCsCharPotentialUnlock.cs b/Campofinale/Packets/Cs/HandleCsCharPotentialUnlock.cs index c51f230..943ae7e 100644 --- a/Campofinale/Packets/Cs/HandleCsCharPotentialUnlock.cs +++ b/Campofinale/Packets/Cs/HandleCsCharPotentialUnlock.cs @@ -26,6 +26,7 @@ namespace Campofinale.Packets.Cs if (character != null) { character.potential=req.Level; + //TODO consume Item ID ScCharPotentialUnlock unlock = new() diff --git a/Campofinale/Packets/Cs/HandleCsItemBagAbandonInBag.cs b/Campofinale/Packets/Cs/HandleCsItemBagAbandonInBag.cs new file mode 100644 index 0000000..990c527 --- /dev/null +++ b/Campofinale/Packets/Cs/HandleCsItemBagAbandonInBag.cs @@ -0,0 +1,27 @@ +using Campofinale.Network; +using Campofinale.Packets.Sc; +using Campofinale.Protocol; +using Google.Protobuf; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Sockets; +using System.Security.Cryptography; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace Campofinale.Packets.Cs +{ + public class HandleCsItemBagAbandonInBag + { + + [Server.Handler(CsMsgId.CsItemBagAbandonInBag)] + public static void Handle(Player session, CsMsgId cmdId, Packet packet) + { + CsItemBagAbandonInBag req = packet.DecodeBody(); + session.inventoryManager.DropItemsBag(req); + } + + } +} diff --git a/Campofinale/Packets/Cs/HandleCsItemBagMoveInBag.cs b/Campofinale/Packets/Cs/HandleCsItemBagMoveInBag.cs new file mode 100644 index 0000000..6860e58 --- /dev/null +++ b/Campofinale/Packets/Cs/HandleCsItemBagMoveInBag.cs @@ -0,0 +1,27 @@ +using Campofinale.Network; +using Campofinale.Packets.Sc; +using Campofinale.Protocol; +using Google.Protobuf; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Sockets; +using System.Security.Cryptography; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace Campofinale.Packets.Cs +{ + public class HandleCsItemBagMoveInBag + { + + [Server.Handler(CsMsgId.CsItemBagMoveInBag)] + public static void Handle(Player session, CsMsgId cmdId, Packet packet) + { + CsItemBagMoveInBag req = packet.DecodeBody(); + session.inventoryManager.items.MoveBagItem(req.FromGrid, req.ToGrid); + } + + } +} diff --git a/Campofinale/Packets/Sc/PacketScItemBagScopeSync.cs b/Campofinale/Packets/Sc/PacketScItemBagScopeSync.cs index 7cd2dfc..d226aba 100644 --- a/Campofinale/Packets/Sc/PacketScItemBagScopeSync.cs +++ b/Campofinale/Packets/Sc/PacketScItemBagScopeSync.cs @@ -114,6 +114,7 @@ namespace Campofinale.Packets.Sc proto.Bag = null; } proto.Depot.Add(i, new ScdItemDepot()); + if(proto.Bag!=null) foreach (var item in client.inventoryManager.items.bag) { proto.Bag.Grids.Add(new ScdItemGrid() diff --git a/Campofinale/Player.cs b/Campofinale/Player.cs index afc1eef..258b4bb 100644 --- a/Campofinale/Player.cs +++ b/Campofinale/Player.cs @@ -163,9 +163,11 @@ namespace Campofinale curStamina = data.curStamina; nextRecoverTime=data.nextRecoverTime; if (data.gender > 0) gender = data.gender; + LoadCharacters(); mails = DatabaseManager.db.LoadMails(roleId); inventoryManager.Load(); + if (data.bag != null) inventoryManager.items.bag = data.bag; spaceshipManager.Load(); if (data.scenes != null) { From 8e1713877a2455f1171ec249cab947c7fe7591da Mon Sep 17 00:00:00 2001 From: CloudTron <96151994+CloudTronUSA@users.noreply.github.com> Date: Sat, 15 Mar 2025 01:44:38 -0700 Subject: [PATCH 24/58] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 03cbf29..a88326e 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Campofinale [EN](README.md) | [IT](docs/README_it-IT.md) | [RU](docs/README_ru-RU.md) | [CN](docs/README_zh-CN.md) | [NL](docs/README_nl-NL.md) -![Logo]() - Campofinale is a experimental server implementation for a certain factory building game. +> **NOTICE:** Our old Discord server was raided (all members were removed), please rejoin our community using this new invite link: https://discord.gg/eGGXymVd4K + ## Current Features * Login @@ -29,8 +29,8 @@ New tutorial will be added in the next days on the wiki, in the meanwhile you ca ## Discord for support -If you want to discuss, ask for support or help with this project, join our [Discord Server](https://discord.gg/wbqqFYaNzD)! +If you want to discuss, ask for support or help with this project, join our [Discord Server](https://discord.gg/eGGXymVd4K)! ## Note -This project is developed independently, and all rights to the original game assets and intellectual property belong to their respective owners. \ No newline at end of file +This project is developed independently, and all rights to the original game assets and intellectual property belong to their respective owners. From 5e4fee92ef9d16bf4e28473d2a6d02631d9539b8 Mon Sep 17 00:00:00 2001 From: CloudTron <96151994+CloudTronUSA@users.noreply.github.com> Date: Sat, 15 Mar 2025 01:45:53 -0700 Subject: [PATCH 25/58] Update README_zh-CN.md --- docs/README_zh-CN.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/README_zh-CN.md b/docs/README_zh-CN.md index 1e1c6e1..5cab08f 100644 --- a/docs/README_zh-CN.md +++ b/docs/README_zh-CN.md @@ -5,6 +5,8 @@ Campofinale 是为某个工厂建造游戏提供的实验性本地服务器实现 +> **我们的旧 Discord 服务器遭到了袭击(攻击者踢走了所有成员),请使用以下新邀请链接重新加入我们的社区:[https://discord.gg/eGGXymVd4K](https://discord.gg/eGGXymVd4K)** + ## 当前功能 * 登录 @@ -38,4 +40,4 @@ Campofinale 是为某个工厂建造游戏提供的实验性本地服务器实 ## 附录 -本项目为独立开发,所有原始游戏资产和知识产权均归其各自所有者所有 \ No newline at end of file +本项目为独立开发,所有原始游戏资产和知识产权均归其各自所有者所有 From a8863e9b3e9075e444a436aa70b60ebbfa0dab24 Mon Sep 17 00:00:00 2001 From: CloudTron <96151994+CloudTronUSA@users.noreply.github.com> Date: Sat, 15 Mar 2025 01:46:14 -0700 Subject: [PATCH 26/58] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a88326e..a30a621 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Campofinale is a experimental server implementation for a certain factory building game. -> **NOTICE:** Our old Discord server was raided (all members were removed), please rejoin our community using this new invite link: https://discord.gg/eGGXymVd4K +> **NOTICE: Our old Discord server was raided (all members were removed), please rejoin our community using this new invite link: https://discord.gg/eGGXymVd4K** ## Current Features From c6b38f06fb5a5efccad4ad8c91fa57fa032d7784 Mon Sep 17 00:00:00 2001 From: CloudTron <96151994+CloudTronUSA@users.noreply.github.com> Date: Sat, 15 Mar 2025 01:46:51 -0700 Subject: [PATCH 27/58] Update README_zh-CN.md --- docs/README_zh-CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README_zh-CN.md b/docs/README_zh-CN.md index 5cab08f..6cda30c 100644 --- a/docs/README_zh-CN.md +++ b/docs/README_zh-CN.md @@ -36,7 +36,7 @@ Campofinale 是为某个工厂建造游戏提供的实验性本地服务器实 ## 在Discord上寻求帮助 -如果你想讨论、寻求帮助或者协助我们完善和改进此项目,请加入我们的[Discord服务器](https://discord.gg/wbqqFYaNzD)! +如果你想讨论、寻求帮助或者协助我们完善和改进此项目,请加入我们的[Discord服务器](https://discord.gg/eGGXymVd4K)! ## 附录 From 23c6f57bb167e910b113939db426dd0f4a4ebde2 Mon Sep 17 00:00:00 2001 From: Albert <62834423+Xannix246@users.noreply.github.com> Date: Sat, 15 Mar 2025 21:06:04 +0300 Subject: [PATCH 28/58] Update README_ru-RU.md --- docs/README_ru-RU.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/README_ru-RU.md b/docs/README_ru-RU.md index 2b3b1b2..71ecc5e 100644 --- a/docs/README_ru-RU.md +++ b/docs/README_ru-RU.md @@ -1,10 +1,10 @@ # Campofinale [EN](/README.md) | [IT](./README_it-IT.md) | [RU](./README_ru-RU.md) | [CN](./README_zh-CN.md) | [NL](./README_nl-NL.md) -![Logo]() - Campofinale - экспериментальная реализация сервера для кое-какой игры по постройке фабрик. +> **Внимание: наш старый Discord сервер был подвергнут крашу (все участники были выгнаны), поэтому настоятельно просим вас присоединиться заново по этой ссылке: https://discord.gg/eGGXymVd4K** + ## Текущие возможности * Переключение персонажей; @@ -25,7 +25,7 @@ Campofinale - экспериментальная реализация серве ## Discord поддержка -Если вы хотите обсудить проект или помочь в его разработке, присоединяйтесь к нашему [Discord серверу](https://discord.gg/gPvqhfdMU6)! +Если вы хотите обсудить проект или помочь в его разработке, присоединяйтесь к нашему [Discord серверу](https://discord.gg/eGGXymVd4K)! ## Примечание From 209bd162486938dca89109500eb6f5afa3c2bcb1 Mon Sep 17 00:00:00 2001 From: CloudTronX Date: Sat, 15 Mar 2025 12:22:53 -0700 Subject: [PATCH 29/58] added support to decimal coordinate teleportation --- Campofinale/Commands/Handlers/CommandTeleport.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Campofinale/Commands/Handlers/CommandTeleport.cs b/Campofinale/Commands/Handlers/CommandTeleport.cs index 3ab8037..93abc67 100644 --- a/Campofinale/Commands/Handlers/CommandTeleport.cs +++ b/Campofinale/Commands/Handlers/CommandTeleport.cs @@ -21,11 +21,6 @@ namespace Campofinale.Commands.Handlers return; } - for (int i=0; i < args.Length; i++) - { - args[i] = Uri.UnescapeDataString(args[i]).Replace(".", ","); - } - float x, y, z; x = args[0] == "~" ? target.position.x : float.Parse(args[0]); From 28674c0aedb6a16d40e32751634482b1f2f8caaa Mon Sep 17 00:00:00 2001 From: Xannix246 <62834423+Xannix246@users.noreply.github.com> Date: Sun, 16 Mar 2025 01:26:00 +0300 Subject: [PATCH 30/58] ingame cmd update Now commands are transfering via base64, and teleport command can increase/decreae position (+ before cords value to increase and -- to decrease) --- .../Commands/Handlers/CommandNickname.cs | 5 ---- .../Commands/Handlers/CommandTeleport.cs | 25 +++++++++++++------ Campofinale/Data/PlayerConsole/index.html | 2 +- Campofinale/Http/PCDispatch.cs | 3 ++- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/Campofinale/Commands/Handlers/CommandNickname.cs b/Campofinale/Commands/Handlers/CommandNickname.cs index c8a0f47..990f077 100644 --- a/Campofinale/Commands/Handlers/CommandNickname.cs +++ b/Campofinale/Commands/Handlers/CommandNickname.cs @@ -19,11 +19,6 @@ namespace Campofinale.Commands.Handlers return; } - for (int i=0; i < args.Length; i++) - { - args[i] = Uri.UnescapeDataString(args[i]); - } - target.nickname = string.Join(" ", args); target.Save(); target.Send(new PacketScSetName(target, target.nickname)); diff --git a/Campofinale/Commands/Handlers/CommandTeleport.cs b/Campofinale/Commands/Handlers/CommandTeleport.cs index 93abc67..13eeea4 100644 --- a/Campofinale/Commands/Handlers/CommandTeleport.cs +++ b/Campofinale/Commands/Handlers/CommandTeleport.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using static Campofinale.Resource.ResourceManager; using Campofinale.Packets.Sc; using MongoDB.Bson; +using System.Globalization; namespace Campofinale.Commands.Handlers { @@ -21,17 +22,27 @@ namespace Campofinale.Commands.Handlers return; } - float x, y, z; + for (int i=0; i < args.Length; i++) + { + args[i] = args[i].Replace(",", "."); + } - x = args[0] == "~" ? target.position.x : float.Parse(args[0]); - y = args[1] == "~" ? target.position.y : float.Parse(args[1]); - z = args[2] == "~" ? target.position.z : float.Parse(args[2]); + float[] pos = [target.position.x, target.position.y, target.position.z]; + + for (int i=0; i < args.Length; i++) { + if(args[i] == "~") continue; + + float curPos = pos[i]; + pos[i] = float.Parse(args[i].StartsWith("--") ? args[i].Trim('-') : args[i], CultureInfo.InvariantCulture); + if (args[i].StartsWith('+')) pos[i] += curPos; + if (args[i].StartsWith("--")) pos[i] = curPos - pos[i]; + } Vector3f position = new Vector3f(new Vector() { - X = x, - Y = y, - Z = z + X = pos[0], + Y = pos[1], + Z = pos[2] }); target.position = position; diff --git a/Campofinale/Data/PlayerConsole/index.html b/Campofinale/Data/PlayerConsole/index.html index c79e32d..8021473 100644 --- a/Campofinale/Data/PlayerConsole/index.html +++ b/Campofinale/Data/PlayerConsole/index.html @@ -154,7 +154,7 @@ try { const url = new URL('%dispatchip%/pcSdk/console'); - url.searchParams.append('command', command); + url.searchParams.append('command', btoa(unescape(encodeURIComponent(command)))); url.searchParams.append('token', token); const response = await fetch(url.toString(), { diff --git a/Campofinale/Http/PCDispatch.cs b/Campofinale/Http/PCDispatch.cs index 37d1275..30a2907 100644 --- a/Campofinale/Http/PCDispatch.cs +++ b/Campofinale/Http/PCDispatch.cs @@ -30,7 +30,8 @@ namespace Campofinale.Http [StaticRoute(HttpServerLite.HttpMethod.GET, "/pcSdk/console")] public static async Task ConsoleResponce(HttpContext ctx) { - string cmd = ctx.Request.Query.Elements["command"].Replace("+"," "); + string encodedCmd = Uri.UnescapeDataString(ctx.Request.Query.Elements["command"]); + string cmd = Encoding.UTF8.GetString(Convert.FromBase64String(encodedCmd)); string token = ctx.Request.Query.Elements["token"]; string message = ""; string[] split = cmd.Split(" "); From 4c62f9f7efce2983825d4aea11ffeb11919fb3bc Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sun, 16 Mar 2025 20:52:48 +0100 Subject: [PATCH 31/58] fix --- Campofinale/Game/Gacha/GachaManager.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Campofinale/Game/Gacha/GachaManager.cs b/Campofinale/Game/Gacha/GachaManager.cs index 313b831..73bd93b 100644 --- a/Campofinale/Game/Gacha/GachaManager.cs +++ b/Campofinale/Game/Gacha/GachaManager.cs @@ -176,7 +176,6 @@ namespace Campofinale.Game.Gacha RewardIds = { $"reward_{transaction.rarity}starChar_weaponCoin", - }, }); From 75dafc17b246b4471dd49ecf2809197756911641 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sun, 16 Mar 2025 20:53:33 +0100 Subject: [PATCH 32/58] fix --- Campofinale/Game/Gacha/GachaManager.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Campofinale/Game/Gacha/GachaManager.cs b/Campofinale/Game/Gacha/GachaManager.cs index 73bd93b..bc19e0b 100644 --- a/Campofinale/Game/Gacha/GachaManager.cs +++ b/Campofinale/Game/Gacha/GachaManager.cs @@ -16,7 +16,7 @@ namespace Campofinale.Game.Gacha public Player player; internal ulong upSeqId; - const double fiftyfifty = 0.45; // 50% (make it less than real 50, because the randomness make win fifty fifty every time + const double fiftyfifty = 0.50; private static readonly Random random = new Random(); public GachaManager(Player player) @@ -219,11 +219,7 @@ namespace Campofinale.Game.Gacha } else { - int index = random.Next(0,items.Count); // Miglior randomizzazione - // index = (int)((1 - Math.Pow(random.NextDouble(), 2)) * (items.Count - 1)); - - // Se vuoi evitare di prendere spesso i primi 2-3 elementi: - // index = (int)Math.Pow(random.NextDouble(), 1.5) * items.Count; + int index = random.Next(0,items.Count); if (index > items.Count-1) { index = items.Count-1; From 2273c3989e059cd5b13b4bd8824a0edf11d46b3c Mon Sep 17 00:00:00 2001 From: Hexafluorine Date: Thu, 20 Mar 2025 18:06:02 -0700 Subject: [PATCH 33/58] Clean up imports --- Campofinale.Protocol/CsMsgId.cs | 646 +++++++------- Campofinale.Protocol/ScMsgId.cs | 790 +++++++++--------- Campofinale/Commands/BaseCommands.cs | 13 +- Campofinale/Commands/CommandManager.cs | 5 - .../Commands/Handlers/CommandAccount.cs | 5 - Campofinale/Commands/Handlers/CommandAdd.cs | 5 - .../Commands/Handlers/CommandCharInfo.cs | 7 - Campofinale/Commands/Handlers/CommandClear.cs | 8 +- Campofinale/Commands/Handlers/CommandHeal.cs | 8 +- Campofinale/Commands/Handlers/CommandHelp.cs | 8 +- .../Commands/Handlers/CommandIdList.cs | 5 - Campofinale/Commands/Handlers/CommandKick.cs | 5 - Campofinale/Commands/Handlers/CommandLevel.cs | 1 - .../Commands/Handlers/CommandNickname.cs | 5 - .../Commands/Handlers/CommandPlayers.cs | 8 +- .../Commands/Handlers/CommandRemove.cs | 5 - Campofinale/Commands/Handlers/CommandSpawn.cs | 5 - .../Commands/Handlers/CommandTeleport.cs | 5 - .../Commands/Handlers/CommandUnlockAll.cs | 8 +- Campofinale/ConfigFile.cs | 9 +- Campofinale/Crypto/CSChaCha20.cs | 3 - Campofinale/Database/Database.cs | 7 - Campofinale/Database/DatabaseManager.cs | 8 +- Campofinale/Game/BitsetManager.cs | 5 - Campofinale/Game/Character/Character.cs | 7 - Campofinale/Game/Dungeons/Dungeon.cs | 7 +- Campofinale/Game/Entities/Entity.cs | 5 - Campofinale/Game/Entities/EntityCharacter.cs | 8 +- .../Game/Entities/EntityInteractive.cs | 5 - Campofinale/Game/Entities/EntityMonster.cs | 5 - Campofinale/Game/Entities/EntityNpc.cs | 9 +- .../Factory/Components/FComponentBusLoader.cs | 5 - .../Components/FComponentPortManager.cs | 5 - .../Factory/Components/FComponentPowerPole.cs | 5 - .../Factory/Components/FComponentPowerSave.cs | 5 - .../Factory/Components/FComponentSelector.cs | 5 - .../Components/FComponentStablePower.cs | 5 - .../Factory/Components/FComponentSubHub.cs | 5 - .../Components/FComponentTravelPole.cs | 5 - Campofinale/Game/Factory/FactoryManager.cs | 6 - Campofinale/Game/Gacha/GachaManager.cs | 6 - Campofinale/Game/Gacha/GachaTransaction.cs | 5 - Campofinale/Game/GameConstants.cs | 8 +- Campofinale/Game/Inventory/InventoryList.cs | 5 - .../Game/Inventory/InventoryManager.cs | 8 - Campofinale/Game/Mail.cs | 5 - Campofinale/Game/SceneManager.cs | 7 - Campofinale/Game/Spaceship/SpaceshipChar.cs | 6 - .../Game/Spaceship/SpaceshipManager.cs | 10 - Campofinale/Game/Spaceship/SpaceshipRoom.cs | 5 - Campofinale/Game/Team.cs | 8 +- Campofinale/Http/Dispatch.cs | 15 +- Campofinale/Http/PCDispatch.cs | 4 - Campofinale/Http/SDK.cs | 6 - Campofinale/Logger.cs | 4 - Campofinale/Network/Packet.cs | 11 - Campofinale/NotifyManager.cs | 1 - Campofinale/Packets/Cs/HandleCsBattleOp.cs | 10 - Campofinale/Packets/Cs/HandleCsBitsetAdd.cs | 12 +- .../Packets/Cs/HandleCsBitsetRemove.cs | 12 +- .../Cs/HandleCsCharBagSetCurrTeamIndex.cs | 16 +- .../Packets/Cs/HandleCsCharBagSetTeam.cs | 9 - .../Cs/HandleCsCharBagSetTeamLeader.cs | 10 - .../Packets/Cs/HandleCsCharBagSetTeamName.cs | 9 - Campofinale/Packets/Cs/HandleCsCharLevelUp.cs | 9 - .../Packets/Cs/HandleCsCharPotentialUnlock.cs | 10 - .../Cs/HandleCsCharUnlockTalentNode.cs | 10 - .../Packets/Cs/HandleCsEnterDungeon.cs | 9 - Campofinale/Packets/Cs/HandleCsEquipPutoff.cs | 9 - Campofinale/Packets/Cs/HandleCsEquipPuton.cs | 9 - Campofinale/Packets/Cs/HandleCsFactoryHsFb.cs | 9 - Campofinale/Packets/Cs/HandleCsFactoryOp.cs | 9 - .../Cs/HandleCsFactoryStatisticRequire.cs | 9 - .../Packets/Cs/HandleCsFinishDialog.cs | 9 - Campofinale/Packets/Cs/HandleCsFlushSync.cs | 9 - .../Packets/Cs/HandleCsGachaTenPullReq.cs | 12 - Campofinale/Packets/Cs/HandleCsGetMail.cs | 1 - .../Packets/Cs/HandleCsItemBagAbandonInBag.cs | 10 - .../Packets/Cs/HandleCsItemBagMoveInBag.cs | 10 - .../Packets/Cs/HandleCsLeaveDungeon.cs | 9 - Campofinale/Packets/Cs/HandleCsLogin.cs | 1 - Campofinale/Packets/Cs/HandleCsMergeMsg.cs | 9 - .../Packets/Cs/HandleCsMoveObjectMove.cs | 9 - Campofinale/Packets/Cs/HandleCsPing.cs | 9 - .../Cs/HandleCsSceneInteractSpInteractive.cs | 12 +- .../HandleCsSceneInteractiveEventTrigger.cs | 12 +- .../Packets/Cs/HandleCsSceneLoadFinish.cs | 15 +- .../Packets/Cs/HandleCsSceneMoveStateSet.cs | 9 - .../Packets/Cs/HandleCsSceneRepatriate.cs | 1 - .../Cs/HandleCsSceneSetLastSafeZone.cs | 13 +- .../Packets/Cs/HandleCsSceneSetSafeZone.cs | 12 +- .../Packets/Cs/HandleCsSceneSetTrackPoint.cs | 9 - .../Packets/Cs/HandleCsSceneTeleport.cs | 9 - .../Cs/HandleCsSpaceshipPresentGiftToChar.cs | 10 - .../Cs/HandleCsSpaceshipStationChar.cs | 9 - ...leCsSpaceshipStationCharChangeWorkState.cs | 9 - .../Cs/HandleCsUpdateQuestObjective.cs | 9 - .../Packets/Cs/HandleCsWeaponAddExp.cs | 12 +- Campofinale/Packets/Cs/HandleCsWeaponPuton.cs | 9 - .../Packets/Sc/PacketScActivitySync.cs | 6 - .../Packets/Sc/PacketScAdventureBookSync.cs | 6 - .../Packets/Sc/PacketScAdventureSyncAll.cs | 6 - Campofinale/Packets/Sc/PacketScBitsetAdd.cs | 6 - .../Packets/Sc/PacketScBitsetRemove.cs | 6 - .../Packets/Sc/PacketScCharBagAddChar.cs | 6 - .../Packets/Sc/PacketScCharBagDelChar.cs | 6 - .../Sc/PacketScCharBagSetCurrTeamIndex.cs | 6 - .../Packets/Sc/PacketScCharBagSetTeamName.cs | 6 - .../Sc/PacketScCharUnlockTalentNode.cs | 6 - .../Packets/Sc/PacketScEnterSceneNotify.cs | 6 - .../Packets/Sc/PacketScFactoryOpRet.cs | 6 - Campofinale/Packets/Sc/PacketScFactorySync.cs | 1 - .../Packets/Sc/PacketScFactorySyncChapter.cs | 7 - Campofinale/Packets/Sc/PacketScGachaSync.cs | 6 - .../Packets/Sc/PacketScGameMechanicsSync.cs | 6 - Campofinale/Packets/Sc/PacketScGetMail.cs | 6 - .../Packets/Sc/PacketScItemBagScopeModify.cs | 6 - .../Packets/Sc/PacketScItemBagScopeSync.cs | 6 - .../Packets/Sc/PacketScObjectEnterView.cs | 7 - .../Packets/Sc/PacketScObjectLeaveView.cs | 10 +- .../Packets/Sc/PacketScSceneCollectionSync.cs | 7 - .../Packets/Sc/PacketScSceneSetTrackPoint.cs | 6 - .../Packets/Sc/PacketScSelfSceneInfo.cs | 9 +- Campofinale/Packets/Sc/PacketScSetName.cs | 6 - .../Packets/Sc/PacketScSnsGetChatList.cs | 6 - .../Packets/Sc/PacketScSpaceshipSync.cs | 6 - .../Sc/PacketScSpaceshipSyncRoomStation.cs | 6 - .../Packets/Sc/PacketScSyncAllBitset.cs | 6 - Campofinale/Packets/Sc/PacketScSyncAllBloc.cs | 6 - .../Packets/Sc/PacketScSyncAllDialog.cs | 6 - .../Packets/Sc/PacketScSyncAllGameVar.cs | 6 - Campofinale/Packets/Sc/PacketScSyncAllMail.cs | 6 - .../Packets/Sc/PacketScSyncAllMiniGame.cs | 6 - .../Packets/Sc/PacketScSyncAllRoleScene.cs | 7 - .../Packets/Sc/PacketScSyncAllUnlock.cs | 8 - .../Packets/Sc/PacketScSyncBaseData.cs | 6 - .../Packets/Sc/PacketScSyncCharBagInfo.cs | 7 - .../Sc/PacketScSyncFullDungeonStatus.cs | 6 - .../Packets/Sc/PacketScSyncGameMode.cs | 6 - Campofinale/Packets/Sc/PacketScSyncStamina.cs | 6 - Campofinale/Packets/Sc/PacketScSyncWallet.cs | 6 - Campofinale/Player.cs | 12 +- Campofinale/Program.cs | 3 +- Campofinale/Resource/GameEnums.cs | 8 +- Campofinale/Resource/LongBitSet.cs | 8 +- Campofinale/Resource/ResourceLoader.cs | 6 - Campofinale/Resource/ResourceManager.cs | 9 +- Campofinale/Resource/Table/BlocDataTable.cs | 8 +- Campofinale/Resource/Table/CharacterTable.cs | 7 +- Campofinale/Resource/Table/DialogIdTable.cs | 9 +- Campofinale/Resource/Table/GiftItemTable.cs | 8 +- .../Resource/Table/InteractiveTable.cs | 8 +- Campofinale/Resource/Table/ItemTypeTable.cs | 8 +- Campofinale/Resource/Table/LevelGradeTable.cs | 8 +- .../Resource/Table/MissionAreaTable.cs | 8 +- Campofinale/Resource/Table/SNSChatTable.cs | 8 +- Campofinale/Resource/Table/StrIdNumTable.cs | 7 +- Campofinale/Resource/Table/SystemJumpTable.cs | 8 +- Campofinale/Resource/TableCfgResource.cs | 8 +- Campofinale/Server.cs | 18 +- 160 files changed, 755 insertions(+), 1844 deletions(-) diff --git a/Campofinale.Protocol/CsMsgId.cs b/Campofinale.Protocol/CsMsgId.cs index fbb7d7e..49acb28 100644 --- a/Campofinale.Protocol/CsMsgId.cs +++ b/Campofinale.Protocol/CsMsgId.cs @@ -1,329 +1,323 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Campofinale.Protocol +namespace Campofinale.Protocol { -public enum CsMsgId : int -{ - CsMessageBegin = 0, - CsLogin = 1, - CsCreateRole = 2, - CsLogout = 3, - CsGmCommand = 4, - CsPing = 5, - CsFlushSync = 6, - CsSetName = 7, - CsSetGender = 8, - CsCheckName = 9, - CsCheckSensitive = 10, - CsAchieveBegin = 20, - CsAchieveComplete = 21, - CsAchieveTakeReward = 22, - CsAchieveEnd = 29, - CsCharBagBegin = 30, - CsCharBagTeamBegin = 31, - CsCharBagSetTeam = 32, - CsCharBagSetCurrTeamIndex = 33, - CsCharBagSetTeamName = 34, - CsCharBagSetTeamLeader = 35, - CsCharBagTeamChangeFinish = 36, - CsCharBagTeamEnd = 37, - CsCharBagEnd = 39, - CsCharBegin = 40, - CsCharLevelUp = 41, - CsCharSetNormalSkill = 43, - CsCharSkillLevelUp = 45, - CsCharSetTeamSkill = 46, - CsCharPotentialUnlock = 47, - CsCharEnd = 49, - CsEquipBegin = 50, - CsEquipPuton = 51, - CsEquipPutoff = 52, - CsEquipMedicineModify = 53, - CsEquipRecycle = 54, - CsEquipEnhance = 55, - CsEquipProduce = 57, - CsEquipEnd = 59, - CsSceneBegin = 80, - CsEnterScene = 81, - CsMoveObjectMove = 82, - CsSceneSetLastRecordCampid = 83, - CsSceneInteractiveEventTrigger = 84, - CsSceneSetVar = 85, - CsSceneRest = 86, - CsSceneLoadFinish = 88, - CsSceneSetSafeZone = 95, - CsSceneQueryEntityExist = 96, - CsSceneQueryInteractiveProperty = 97, - CsSceneSetTrackPoint = 99, - CsSceneInteractTree = 100, - CsSceneStaticMapMarkUpdate = 101, - CsSceneTeleport = 103, - CsSceneMoveStateSet = 104, - CsSceneSubmitItem = 105, - CsSceneSubmitEther = 106, - CsSceneSetLevelScriptActive = 107, - CsSceneLevelScriptEventTrigger = 109, - CsSceneCommitLevelScriptCacheStep = 110, - CsSceneRepatriate = 115, - CsSceneInteractSpInteractive = 116, - CsSceneSetLastSafeZone = 117, - CsSceneSetBattle = 118, - CsSceneRevival = 119, - CsSceneSetLevelScriptStart = 120, - CsSceneMonsterSpawnerBeginWave = 121, - CsSceneSpawnSummon = 122, - CsSceneLeavePlane = 123, - CsSceneGradeModify = 124, - CsSceneUpdateScriptTaskProgress = 125, - CsSceneTeleportFinish = 126, - CsSceneSetStorySafeZone = 127, - CsSceneSubmitRecycle = 128, - CsSceneEnd = 199, - CsFactoryBegin = 200, - CsFactorySttUnlockNode = 201, - CsFactorySttUnlockLayer = 202, - CsFactoryManuallyWorkExec = 211, - CsFactoryProductManualUnlock = 212, - CsFactoryQuickbarSetOne = 215, - CsFactoryQuickbarMoveOne = 216, - CsFactorySoilReclaim = 217, - CsFactorySoilWater = 218, - CsFactorySoilCancel = 219, - CsFactorySoilHarvest = 220, - CsFactorySoilFarmlandLevelUp = 221, - CsFactoryHubWorkshopMake = 222, - CsFactoryHubTransportRouteSet = 223, - CsFactoryHubTransportRouteReset = 224, - CsFactoryHubTransportRouteRestart = 225, - CsFactoryHsFb = 232, - CsFactoryStatisticSetBookmarkItemIds = 234, - CsFactoryStatisticRequire = 235, - CsFactoryPinSet = 236, - CsFactoryOp = 251, - CsFactoryObserverOp = 268, - CsFactoryEnd = 269, - CsWeaponBegin = 270, - CsWeaponPuton = 271, - CsWeaponBreakthrough = 273, - CsWeaponAddExp = 274, - CsWeaponAttachGem = 275, - CsWeaponDetachGem = 276, - CsWeaponRefineUpgrade = 277, - CsWeaponEnd = 279, - CsWikiBegin = 290, - CsUnlockWiki = 291, - CsMarkWikiRead = 292, - CsWikiEnd = 299, - CsMissionBegin = 310, - CsFailMission = 311, - CsTrackMission = 313, - CsStopTrackingMission = 314, - CsUpdateQuestObjective = 315, - CsAcceptMission = 316, - CsRollBlocMission = 317, - CsMissionEventTrigger = 318, - CsMissionClientTriggerDone = 319, - CsSetNewMissionTagDone = 320, - CsMissionEnd = 329, - CsGuideBegin = 330, - CsCompleteGuideGroupKeyStep = 331, - CsCompleteGuideGroup = 332, - CsGuideEnd = 339, - CsDialogBegin = 340, - CsFinishDialog = 341, - CsDialogEnd = 349, - CsBlocBegin = 350, - CsBlocTakeLevelReward = 351, - CsBlocShopBuy = 352, - CsBlocEnd = 360, - CsDungeonBegin = 370, - CsEnterDungeon = 371, - CsRestartDungeon = 372, - CsLeaveDungeon = 373, - CsDungeonRecoverAp = 375, - CsDungeonTouchEntrance = 377, - CsDungeonEnd = 378, - CsEnterTrainDungeon = 379, - CsGameMechanicsBegin = 380, - CsGameMechanicsReqActive = 381, - CsGameMechanicsReqReward = 382, - CsGameMechanicsNtfInstPrepareFinish = 383, - CsGameMechanicsEnd = 399, - CsMailBegin = 400, - CsGetMail = 401, - CsReadMail = 402, - CsDeleteMail = 403, - CsDeleteAllMail = 404, - CsGetMailAttachment = 405, - CsGetAllMailAttachment = 406, - CsMarkStarMail = 407, - CsMailEnd = 419, - CsRedDotBegin = 430, - CsRemoveItemNewTags = 431, - CsRedDotReadFormula = 432, - CsRedDotReadCharDoc = 433, - CsRedDotReadCharVoice = 434, - CsRedDotReadEquipFormula = 435, - CsRedDotEnd = 440, - CsPrtsBegin = 441, - CsPrtsMarkRead = 442, - CsPrtsMarkTerminalRead = 443, - CsPrtsRichContentRead = 444, - CsPrtsFinishInvestigate = 445, - CsPrtsEnd = 449, - CsBitsetBegin = 480, - CsBitsetAdd = 481, - CsBitsetRemove = 482, - CsBitsetRemoveAll = 483, - CsBitsetEnd = 499, - CsMergeMsg = 500, - CsPayBegin = 510, - CsCreateOrder = 511, - CsPayEnd = 529, - CsFriendBegin = 530, - CsFriendRequestSubmit = 531, - CsFriendRequestReject = 532, - CsFriendRequestAccept = 533, - CsFriendDelete = 534, - CsFriendSearchName = 535, - CsFriendRequestListSync = 536, - CsFriendListSync = 537, - CsFriendEnd = 570, - CsWalletBegin = 600, - CsMoneyChange = 601, - CsWalletEnd = 630, - CsGameVarBegin = 631, - CsUpdateClientGameVar = 632, - CsGameVarEnd = 640, - CsMiniGameBegin = 641, - CsCompleteMiniGame = 642, - CsMiniGameEnd = 650, - CsRpgDungeonBegin = 651, - CsRpgDungeonBuy = 652, - CsRpgDungeonSell = 653, - CsRpgDungeonEquipPuton = 654, - CsRpgDungeonEquipPutoff = 655, - CsRpgDungeonPickLvAbility = 656, - CsRpgDungeonTimeStop = 657, - CsRpgDungeonAbilityChange = 658, - CsRpgDungeonEnd = 700, - CsGemBegin = 801, - CsGemRecast = 802, - CsGemEnd = 820, - CsSnsBegin = 701, - CsSnsGetList = 702, - CsSnsMomentOption = 703, - CsSnsChatDialogOption = 704, - CsSnsMomentRead = 705, - CsSnsFinishDialog = 706, - CsSnsReadDialog = 707, - CsSnsEnd = 730, - CsSpaceshipBegin = 751, - CsSpaceshipBuildRoom = 752, - CsSpaceshipLevelUpRoom = 753, - CsSpaceshipStationChar = 754, - CsSpaceshipStationCharChangeWorkState = 755, - CsSpaceshipPresentGiftToChar = 756, - CsSpaceshipRecvGiftFromChar = 757, - CsSpaceshipManufacturingBegin = 771, - CsSpaceshipManufacturingStationStart = 772, - CsSpaceshipManufacturingStationCollect = 775, - CsSpaceshipManufacturingStationCancel = 776, - CsSpaceshipManufacturingStationChangeOrder = 777, - CsSpaceshipManufacturingEnd = 785, - CsSpaceshipGrowCabinBegin = 786, - CsSpaceshipGrowCabinBreed = 787, - CsSpaceshipGrowCabinSow = 788, - CsSpaceshipGrowCabinHarvest = 789, - CsSpaceshipGrowCabinCancel = 790, - CsSpaceshipGrowCabinClearPreviewRecipe = 791, - CsSpaceshipGrowCabinEnd = 799, - CsSpaceshipEnd = 800, - CsTdBegin = 821, - CsTdGetTdList = 822, - CsTdStart = 823, - CsTdLeave = 825, - CsTdBuyBuilding = 826, - CsTdPickDropItem = 827, - CsTdDropExpired = 828, - CsTdEnd = 899, - CsBuffBegin = 900, - CsBattleOp = 901, - CsDevClearBattleInfo = 902, - CsBuffEnd = 950, - CsSkillBegin = 960, - CsCastSkill = 961, - CsCastSkillEnd = 962, - CsCastSkillEffect = 963, - CsSkillEnd = 999, - CsItemBagBegin = 1000, - CsItemBagTidyInBag = 1001, - CsItemBagMoveInBag = 1002, - CsItemBagSplitInBag = 1003, - CsItemBagFactoryDepotToBag = 1004, - CsItemBagBagToFactoryDepot = 1005, - CsItemBagFactoryDepotToBagGrid = 1006, - CsItemBagUseItem = 1007, - CsItemBagSetQuickBar = 1008, - CsItemBagSetQuickBarPos = 1009, - CsItemBagSetItemLock = 1010, - CsItemBagAbandonInBag = 1011, - CsItemBagDestroyInDepot = 1012, - CsItemBagDestroyInFactoryDepot = 1013, - CsItemBagDumpBottleInBag = 1014, - CsItemBagDumpBottleInFactoryDepot = 1015, - CsItemBagTakeoutLostAndFound = 1031, - CsItemBagUseItemCase = 1032, - CsItemBagChgSpaceshipChapter = 1033, - CsItemBagEnd = 1049, - CsSettlementBegin = 1050, - CsSettlementSelectRequire = 1051, - CsSettlementSetOfficer = 1052, - CsSettlementSetSubmitMode = 1053, - CsSettlementSubmitRequire = 1054, - CsSettlementEnd = 1099, - CsShopBegin = 1100, - CsShopBuy = 1111, - CsShopSwapMoney = 1112, - CsShopEnd = 1149, - CsAdventureBegin = 1150, - CsAdventureTakeRewardAll = 1151, - CsAdventureEnd = 1179, - CsAdventureBookBegin = 1250, - CsTakeAllAdventureTaskReward = 1251, - CsTakeAdventureTaskReward = 1252, - CsTakeAdventureBookStageReward = 1253, - CsAdventureBookEnd = 1299, - CsTalentBegin = 1300, - CsCharUnlockTalentNode = 1301, - CsTalentEnd = 1329, - CsRacingDungeonBegin = 1330, - CsRacingDungeonBattlePassReceiveReward = 1332, - CsRacingDungeonGetBattlePass = 1333, - CsRacingDungeonGetAchievement = 1334, - CsRacingDungeonAchievementReceiveReward = 1335, - CsRacingDungeonLeave = 1336, - CsRacingDungeonUpdateBattleInfo = 1337, - CsRacingDungeonEnd = 1400, - CsTrialCharacterBegin = 1401, - CsUseTrialCharacterEquipMedicine = 1402, - CsTrialCharacterEnd = 1403, - CsGachaBegin = 1431, - CsGachaSinglePullReq = 1432, - CsGachaTenPullReq = 1433, - CsGachaEnd = 1450, - CsGameTimeFreezeBegin = 1451, - CsGameTimeFreezeStartReq = 1452, - CsGameTimeFreezeEndReq = 1453, - CsGameTimeFreezeEnd = 1460, - CsActivityBegin = 1461, - CsDailyCheckin = 1471, - CsActivityEnd = 1510, - CsMessageEnd = 4095, + public enum CsMsgId : int + { + CsMessageBegin = 0, + CsLogin = 1, + CsCreateRole = 2, + CsLogout = 3, + CsGmCommand = 4, + CsPing = 5, + CsFlushSync = 6, + CsSetName = 7, + CsSetGender = 8, + CsCheckName = 9, + CsCheckSensitive = 10, + CsAchieveBegin = 20, + CsAchieveComplete = 21, + CsAchieveTakeReward = 22, + CsAchieveEnd = 29, + CsCharBagBegin = 30, + CsCharBagTeamBegin = 31, + CsCharBagSetTeam = 32, + CsCharBagSetCurrTeamIndex = 33, + CsCharBagSetTeamName = 34, + CsCharBagSetTeamLeader = 35, + CsCharBagTeamChangeFinish = 36, + CsCharBagTeamEnd = 37, + CsCharBagEnd = 39, + CsCharBegin = 40, + CsCharLevelUp = 41, + CsCharSetNormalSkill = 43, + CsCharSkillLevelUp = 45, + CsCharSetTeamSkill = 46, + CsCharPotentialUnlock = 47, + CsCharEnd = 49, + CsEquipBegin = 50, + CsEquipPuton = 51, + CsEquipPutoff = 52, + CsEquipMedicineModify = 53, + CsEquipRecycle = 54, + CsEquipEnhance = 55, + CsEquipProduce = 57, + CsEquipEnd = 59, + CsSceneBegin = 80, + CsEnterScene = 81, + CsMoveObjectMove = 82, + CsSceneSetLastRecordCampid = 83, + CsSceneInteractiveEventTrigger = 84, + CsSceneSetVar = 85, + CsSceneRest = 86, + CsSceneLoadFinish = 88, + CsSceneSetSafeZone = 95, + CsSceneQueryEntityExist = 96, + CsSceneQueryInteractiveProperty = 97, + CsSceneSetTrackPoint = 99, + CsSceneInteractTree = 100, + CsSceneStaticMapMarkUpdate = 101, + CsSceneTeleport = 103, + CsSceneMoveStateSet = 104, + CsSceneSubmitItem = 105, + CsSceneSubmitEther = 106, + CsSceneSetLevelScriptActive = 107, + CsSceneLevelScriptEventTrigger = 109, + CsSceneCommitLevelScriptCacheStep = 110, + CsSceneRepatriate = 115, + CsSceneInteractSpInteractive = 116, + CsSceneSetLastSafeZone = 117, + CsSceneSetBattle = 118, + CsSceneRevival = 119, + CsSceneSetLevelScriptStart = 120, + CsSceneMonsterSpawnerBeginWave = 121, + CsSceneSpawnSummon = 122, + CsSceneLeavePlane = 123, + CsSceneGradeModify = 124, + CsSceneUpdateScriptTaskProgress = 125, + CsSceneTeleportFinish = 126, + CsSceneSetStorySafeZone = 127, + CsSceneSubmitRecycle = 128, + CsSceneEnd = 199, + CsFactoryBegin = 200, + CsFactorySttUnlockNode = 201, + CsFactorySttUnlockLayer = 202, + CsFactoryManuallyWorkExec = 211, + CsFactoryProductManualUnlock = 212, + CsFactoryQuickbarSetOne = 215, + CsFactoryQuickbarMoveOne = 216, + CsFactorySoilReclaim = 217, + CsFactorySoilWater = 218, + CsFactorySoilCancel = 219, + CsFactorySoilHarvest = 220, + CsFactorySoilFarmlandLevelUp = 221, + CsFactoryHubWorkshopMake = 222, + CsFactoryHubTransportRouteSet = 223, + CsFactoryHubTransportRouteReset = 224, + CsFactoryHubTransportRouteRestart = 225, + CsFactoryHsFb = 232, + CsFactoryStatisticSetBookmarkItemIds = 234, + CsFactoryStatisticRequire = 235, + CsFactoryPinSet = 236, + CsFactoryOp = 251, + CsFactoryObserverOp = 268, + CsFactoryEnd = 269, + CsWeaponBegin = 270, + CsWeaponPuton = 271, + CsWeaponBreakthrough = 273, + CsWeaponAddExp = 274, + CsWeaponAttachGem = 275, + CsWeaponDetachGem = 276, + CsWeaponRefineUpgrade = 277, + CsWeaponEnd = 279, + CsWikiBegin = 290, + CsUnlockWiki = 291, + CsMarkWikiRead = 292, + CsWikiEnd = 299, + CsMissionBegin = 310, + CsFailMission = 311, + CsTrackMission = 313, + CsStopTrackingMission = 314, + CsUpdateQuestObjective = 315, + CsAcceptMission = 316, + CsRollBlocMission = 317, + CsMissionEventTrigger = 318, + CsMissionClientTriggerDone = 319, + CsSetNewMissionTagDone = 320, + CsMissionEnd = 329, + CsGuideBegin = 330, + CsCompleteGuideGroupKeyStep = 331, + CsCompleteGuideGroup = 332, + CsGuideEnd = 339, + CsDialogBegin = 340, + CsFinishDialog = 341, + CsDialogEnd = 349, + CsBlocBegin = 350, + CsBlocTakeLevelReward = 351, + CsBlocShopBuy = 352, + CsBlocEnd = 360, + CsDungeonBegin = 370, + CsEnterDungeon = 371, + CsRestartDungeon = 372, + CsLeaveDungeon = 373, + CsDungeonRecoverAp = 375, + CsDungeonTouchEntrance = 377, + CsDungeonEnd = 378, + CsEnterTrainDungeon = 379, + CsGameMechanicsBegin = 380, + CsGameMechanicsReqActive = 381, + CsGameMechanicsReqReward = 382, + CsGameMechanicsNtfInstPrepareFinish = 383, + CsGameMechanicsEnd = 399, + CsMailBegin = 400, + CsGetMail = 401, + CsReadMail = 402, + CsDeleteMail = 403, + CsDeleteAllMail = 404, + CsGetMailAttachment = 405, + CsGetAllMailAttachment = 406, + CsMarkStarMail = 407, + CsMailEnd = 419, + CsRedDotBegin = 430, + CsRemoveItemNewTags = 431, + CsRedDotReadFormula = 432, + CsRedDotReadCharDoc = 433, + CsRedDotReadCharVoice = 434, + CsRedDotReadEquipFormula = 435, + CsRedDotEnd = 440, + CsPrtsBegin = 441, + CsPrtsMarkRead = 442, + CsPrtsMarkTerminalRead = 443, + CsPrtsRichContentRead = 444, + CsPrtsFinishInvestigate = 445, + CsPrtsEnd = 449, + CsBitsetBegin = 480, + CsBitsetAdd = 481, + CsBitsetRemove = 482, + CsBitsetRemoveAll = 483, + CsBitsetEnd = 499, + CsMergeMsg = 500, + CsPayBegin = 510, + CsCreateOrder = 511, + CsPayEnd = 529, + CsFriendBegin = 530, + CsFriendRequestSubmit = 531, + CsFriendRequestReject = 532, + CsFriendRequestAccept = 533, + CsFriendDelete = 534, + CsFriendSearchName = 535, + CsFriendRequestListSync = 536, + CsFriendListSync = 537, + CsFriendEnd = 570, + CsWalletBegin = 600, + CsMoneyChange = 601, + CsWalletEnd = 630, + CsGameVarBegin = 631, + CsUpdateClientGameVar = 632, + CsGameVarEnd = 640, + CsMiniGameBegin = 641, + CsCompleteMiniGame = 642, + CsMiniGameEnd = 650, + CsRpgDungeonBegin = 651, + CsRpgDungeonBuy = 652, + CsRpgDungeonSell = 653, + CsRpgDungeonEquipPuton = 654, + CsRpgDungeonEquipPutoff = 655, + CsRpgDungeonPickLvAbility = 656, + CsRpgDungeonTimeStop = 657, + CsRpgDungeonAbilityChange = 658, + CsRpgDungeonEnd = 700, + CsGemBegin = 801, + CsGemRecast = 802, + CsGemEnd = 820, + CsSnsBegin = 701, + CsSnsGetList = 702, + CsSnsMomentOption = 703, + CsSnsChatDialogOption = 704, + CsSnsMomentRead = 705, + CsSnsFinishDialog = 706, + CsSnsReadDialog = 707, + CsSnsEnd = 730, + CsSpaceshipBegin = 751, + CsSpaceshipBuildRoom = 752, + CsSpaceshipLevelUpRoom = 753, + CsSpaceshipStationChar = 754, + CsSpaceshipStationCharChangeWorkState = 755, + CsSpaceshipPresentGiftToChar = 756, + CsSpaceshipRecvGiftFromChar = 757, + CsSpaceshipManufacturingBegin = 771, + CsSpaceshipManufacturingStationStart = 772, + CsSpaceshipManufacturingStationCollect = 775, + CsSpaceshipManufacturingStationCancel = 776, + CsSpaceshipManufacturingStationChangeOrder = 777, + CsSpaceshipManufacturingEnd = 785, + CsSpaceshipGrowCabinBegin = 786, + CsSpaceshipGrowCabinBreed = 787, + CsSpaceshipGrowCabinSow = 788, + CsSpaceshipGrowCabinHarvest = 789, + CsSpaceshipGrowCabinCancel = 790, + CsSpaceshipGrowCabinClearPreviewRecipe = 791, + CsSpaceshipGrowCabinEnd = 799, + CsSpaceshipEnd = 800, + CsTdBegin = 821, + CsTdGetTdList = 822, + CsTdStart = 823, + CsTdLeave = 825, + CsTdBuyBuilding = 826, + CsTdPickDropItem = 827, + CsTdDropExpired = 828, + CsTdEnd = 899, + CsBuffBegin = 900, + CsBattleOp = 901, + CsDevClearBattleInfo = 902, + CsBuffEnd = 950, + CsSkillBegin = 960, + CsCastSkill = 961, + CsCastSkillEnd = 962, + CsCastSkillEffect = 963, + CsSkillEnd = 999, + CsItemBagBegin = 1000, + CsItemBagTidyInBag = 1001, + CsItemBagMoveInBag = 1002, + CsItemBagSplitInBag = 1003, + CsItemBagFactoryDepotToBag = 1004, + CsItemBagBagToFactoryDepot = 1005, + CsItemBagFactoryDepotToBagGrid = 1006, + CsItemBagUseItem = 1007, + CsItemBagSetQuickBar = 1008, + CsItemBagSetQuickBarPos = 1009, + CsItemBagSetItemLock = 1010, + CsItemBagAbandonInBag = 1011, + CsItemBagDestroyInDepot = 1012, + CsItemBagDestroyInFactoryDepot = 1013, + CsItemBagDumpBottleInBag = 1014, + CsItemBagDumpBottleInFactoryDepot = 1015, + CsItemBagTakeoutLostAndFound = 1031, + CsItemBagUseItemCase = 1032, + CsItemBagChgSpaceshipChapter = 1033, + CsItemBagEnd = 1049, + CsSettlementBegin = 1050, + CsSettlementSelectRequire = 1051, + CsSettlementSetOfficer = 1052, + CsSettlementSetSubmitMode = 1053, + CsSettlementSubmitRequire = 1054, + CsSettlementEnd = 1099, + CsShopBegin = 1100, + CsShopBuy = 1111, + CsShopSwapMoney = 1112, + CsShopEnd = 1149, + CsAdventureBegin = 1150, + CsAdventureTakeRewardAll = 1151, + CsAdventureEnd = 1179, + CsAdventureBookBegin = 1250, + CsTakeAllAdventureTaskReward = 1251, + CsTakeAdventureTaskReward = 1252, + CsTakeAdventureBookStageReward = 1253, + CsAdventureBookEnd = 1299, + CsTalentBegin = 1300, + CsCharUnlockTalentNode = 1301, + CsTalentEnd = 1329, + CsRacingDungeonBegin = 1330, + CsRacingDungeonBattlePassReceiveReward = 1332, + CsRacingDungeonGetBattlePass = 1333, + CsRacingDungeonGetAchievement = 1334, + CsRacingDungeonAchievementReceiveReward = 1335, + CsRacingDungeonLeave = 1336, + CsRacingDungeonUpdateBattleInfo = 1337, + CsRacingDungeonEnd = 1400, + CsTrialCharacterBegin = 1401, + CsUseTrialCharacterEquipMedicine = 1402, + CsTrialCharacterEnd = 1403, + CsGachaBegin = 1431, + CsGachaSinglePullReq = 1432, + CsGachaTenPullReq = 1433, + CsGachaEnd = 1450, + CsGameTimeFreezeBegin = 1451, + CsGameTimeFreezeStartReq = 1452, + CsGameTimeFreezeEndReq = 1453, + CsGameTimeFreezeEnd = 1460, + CsActivityBegin = 1461, + CsDailyCheckin = 1471, + CsActivityEnd = 1510, + CsMessageEnd = 4095, -} + } } diff --git a/Campofinale.Protocol/ScMsgId.cs b/Campofinale.Protocol/ScMsgId.cs index 33ff68a..a33246c 100644 --- a/Campofinale.Protocol/ScMsgId.cs +++ b/Campofinale.Protocol/ScMsgId.cs @@ -1,401 +1,395 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Campofinale.Protocol +namespace Campofinale.Protocol { -public enum ScMsgId : int -{ - ScMessageBegin = 0, - ScLogin = 1, - ScSyncBaseData = 2, - ScNtfErrorCode = 3, - ScGmCommand = 4, - ScPing = 5, - ScReconnectIncr = 6, - ScReconnectFull = 7, - ScFlushSync = 8, - ScNtfCode = 9, - ScSetName = 10, - ScSetGender = 11, - ScCheckName = 12, - ScCheckSensitive = 13, - ScSyncFullDataEnd = 14,// - ScAchieveComplete = 15, - ScSyncAllRoleScene = 20,// - ScObjectEnterView = 21, - ScObjectLeaveView = 22, - ScMoveObjectMove = 23, - ScEnterSceneNotify = 24, - ScSelfSceneInfo = 25, - ScLeaveSceneNotify = 26, - ScSceneSetLastRecordCampid = 27, - ScSceneUpdateInteractiveProperty = 28, - ScSceneSetVar = 29, - ScSceneRevival = 30, - ScSceneCreateEntity = 31, - ScSceneDestroyEntity = 32, - ScSceneSetSafeZone = 35, - ScSceneQueryEntityExist = 36, - ScSceneLevelScriptStateNotify = 37, - ScSceneQueryInteractiveProperty = 38, - ScSceneUnlockArea = 39, - ScSceneSetTrackPoint = 40, - ScSceneCollectionSync = 42, // - ScSceneCollectionModify = 43, - ScSceneMapMarkSync = 44,// - ScSceneStaticMapMarkModify = 45, - ScSceneTeleport = 46, - ScSceneSubmitItem = 47, - ScSceneSubmitEther = 48, - ScSceneUpdateLevelScriptProperty = 49, - ScSceneResetEntity = 50, - ScSceneLevelScriptResetBegin = 51, - ScSceneLevelScriptResetEnd = 52, - ScSceneSetBattle = 53, - ScSceneLevelScriptEventTrigger = 55, - ScSceneInteractiveEventTrigger = 56, - ScSceneTriggerClientLevelScriptEvent = 57, - ScSceneTriggerClientInteractiveEvent = 58, - ScSceneCrossSceneStatus = 59, - ScSceneDropCreate = 800, - ScSceneDropDelete = 801, - ScSceneDropModify = 802, - ScSceneGradeChangeNotify = 803, - ScSeamlessSceneDestroyNotify = 804, - ScSceneMonsterSpawnerStart = 805, - ScSceneMonsterSpawnerStop = 806, - ScSceneMonsterSpawnerComplete = 807, - ScSceneMonsterSpawnerBeginWave = 808, - ScSceneMonsterSpawnerWaveComplete = 809, - ScSceneMonsterSpawnerObjectDataBegin = 811, - ScSceneMonsterSpawnerObjectDataEnd = 812, - ScSceneLevelScriptTaskStateUpdate = 813, - ScSceneClientIdInfo = 814, - ScSceneLevelScriptTaskProgressUpdate = 815, - ScSceneLevelScriptTaskStartFinish = 816, - ScSceneInteractSpInteractive = 817, - ScSceneUpdateInteractiveMeta = 818, - ScSceneGradeModify = 819, - ScSceneSetStorySafeZone = 820, - ScSceneRepatriate = 821, - ScSceneSubmitRecycle = 822, - ScSceneLevelScriptSetDone = 823, - ScSyncCharBagInfo = 60,// - ScCharBagAddChar = 61, - ScCharBagSetTeam = 62, - ScCharBagSetCurrTeamIndex = 63, - ScCharBagSetTeamName = 64, - ScCharBagSetTeamLeader = 65, - ScCharBagSetMaxTeamMemberCount = 66, - ScCharBagTeamLeaderNotMatchNtf = 67, - ScCharBagDelChar = 68, - ScCharBagAddCharWithConversionNotify = 69, - ScSyncWallet = 70,// - ScWalletSyncMoney = 71, - ScCharSkillInfos = 78, - ScCharPotentialUnlock = 79, - ScCharLevelUp = 80, - ScCharSyncLevelExp = 82, - ScCharSetNormalSkill = 83, - ScCharSkillLevelUp = 84, - ScCharUnlockSkill = 85, - ScCharGainExpToast = 86, - ScCharSyncStatus = 87, - ScCharSetTeamSkill = 89, - ScEquipPuton = 90, - ScEquipPutoff = 91, - ScEquipMedicineModify = 92, - ScEquipRecycle = 93, - ScEquipEnhance = 94, - ScEquipProduce = 96, - ScSyncAllMission = 110,// - ScQuestStateUpdate = 111, - ScMissionStateUpdate = 112, - ScQuestFailed = 113, - ScMissionFailed = 114, - ScTrackMissionChange = 115, - ScQuestObjectivesUpdate = 116, - ScMissionDeleted = 117, - ScRollBlocMission = 120, - ScSyncBlocMissionInfo = 121,// - ScBlocCompletedMissionNumUpdate = 122, - ScQuestRollback = 123, - ScUpdateMissionProperty = 124, - ScSceneTriggerClientMissionEvent = 125, - ScMissionEventTrigger = 126, - ScDailyMissionInfoUpdate = 127, - ScSyncAllDialog = 130,// - ScFinishDialog = 131, - ScSyncAllGuide = 140,// - ScCompleteGuideGroupKeyStep = 141, - ScCompleteGuideGroup = 142, - ScAcceptGuideGroup = 143, - ScSyncAttr = 150, - ScSyncAllUnlock = 160,// - ScUnlockSystem = 161, - ScSyncAllBitset = 165,// - ScBitsetAdd = 166, - ScBitsetRemove = 167, - ScBitsetRemoveAll = 168, - ScFactorySync = 200,// - ScFactoryModifyFormulaMan = 201, - ScFactoryModifyStt = 202, - ScFactoryModifyVisibleFormula = 203, - ScFactoryModifyFormulaMode = 204, - ScFactorySyncOfflineInfo = 205,// - ScFactorySyncScope = 210,// - ScFactoryReleaseScope = 211, - ScFactoryModifyScope = 212, - ScFactoryModifyQuickbar = 213, - ScFactoryManuallyWorkExec = 214, - ScFactoryProductManualUnlock = 215, - ScFactoryModifySoil = 216, - ScFactorySoilReclaim = 217, - ScFactorySoilWater = 218, - ScFactorySoilCancel = 219, - ScFactorySoilHarvest = 220, - ScFactorySyncChapter = 221,// - ScFactoryModifyChapterNodes = 222, - ScFactoryModifyChapterComponents = 223, - ScFactoryModifyChapterScene = 224, - ScFactoryModifyChapterBlackboard = 225, - ScFactoryModifyChapterPinBoard = 226, - ScFactoryModifyChapterMap = 227, - ScFactoryHs = 231, - ScFactoryHsSync = 232,// - ScFactorySyncStatistic = 241, - ScFactoryModifyStatistic = 242, - ScFactoryStatisticRequire = 243, - ScFactoryHubWorkshopMake = 244, - ScFactoryHubTransportRouteModify = 245, - ScFactoryModifyStatisticBookmark = 246, - ScFactoryOpRet = 251, - ScFactoryObserverRet = 259, - ScWeaponPuton = 260, - ScWeaponBreakthrough = 262, - ScWeaponAddExp = 263, - ScWeaponAttachGem = 264, - ScWeaponDetachGem = 265, - ScWeaponRefineUpgrade = 266, - ScRewardToastBegin = 270, - ScRewardToastEnd = 271, - ScRewardDropMoneyToast = 272, - ScRewardToSceneBegin = 273, - ScRewardToSceneEnd = 274, - ScRewardDropSpItemToast = 275, - ScSyncAllBloc = 280,// - ScBlocSyncLevel = 281, - ScBlocTakeLevelReward = 282, - ScBlocShopBuy = 283, - ScDungeonBegin = 300, - ScEnterDungeon = 301, - ScRestartDungeon = 302, - ScLeaveDungeon = 303, - ScSyncStamina = 304, - ScSyncFullDungeonStatus = 306, - ScDungeonEnd = 359, - ScSyncAllMail = 400,// - ScGetMail = 401, - ScReadMail = 402, - ScGetMailAttachment = 403, - ScDelMailNotify = 404, - ScNewMailNotify = 405, - ScMarkStarMail = 406, - ScSyncGameMode = 430, - ScRemoveItemNewTags = 440, - ScSyncAllWiki = 470, - ScSyncAllStat = 500, - ScSyncStat = 501, - ScNewNoticeNotify = 600, - ScCreateOrder = 650, - ScOrderMsg = 651, - ScFriendBegin = 700, - ScFriendRequestSubmit = 701, - ScFriendRequestReject = 702, - ScFriendRequestAccept = 703, - ScFriendDelete = 704, - ScFriendSearchName = 705, - ScFriendRequestListSync = 706, - ScFriendListSync = 707, - ScFriendRequestAddNotify = 708, - ScFriendAddNotify = 709, - ScFriendEnd = 750, - ScUpdateGameVar = 901, - ScSyncAllGameVar = 902,// - ScUpdateMiniGame = 913, - ScSyncAllMiniGame = 914,// - ScCompleteMiniGame = 915, - ScRpgDungeonBegin = 950, - ScRpgDungeonBuy = 951, - ScRpgDungeonSell = 952, - ScRpgDungeonEquipPuton = 953, - ScRpgDungeonEquipPutoff = 954, - ScSyncRpgEquipColumn = 955, - ScSyncRpgDungeonBuffList = 956, - ScSyncRpgTeamLevel = 957, - ScSyncRpgLevelUp = 958, - ScRpgDungeonPickLvAbility = 959, - ScSyncRpgDungeonTimeInfo = 960, - ScSyncRpgDungeonAbility = 961, - ScRpgDungeonEnd = 999, - ScItemBagCommonSync = 1000,// - ScItemBagCommonModify = 1001, - ScItemBagScopeSync = 1002,// - ScItemBagScopeModify = 1003, - ScItemBagUseItem = 1004, - ScItemBagSetQuickBar = 1005, - ScItemBagSetQuickBarPos = 1006, - ScItemBagSetItemLock = 1007, - ScItemBagAbandonInBag = 1008, - ScItemBagBagToFactoryDepot = 1009, - ScItemBagTakeoutLostAndFound = 1031, - ScItemBagGotItemToast = 1032, - ScItemBagTrialCharDepotModify = 1033, - ScItemBagTrialCharDepotClear = 1034, - ScItemBagUseItemCase = 1035, - ScItemBagChgSpaceshipChapter = 1036, - ScItemBagEnd = 1049, - ScAddBuff = 1100, - ScRemoveBuff = 1101, - ScTriggerBuff = 1102, - ScClearBuffs = 1103, - ScCastSkill = 1160, - ScSyncHp = 1161, - ScSyncPoise = 1162, - ScSyncUltimateSpCellCnt = 1163, - ScSpawnEnemy = 1170, - ScSpawnSummon = 1171, - ScEntityPropertyChange = 1172, - ScBattleDebugInfo = 1173, - ScBattleGenerationChange = 1174, - ScAttachServerSkill = 1175, - ScDetachServerSkill = 1176, - ScAddServerBuff = 1177, - ScRemoveServerBuff = 1178, - ScSpaceshipSync = 1200,// - ScSpaceshipModifyRoom = 1201, - ScSpaceshipModifyChar = 1202, - ScSpaceshipPresentCharInfo = 1203, - ScSpaceshipCharFavorabilityChange = 1204, - ScSpaceshipRecvGiftFromChar = 1205, - ScSpaceshipPresentGiftToChar = 1206, - ScSpaceshipSyncRoomLevelUp = 1207, - ScSpaceshipSyncCharSkill = 1208, - ScSpaceshipSyncRoomStation = 1209, - ScSpaceshipManufacturingStationSync = 1210, - ScSpaceshipManufacturingStationStart = 1211, - ScSpaceshipManufacturingStationCancel = 1212, - ScSpaceshipManufacturingStationCollect = 1213, - ScSpaceshipModifyGrowCabin = 1214, - ScSpaceshipGrowCabinBreed = 1215, - ScSpaceshipGrowCabinSow = 1216, - ScSpaceshipGrowCabinHarvest = 1217, - ScSpaceshipGrowCabinCancel = 1218, - ScSpaceshipReportCharWorkModify = 1219, - ScSpaceshipReportOutputModify = 1220, - ScGameMechanicsBegin = 1250, - ScGameMechanicsSync = 1251,// - ScGameMechanicsSyncUnlockCondition = 1252, - ScGameMechanicsModifyRecords = 1253, - ScGameMechanicsSyncChallengeStart = 1254, - ScGameMechanicsSyncChallengeComplete = 1255, - ScGameMechanicsSyncCompletionReward = 1256, - ScGameMechanicsSyncEnterGameInst = 1257, - ScGameMechanicsSyncLeaveGameInst = 1258, - ScGameMechanicsSyncRestartGameInst = 1259, - ScGameMechanicsModifyInstTimeFreeze = 1260, - ScGameMechanicsEnd = 1299, - ScSnsBegin = 1300, - ScSnsGetMomentList = 1301, - ScSnsGetChatList = 1302, - ScSyncSnsAddDialog = 1303, - ScSnsMomentOption = 1304, - ScSyncSnsDialogModify = 1305, - ScSyncSnsAddMoment = 1306, - ScSnsMomentRead = 1307, - ScSnsReadDialog = 1308, - ScSyncSnsChatModify = 1309, - ScSnsEnd = 1330, - ScSettlementBegin = 1331, - ScSettlementSyncAll = 1332,// - ScSettlementSyncModify = 1333, - ScSettlementFinishRequires = 1334, - ScSettlementSetOfficer = 1335, - ScSettlementSelectRequire = 1336, - ScSettlementSetSubmitMode = 1337, - ScSettlementEnd = 1350, - ScShopBegin = 1351, - ScShopSync = 1352,// - ScShopSyncShopGroupCondition = 1353, - ScShopModifyShop = 1354, - ScShopSyncShopCondition = 1355, - ScShopSyncGoodsCondition = 1356, - ScShopModifyFrequencyLimit = 1357, - ScShopDeleteFrequencyLimit = 1358, - ScShopBuyResp = 1359, - ScShopSwapMoney = 1360, - ScShopEnd = 1370, - ScTdBegin = 1371, - ScTdGetTdList = 1372, - ScTdStart = 1373, - ScTdLeave = 1374, - ScSyncTdSettlement = 1375, - ScSyncTdFullStatus = 1376, - ScSyncTdDropItem = 1378, - ScTdPickDropItem = 1379, - ScTdBuyBuilding = 1380, - ScTdEnd = 1400, - ScAdventureBegin = 1401, - ScAdventureLevelModify = 1402, - ScAdventureSyncAll = 1403,// - ScAdventureEnd = 1430, - ScGemRecast = 1431, - ScGemEnd = 1440, - ScResetDailyAdventureTask = 1441, - ScDailyActivationModify = 1443, - ScAdventureTaskModify = 1444, - ScAdventureBookSync = 1445,// - ScAdventureBookStageModify = 1447, - ScTalentBegin = 1490, - ScCharUnlockTalentNode = 1491, - ScTalentEnd = 1529, - ScRacingDungeonBegin = 1530, - ScSyncRacingDungeonPassedLevel = 1531, - ScRacingDungeonEnter = 1532, - ScSyncRacingDungeonSettlement = 1533, - ScSyncRacingDungeonReconnect = 1534, - ScRacingDungeonBattlePassReceiveReward = 1535, - ScRacingDungeonGetBattlePass = 1536, - ScRacingDungeonGetAchievement = 1537, - ScRacingDungeonAchievementReceiveReward = 1538, - ScSyncRacingDungeonBuffModify = 1539, - ScSyncRacingDungeonAchievementModify = 1540, - ScSyncRacingTimerPause = 1541, - ScSyncRacingDungeonCompleteRoom = 1542, - ScSyncRacingDungeonCountdownEvent = 1543, - ScRacingDungeonEnd = 1600, - ScCharBagSetTempTeam = 1601, - ScCharBagRemoveTrialCharacter = 1602, - ScTrialCharacterEquipMedicineModify = 1603, - ScGachaBegin = 1610, - ScGachaSync = 1611,// - ScGachaModifyPoolInfo = 1612, - ScGachaSyncPullResult = 1613, - ScGachaModifyPoolRoleData = 1614, - ScGachaEnd = 1640, - ScGameTimeFreezeBegin = 1641, - ScGameTimeFreezeStartRsp = 1642, - ScGameTimeFreezeEndRsp = 1643, - ScGameTimeFreezeEnd = 1650, - ScActivityBegin = 1651, - ScActivitySync = 1652,// - ScActivityModify = 1653, - ScDailyCheckin = 1661, - ScActivityEnd = 1690, - ScMessageEnd = 4095, + public enum ScMsgId : int + { + ScMessageBegin = 0, + ScLogin = 1, + ScSyncBaseData = 2, + ScNtfErrorCode = 3, + ScGmCommand = 4, + ScPing = 5, + ScReconnectIncr = 6, + ScReconnectFull = 7, + ScFlushSync = 8, + ScNtfCode = 9, + ScSetName = 10, + ScSetGender = 11, + ScCheckName = 12, + ScCheckSensitive = 13, + ScSyncFullDataEnd = 14,// + ScAchieveComplete = 15, + ScSyncAllRoleScene = 20,// + ScObjectEnterView = 21, + ScObjectLeaveView = 22, + ScMoveObjectMove = 23, + ScEnterSceneNotify = 24, + ScSelfSceneInfo = 25, + ScLeaveSceneNotify = 26, + ScSceneSetLastRecordCampid = 27, + ScSceneUpdateInteractiveProperty = 28, + ScSceneSetVar = 29, + ScSceneRevival = 30, + ScSceneCreateEntity = 31, + ScSceneDestroyEntity = 32, + ScSceneSetSafeZone = 35, + ScSceneQueryEntityExist = 36, + ScSceneLevelScriptStateNotify = 37, + ScSceneQueryInteractiveProperty = 38, + ScSceneUnlockArea = 39, + ScSceneSetTrackPoint = 40, + ScSceneCollectionSync = 42, // + ScSceneCollectionModify = 43, + ScSceneMapMarkSync = 44,// + ScSceneStaticMapMarkModify = 45, + ScSceneTeleport = 46, + ScSceneSubmitItem = 47, + ScSceneSubmitEther = 48, + ScSceneUpdateLevelScriptProperty = 49, + ScSceneResetEntity = 50, + ScSceneLevelScriptResetBegin = 51, + ScSceneLevelScriptResetEnd = 52, + ScSceneSetBattle = 53, + ScSceneLevelScriptEventTrigger = 55, + ScSceneInteractiveEventTrigger = 56, + ScSceneTriggerClientLevelScriptEvent = 57, + ScSceneTriggerClientInteractiveEvent = 58, + ScSceneCrossSceneStatus = 59, + ScSceneDropCreate = 800, + ScSceneDropDelete = 801, + ScSceneDropModify = 802, + ScSceneGradeChangeNotify = 803, + ScSeamlessSceneDestroyNotify = 804, + ScSceneMonsterSpawnerStart = 805, + ScSceneMonsterSpawnerStop = 806, + ScSceneMonsterSpawnerComplete = 807, + ScSceneMonsterSpawnerBeginWave = 808, + ScSceneMonsterSpawnerWaveComplete = 809, + ScSceneMonsterSpawnerObjectDataBegin = 811, + ScSceneMonsterSpawnerObjectDataEnd = 812, + ScSceneLevelScriptTaskStateUpdate = 813, + ScSceneClientIdInfo = 814, + ScSceneLevelScriptTaskProgressUpdate = 815, + ScSceneLevelScriptTaskStartFinish = 816, + ScSceneInteractSpInteractive = 817, + ScSceneUpdateInteractiveMeta = 818, + ScSceneGradeModify = 819, + ScSceneSetStorySafeZone = 820, + ScSceneRepatriate = 821, + ScSceneSubmitRecycle = 822, + ScSceneLevelScriptSetDone = 823, + ScSyncCharBagInfo = 60,// + ScCharBagAddChar = 61, + ScCharBagSetTeam = 62, + ScCharBagSetCurrTeamIndex = 63, + ScCharBagSetTeamName = 64, + ScCharBagSetTeamLeader = 65, + ScCharBagSetMaxTeamMemberCount = 66, + ScCharBagTeamLeaderNotMatchNtf = 67, + ScCharBagDelChar = 68, + ScCharBagAddCharWithConversionNotify = 69, + ScSyncWallet = 70,// + ScWalletSyncMoney = 71, + ScCharSkillInfos = 78, + ScCharPotentialUnlock = 79, + ScCharLevelUp = 80, + ScCharSyncLevelExp = 82, + ScCharSetNormalSkill = 83, + ScCharSkillLevelUp = 84, + ScCharUnlockSkill = 85, + ScCharGainExpToast = 86, + ScCharSyncStatus = 87, + ScCharSetTeamSkill = 89, + ScEquipPuton = 90, + ScEquipPutoff = 91, + ScEquipMedicineModify = 92, + ScEquipRecycle = 93, + ScEquipEnhance = 94, + ScEquipProduce = 96, + ScSyncAllMission = 110,// + ScQuestStateUpdate = 111, + ScMissionStateUpdate = 112, + ScQuestFailed = 113, + ScMissionFailed = 114, + ScTrackMissionChange = 115, + ScQuestObjectivesUpdate = 116, + ScMissionDeleted = 117, + ScRollBlocMission = 120, + ScSyncBlocMissionInfo = 121,// + ScBlocCompletedMissionNumUpdate = 122, + ScQuestRollback = 123, + ScUpdateMissionProperty = 124, + ScSceneTriggerClientMissionEvent = 125, + ScMissionEventTrigger = 126, + ScDailyMissionInfoUpdate = 127, + ScSyncAllDialog = 130,// + ScFinishDialog = 131, + ScSyncAllGuide = 140,// + ScCompleteGuideGroupKeyStep = 141, + ScCompleteGuideGroup = 142, + ScAcceptGuideGroup = 143, + ScSyncAttr = 150, + ScSyncAllUnlock = 160,// + ScUnlockSystem = 161, + ScSyncAllBitset = 165,// + ScBitsetAdd = 166, + ScBitsetRemove = 167, + ScBitsetRemoveAll = 168, + ScFactorySync = 200,// + ScFactoryModifyFormulaMan = 201, + ScFactoryModifyStt = 202, + ScFactoryModifyVisibleFormula = 203, + ScFactoryModifyFormulaMode = 204, + ScFactorySyncOfflineInfo = 205,// + ScFactorySyncScope = 210,// + ScFactoryReleaseScope = 211, + ScFactoryModifyScope = 212, + ScFactoryModifyQuickbar = 213, + ScFactoryManuallyWorkExec = 214, + ScFactoryProductManualUnlock = 215, + ScFactoryModifySoil = 216, + ScFactorySoilReclaim = 217, + ScFactorySoilWater = 218, + ScFactorySoilCancel = 219, + ScFactorySoilHarvest = 220, + ScFactorySyncChapter = 221,// + ScFactoryModifyChapterNodes = 222, + ScFactoryModifyChapterComponents = 223, + ScFactoryModifyChapterScene = 224, + ScFactoryModifyChapterBlackboard = 225, + ScFactoryModifyChapterPinBoard = 226, + ScFactoryModifyChapterMap = 227, + ScFactoryHs = 231, + ScFactoryHsSync = 232,// + ScFactorySyncStatistic = 241, + ScFactoryModifyStatistic = 242, + ScFactoryStatisticRequire = 243, + ScFactoryHubWorkshopMake = 244, + ScFactoryHubTransportRouteModify = 245, + ScFactoryModifyStatisticBookmark = 246, + ScFactoryOpRet = 251, + ScFactoryObserverRet = 259, + ScWeaponPuton = 260, + ScWeaponBreakthrough = 262, + ScWeaponAddExp = 263, + ScWeaponAttachGem = 264, + ScWeaponDetachGem = 265, + ScWeaponRefineUpgrade = 266, + ScRewardToastBegin = 270, + ScRewardToastEnd = 271, + ScRewardDropMoneyToast = 272, + ScRewardToSceneBegin = 273, + ScRewardToSceneEnd = 274, + ScRewardDropSpItemToast = 275, + ScSyncAllBloc = 280,// + ScBlocSyncLevel = 281, + ScBlocTakeLevelReward = 282, + ScBlocShopBuy = 283, + ScDungeonBegin = 300, + ScEnterDungeon = 301, + ScRestartDungeon = 302, + ScLeaveDungeon = 303, + ScSyncStamina = 304, + ScSyncFullDungeonStatus = 306, + ScDungeonEnd = 359, + ScSyncAllMail = 400,// + ScGetMail = 401, + ScReadMail = 402, + ScGetMailAttachment = 403, + ScDelMailNotify = 404, + ScNewMailNotify = 405, + ScMarkStarMail = 406, + ScSyncGameMode = 430, + ScRemoveItemNewTags = 440, + ScSyncAllWiki = 470, + ScSyncAllStat = 500, + ScSyncStat = 501, + ScNewNoticeNotify = 600, + ScCreateOrder = 650, + ScOrderMsg = 651, + ScFriendBegin = 700, + ScFriendRequestSubmit = 701, + ScFriendRequestReject = 702, + ScFriendRequestAccept = 703, + ScFriendDelete = 704, + ScFriendSearchName = 705, + ScFriendRequestListSync = 706, + ScFriendListSync = 707, + ScFriendRequestAddNotify = 708, + ScFriendAddNotify = 709, + ScFriendEnd = 750, + ScUpdateGameVar = 901, + ScSyncAllGameVar = 902,// + ScUpdateMiniGame = 913, + ScSyncAllMiniGame = 914,// + ScCompleteMiniGame = 915, + ScRpgDungeonBegin = 950, + ScRpgDungeonBuy = 951, + ScRpgDungeonSell = 952, + ScRpgDungeonEquipPuton = 953, + ScRpgDungeonEquipPutoff = 954, + ScSyncRpgEquipColumn = 955, + ScSyncRpgDungeonBuffList = 956, + ScSyncRpgTeamLevel = 957, + ScSyncRpgLevelUp = 958, + ScRpgDungeonPickLvAbility = 959, + ScSyncRpgDungeonTimeInfo = 960, + ScSyncRpgDungeonAbility = 961, + ScRpgDungeonEnd = 999, + ScItemBagCommonSync = 1000,// + ScItemBagCommonModify = 1001, + ScItemBagScopeSync = 1002,// + ScItemBagScopeModify = 1003, + ScItemBagUseItem = 1004, + ScItemBagSetQuickBar = 1005, + ScItemBagSetQuickBarPos = 1006, + ScItemBagSetItemLock = 1007, + ScItemBagAbandonInBag = 1008, + ScItemBagBagToFactoryDepot = 1009, + ScItemBagTakeoutLostAndFound = 1031, + ScItemBagGotItemToast = 1032, + ScItemBagTrialCharDepotModify = 1033, + ScItemBagTrialCharDepotClear = 1034, + ScItemBagUseItemCase = 1035, + ScItemBagChgSpaceshipChapter = 1036, + ScItemBagEnd = 1049, + ScAddBuff = 1100, + ScRemoveBuff = 1101, + ScTriggerBuff = 1102, + ScClearBuffs = 1103, + ScCastSkill = 1160, + ScSyncHp = 1161, + ScSyncPoise = 1162, + ScSyncUltimateSpCellCnt = 1163, + ScSpawnEnemy = 1170, + ScSpawnSummon = 1171, + ScEntityPropertyChange = 1172, + ScBattleDebugInfo = 1173, + ScBattleGenerationChange = 1174, + ScAttachServerSkill = 1175, + ScDetachServerSkill = 1176, + ScAddServerBuff = 1177, + ScRemoveServerBuff = 1178, + ScSpaceshipSync = 1200,// + ScSpaceshipModifyRoom = 1201, + ScSpaceshipModifyChar = 1202, + ScSpaceshipPresentCharInfo = 1203, + ScSpaceshipCharFavorabilityChange = 1204, + ScSpaceshipRecvGiftFromChar = 1205, + ScSpaceshipPresentGiftToChar = 1206, + ScSpaceshipSyncRoomLevelUp = 1207, + ScSpaceshipSyncCharSkill = 1208, + ScSpaceshipSyncRoomStation = 1209, + ScSpaceshipManufacturingStationSync = 1210, + ScSpaceshipManufacturingStationStart = 1211, + ScSpaceshipManufacturingStationCancel = 1212, + ScSpaceshipManufacturingStationCollect = 1213, + ScSpaceshipModifyGrowCabin = 1214, + ScSpaceshipGrowCabinBreed = 1215, + ScSpaceshipGrowCabinSow = 1216, + ScSpaceshipGrowCabinHarvest = 1217, + ScSpaceshipGrowCabinCancel = 1218, + ScSpaceshipReportCharWorkModify = 1219, + ScSpaceshipReportOutputModify = 1220, + ScGameMechanicsBegin = 1250, + ScGameMechanicsSync = 1251,// + ScGameMechanicsSyncUnlockCondition = 1252, + ScGameMechanicsModifyRecords = 1253, + ScGameMechanicsSyncChallengeStart = 1254, + ScGameMechanicsSyncChallengeComplete = 1255, + ScGameMechanicsSyncCompletionReward = 1256, + ScGameMechanicsSyncEnterGameInst = 1257, + ScGameMechanicsSyncLeaveGameInst = 1258, + ScGameMechanicsSyncRestartGameInst = 1259, + ScGameMechanicsModifyInstTimeFreeze = 1260, + ScGameMechanicsEnd = 1299, + ScSnsBegin = 1300, + ScSnsGetMomentList = 1301, + ScSnsGetChatList = 1302, + ScSyncSnsAddDialog = 1303, + ScSnsMomentOption = 1304, + ScSyncSnsDialogModify = 1305, + ScSyncSnsAddMoment = 1306, + ScSnsMomentRead = 1307, + ScSnsReadDialog = 1308, + ScSyncSnsChatModify = 1309, + ScSnsEnd = 1330, + ScSettlementBegin = 1331, + ScSettlementSyncAll = 1332,// + ScSettlementSyncModify = 1333, + ScSettlementFinishRequires = 1334, + ScSettlementSetOfficer = 1335, + ScSettlementSelectRequire = 1336, + ScSettlementSetSubmitMode = 1337, + ScSettlementEnd = 1350, + ScShopBegin = 1351, + ScShopSync = 1352,// + ScShopSyncShopGroupCondition = 1353, + ScShopModifyShop = 1354, + ScShopSyncShopCondition = 1355, + ScShopSyncGoodsCondition = 1356, + ScShopModifyFrequencyLimit = 1357, + ScShopDeleteFrequencyLimit = 1358, + ScShopBuyResp = 1359, + ScShopSwapMoney = 1360, + ScShopEnd = 1370, + ScTdBegin = 1371, + ScTdGetTdList = 1372, + ScTdStart = 1373, + ScTdLeave = 1374, + ScSyncTdSettlement = 1375, + ScSyncTdFullStatus = 1376, + ScSyncTdDropItem = 1378, + ScTdPickDropItem = 1379, + ScTdBuyBuilding = 1380, + ScTdEnd = 1400, + ScAdventureBegin = 1401, + ScAdventureLevelModify = 1402, + ScAdventureSyncAll = 1403,// + ScAdventureEnd = 1430, + ScGemRecast = 1431, + ScGemEnd = 1440, + ScResetDailyAdventureTask = 1441, + ScDailyActivationModify = 1443, + ScAdventureTaskModify = 1444, + ScAdventureBookSync = 1445,// + ScAdventureBookStageModify = 1447, + ScTalentBegin = 1490, + ScCharUnlockTalentNode = 1491, + ScTalentEnd = 1529, + ScRacingDungeonBegin = 1530, + ScSyncRacingDungeonPassedLevel = 1531, + ScRacingDungeonEnter = 1532, + ScSyncRacingDungeonSettlement = 1533, + ScSyncRacingDungeonReconnect = 1534, + ScRacingDungeonBattlePassReceiveReward = 1535, + ScRacingDungeonGetBattlePass = 1536, + ScRacingDungeonGetAchievement = 1537, + ScRacingDungeonAchievementReceiveReward = 1538, + ScSyncRacingDungeonBuffModify = 1539, + ScSyncRacingDungeonAchievementModify = 1540, + ScSyncRacingTimerPause = 1541, + ScSyncRacingDungeonCompleteRoom = 1542, + ScSyncRacingDungeonCountdownEvent = 1543, + ScRacingDungeonEnd = 1600, + ScCharBagSetTempTeam = 1601, + ScCharBagRemoveTrialCharacter = 1602, + ScTrialCharacterEquipMedicineModify = 1603, + ScGachaBegin = 1610, + ScGachaSync = 1611,// + ScGachaModifyPoolInfo = 1612, + ScGachaSyncPullResult = 1613, + ScGachaModifyPoolRoleData = 1614, + ScGachaEnd = 1640, + ScGameTimeFreezeBegin = 1641, + ScGameTimeFreezeStartRsp = 1642, + ScGameTimeFreezeEndRsp = 1643, + ScGameTimeFreezeEnd = 1650, + ScActivityBegin = 1651, + ScActivitySync = 1652,// + ScActivityModify = 1653, + ScDailyCheckin = 1661, + ScActivityEnd = 1690, + ScMessageEnd = 4095, -} + } } diff --git a/Campofinale/Commands/BaseCommands.cs b/Campofinale/Commands/BaseCommands.cs index 3a091ed..31b8241 100644 --- a/Campofinale/Commands/BaseCommands.cs +++ b/Campofinale/Commands/BaseCommands.cs @@ -1,15 +1,4 @@ -using Campofinale.Database; -using Campofinale.Game.Entities; -using Campofinale.Protocol; -using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using static Campofinale.Resource.ResourceManager; - -namespace Campofinale.Commands +namespace Campofinale.Commands { public static class BaseCommands { diff --git a/Campofinale/Commands/CommandManager.cs b/Campofinale/Commands/CommandManager.cs index ee84bb5..61e9689 100644 --- a/Campofinale/Commands/CommandManager.cs +++ b/Campofinale/Commands/CommandManager.cs @@ -1,15 +1,10 @@ namespace Campofinale.Commands { - using Pastel; using System; using System.Collections.Generic; - using System.Drawing; using System.Collections.Immutable; using System.Linq.Expressions; using System.Reflection; - using System.Net.Sockets; - using Campofinale.Protocol; - using Campofinale.Network; public static class CommandManager { diff --git a/Campofinale/Commands/Handlers/CommandAccount.cs b/Campofinale/Commands/Handlers/CommandAccount.cs index c3a6682..fb43107 100644 --- a/Campofinale/Commands/Handlers/CommandAccount.cs +++ b/Campofinale/Commands/Handlers/CommandAccount.cs @@ -1,9 +1,4 @@ using Campofinale.Database; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Commands.Handlers { diff --git a/Campofinale/Commands/Handlers/CommandAdd.cs b/Campofinale/Commands/Handlers/CommandAdd.cs index e8337c1..fd88b2b 100644 --- a/Campofinale/Commands/Handlers/CommandAdd.cs +++ b/Campofinale/Commands/Handlers/CommandAdd.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Campofinale.Game.Character; using Campofinale.Game.Inventory; using Campofinale.Packets.Sc; diff --git a/Campofinale/Commands/Handlers/CommandCharInfo.cs b/Campofinale/Commands/Handlers/CommandCharInfo.cs index 1e90266..6dc08ef 100644 --- a/Campofinale/Commands/Handlers/CommandCharInfo.cs +++ b/Campofinale/Commands/Handlers/CommandCharInfo.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using MongoDB.Bson; using static Campofinale.Resource.ResourceManager; -using Newtonsoft.Json; using Campofinale.Game.Character; using Campofinale.Database; using Campofinale.Game.Inventory; diff --git a/Campofinale/Commands/Handlers/CommandClear.cs b/Campofinale/Commands/Handlers/CommandClear.cs index b2752f6..aeda8b5 100644 --- a/Campofinale/Commands/Handlers/CommandClear.cs +++ b/Campofinale/Commands/Handlers/CommandClear.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Campofinale.Commands.Handlers +namespace Campofinale.Commands.Handlers { public static class CommandClear { diff --git a/Campofinale/Commands/Handlers/CommandHeal.cs b/Campofinale/Commands/Handlers/CommandHeal.cs index 73e84c5..992c2b2 100644 --- a/Campofinale/Commands/Handlers/CommandHeal.cs +++ b/Campofinale/Commands/Handlers/CommandHeal.cs @@ -1,12 +1,6 @@ -using Campofinale.Game.Entities; -using Campofinale.Packets.Sc; +using Campofinale.Packets.Sc; using Campofinale.Protocol; using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Commands.Handlers { diff --git a/Campofinale/Commands/Handlers/CommandHelp.cs b/Campofinale/Commands/Handlers/CommandHelp.cs index 0f015f7..05f4957 100644 --- a/Campofinale/Commands/Handlers/CommandHelp.cs +++ b/Campofinale/Commands/Handlers/CommandHelp.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Campofinale.Commands.Handlers +namespace Campofinale.Commands.Handlers { public static class CommandHelp { diff --git a/Campofinale/Commands/Handlers/CommandIdList.cs b/Campofinale/Commands/Handlers/CommandIdList.cs index a772883..482ac5d 100644 --- a/Campofinale/Commands/Handlers/CommandIdList.cs +++ b/Campofinale/Commands/Handlers/CommandIdList.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Resource.ResourceManager; namespace Campofinale.Commands.Handlers diff --git a/Campofinale/Commands/Handlers/CommandKick.cs b/Campofinale/Commands/Handlers/CommandKick.cs index fbf0a61..9cc87d9 100644 --- a/Campofinale/Commands/Handlers/CommandKick.cs +++ b/Campofinale/Commands/Handlers/CommandKick.cs @@ -1,9 +1,4 @@ using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Commands.Handlers { diff --git a/Campofinale/Commands/Handlers/CommandLevel.cs b/Campofinale/Commands/Handlers/CommandLevel.cs index b91a550..757fe87 100644 --- a/Campofinale/Commands/Handlers/CommandLevel.cs +++ b/Campofinale/Commands/Handlers/CommandLevel.cs @@ -1,5 +1,4 @@ using Campofinale.Commands; -using Campofinale.Database; using Campofinale.Packets.Sc; using Campofinale.Resource; diff --git a/Campofinale/Commands/Handlers/CommandNickname.cs b/Campofinale/Commands/Handlers/CommandNickname.cs index 990f077..f58691d 100644 --- a/Campofinale/Commands/Handlers/CommandNickname.cs +++ b/Campofinale/Commands/Handlers/CommandNickname.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Campofinale.Packets.Sc; namespace Campofinale.Commands.Handlers diff --git a/Campofinale/Commands/Handlers/CommandPlayers.cs b/Campofinale/Commands/Handlers/CommandPlayers.cs index 78c17c6..804c4b6 100644 --- a/Campofinale/Commands/Handlers/CommandPlayers.cs +++ b/Campofinale/Commands/Handlers/CommandPlayers.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Campofinale.Commands.Handlers +namespace Campofinale.Commands.Handlers { public static class CommandPlayers { diff --git a/Campofinale/Commands/Handlers/CommandRemove.cs b/Campofinale/Commands/Handlers/CommandRemove.cs index 02b8f47..fcec4a7 100644 --- a/Campofinale/Commands/Handlers/CommandRemove.cs +++ b/Campofinale/Commands/Handlers/CommandRemove.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Campofinale.Database; using Campofinale.Game.Character; using Campofinale.Packets.Sc; diff --git a/Campofinale/Commands/Handlers/CommandSpawn.cs b/Campofinale/Commands/Handlers/CommandSpawn.cs index b764ae6..ed3a097 100644 --- a/Campofinale/Commands/Handlers/CommandSpawn.cs +++ b/Campofinale/Commands/Handlers/CommandSpawn.cs @@ -1,10 +1,5 @@ using Campofinale.Game.Entities; using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Commands.Handlers { diff --git a/Campofinale/Commands/Handlers/CommandTeleport.cs b/Campofinale/Commands/Handlers/CommandTeleport.cs index 13eeea4..1f1f400 100644 --- a/Campofinale/Commands/Handlers/CommandTeleport.cs +++ b/Campofinale/Commands/Handlers/CommandTeleport.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Resource.ResourceManager; using Campofinale.Packets.Sc; using MongoDB.Bson; diff --git a/Campofinale/Commands/Handlers/CommandUnlockAll.cs b/Campofinale/Commands/Handlers/CommandUnlockAll.cs index a3829ae..e41555d 100644 --- a/Campofinale/Commands/Handlers/CommandUnlockAll.cs +++ b/Campofinale/Commands/Handlers/CommandUnlockAll.cs @@ -1,12 +1,6 @@ -using Campofinale.Database; -using Campofinale.Packets.Sc; +using Campofinale.Packets.Sc; using Campofinale.Protocol; using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Commands.Handlers { diff --git a/Campofinale/ConfigFile.cs b/Campofinale/ConfigFile.cs index bfb403b..206b408 100644 --- a/Campofinale/ConfigFile.cs +++ b/Campofinale/ConfigFile.cs @@ -1,11 +1,4 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Campofinale +namespace Campofinale { public class ConfigFile { diff --git a/Campofinale/Crypto/CSChaCha20.cs b/Campofinale/Crypto/CSChaCha20.cs index 6415cd2..ea9358c 100644 --- a/Campofinale/Crypto/CSChaCha20.cs +++ b/Campofinale/Crypto/CSChaCha20.cs @@ -15,9 +15,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -using System; -using System.IO; -using System.Threading.Tasks; using System.Runtime.Intrinsics; using System.Runtime.CompilerServices; diff --git a/Campofinale/Database/Database.cs b/Campofinale/Database/Database.cs index 21e0196..1f2af8c 100644 --- a/Campofinale/Database/Database.cs +++ b/Campofinale/Database/Database.cs @@ -3,19 +3,12 @@ using Campofinale.Game.Character; using Campofinale.Game.Gacha; using Campofinale.Game.Inventory; using Campofinale.Game.Spaceship; -using Campofinale.Resource; using MongoDB.Bson; using MongoDB.Bson.Serialization.Attributes; using MongoDB.Driver; -using System; -using System.Collections.Generic; -using System.Linq; using System.Security.Cryptography; using System.Text; -using System.Threading.Tasks; -using static Campofinale.Player; using static Campofinale.Resource.ResourceManager; -using static SQLite.SQLite3; namespace Campofinale.Database { diff --git a/Campofinale/Database/DatabaseManager.cs b/Campofinale/Database/DatabaseManager.cs index ba4f8f0..e769373 100644 --- a/Campofinale/Database/DatabaseManager.cs +++ b/Campofinale/Database/DatabaseManager.cs @@ -1,10 +1,4 @@ -using MongoDB.Bson.Serialization.Serializers; -using MongoDB.Bson.Serialization; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using MongoDB.Bson.Serialization; using MongoDB.Bson.IO; using MongoDB.Bson; using System.Reflection; diff --git a/Campofinale/Game/BitsetManager.cs b/Campofinale/Game/BitsetManager.cs index fe79911..65c7aba 100644 --- a/Campofinale/Game/BitsetManager.cs +++ b/Campofinale/Game/BitsetManager.cs @@ -1,9 +1,4 @@ using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Resource.ResourceManager; namespace Campofinale.Game diff --git a/Campofinale/Game/Character/Character.cs b/Campofinale/Game/Character/Character.cs index a9081fe..86b8414 100644 --- a/Campofinale/Game/Character/Character.cs +++ b/Campofinale/Game/Character/Character.cs @@ -6,13 +6,6 @@ using Google.Protobuf.Collections; using MongoDB.Bson; using MongoDB.Bson.Serialization.Attributes; using MongoDB.Bson.Serialization.IdGenerators; -using MongoDB.Driver; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Resource.ResourceManager; using static Campofinale.Resource.ResourceManager.CharGrowthTable; using static Campofinale.Resource.ResourceManager.WeaponUpgradeTemplateTable; diff --git a/Campofinale/Game/Dungeons/Dungeon.cs b/Campofinale/Game/Dungeons/Dungeon.cs index 853167c..c22e73d 100644 --- a/Campofinale/Game/Dungeons/Dungeon.cs +++ b/Campofinale/Game/Dungeons/Dungeon.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using static Campofinale.Resource.ResourceManager; +using static Campofinale.Resource.ResourceManager; namespace Campofinale.Game.Dungeons { diff --git a/Campofinale/Game/Entities/Entity.cs b/Campofinale/Game/Entities/Entity.cs index 5daac22..4cb04aa 100644 --- a/Campofinale/Game/Entities/Entity.cs +++ b/Campofinale/Game/Entities/Entity.cs @@ -1,9 +1,4 @@ using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Resource.ResourceManager; using static Campofinale.Resource.ResourceManager.LevelScene.LevelData; diff --git a/Campofinale/Game/Entities/EntityCharacter.cs b/Campofinale/Game/Entities/EntityCharacter.cs index dbfc034..806f932 100644 --- a/Campofinale/Game/Entities/EntityCharacter.cs +++ b/Campofinale/Game/Entities/EntityCharacter.cs @@ -1,10 +1,4 @@ -using Campofinale.Game.Character; -using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Campofinale.Protocol; using static Campofinale.Resource.ResourceManager; namespace Campofinale.Game.Entities diff --git a/Campofinale/Game/Entities/EntityInteractive.cs b/Campofinale/Game/Entities/EntityInteractive.cs index 891e63a..4915960 100644 --- a/Campofinale/Game/Entities/EntityInteractive.cs +++ b/Campofinale/Game/Entities/EntityInteractive.cs @@ -1,11 +1,6 @@ using Campofinale.Packets.Sc; using Campofinale.Protocol; using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Resource.ResourceManager; using static Campofinale.Resource.ResourceManager.LevelScene.LevelData; diff --git a/Campofinale/Game/Entities/EntityMonster.cs b/Campofinale/Game/Entities/EntityMonster.cs index 7493a00..48299f3 100644 --- a/Campofinale/Game/Entities/EntityMonster.cs +++ b/Campofinale/Game/Entities/EntityMonster.cs @@ -1,10 +1,5 @@ using Campofinale.Protocol; using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Resource.ResourceManager; namespace Campofinale.Game.Entities diff --git a/Campofinale/Game/Entities/EntityNpc.cs b/Campofinale/Game/Entities/EntityNpc.cs index 2cf4b40..3c44da8 100644 --- a/Campofinale/Game/Entities/EntityNpc.cs +++ b/Campofinale/Game/Entities/EntityNpc.cs @@ -1,11 +1,4 @@ -using Campofinale.Protocol; -using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using static Campofinale.Resource.ResourceManager; +using static Campofinale.Resource.ResourceManager; namespace Campofinale.Game.Entities { diff --git a/Campofinale/Game/Factory/Components/FComponentBusLoader.cs b/Campofinale/Game/Factory/Components/FComponentBusLoader.cs index b9bf4d8..8a7e534 100644 --- a/Campofinale/Game/Factory/Components/FComponentBusLoader.cs +++ b/Campofinale/Game/Factory/Components/FComponentBusLoader.cs @@ -1,9 +1,4 @@ using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Game.Factory.FactoryNode; namespace Campofinale.Game.Factory.Components diff --git a/Campofinale/Game/Factory/Components/FComponentPortManager.cs b/Campofinale/Game/Factory/Components/FComponentPortManager.cs index 696919f..43e473d 100644 --- a/Campofinale/Game/Factory/Components/FComponentPortManager.cs +++ b/Campofinale/Game/Factory/Components/FComponentPortManager.cs @@ -1,9 +1,4 @@ using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Game.Factory.FactoryNode; namespace Campofinale.Game.Factory.Components diff --git a/Campofinale/Game/Factory/Components/FComponentPowerPole.cs b/Campofinale/Game/Factory/Components/FComponentPowerPole.cs index c7121af..483bc26 100644 --- a/Campofinale/Game/Factory/Components/FComponentPowerPole.cs +++ b/Campofinale/Game/Factory/Components/FComponentPowerPole.cs @@ -1,9 +1,4 @@ using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Game.Factory.FactoryNode; namespace Campofinale.Game.Factory.Components diff --git a/Campofinale/Game/Factory/Components/FComponentPowerSave.cs b/Campofinale/Game/Factory/Components/FComponentPowerSave.cs index 99510c5..35a0fa9 100644 --- a/Campofinale/Game/Factory/Components/FComponentPowerSave.cs +++ b/Campofinale/Game/Factory/Components/FComponentPowerSave.cs @@ -1,9 +1,4 @@ using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Game.Factory.FactoryNode; namespace Campofinale.Game.Factory.Components diff --git a/Campofinale/Game/Factory/Components/FComponentSelector.cs b/Campofinale/Game/Factory/Components/FComponentSelector.cs index 462637f..c77be14 100644 --- a/Campofinale/Game/Factory/Components/FComponentSelector.cs +++ b/Campofinale/Game/Factory/Components/FComponentSelector.cs @@ -1,9 +1,4 @@ using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Game.Factory.FactoryNode; namespace Campofinale.Game.Factory.Components diff --git a/Campofinale/Game/Factory/Components/FComponentStablePower.cs b/Campofinale/Game/Factory/Components/FComponentStablePower.cs index 4082ba7..84fa52d 100644 --- a/Campofinale/Game/Factory/Components/FComponentStablePower.cs +++ b/Campofinale/Game/Factory/Components/FComponentStablePower.cs @@ -1,9 +1,4 @@ using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Game.Factory.FactoryNode; namespace Campofinale.Game.Factory.Components diff --git a/Campofinale/Game/Factory/Components/FComponentSubHub.cs b/Campofinale/Game/Factory/Components/FComponentSubHub.cs index b6595a2..ffbc34f 100644 --- a/Campofinale/Game/Factory/Components/FComponentSubHub.cs +++ b/Campofinale/Game/Factory/Components/FComponentSubHub.cs @@ -1,9 +1,4 @@ using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Game.Factory.FactoryNode; namespace Campofinale.Game.Factory.Components diff --git a/Campofinale/Game/Factory/Components/FComponentTravelPole.cs b/Campofinale/Game/Factory/Components/FComponentTravelPole.cs index 3576551..cda4e62 100644 --- a/Campofinale/Game/Factory/Components/FComponentTravelPole.cs +++ b/Campofinale/Game/Factory/Components/FComponentTravelPole.cs @@ -1,9 +1,4 @@ using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Game.Factory.FactoryNode; namespace Campofinale.Game.Factory.Components diff --git a/Campofinale/Game/Factory/FactoryManager.cs b/Campofinale/Game/Factory/FactoryManager.cs index 6e4b232..91f395c 100644 --- a/Campofinale/Game/Factory/FactoryManager.cs +++ b/Campofinale/Game/Factory/FactoryManager.cs @@ -3,12 +3,6 @@ using Campofinale.Packets.Sc; using Campofinale.Protocol; using Campofinale.Resource; using MongoDB.Bson.Serialization.Attributes; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Numerics; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Resource.ResourceManager; namespace Campofinale.Game.Factory diff --git a/Campofinale/Game/Gacha/GachaManager.cs b/Campofinale/Game/Gacha/GachaManager.cs index bc19e0b..7d16766 100644 --- a/Campofinale/Game/Gacha/GachaManager.cs +++ b/Campofinale/Game/Gacha/GachaManager.cs @@ -1,12 +1,6 @@ using Campofinale.Database; using Campofinale.Protocol; using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Resource.ResourceManager; namespace Campofinale.Game.Gacha diff --git a/Campofinale/Game/Gacha/GachaTransaction.cs b/Campofinale/Game/Gacha/GachaTransaction.cs index 88eddbd..87da47a 100644 --- a/Campofinale/Game/Gacha/GachaTransaction.cs +++ b/Campofinale/Game/Gacha/GachaTransaction.cs @@ -1,10 +1,5 @@ using MongoDB.Bson.Serialization.Attributes; using MongoDB.Bson; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using MongoDB.Bson.Serialization.IdGenerators; namespace Campofinale.Game.Gacha diff --git a/Campofinale/Game/GameConstants.cs b/Campofinale/Game/GameConstants.cs index 8878468..0f42e40 100644 --- a/Campofinale/Game/GameConstants.cs +++ b/Campofinale/Game/GameConstants.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Campofinale.Game +namespace Campofinale.Game { public static class GameConstants { diff --git a/Campofinale/Game/Inventory/InventoryList.cs b/Campofinale/Game/Inventory/InventoryList.cs index 77aaa4c..39b343e 100644 --- a/Campofinale/Game/Inventory/InventoryList.cs +++ b/Campofinale/Game/Inventory/InventoryList.cs @@ -1,10 +1,5 @@ using Campofinale.Database; using Campofinale.Packets.Sc; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Game.Inventory { diff --git a/Campofinale/Game/Inventory/InventoryManager.cs b/Campofinale/Game/Inventory/InventoryManager.cs index 87b1780..fa7b733 100644 --- a/Campofinale/Game/Inventory/InventoryManager.cs +++ b/Campofinale/Game/Inventory/InventoryManager.cs @@ -1,14 +1,6 @@ using Campofinale.Database; using Campofinale.Packets.Sc; -using Campofinale.Resource; using Google.Protobuf.Collections; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection.Metadata; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Resource.ResourceManager; namespace Campofinale.Game.Inventory diff --git a/Campofinale/Game/Mail.cs b/Campofinale/Game/Mail.cs index 7e8209f..6e47f44 100644 --- a/Campofinale/Game/Mail.cs +++ b/Campofinale/Game/Mail.cs @@ -1,11 +1,6 @@ using Campofinale.Resource; using MongoDB.Bson.Serialization.Attributes; using MongoDB.Bson; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using MongoDB.Bson.Serialization.IdGenerators; namespace Campofinale.Game diff --git a/Campofinale/Game/SceneManager.cs b/Campofinale/Game/SceneManager.cs index 1085781..096d1d6 100644 --- a/Campofinale/Game/SceneManager.cs +++ b/Campofinale/Game/SceneManager.cs @@ -3,14 +3,7 @@ using Campofinale.Game.Inventory; using Campofinale.Packets.Sc; using Campofinale.Resource; using MongoDB.Bson.Serialization.Attributes; -using SharpCompress.Common; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Numerics; -using System.Text; using System.Text.Json.Serialization; -using System.Threading.Tasks; using static Campofinale.Resource.ResourceManager; using static Campofinale.Resource.ResourceManager.LevelScene.LevelData; diff --git a/Campofinale/Game/Spaceship/SpaceshipChar.cs b/Campofinale/Game/Spaceship/SpaceshipChar.cs index a81a463..0e19865 100644 --- a/Campofinale/Game/Spaceship/SpaceshipChar.cs +++ b/Campofinale/Game/Spaceship/SpaceshipChar.cs @@ -1,11 +1,5 @@ using MongoDB.Bson.Serialization.Attributes; using MongoDB.Bson; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using static Campofinale.Resource.ResourceManager; using MongoDB.Bson.Serialization.IdGenerators; using Campofinale.Resource; diff --git a/Campofinale/Game/Spaceship/SpaceshipManager.cs b/Campofinale/Game/Spaceship/SpaceshipManager.cs index 521fffe..aabdaaa 100644 --- a/Campofinale/Game/Spaceship/SpaceshipManager.cs +++ b/Campofinale/Game/Spaceship/SpaceshipManager.cs @@ -1,14 +1,4 @@ using Campofinale.Database; -using Campofinale.Game.Inventory; -using MongoDB.Bson.Serialization.Attributes; -using MongoDB.Bson; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using MongoDB.Bson.Serialization.IdGenerators; -using static Campofinale.Resource.ResourceManager; using Campofinale.Resource; using Campofinale.Resource.Table; diff --git a/Campofinale/Game/Spaceship/SpaceshipRoom.cs b/Campofinale/Game/Spaceship/SpaceshipRoom.cs index f50e417..a320d4b 100644 --- a/Campofinale/Game/Spaceship/SpaceshipRoom.cs +++ b/Campofinale/Game/Spaceship/SpaceshipRoom.cs @@ -1,10 +1,5 @@ using MongoDB.Bson.Serialization.Attributes; using MongoDB.Bson; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Resource.ResourceManager; using Campofinale.Resource; using MongoDB.Bson.Serialization.IdGenerators; diff --git a/Campofinale/Game/Team.cs b/Campofinale/Game/Team.cs index 232e5de..5fce7ff 100644 --- a/Campofinale/Game/Team.cs +++ b/Campofinale/Game/Team.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Campofinale.Game +namespace Campofinale.Game { public class Team { diff --git a/Campofinale/Http/Dispatch.cs b/Campofinale/Http/Dispatch.cs index bcbfc1b..3778de7 100644 --- a/Campofinale/Http/Dispatch.cs +++ b/Campofinale/Http/Dispatch.cs @@ -1,18 +1,5 @@ -using Campofinale.Database; -using Campofinale.Game; -using Campofinale.Game.Gacha; -using Google.Protobuf.WellKnownTypes; +using Campofinale.Game; using HttpServerLite; -using MongoDB.Bson.IO; -using SQLite; -using SQLiteNetExtensions.Extensions; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Channels; -using System.Threading.Tasks; -using static Campofinale.Game.Gacha.GachaManager; namespace Campofinale.Http { diff --git a/Campofinale/Http/PCDispatch.cs b/Campofinale/Http/PCDispatch.cs index 30a2907..70b0a73 100644 --- a/Campofinale/Http/PCDispatch.cs +++ b/Campofinale/Http/PCDispatch.cs @@ -1,10 +1,6 @@ using Campofinale.Commands; -using Campofinale.Commands.Handlers; using Campofinale.Database; using HttpServerLite; -using System; -using System.Collections.Generic; -using System.Linq; using System.Text; diff --git a/Campofinale/Http/SDK.cs b/Campofinale/Http/SDK.cs index 96edd0f..1a8b599 100644 --- a/Campofinale/Http/SDK.cs +++ b/Campofinale/Http/SDK.cs @@ -1,11 +1,5 @@ using Campofinale.Database; -using Campofinale.Resource; using HttpServerLite; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Game.Gacha.GachaManager; using static Campofinale.Http.Dispatch; diff --git a/Campofinale/Logger.cs b/Campofinale/Logger.cs index 8669522..0bc910a 100644 --- a/Campofinale/Logger.cs +++ b/Campofinale/Logger.cs @@ -1,9 +1,5 @@ -using Campofinale; using Pastel; -using System; using System.Diagnostics; -using System.IO; -using static System.Net.Mime.MediaTypeNames; public static class Logger { diff --git a/Campofinale/Network/Packet.cs b/Campofinale/Network/Packet.cs index b2c3208..817f0d9 100644 --- a/Campofinale/Network/Packet.cs +++ b/Campofinale/Network/Packet.cs @@ -1,20 +1,9 @@ using Campofinale.Protocol; using Google.Protobuf; using Pastel; -using System; -using System.Buffers.Binary; -using System.Collections.Generic; using System.Drawing; -using System.Linq; using System.Net; -using System.Net.Sockets; -using System.Reflection; -using System.Runtime.InteropServices; using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; - -using static System.Runtime.InteropServices.JavaScript.JSType; namespace Campofinale.Network { diff --git a/Campofinale/NotifyManager.cs b/Campofinale/NotifyManager.cs index c49a42f..c508d2d 100644 --- a/Campofinale/NotifyManager.cs +++ b/Campofinale/NotifyManager.cs @@ -7,7 +7,6 @@ using System.Collections.Immutable; using System.Linq.Expressions; using System.Reflection; - using System.Net.Sockets; using Campofinale.Protocol; using Campofinale.Network; diff --git a/Campofinale/Packets/Cs/HandleCsBattleOp.cs b/Campofinale/Packets/Cs/HandleCsBattleOp.cs index 509c64e..8446e08 100644 --- a/Campofinale/Packets/Cs/HandleCsBattleOp.cs +++ b/Campofinale/Packets/Cs/HandleCsBattleOp.cs @@ -2,16 +2,6 @@ using Campofinale.Game.Entities; using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using MongoDB.Driver.Core.Clusters; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsBitsetAdd.cs b/Campofinale/Packets/Cs/HandleCsBitsetAdd.cs index 97010fd..44f108d 100644 --- a/Campofinale/Packets/Cs/HandleCsBitsetAdd.cs +++ b/Campofinale/Packets/Cs/HandleCsBitsetAdd.cs @@ -1,17 +1,7 @@ -using Campofinale.Game.Character; -using Campofinale.Network; +using Campofinale.Network; using Campofinale.Packets.Sc; using Campofinale.Protocol; using Campofinale.Resource; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsBitsetRemove.cs b/Campofinale/Packets/Cs/HandleCsBitsetRemove.cs index 91350c3..b8e0988 100644 --- a/Campofinale/Packets/Cs/HandleCsBitsetRemove.cs +++ b/Campofinale/Packets/Cs/HandleCsBitsetRemove.cs @@ -1,17 +1,7 @@ -using Campofinale.Game.Character; -using Campofinale.Network; +using Campofinale.Network; using Campofinale.Packets.Sc; using Campofinale.Protocol; using Campofinale.Resource; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsCharBagSetCurrTeamIndex.cs b/Campofinale/Packets/Cs/HandleCsCharBagSetCurrTeamIndex.cs index 5bf8884..c17ecda 100644 --- a/Campofinale/Packets/Cs/HandleCsCharBagSetCurrTeamIndex.cs +++ b/Campofinale/Packets/Cs/HandleCsCharBagSetCurrTeamIndex.cs @@ -1,21 +1,7 @@ -using BeyondTools.VFS.Crypto; -using Campofinale.Network; +using Campofinale.Network; using Campofinale.Packets.Sc; using Campofinale.Protocol; using Campofinale.Resource; -using Google.Protobuf; -using Google.Protobuf.WellKnownTypes; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; - -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; -using static Campofinale.Resource.ResourceManager; -using static System.Net.Mime.MediaTypeNames; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsCharBagSetTeam.cs b/Campofinale/Packets/Cs/HandleCsCharBagSetTeam.cs index b6cfd9e..e588c68 100644 --- a/Campofinale/Packets/Cs/HandleCsCharBagSetTeam.cs +++ b/Campofinale/Packets/Cs/HandleCsCharBagSetTeam.cs @@ -1,15 +1,6 @@ using Campofinale.Network; using Campofinale.Packets.Sc; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsCharBagSetTeamLeader.cs b/Campofinale/Packets/Cs/HandleCsCharBagSetTeamLeader.cs index db68e56..f4673a1 100644 --- a/Campofinale/Packets/Cs/HandleCsCharBagSetTeamLeader.cs +++ b/Campofinale/Packets/Cs/HandleCsCharBagSetTeamLeader.cs @@ -1,15 +1,5 @@ using Campofinale.Network; -using Campofinale.Packets.Sc; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsCharBagSetTeamName.cs b/Campofinale/Packets/Cs/HandleCsCharBagSetTeamName.cs index eee9396..0554b0b 100644 --- a/Campofinale/Packets/Cs/HandleCsCharBagSetTeamName.cs +++ b/Campofinale/Packets/Cs/HandleCsCharBagSetTeamName.cs @@ -1,14 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsCharLevelUp.cs b/Campofinale/Packets/Cs/HandleCsCharLevelUp.cs index 4f6ce96..a4d0714 100644 --- a/Campofinale/Packets/Cs/HandleCsCharLevelUp.cs +++ b/Campofinale/Packets/Cs/HandleCsCharLevelUp.cs @@ -1,15 +1,6 @@ using Campofinale.Game.Character; using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsCharPotentialUnlock.cs b/Campofinale/Packets/Cs/HandleCsCharPotentialUnlock.cs index 943ae7e..bf2b64b 100644 --- a/Campofinale/Packets/Cs/HandleCsCharPotentialUnlock.cs +++ b/Campofinale/Packets/Cs/HandleCsCharPotentialUnlock.cs @@ -1,16 +1,6 @@ using Campofinale.Game.Character; using Campofinale.Network; -using Campofinale.Packets.Sc; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsCharUnlockTalentNode.cs b/Campofinale/Packets/Cs/HandleCsCharUnlockTalentNode.cs index 262a745..0d2ea8a 100644 --- a/Campofinale/Packets/Cs/HandleCsCharUnlockTalentNode.cs +++ b/Campofinale/Packets/Cs/HandleCsCharUnlockTalentNode.cs @@ -1,16 +1,6 @@ using Campofinale.Game.Character; using Campofinale.Network; -using Campofinale.Packets.Sc; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsEnterDungeon.cs b/Campofinale/Packets/Cs/HandleCsEnterDungeon.cs index a3d75f9..12ff9e8 100644 --- a/Campofinale/Packets/Cs/HandleCsEnterDungeon.cs +++ b/Campofinale/Packets/Cs/HandleCsEnterDungeon.cs @@ -1,14 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsEquipPutoff.cs b/Campofinale/Packets/Cs/HandleCsEquipPutoff.cs index 137a510..3cbc030 100644 --- a/Campofinale/Packets/Cs/HandleCsEquipPutoff.cs +++ b/Campofinale/Packets/Cs/HandleCsEquipPutoff.cs @@ -1,15 +1,6 @@ using Campofinale.Game.Character; using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsEquipPuton.cs b/Campofinale/Packets/Cs/HandleCsEquipPuton.cs index b00625c..0c719b4 100644 --- a/Campofinale/Packets/Cs/HandleCsEquipPuton.cs +++ b/Campofinale/Packets/Cs/HandleCsEquipPuton.cs @@ -1,15 +1,6 @@ using Campofinale.Game.Character; using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsFactoryHsFb.cs b/Campofinale/Packets/Cs/HandleCsFactoryHsFb.cs index 8a01e76..853efe5 100644 --- a/Campofinale/Packets/Cs/HandleCsFactoryHsFb.cs +++ b/Campofinale/Packets/Cs/HandleCsFactoryHsFb.cs @@ -1,14 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsFactoryOp.cs b/Campofinale/Packets/Cs/HandleCsFactoryOp.cs index 4b84f52..9fb3346 100644 --- a/Campofinale/Packets/Cs/HandleCsFactoryOp.cs +++ b/Campofinale/Packets/Cs/HandleCsFactoryOp.cs @@ -1,14 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsFactoryStatisticRequire.cs b/Campofinale/Packets/Cs/HandleCsFactoryStatisticRequire.cs index dd5a13e..0c8d54a 100644 --- a/Campofinale/Packets/Cs/HandleCsFactoryStatisticRequire.cs +++ b/Campofinale/Packets/Cs/HandleCsFactoryStatisticRequire.cs @@ -1,14 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsFinishDialog.cs b/Campofinale/Packets/Cs/HandleCsFinishDialog.cs index ff3496b..80693e5 100644 --- a/Campofinale/Packets/Cs/HandleCsFinishDialog.cs +++ b/Campofinale/Packets/Cs/HandleCsFinishDialog.cs @@ -1,14 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsFlushSync.cs b/Campofinale/Packets/Cs/HandleCsFlushSync.cs index 1b4b999..0aad914 100644 --- a/Campofinale/Packets/Cs/HandleCsFlushSync.cs +++ b/Campofinale/Packets/Cs/HandleCsFlushSync.cs @@ -1,14 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsGachaTenPullReq.cs b/Campofinale/Packets/Cs/HandleCsGachaTenPullReq.cs index 4ad968a..407d1b5 100644 --- a/Campofinale/Packets/Cs/HandleCsGachaTenPullReq.cs +++ b/Campofinale/Packets/Cs/HandleCsGachaTenPullReq.cs @@ -1,17 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using Campofinale.Resource; -using Google.Protobuf; -using Google.Protobuf.WellKnownTypes; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; -using static Campofinale.Resource.ResourceManager; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsGetMail.cs b/Campofinale/Packets/Cs/HandleCsGetMail.cs index b3aff0b..c18e701 100644 --- a/Campofinale/Packets/Cs/HandleCsGetMail.cs +++ b/Campofinale/Packets/Cs/HandleCsGetMail.cs @@ -2,7 +2,6 @@ using Campofinale.Packets.Sc; using Campofinale.Protocol; - namespace Campofinale.Packets.Cs { public class HandleCsGetMail diff --git a/Campofinale/Packets/Cs/HandleCsItemBagAbandonInBag.cs b/Campofinale/Packets/Cs/HandleCsItemBagAbandonInBag.cs index 990c527..e0caa05 100644 --- a/Campofinale/Packets/Cs/HandleCsItemBagAbandonInBag.cs +++ b/Campofinale/Packets/Cs/HandleCsItemBagAbandonInBag.cs @@ -1,15 +1,5 @@ using Campofinale.Network; -using Campofinale.Packets.Sc; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsItemBagMoveInBag.cs b/Campofinale/Packets/Cs/HandleCsItemBagMoveInBag.cs index 6860e58..ad603de 100644 --- a/Campofinale/Packets/Cs/HandleCsItemBagMoveInBag.cs +++ b/Campofinale/Packets/Cs/HandleCsItemBagMoveInBag.cs @@ -1,15 +1,5 @@ using Campofinale.Network; -using Campofinale.Packets.Sc; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsLeaveDungeon.cs b/Campofinale/Packets/Cs/HandleCsLeaveDungeon.cs index 63216f3..c41097c 100644 --- a/Campofinale/Packets/Cs/HandleCsLeaveDungeon.cs +++ b/Campofinale/Packets/Cs/HandleCsLeaveDungeon.cs @@ -1,14 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsLogin.cs b/Campofinale/Packets/Cs/HandleCsLogin.cs index 217092a..5067b8e 100644 --- a/Campofinale/Packets/Cs/HandleCsLogin.cs +++ b/Campofinale/Packets/Cs/HandleCsLogin.cs @@ -7,7 +7,6 @@ using Campofinale.Protocol; using Campofinale.Resource; using System.Security.Cryptography; using static Campofinale.Resource.ResourceManager; -using System.Reflection; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsMergeMsg.cs b/Campofinale/Packets/Cs/HandleCsMergeMsg.cs index 15542ff..b5e667c 100644 --- a/Campofinale/Packets/Cs/HandleCsMergeMsg.cs +++ b/Campofinale/Packets/Cs/HandleCsMergeMsg.cs @@ -1,14 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsMoveObjectMove.cs b/Campofinale/Packets/Cs/HandleCsMoveObjectMove.cs index b8bb46d..dafe2a2 100644 --- a/Campofinale/Packets/Cs/HandleCsMoveObjectMove.cs +++ b/Campofinale/Packets/Cs/HandleCsMoveObjectMove.cs @@ -1,15 +1,6 @@ using Campofinale.Game.Entities; using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; using static Campofinale.Resource.ResourceManager; namespace Campofinale.Packets.Cs diff --git a/Campofinale/Packets/Cs/HandleCsPing.cs b/Campofinale/Packets/Cs/HandleCsPing.cs index e00fa53..f3cccf3 100644 --- a/Campofinale/Packets/Cs/HandleCsPing.cs +++ b/Campofinale/Packets/Cs/HandleCsPing.cs @@ -1,14 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsSceneInteractSpInteractive.cs b/Campofinale/Packets/Cs/HandleCsSceneInteractSpInteractive.cs index 0925866..eb39054 100644 --- a/Campofinale/Packets/Cs/HandleCsSceneInteractSpInteractive.cs +++ b/Campofinale/Packets/Cs/HandleCsSceneInteractSpInteractive.cs @@ -1,18 +1,8 @@ -using Campofinale.Game.Character; -using Campofinale.Game.Entities; +using Campofinale.Game.Entities; using Campofinale.Network; using Campofinale.Packets.Sc; using Campofinale.Protocol; using Campofinale.Resource; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; using static Campofinale.Resource.ResourceManager; namespace Campofinale.Packets.Cs diff --git a/Campofinale/Packets/Cs/HandleCsSceneInteractiveEventTrigger.cs b/Campofinale/Packets/Cs/HandleCsSceneInteractiveEventTrigger.cs index 323271c..d4cbf2b 100644 --- a/Campofinale/Packets/Cs/HandleCsSceneInteractiveEventTrigger.cs +++ b/Campofinale/Packets/Cs/HandleCsSceneInteractiveEventTrigger.cs @@ -1,16 +1,6 @@ -using Campofinale.Game.Character; -using Campofinale.Game.Entities; +using Campofinale.Game.Entities; using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsSceneLoadFinish.cs b/Campofinale/Packets/Cs/HandleCsSceneLoadFinish.cs index a1e0c46..2585ef6 100644 --- a/Campofinale/Packets/Cs/HandleCsSceneLoadFinish.cs +++ b/Campofinale/Packets/Cs/HandleCsSceneLoadFinish.cs @@ -1,21 +1,8 @@ -using BeyondTools.VFS.Crypto; -using Campofinale.Network; +using Campofinale.Network; using Campofinale.Packets.Sc; using Campofinale.Protocol; using Campofinale.Resource; -using Google.Protobuf; -using Google.Protobuf.WellKnownTypes; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; - -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; using static Campofinale.Resource.ResourceManager; -using static System.Net.Mime.MediaTypeNames; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsSceneMoveStateSet.cs b/Campofinale/Packets/Cs/HandleCsSceneMoveStateSet.cs index d177b0b..781aff0 100644 --- a/Campofinale/Packets/Cs/HandleCsSceneMoveStateSet.cs +++ b/Campofinale/Packets/Cs/HandleCsSceneMoveStateSet.cs @@ -1,14 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsSceneRepatriate.cs b/Campofinale/Packets/Cs/HandleCsSceneRepatriate.cs index 0b06392..75b40ad 100644 --- a/Campofinale/Packets/Cs/HandleCsSceneRepatriate.cs +++ b/Campofinale/Packets/Cs/HandleCsSceneRepatriate.cs @@ -1,5 +1,4 @@ using Campofinale.Network; -using Campofinale.Packets.Sc; using Campofinale.Protocol; namespace Campofinale.Packets.Cs diff --git a/Campofinale/Packets/Cs/HandleCsSceneSetLastSafeZone.cs b/Campofinale/Packets/Cs/HandleCsSceneSetLastSafeZone.cs index d85216e..9a3e459 100644 --- a/Campofinale/Packets/Cs/HandleCsSceneSetLastSafeZone.cs +++ b/Campofinale/Packets/Cs/HandleCsSceneSetLastSafeZone.cs @@ -1,16 +1,5 @@ -using Campofinale.Game; -using Campofinale.Network; +using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; -using static Campofinale.Resource.ResourceManager; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsSceneSetSafeZone.cs b/Campofinale/Packets/Cs/HandleCsSceneSetSafeZone.cs index 1d90e2f..bdb0dbe 100644 --- a/Campofinale/Packets/Cs/HandleCsSceneSetSafeZone.cs +++ b/Campofinale/Packets/Cs/HandleCsSceneSetSafeZone.cs @@ -1,16 +1,6 @@ -using Campofinale.Game; -using Campofinale.Game.Entities; +using Campofinale.Game.Entities; using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; using static Campofinale.Resource.ResourceManager; namespace Campofinale.Packets.Cs diff --git a/Campofinale/Packets/Cs/HandleCsSceneSetTrackPoint.cs b/Campofinale/Packets/Cs/HandleCsSceneSetTrackPoint.cs index faec2d4..1a9519e 100644 --- a/Campofinale/Packets/Cs/HandleCsSceneSetTrackPoint.cs +++ b/Campofinale/Packets/Cs/HandleCsSceneSetTrackPoint.cs @@ -1,15 +1,6 @@ using Campofinale.Network; using Campofinale.Packets.Sc; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsSceneTeleport.cs b/Campofinale/Packets/Cs/HandleCsSceneTeleport.cs index 97cc91b..086b3c0 100644 --- a/Campofinale/Packets/Cs/HandleCsSceneTeleport.cs +++ b/Campofinale/Packets/Cs/HandleCsSceneTeleport.cs @@ -1,14 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsSpaceshipPresentGiftToChar.cs b/Campofinale/Packets/Cs/HandleCsSpaceshipPresentGiftToChar.cs index bbdf214..f02ba72 100644 --- a/Campofinale/Packets/Cs/HandleCsSpaceshipPresentGiftToChar.cs +++ b/Campofinale/Packets/Cs/HandleCsSpaceshipPresentGiftToChar.cs @@ -1,15 +1,5 @@ using Campofinale.Network; -using Campofinale.Packets.Sc; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsSpaceshipStationChar.cs b/Campofinale/Packets/Cs/HandleCsSpaceshipStationChar.cs index 0df56a1..c7ba586 100644 --- a/Campofinale/Packets/Cs/HandleCsSpaceshipStationChar.cs +++ b/Campofinale/Packets/Cs/HandleCsSpaceshipStationChar.cs @@ -1,15 +1,6 @@ using Campofinale.Network; using Campofinale.Packets.Sc; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsSpaceshipStationCharChangeWorkState.cs b/Campofinale/Packets/Cs/HandleCsSpaceshipStationCharChangeWorkState.cs index 8bf17ae..9f91d25 100644 --- a/Campofinale/Packets/Cs/HandleCsSpaceshipStationCharChangeWorkState.cs +++ b/Campofinale/Packets/Cs/HandleCsSpaceshipStationCharChangeWorkState.cs @@ -1,15 +1,6 @@ using Campofinale.Network; using Campofinale.Packets.Sc; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsUpdateQuestObjective.cs b/Campofinale/Packets/Cs/HandleCsUpdateQuestObjective.cs index 66560a8..a815e23 100644 --- a/Campofinale/Packets/Cs/HandleCsUpdateQuestObjective.cs +++ b/Campofinale/Packets/Cs/HandleCsUpdateQuestObjective.cs @@ -1,14 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsWeaponAddExp.cs b/Campofinale/Packets/Cs/HandleCsWeaponAddExp.cs index b58bce7..d464dcf 100644 --- a/Campofinale/Packets/Cs/HandleCsWeaponAddExp.cs +++ b/Campofinale/Packets/Cs/HandleCsWeaponAddExp.cs @@ -1,16 +1,6 @@ -using Campofinale.Game.Character; -using Campofinale.Game.Inventory; +using Campofinale.Game.Inventory; using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Cs/HandleCsWeaponPuton.cs b/Campofinale/Packets/Cs/HandleCsWeaponPuton.cs index 60bd5c2..6e2c56a 100644 --- a/Campofinale/Packets/Cs/HandleCsWeaponPuton.cs +++ b/Campofinale/Packets/Cs/HandleCsWeaponPuton.cs @@ -1,15 +1,6 @@ using Campofinale.Game.Character; using Campofinale.Network; using Campofinale.Protocol; -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Sockets; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Campofinale.Packets.Cs { diff --git a/Campofinale/Packets/Sc/PacketScActivitySync.cs b/Campofinale/Packets/Sc/PacketScActivitySync.cs index 44a22e3..5bf730a 100644 --- a/Campofinale/Packets/Sc/PacketScActivitySync.cs +++ b/Campofinale/Packets/Sc/PacketScActivitySync.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScAdventureBookSync.cs b/Campofinale/Packets/Sc/PacketScAdventureBookSync.cs index 458be18..bf2a0b9 100644 --- a/Campofinale/Packets/Sc/PacketScAdventureBookSync.cs +++ b/Campofinale/Packets/Sc/PacketScAdventureBookSync.cs @@ -1,12 +1,6 @@ using Campofinale.Network; using Campofinale.Protocol; using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScAdventureSyncAll.cs b/Campofinale/Packets/Sc/PacketScAdventureSyncAll.cs index 2b8c735..3b149f3 100644 --- a/Campofinale/Packets/Sc/PacketScAdventureSyncAll.cs +++ b/Campofinale/Packets/Sc/PacketScAdventureSyncAll.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScBitsetAdd.cs b/Campofinale/Packets/Sc/PacketScBitsetAdd.cs index 8dfa1fa..6580c7d 100644 --- a/Campofinale/Packets/Sc/PacketScBitsetAdd.cs +++ b/Campofinale/Packets/Sc/PacketScBitsetAdd.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScBitsetRemove.cs b/Campofinale/Packets/Sc/PacketScBitsetRemove.cs index 29f2653..5ca90f0 100644 --- a/Campofinale/Packets/Sc/PacketScBitsetRemove.cs +++ b/Campofinale/Packets/Sc/PacketScBitsetRemove.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScCharBagAddChar.cs b/Campofinale/Packets/Sc/PacketScCharBagAddChar.cs index 3343686..7c6617d 100644 --- a/Campofinale/Packets/Sc/PacketScCharBagAddChar.cs +++ b/Campofinale/Packets/Sc/PacketScCharBagAddChar.cs @@ -1,12 +1,6 @@ using Campofinale.Game.Character; using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScCharBagDelChar.cs b/Campofinale/Packets/Sc/PacketScCharBagDelChar.cs index efa3860..9ba09d7 100644 --- a/Campofinale/Packets/Sc/PacketScCharBagDelChar.cs +++ b/Campofinale/Packets/Sc/PacketScCharBagDelChar.cs @@ -1,12 +1,6 @@ using Campofinale.Game.Character; using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScCharBagSetCurrTeamIndex.cs b/Campofinale/Packets/Sc/PacketScCharBagSetCurrTeamIndex.cs index 2fbdeed..99af587 100644 --- a/Campofinale/Packets/Sc/PacketScCharBagSetCurrTeamIndex.cs +++ b/Campofinale/Packets/Sc/PacketScCharBagSetCurrTeamIndex.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScCharBagSetTeamName.cs b/Campofinale/Packets/Sc/PacketScCharBagSetTeamName.cs index b069b45..1b34feb 100644 --- a/Campofinale/Packets/Sc/PacketScCharBagSetTeamName.cs +++ b/Campofinale/Packets/Sc/PacketScCharBagSetTeamName.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScCharUnlockTalentNode.cs b/Campofinale/Packets/Sc/PacketScCharUnlockTalentNode.cs index 1cb04de..0a65011 100644 --- a/Campofinale/Packets/Sc/PacketScCharUnlockTalentNode.cs +++ b/Campofinale/Packets/Sc/PacketScCharUnlockTalentNode.cs @@ -1,12 +1,6 @@ using Campofinale.Game.Character; using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScEnterSceneNotify.cs b/Campofinale/Packets/Sc/PacketScEnterSceneNotify.cs index 98dedba..8c851ed 100644 --- a/Campofinale/Packets/Sc/PacketScEnterSceneNotify.cs +++ b/Campofinale/Packets/Sc/PacketScEnterSceneNotify.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Resource.ResourceManager; namespace Campofinale.Packets.Sc diff --git a/Campofinale/Packets/Sc/PacketScFactoryOpRet.cs b/Campofinale/Packets/Sc/PacketScFactoryOpRet.cs index d649328..9057871 100644 --- a/Campofinale/Packets/Sc/PacketScFactoryOpRet.cs +++ b/Campofinale/Packets/Sc/PacketScFactoryOpRet.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScFactorySync.cs b/Campofinale/Packets/Sc/PacketScFactorySync.cs index f2df4b9..586cb41 100644 --- a/Campofinale/Packets/Sc/PacketScFactorySync.cs +++ b/Campofinale/Packets/Sc/PacketScFactorySync.cs @@ -1,6 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using static Campofinale.Resource.ResourceManager; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScFactorySyncChapter.cs b/Campofinale/Packets/Sc/PacketScFactorySyncChapter.cs index 2189cd4..f154a82 100644 --- a/Campofinale/Packets/Sc/PacketScFactorySyncChapter.cs +++ b/Campofinale/Packets/Sc/PacketScFactorySyncChapter.cs @@ -1,15 +1,8 @@ using Campofinale.Game.Factory; -using Campofinale.Game.Inventory; using Campofinale.Network; using Campofinale.Protocol; using Campofinale.Resource; using Campofinale.Resource.Table; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Resource.ResourceManager; namespace Campofinale.Packets.Sc diff --git a/Campofinale/Packets/Sc/PacketScGachaSync.cs b/Campofinale/Packets/Sc/PacketScGachaSync.cs index dcb25e7..92a9137 100644 --- a/Campofinale/Packets/Sc/PacketScGachaSync.cs +++ b/Campofinale/Packets/Sc/PacketScGachaSync.cs @@ -1,12 +1,6 @@ using Campofinale.Game.Gacha; using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Resource.ResourceManager; namespace Campofinale.Packets.Sc diff --git a/Campofinale/Packets/Sc/PacketScGameMechanicsSync.cs b/Campofinale/Packets/Sc/PacketScGameMechanicsSync.cs index 8b728c7..36b91e8 100644 --- a/Campofinale/Packets/Sc/PacketScGameMechanicsSync.cs +++ b/Campofinale/Packets/Sc/PacketScGameMechanicsSync.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Resource.ResourceManager; namespace Campofinale.Packets.Sc diff --git a/Campofinale/Packets/Sc/PacketScGetMail.cs b/Campofinale/Packets/Sc/PacketScGetMail.cs index 76a44e5..ead7e6e 100644 --- a/Campofinale/Packets/Sc/PacketScGetMail.cs +++ b/Campofinale/Packets/Sc/PacketScGetMail.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScItemBagScopeModify.cs b/Campofinale/Packets/Sc/PacketScItemBagScopeModify.cs index 2f3fc24..ccc887c 100644 --- a/Campofinale/Packets/Sc/PacketScItemBagScopeModify.cs +++ b/Campofinale/Packets/Sc/PacketScItemBagScopeModify.cs @@ -1,12 +1,6 @@ using Campofinale.Game.Inventory; using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScItemBagScopeSync.cs b/Campofinale/Packets/Sc/PacketScItemBagScopeSync.cs index d226aba..a78a197 100644 --- a/Campofinale/Packets/Sc/PacketScItemBagScopeSync.cs +++ b/Campofinale/Packets/Sc/PacketScItemBagScopeSync.cs @@ -2,12 +2,6 @@ using Campofinale.Network; using Campofinale.Protocol; using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScObjectEnterView.cs b/Campofinale/Packets/Sc/PacketScObjectEnterView.cs index 2b5b7aa..856153b 100644 --- a/Campofinale/Packets/Sc/PacketScObjectEnterView.cs +++ b/Campofinale/Packets/Sc/PacketScObjectEnterView.cs @@ -1,13 +1,6 @@ using Campofinale.Game.Entities; using Campofinale.Network; using Campofinale.Protocol; -using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScObjectLeaveView.cs b/Campofinale/Packets/Sc/PacketScObjectLeaveView.cs index b0643ab..047a4c1 100644 --- a/Campofinale/Packets/Sc/PacketScObjectLeaveView.cs +++ b/Campofinale/Packets/Sc/PacketScObjectLeaveView.cs @@ -1,13 +1,5 @@ -using Campofinale.Game.Entities; -using Campofinale.Network; +using Campofinale.Network; using Campofinale.Protocol; -using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScSceneCollectionSync.cs b/Campofinale/Packets/Sc/PacketScSceneCollectionSync.cs index 171fd96..23b41ee 100644 --- a/Campofinale/Packets/Sc/PacketScSceneCollectionSync.cs +++ b/Campofinale/Packets/Sc/PacketScSceneCollectionSync.cs @@ -1,13 +1,6 @@ using Campofinale.Network; using Campofinale.Protocol; using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using Campofinale.Resource; using Campofinale.Game; namespace Campofinale.Packets.Sc diff --git a/Campofinale/Packets/Sc/PacketScSceneSetTrackPoint.cs b/Campofinale/Packets/Sc/PacketScSceneSetTrackPoint.cs index 383e011..6f5d0c7 100644 --- a/Campofinale/Packets/Sc/PacketScSceneSetTrackPoint.cs +++ b/Campofinale/Packets/Sc/PacketScSceneSetTrackPoint.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScSelfSceneInfo.cs b/Campofinale/Packets/Sc/PacketScSelfSceneInfo.cs index 9e4fff3..a7a86d3 100644 --- a/Campofinale/Packets/Sc/PacketScSelfSceneInfo.cs +++ b/Campofinale/Packets/Sc/PacketScSelfSceneInfo.cs @@ -1,13 +1,6 @@ -using Campofinale.Game.Entities; -using Campofinale.Network; +using Campofinale.Network; using Campofinale.Protocol; using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScSetName.cs b/Campofinale/Packets/Sc/PacketScSetName.cs index 088faa5..5d90a5f 100644 --- a/Campofinale/Packets/Sc/PacketScSetName.cs +++ b/Campofinale/Packets/Sc/PacketScSetName.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScSnsGetChatList.cs b/Campofinale/Packets/Sc/PacketScSnsGetChatList.cs index 3f96ca3..f1cc441 100644 --- a/Campofinale/Packets/Sc/PacketScSnsGetChatList.cs +++ b/Campofinale/Packets/Sc/PacketScSnsGetChatList.cs @@ -1,12 +1,6 @@ using Campofinale.Network; using Campofinale.Protocol; using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScSpaceshipSync.cs b/Campofinale/Packets/Sc/PacketScSpaceshipSync.cs index 7573185..24dac98 100644 --- a/Campofinale/Packets/Sc/PacketScSpaceshipSync.cs +++ b/Campofinale/Packets/Sc/PacketScSpaceshipSync.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScSpaceshipSyncRoomStation.cs b/Campofinale/Packets/Sc/PacketScSpaceshipSyncRoomStation.cs index 3574a78..9253234 100644 --- a/Campofinale/Packets/Sc/PacketScSpaceshipSyncRoomStation.cs +++ b/Campofinale/Packets/Sc/PacketScSpaceshipSyncRoomStation.cs @@ -1,12 +1,6 @@ using Campofinale.Game.Spaceship; using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScSyncAllBitset.cs b/Campofinale/Packets/Sc/PacketScSyncAllBitset.cs index 9eb3c96..d875ef5 100644 --- a/Campofinale/Packets/Sc/PacketScSyncAllBitset.cs +++ b/Campofinale/Packets/Sc/PacketScSyncAllBitset.cs @@ -1,12 +1,6 @@ using Campofinale.Network; using Campofinale.Protocol; using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScSyncAllBloc.cs b/Campofinale/Packets/Sc/PacketScSyncAllBloc.cs index 083aa60..b50aa26 100644 --- a/Campofinale/Packets/Sc/PacketScSyncAllBloc.cs +++ b/Campofinale/Packets/Sc/PacketScSyncAllBloc.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Resource.ResourceManager; namespace Campofinale.Packets.Sc diff --git a/Campofinale/Packets/Sc/PacketScSyncAllDialog.cs b/Campofinale/Packets/Sc/PacketScSyncAllDialog.cs index 0fd4788..5aa9651 100644 --- a/Campofinale/Packets/Sc/PacketScSyncAllDialog.cs +++ b/Campofinale/Packets/Sc/PacketScSyncAllDialog.cs @@ -1,12 +1,6 @@ using Campofinale.Network; using Campofinale.Protocol; using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScSyncAllGameVar.cs b/Campofinale/Packets/Sc/PacketScSyncAllGameVar.cs index 4523079..1f4f7d7 100644 --- a/Campofinale/Packets/Sc/PacketScSyncAllGameVar.cs +++ b/Campofinale/Packets/Sc/PacketScSyncAllGameVar.cs @@ -1,12 +1,6 @@ using Campofinale.Network; using Campofinale.Protocol; using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScSyncAllMail.cs b/Campofinale/Packets/Sc/PacketScSyncAllMail.cs index 2c7fd2d..37309a8 100644 --- a/Campofinale/Packets/Sc/PacketScSyncAllMail.cs +++ b/Campofinale/Packets/Sc/PacketScSyncAllMail.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScSyncAllMiniGame.cs b/Campofinale/Packets/Sc/PacketScSyncAllMiniGame.cs index d7ccc89..431300b 100644 --- a/Campofinale/Packets/Sc/PacketScSyncAllMiniGame.cs +++ b/Campofinale/Packets/Sc/PacketScSyncAllMiniGame.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScSyncAllRoleScene.cs b/Campofinale/Packets/Sc/PacketScSyncAllRoleScene.cs index 0ada96d..db30cad 100644 --- a/Campofinale/Packets/Sc/PacketScSyncAllRoleScene.cs +++ b/Campofinale/Packets/Sc/PacketScSyncAllRoleScene.cs @@ -1,13 +1,6 @@ using Campofinale.Network; using Campofinale.Protocol; using Campofinale.Resource; -using Campofinale.Resource.Table; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Resource.ResourceManager; namespace Campofinale.Packets.Sc diff --git a/Campofinale/Packets/Sc/PacketScSyncAllUnlock.cs b/Campofinale/Packets/Sc/PacketScSyncAllUnlock.cs index 43e4b9e..464b922 100644 --- a/Campofinale/Packets/Sc/PacketScSyncAllUnlock.cs +++ b/Campofinale/Packets/Sc/PacketScSyncAllUnlock.cs @@ -1,13 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using static Campofinale.Resource.ResourceManager; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScSyncBaseData.cs b/Campofinale/Packets/Sc/PacketScSyncBaseData.cs index 672afa2..cad8c4b 100644 --- a/Campofinale/Packets/Sc/PacketScSyncBaseData.cs +++ b/Campofinale/Packets/Sc/PacketScSyncBaseData.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScSyncCharBagInfo.cs b/Campofinale/Packets/Sc/PacketScSyncCharBagInfo.cs index 6820ff0..4088750 100644 --- a/Campofinale/Packets/Sc/PacketScSyncCharBagInfo.cs +++ b/Campofinale/Packets/Sc/PacketScSyncCharBagInfo.cs @@ -1,12 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using Campofinale.Resource; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScSyncFullDungeonStatus.cs b/Campofinale/Packets/Sc/PacketScSyncFullDungeonStatus.cs index 35b5195..495a736 100644 --- a/Campofinale/Packets/Sc/PacketScSyncFullDungeonStatus.cs +++ b/Campofinale/Packets/Sc/PacketScSyncFullDungeonStatus.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScSyncGameMode.cs b/Campofinale/Packets/Sc/PacketScSyncGameMode.cs index b44a7c4..9dd4cc4 100644 --- a/Campofinale/Packets/Sc/PacketScSyncGameMode.cs +++ b/Campofinale/Packets/Sc/PacketScSyncGameMode.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScSyncStamina.cs b/Campofinale/Packets/Sc/PacketScSyncStamina.cs index a9739dc..361c5e3 100644 --- a/Campofinale/Packets/Sc/PacketScSyncStamina.cs +++ b/Campofinale/Packets/Sc/PacketScSyncStamina.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Packets/Sc/PacketScSyncWallet.cs b/Campofinale/Packets/Sc/PacketScSyncWallet.cs index eb6611d..e7fb633 100644 --- a/Campofinale/Packets/Sc/PacketScSyncWallet.cs +++ b/Campofinale/Packets/Sc/PacketScSyncWallet.cs @@ -1,11 +1,5 @@ using Campofinale.Network; using Campofinale.Protocol; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Packets.Sc { diff --git a/Campofinale/Player.cs b/Campofinale/Player.cs index 258b4bb..9e4ad0f 100644 --- a/Campofinale/Player.cs +++ b/Campofinale/Player.cs @@ -1,16 +1,6 @@ - -using Campofinale.Network; +using Campofinale.Network; using Campofinale.Protocol; using Google.Protobuf; -using Google.Protobuf.Collections; -using Pastel; -using SQLite; -using SQLiteNetExtensions.Attributes; -using System.Drawing; -using System.Linq; -using System.Numerics; -using MongoDB.Bson.Serialization.Attributes; -using System.Reflection; using System.Net.Sockets; using Campofinale.Packets.Sc; using Campofinale.Game.Character; diff --git a/Campofinale/Program.cs b/Campofinale/Program.cs index bd0a3aa..6b43f01 100644 --- a/Campofinale/Program.cs +++ b/Campofinale/Program.cs @@ -1,5 +1,4 @@ -// See https://aka.ms/new-console-template for more information -using Campofinale; +using Campofinale; using Newtonsoft.Json; class Program diff --git a/Campofinale/Resource/GameEnums.cs b/Campofinale/Resource/GameEnums.cs index 3296149..515ae19 100644 --- a/Campofinale/Resource/GameEnums.cs +++ b/Campofinale/Resource/GameEnums.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Campofinale.Resource +namespace Campofinale.Resource { public enum MissionState : int// TypeDefIndex: 33630 { diff --git a/Campofinale/Resource/LongBitSet.cs b/Campofinale/Resource/LongBitSet.cs index 319e19d..0e2aca4 100644 --- a/Campofinale/Resource/LongBitSet.cs +++ b/Campofinale/Resource/LongBitSet.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Campofinale.Resource +namespace Campofinale.Resource { /// /// Utility class for supporting long bit set diff --git a/Campofinale/Resource/ResourceLoader.cs b/Campofinale/Resource/ResourceLoader.cs index e0607a3..b411eff 100644 --- a/Campofinale/Resource/ResourceLoader.cs +++ b/Campofinale/Resource/ResourceLoader.cs @@ -1,11 +1,5 @@ using Newtonsoft.Json; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; using System.Reflection; -using System.Text; -using System.Threading.Tasks; namespace Campofinale.Resource { diff --git a/Campofinale/Resource/ResourceManager.cs b/Campofinale/Resource/ResourceManager.cs index 17c1cfe..4c76a71 100644 --- a/Campofinale/Resource/ResourceManager.cs +++ b/Campofinale/Resource/ResourceManager.cs @@ -1,12 +1,5 @@ - -using Campofinale.Resource.Table; +using Campofinale.Resource.Table; using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using static Campofinale.Resource.ResourceManager.LevelScene; namespace Campofinale.Resource diff --git a/Campofinale/Resource/Table/BlocDataTable.cs b/Campofinale/Resource/Table/BlocDataTable.cs index 2068ba9..dc95217 100644 --- a/Campofinale/Resource/Table/BlocDataTable.cs +++ b/Campofinale/Resource/Table/BlocDataTable.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Campofinale.Resource.Table +namespace Campofinale.Resource.Table { [TableCfgType("TableCfg/BlocDataTable.json", LoadPriority.LOW)] public class BlocDataTable : TableCfgResource diff --git a/Campofinale/Resource/Table/CharacterTable.cs b/Campofinale/Resource/Table/CharacterTable.cs index 0038c6d..0544207 100644 --- a/Campofinale/Resource/Table/CharacterTable.cs +++ b/Campofinale/Resource/Table/CharacterTable.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using static Campofinale.Resource.ResourceManager; +using static Campofinale.Resource.ResourceManager; namespace Campofinale.Resource.Table { diff --git a/Campofinale/Resource/Table/DialogIdTable.cs b/Campofinale/Resource/Table/DialogIdTable.cs index c492af4..50ab8a2 100644 --- a/Campofinale/Resource/Table/DialogIdTable.cs +++ b/Campofinale/Resource/Table/DialogIdTable.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using static Campofinale.Resource.ResourceManager; - -namespace Campofinale.Resource.Table +namespace Campofinale.Resource.Table { [TableCfgType("Json/GameplayConfig/DialogIdTable.json", LoadPriority.LOW)] public class DialogIdTable : StrIdNumTable diff --git a/Campofinale/Resource/Table/GiftItemTable.cs b/Campofinale/Resource/Table/GiftItemTable.cs index 6cd6849..57c7029 100644 --- a/Campofinale/Resource/Table/GiftItemTable.cs +++ b/Campofinale/Resource/Table/GiftItemTable.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Campofinale.Resource.Table +namespace Campofinale.Resource.Table { [TableCfgType("TableCfg/GiftItemTable.json", LoadPriority.LOW)] public class GiftItemTable diff --git a/Campofinale/Resource/Table/InteractiveTable.cs b/Campofinale/Resource/Table/InteractiveTable.cs index 0b015b6..e809199 100644 --- a/Campofinale/Resource/Table/InteractiveTable.cs +++ b/Campofinale/Resource/Table/InteractiveTable.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Campofinale.Resource.Table +namespace Campofinale.Resource.Table { [TableCfgType("Json/Interactive/InteractiveTable.json", LoadPriority.LOW)] public class InteractiveTable : TableCfgResource diff --git a/Campofinale/Resource/Table/ItemTypeTable.cs b/Campofinale/Resource/Table/ItemTypeTable.cs index aa223d7..27b0921 100644 --- a/Campofinale/Resource/Table/ItemTypeTable.cs +++ b/Campofinale/Resource/Table/ItemTypeTable.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Campofinale.Resource.Table +namespace Campofinale.Resource.Table { [TableCfgType("TableCfg/ItemTypeTable.json", LoadPriority.LOW)] public class ItemTypeTable diff --git a/Campofinale/Resource/Table/LevelGradeTable.cs b/Campofinale/Resource/Table/LevelGradeTable.cs index 265fb44..7d4c8b7 100644 --- a/Campofinale/Resource/Table/LevelGradeTable.cs +++ b/Campofinale/Resource/Table/LevelGradeTable.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Campofinale.Resource.Table +namespace Campofinale.Resource.Table { [TableCfgType("TableCfg/LevelGradeTable.json", LoadPriority.LOW)] public class LevelGradeTable : TableCfgResource diff --git a/Campofinale/Resource/Table/MissionAreaTable.cs b/Campofinale/Resource/Table/MissionAreaTable.cs index e60ea4c..5c6719e 100644 --- a/Campofinale/Resource/Table/MissionAreaTable.cs +++ b/Campofinale/Resource/Table/MissionAreaTable.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Campofinale.Resource.Table +namespace Campofinale.Resource.Table { [TableCfgType("Json/GameplayConfig/MissionAreaTable.json", LoadPriority.LOW)] public class MissionAreaTable : TableCfgResource diff --git a/Campofinale/Resource/Table/SNSChatTable.cs b/Campofinale/Resource/Table/SNSChatTable.cs index b2101e5..e5716ca 100644 --- a/Campofinale/Resource/Table/SNSChatTable.cs +++ b/Campofinale/Resource/Table/SNSChatTable.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Campofinale.Resource.Table +namespace Campofinale.Resource.Table { [TableCfgType("TableCfg/SNSChatTable.json", LoadPriority.LOW)] public class SNSChatTable diff --git a/Campofinale/Resource/Table/StrIdNumTable.cs b/Campofinale/Resource/Table/StrIdNumTable.cs index 47a2e13..1fcb1d9 100644 --- a/Campofinale/Resource/Table/StrIdNumTable.cs +++ b/Campofinale/Resource/Table/StrIdNumTable.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using static Campofinale.Resource.ResourceManager; +using static Campofinale.Resource.ResourceManager; namespace Campofinale.Resource.Table { diff --git a/Campofinale/Resource/Table/SystemJumpTable.cs b/Campofinale/Resource/Table/SystemJumpTable.cs index e9f9154..48101c5 100644 --- a/Campofinale/Resource/Table/SystemJumpTable.cs +++ b/Campofinale/Resource/Table/SystemJumpTable.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Campofinale.Resource.Table +namespace Campofinale.Resource.Table { [TableCfgType("TableCfg/SystemJumpTable.json", LoadPriority.LOW)] public class SystemJumpTable diff --git a/Campofinale/Resource/TableCfgResource.cs b/Campofinale/Resource/TableCfgResource.cs index 15d7c48..e640d89 100644 --- a/Campofinale/Resource/TableCfgResource.cs +++ b/Campofinale/Resource/TableCfgResource.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Campofinale.Resource +namespace Campofinale.Resource { public abstract class TableCfgResource { diff --git a/Campofinale/Server.cs b/Campofinale/Server.cs index 0c61e82..7ea68b0 100644 --- a/Campofinale/Server.cs +++ b/Campofinale/Server.cs @@ -1,29 +1,13 @@ - -using BeyondTools.VFS.Crypto; -using Campofinale.Commands; +using Campofinale.Commands; using Campofinale.Database; using Campofinale.Game; using Campofinale.Http; -using Campofinale.Network; using Campofinale.Protocol; using Campofinale.Resource; -using Google.Protobuf; -using Newtonsoft.Json; using Pastel; -using SQLite; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Drawing; -using System.Linq; using System.Net; using System.Net.Sockets; using System.Reflection; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; -using static Campofinale.Http.Dispatch; - namespace Campofinale { From 9cc32bbe3a0baf2088caa5d7e7d813c9ec674748 Mon Sep 17 00:00:00 2001 From: Hexafluorine Date: Thu, 20 Mar 2025 20:34:04 -0700 Subject: [PATCH 34/58] Fix MongoDB Issue Ensures MongoDB service has started so it doesn't throw an error when accessing the db (Windows only) --- Campofinale/Campofinale.csproj | 2 + Campofinale/Server.cs | 25 +++++++++++ Campofinale/app.manifest | 79 ++++++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 Campofinale/app.manifest diff --git a/Campofinale/Campofinale.csproj b/Campofinale/Campofinale.csproj index 1302251..c3242e2 100644 --- a/Campofinale/Campofinale.csproj +++ b/Campofinale/Campofinale.csproj @@ -8,6 +8,7 @@ true AnyCPU;x86;ARM32 Program + app.manifest @@ -29,6 +30,7 @@ + diff --git a/Campofinale/Server.cs b/Campofinale/Server.cs index 7ea68b0..017f802 100644 --- a/Campofinale/Server.cs +++ b/Campofinale/Server.cs @@ -8,6 +8,8 @@ using Pastel; using System.Net; using System.Net.Sockets; using System.Reflection; +using System.Runtime.InteropServices; +using System.ServiceProcess; namespace Campofinale { @@ -79,6 +81,7 @@ namespace Campofinale showLogs = !hideLogs; Logger.Print($"Logs are {(showLogs ? "enabled" : "disabled")}"); Server.config = config; + StartDBService(); DatabaseManager.Init(); ResourceManager.Init(); new Thread(new ThreadStart(DispatchServer)).Start(); @@ -176,5 +179,27 @@ namespace Campofinale player.Kick(CODE.ErrServerClosed); } } + private static void StartDBService() + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + try + { + string mongodbService = "MongoDB"; + using (ServiceController service = new ServiceController(mongodbService)) + { + if (service.Status != ServiceControllerStatus.Running) + { + Logger.Print($"Starting {mongodbService} service..."); + service.Start(); + service.WaitForStatus(ServiceControllerStatus.Running, TimeSpan.FromSeconds(30)); + Logger.Print($"Started {mongodbService} service"); + } + } + } + catch (Exception e) + { + Logger.PrintError($"Failed to Start MongoDB service: {e}"); + } + } } } diff --git a/Campofinale/app.manifest b/Campofinale/app.manifest new file mode 100644 index 0000000..04608b9 --- /dev/null +++ b/Campofinale/app.manifest @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From d46a63c38623c775c17bf2c520549aed2999d2a6 Mon Sep 17 00:00:00 2001 From: Hexafluorine <110123144+Hexafluorine@users.noreply.github.com> Date: Mon, 5 May 2025 22:26:37 -0700 Subject: [PATCH 35/58] Clean up --- Campofinale/Logger.cs | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Campofinale/Logger.cs b/Campofinale/Logger.cs index 0bc910a..18d62f1 100644 --- a/Campofinale/Logger.cs +++ b/Campofinale/Logger.cs @@ -51,7 +51,9 @@ public static class Logger } public static string GetColor(string c) { - if (ClassColors.ContainsKey(c)) return ClassColors[c]; + if (ClassColors.ContainsKey(c)) + return ClassColors[c]; + return "999"; } private static StreamWriter logWriter; @@ -60,26 +62,26 @@ public static class Logger public static void Initialize(bool hideLogs = false) { Logger.hideLogs = hideLogs; + logWriter = new StreamWriter("latest.log", false); + logWriter.AutoFlush = true; } /// /// Log a message /// /// - public static void Log(string message) + private static void Log(string message) { - if (!hideLogs) + if(hideLogs) + return; + + try + { + logWriter.WriteLine($"{DateTime.Now}: {message}"); + } + catch(Exception e) { - try - { - logWriter.WriteLine($"{DateTime.Now}: {message}"); - logWriter.Flush(); - } - catch(Exception e) - { - } - } } @@ -87,4 +89,4 @@ public static class Logger { logWriter.Close(); } -} \ No newline at end of file +} From b3f24c83ecd43730d9b83ee2f974bc43580a4f70 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sat, 10 May 2025 16:49:04 +0200 Subject: [PATCH 36/58] Preparing "MissionDataTable" (not original name, the original name in dump.cs is: Beyond.Gameplay.MissionRuntimeAsset) --- Campofinale/Packets/Cs/HandleCsLogin.cs | 35 ++++++++++++++- Campofinale/Resource/GameEnums.cs | 9 ++++ .../Resource/Table/MissionDataTable.cs | 45 +++++++++++++++++++ 3 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 Campofinale/Resource/Table/MissionDataTable.cs diff --git a/Campofinale/Packets/Cs/HandleCsLogin.cs b/Campofinale/Packets/Cs/HandleCsLogin.cs index 5067b8e..96307fe 100644 --- a/Campofinale/Packets/Cs/HandleCsLogin.cs +++ b/Campofinale/Packets/Cs/HandleCsLogin.cs @@ -181,11 +181,42 @@ namespace Campofinale.Packets.Cs };*/ //session.Send(ScMessageId.ScSyncAllMission, missions); string json1 = File.ReadAllText("44_ScSyncAllMission.json"); + + ScSyncAllMission m = Newtonsoft.Json.JsonConvert.DeserializeObject(json1); m.TrackMissionId = ""; - session.Send(ScMsgId.ScSyncAllMission, m); - + session.Send(ScMsgId.ScSyncAllMission, m); + /*session.Send(ScMsgId.ScSyncAllMission, new ScSyncAllMission() + { + Missions = + { + {"e0m0", new Mission() + { + MissionId="e0m0", + MissionState=(int)MissionState.Processing, + } } + }, + TrackMissionId = "e0m0", + + CurQuests = + { + {"e0m0_q#1", new Quest() + { + QuestId="e0m0_q#1", + QuestState=(int)QuestState.Processing, + QuestObjectives = + { + new QuestObjective() + { + ConditionId="", + + } + } + } } + } + });*/ + session.Send(new PacketScGachaSync(session)); ScSettlementSyncAll settlements = new ScSettlementSyncAll() { diff --git a/Campofinale/Resource/GameEnums.cs b/Campofinale/Resource/GameEnums.cs index 515ae19..f53c5f5 100644 --- a/Campofinale/Resource/GameEnums.cs +++ b/Campofinale/Resource/GameEnums.cs @@ -8,6 +8,15 @@ Completed = 3, Failed = 4 } + public enum QuestState + { + + None = 0, + Available = 1, + Processing = 2, + Completed = 3, + Failed = 4, + } public enum InteractiveComponentType { TriggerObserver = 0, diff --git a/Campofinale/Resource/Table/MissionDataTable.cs b/Campofinale/Resource/Table/MissionDataTable.cs new file mode 100644 index 0000000..69353fc --- /dev/null +++ b/Campofinale/Resource/Table/MissionDataTable.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Campofinale.Resource.Table +{ + //Beyond.Gameplay.MissionRuntimeAsset + [TableCfgType("TableCfg/MissionDataTable.json", LoadPriority.LOW)] + public class MissionDataTable + { + public string missionId; + public string rewardId; + public MissionType missionType; + public string charId; + public string levelId; + public Dictionary questDic; + public int onMissionAcceptId; + public int onMissionCompletedId; + public int onMissionFailedId; + + public class QuestInfo + { + public string questId; + public bool optional; + public bool autoSucceed; + public bool autoRestartWhenFailed; + public int objectiveConditionNum; + public string rewardId; + + } + public enum MissionType + { + Main = 0, + Char = 1, + Factory = 2, + Bloc = 3, + Hide = 4, + Misc = 5, + Dungeon = 6, + World = 7, + } + } +} From d9f06c270465c7c66bc015afaf06dc048dddfc85 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sat, 10 May 2025 16:52:01 +0200 Subject: [PATCH 37/58] removing useless imports --- Campofinale/Resource/Table/MissionDataTable.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Campofinale/Resource/Table/MissionDataTable.cs b/Campofinale/Resource/Table/MissionDataTable.cs index 69353fc..9da1ef7 100644 --- a/Campofinale/Resource/Table/MissionDataTable.cs +++ b/Campofinale/Resource/Table/MissionDataTable.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Campofinale.Resource.Table +namespace Campofinale.Resource.Table { //Beyond.Gameplay.MissionRuntimeAsset [TableCfgType("TableCfg/MissionDataTable.json", LoadPriority.LOW)] From a66f7e8d7eab919b931095357d5cb7f447af9fef Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sat, 10 May 2025 16:56:37 +0200 Subject: [PATCH 38/58] TODO: MissionSystem --- Campofinale/Game/Mission/MissionSystem.cs | 20 ++++++++++++++++++++ Campofinale/Player.cs | 3 +++ 2 files changed, 23 insertions(+) create mode 100644 Campofinale/Game/Mission/MissionSystem.cs diff --git a/Campofinale/Game/Mission/MissionSystem.cs b/Campofinale/Game/Mission/MissionSystem.cs new file mode 100644 index 0000000..8de3bcc --- /dev/null +++ b/Campofinale/Game/Mission/MissionSystem.cs @@ -0,0 +1,20 @@ +using Campofinale.Database; + +namespace Campofinale.Game.Mission +{ + public class MissionSystem + { + public Player owner; + public MissionSystem(Player o) + { + owner = o; + } + public void Save() + { + + } + public void Load() + { + } + } +} diff --git a/Campofinale/Player.cs b/Campofinale/Player.cs index 9e4ad0f..7690b3e 100644 --- a/Campofinale/Player.cs +++ b/Campofinale/Player.cs @@ -13,6 +13,7 @@ using Campofinale.Game.Gacha; using Campofinale.Game.Spaceship; using Campofinale.Game.Dungeons; using Campofinale.Game.Factory; +using Campofinale.Game.Mission; namespace Campofinale @@ -94,6 +95,7 @@ namespace Campofinale public GachaManager gachaManager; public BitsetManager bitsetManager; public FactoryManager factoryManager; + public MissionSystem missionSystem; public int teamIndex = 0; public List teams= new List(); public List mails = new List(); @@ -123,6 +125,7 @@ namespace Campofinale gachaManager = new(this); spaceshipManager = new(this); factoryManager = new(this); + missionSystem = new(this); receivorThread = new Thread(new ThreadStart(Receive)); } From 1bd767d9ce3a51161206a6e460881f9aeda15c8d Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sat, 10 May 2025 17:06:58 +0200 Subject: [PATCH 39/58] modified readme --- README.md | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 88 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a30a621..926f71f 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,6 @@ Campofinale is a experimental server implementation for a certain factory building game. -> **NOTICE: Our old Discord server was raided (all members were removed), please rejoin our community using this new invite link: https://discord.gg/eGGXymVd4K** - ## Current Features * Login @@ -14,6 +12,93 @@ Campofinale is a experimental server implementation for a certain factory buildi * Save data with MongoDB * Combat system +## TODO +* Android Support +* Mission System +* Working buffs + +## Installation Steps (Windows) + +1. Install: + * [.NET SDK](https://dotnet.microsoft.com/en-us/download) (8.0.12 is recommended) + * [MongoDB](https://www.mongodb.com/try/download/community) + * [Fiddler Classic](https://www.telerik.com/fiddler/fiddler-classic) OR [mitmproxy](https://mitmproxy.org/) + + 1. When installing *Fiddler Classic*, make sure to **enable** "Decrypt HTTPS traffic" and **install** the certificate! + 1. You have to enable two features via Tools (top left in menubar) -> Options -> HTTPS -> Check "Capture HTTPS CONNECTs" and "Decrypt HTTPS traffic". You can also re-install the certificate via Actions (right next to "Capture HTTPS CONNECTs") -> Trust Root Certificate and press "Yes" +2. Download the [precompiled build](https://github.com/Campofinale/Campofinale/releases/latest) or build it by yourself +3. Put the `Json`, `TableCfg` and `DynamicAssets` folders inside the `Campofinale.exe` folder (you can download a copy [here](https://github.com/PotRooms/EndFieldData/tree/main)) +4. Run the server (`Campofinale.exe`) +5. Overwrite the `C:\Users\\Documents\Fiddler2\Scripts\CustomRules.js` script (or backup the default one and create a new file with the same name) with the following script: + * You can also run *Fiddler Classic*, go to `Rules -> Customize Rules` (CTRL + R) and save it, or by selecting the *FiddlerScript* tab + + ```javascript + import System; + import System.Windows.Forms; + import Fiddler; + import System.Text.RegularExpressions; + + class Handlers + { + static function OnBeforeRequest(oS: Session) { + if( + oS.fullUrl.Contains("discord") || + oS.fullUrl.Contains("steam") || + oS.fullUrl.Contains("git") || + oS.fullUrl.Contains("yandex") + //you can add any addresses if some sites don't work + ) { + oS.Ignore(); + } + + if (!oS.oRequest.headers.HTTPMethod.Equals("CONNECT")) { + if(oS.fullUrl.Contains("gryphline.com") || oS.fullUrl.Contains("hg-cdn.com")) { + oS.fullUrl = oS.fullUrl.Replace("https://", "http://"); + oS.host = "localhost"; // place another ip if you need + oS.port = 5000; //and port + } + } + } + }; + ``` + By Xannix + Or you can use the mitmproxy command: + + ```shell + mitmproxy -s ak.py + ``` + + ak.py: + + ```py + import mitmproxy + from mitmproxy import ctx, http + class EndFieldModifier: + def requestheaders(self,flow: mitmproxy.http.HTTPFlow): + if "gryphline.com" in flow.request.host or "hg-cdn.com" in flow.request.host: + if flow.request.method=="CONNECT": + return + + flow.request.scheme="http" + flow.request.cookies.update({ + "OriginalHost":flow.request.host, + "OriginalUrl":flow.request.url + }) + flow.request.host="localhost" + flow.request.port=5000 + ctx.log.info("URL:"+flow.request.url) + + + + addons=[ + EndFieldModifier() + ] + ``` + +6. Run *Fiddler Classic* - it should start with the new *Custom Rules script* (you can check it in the *FiddlerScript* tab) +7. Run the Game Client and start to play! (Note: Only OS client is supported for now) +8. You must create an account using `account create (username)` in the server console, then login in the game with an email like `(username)@randomemailformathere.whatyouwant`. There is no password so you can input a random password for its field. + ## Additional Information You can find the description of all server commands [here](docs/CommandList/commands_en-US.md).
@@ -23,13 +108,10 @@ The list of all characters is [here](docs/CharactersTable.md).
The list of all items is [here](docs/ItemsTable.md).
If you want to open the in-game console, go to `Settings -> Platform & Account -> Account Settings (Access Account button)`. To view available commands, type `help`. -## Tutorial - -New tutorial will be added in the next days on the wiki, in the meanwhile you can ask help in the Discord server ## Discord for support -If you want to discuss, ask for support or help with this project, join our [Discord Server](https://discord.gg/eGGXymVd4K)! +If you want to discuss, ask for support or help with this project, join our [Discord Server](https://discord.gg/YZGYtAxeZk)! ## Note From 2e2469cf0051ca1eb3897cf59a45ecc04c2d9d16 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sat, 10 May 2025 17:45:59 +0200 Subject: [PATCH 40/58] Added GachaWeaponPoolTable but weapons banners not work (idk why) --- Campofinale/Packets/Sc/PacketScGachaSync.cs | 44 ++++++++++++++++++- Campofinale/Resource/ResourceManager.cs | 8 +++- .../Resource/Table/GachaWeaponPoolTable.cs | 11 +++++ 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 Campofinale/Resource/Table/GachaWeaponPoolTable.cs diff --git a/Campofinale/Packets/Sc/PacketScGachaSync.cs b/Campofinale/Packets/Sc/PacketScGachaSync.cs index 92a9137..c1c4601 100644 --- a/Campofinale/Packets/Sc/PacketScGachaSync.cs +++ b/Campofinale/Packets/Sc/PacketScGachaSync.cs @@ -30,8 +30,50 @@ namespace Campofinale.Packets.Sc WeaponGachaPool = new() { - } + }, + }; + foreach(var item in gachaWeaponPoolTable) + { + (int fiveStarPity, int sixStarPity, GachaTransaction? lastSixStar, bool isFiftyFiftyLost) + PityInfo = client.gachaManager.GetCurrentPity(item.Value.id); + ScdGachaPoolInfo wPool = new ScdGachaPoolInfo() + { + GachaPoolId = item.Value.id, + IsClosed = false, + CloseTime = DateTime.UtcNow.AddDays(20).ToUnixTimestampMilliseconds() / 1000, + OpenTime = DateTime.UtcNow.ToUnixTimestampMilliseconds() / 1000, + PublicCloseReason = 0, + + + }; + if (item.Value.closeTimes.Count == 0) + { + wPool.CloseTime = 0; + wPool.OpenTime = 0; + } + proto.WeaponGachaPool.GachaPoolInfos.Add(wPool); + proto.WeaponGachaPool.GachaPoolRoleDatas.Add(new ScdGachaPoolRoleData() + { + GachaPoolId = item.Value.id, + IsClosed = false, + PersonalCloseReason = 0, + SoftGuaranteeProgress = PityInfo.sixStarPity, + TotalPullCount = PityInfo.sixStarPity, + Star5SoftGuaranteeProgress = PityInfo.fiveStarPity, + HardGuaranteeProgress = PityInfo.sixStarPity, + + }); + proto.WeaponGachaPool.GachaPoolCategoryRoleDatas.Add(new ScdGachaPoolCategoryRoleData() + { + GachaPoolType = item.Value.type, + TotalPullCount = PityInfo.sixStarPity, + Star5SoftGuaranteeProgress = PityInfo.fiveStarPity, + SoftGuaranteeProgress = PityInfo.sixStarPity, + + }); + + } //TODO: Implement banner config for opentime etc foreach (var item in gachaCharPoolTable) { diff --git a/Campofinale/Resource/ResourceManager.cs b/Campofinale/Resource/ResourceManager.cs index 4c76a71..5583c83 100644 --- a/Campofinale/Resource/ResourceManager.cs +++ b/Campofinale/Resource/ResourceManager.cs @@ -37,15 +37,19 @@ namespace Campofinale.Resource public static Dictionary itemTable = new(); public static Dictionary domainDataTable = new(); public static Dictionary collectionTable = new(); - public static Dictionary gachaCharPoolTable = new(); public static Dictionary charBreakNodeTable = new(); public static Dictionary enemyAttributeTemplateTable = new(); public static Dictionary charLevelUpTable = new(); public static Dictionary expItemDataMap = new(); public static Dictionary charGrowthTable = new(); public static Dictionary weaponUpgradeTemplateTable = new(); + //Gacha + public static Dictionary gachaCharPoolTable = new(); public static Dictionary gachaCharPoolContentTable = new(); public static Dictionary gachaCharPoolTypeTable = new(); + + public static Dictionary gachaWeaponPoolTable = new(); + // public static Dictionary enemyTable = new(); public static Dictionary equipTable = new(); public static Dictionary equipSuitTable = new(); @@ -63,6 +67,8 @@ namespace Campofinale.Resource public static Dictionary itemTypeTable = new(); // public static Dictionary snsChatTable = new();// public static Dictionary giftItemTable = new(); + public static Dictionary missionDataTable = new(); + public static InteractiveTable interactiveTable = new(); // public static List levelDatas = new(); public static List interactiveData = new(); diff --git a/Campofinale/Resource/Table/GachaWeaponPoolTable.cs b/Campofinale/Resource/Table/GachaWeaponPoolTable.cs new file mode 100644 index 0000000..fb1be48 --- /dev/null +++ b/Campofinale/Resource/Table/GachaWeaponPoolTable.cs @@ -0,0 +1,11 @@ +namespace Campofinale.Resource.Table +{ + [TableCfgType("TableCfg/GachaWeaponPoolTable.json", LoadPriority.LOW)] + public class GachaWeaponPoolTable + { + public string id; + public int type; + public List upWeaponIds; + public List closeTimes; + } +} From 18414087f3df136d20ca9f7eb8347f7a32540e5b Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Tue, 13 May 2025 15:12:40 +0200 Subject: [PATCH 41/58] moved dispatch cn thing to it's own class --- Campofinale/Game/GameConstants.cs | 20 ++++ Campofinale/Http/Dispatch.cs | 55 +---------- Campofinale/Http/DispatchCN.cs | 91 +++++++++++++++++++ Campofinale/Packets/Cs/HandleCsLogin.cs | 28 +++++- .../Packets/Sc/PacketScSyncCharBagInfo.cs | 5 +- 5 files changed, 145 insertions(+), 54 deletions(-) create mode 100644 Campofinale/Http/DispatchCN.cs diff --git a/Campofinale/Game/GameConstants.cs b/Campofinale/Game/GameConstants.cs index 0f42e40..fa458d8 100644 --- a/Campofinale/Game/GameConstants.cs +++ b/Campofinale/Game/GameConstants.cs @@ -2,9 +2,29 @@ { public static class GameConstants { + //TODO, have to check if this is really userful for support different platform or if android version doesn't need the GAME_VERSION_ASSET_URL (probably not?) + //So, in case is useful only if the android build it's different than 0.5.28 + public static List GAME_VERSIONS = new() + { + new GameVersionConst("0.5.28"), //Windows CBT2 + new GameVersionConst("x.x.xx"), //Android CBT2 + + }; public static string GAME_VERSION = "0.5.28"; //CBT 2 + public static string public static string GAME_VERSION_ASSET_URL = "https://beyond.hg-cdn.com/uXUuLlNbIYmMMTlN/0.5/update/6/1/Windows/0.5.28_U1mgxrslUitdn3hb/files";//CBT 2 public static int MAX_TEAMS_NUMBER = 5; //Not used yet public static (long, string) SERVER_UID = (99, "99"); //Not used yet, no friend chat in current Beta } + public class GameVersionConst + { + public string GAME_VERSION = "0.5.28"; + public string GAME_VERSION_ASSET_URL = "https://beyond.hg-cdn.com/uXUuLlNbIYmMMTlN/0.5/update/6/1/Windows/0.5.28_U1mgxrslUitdn3hb/files";//CBT 2 + public GameVersionConst() { } + + public GameVersionConst(string version) + { + this.GAME_VERSION = version; + } + } } diff --git a/Campofinale/Http/Dispatch.cs b/Campofinale/Http/Dispatch.cs index 3778de7..aa372cd 100644 --- a/Campofinale/Http/Dispatch.cs +++ b/Campofinale/Http/Dispatch.cs @@ -97,17 +97,7 @@ namespace Campofinale.Http await ctx.Response.SendAsync(resp); } - [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/default/network_config")] - public static async Task network_config_cn(HttpContext ctx) - { - string resp = "{\"asset\":\"https://beyond.hg-cdn.com/asset/\",\"hgage\":\"\",\"sdkenv\":\"2\",\"u8root\":\"https://u8.gryphline.com/u8\",\"appcode\":4,\"channel\":\"prod\",\"netlogid\":\"GFz8RRMDN45w\",\"gameclose\":false,\"netlogurl\":\"http://native-log-collect.gryphline.com:32000/\",\"accounturl\":\"https://binding-api-account-prod.gryphline.com\",\"launcherurl\":\"https://launcher.gryphline.com\"}"; - - ctx.Response.StatusCode = 200; - ctx.Response.ContentLength = resp.Length; - ctx.Response.ContentType = "application/json"; - - await ctx.Response.SendAsync(resp); - } + [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/1003/prod-cbt/default/Windows/game_config")] public static async Task game_config(HttpContext ctx) { @@ -119,17 +109,7 @@ namespace Campofinale.Http await ctx.Response.SendAsync(resp); } - [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/Windows/game_config")] - public static async Task game_config_cn(HttpContext ctx) - { - string resp = "{\"mockLogin\": false, \"selectSrv\": false, \"enableHotUpdate\": false, \"enableEntitySpawnLog\": false}"; - - ctx.Response.StatusCode = 200; - ctx.Response.ContentLength = resp.Length; - ctx.Response.ContentType = "application/json"; - - await ctx.Response.SendAsync(resp); - } + [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/gameBulletin/version")] public static async Task Version(HttpContext ctx) { @@ -166,35 +146,8 @@ namespace Campofinale.Http public string password; } - [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/Windows/res_version")] - public static async Task cn_res_version(HttpContext ctx) - { - - string resp = "{\"version\": \"2089329-32\", \"kickFlag\": true}"; - - - ctx.Response.StatusCode = 200; - //ctx.Response.ContentLength = resp.Length; - ctx.Response.ContentType = "application/json"; - - await ctx.Response.SendAsync(resp); - } - - [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/default/server_config_China")] - public static async Task server_config_China(HttpContext ctx) - { - string requestBody = ctx.Request.DataAsString; - Console.WriteLine(requestBody); - string resp = "{\"addr\": \"" + Server.config.gameServer.accessAddress + "\", \"port\": " + Server.config.gameServer.accessPort + "}"; - - - - ctx.Response.StatusCode = 200; - - ctx.Response.ContentType = "application/json"; - - await ctx.Response.SendAsync(resp); - } + + [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/1003/prod-cbt/default/default/server_config_EUAndUS")] public static async Task server_config_EUAndUS(HttpContext ctx) { diff --git a/Campofinale/Http/DispatchCN.cs b/Campofinale/Http/DispatchCN.cs new file mode 100644 index 0000000..20e00b5 --- /dev/null +++ b/Campofinale/Http/DispatchCN.cs @@ -0,0 +1,91 @@ +using HttpServerLite; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Campofinale.Http +{ + internal class DispatchCN + { + //SERVER + [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/default/server_config_China")] + public static async Task server_config_China(HttpContext ctx) + { + string requestBody = ctx.Request.DataAsString; + Console.WriteLine(requestBody); + string resp = "{\"addr\": \"" + Server.config.gameServer.accessAddress + "\", \"port\": " + Server.config.gameServer.accessPort + "}"; + + + + ctx.Response.StatusCode = 200; + + ctx.Response.ContentType = "application/json"; + + await ctx.Response.SendAsync(resp); + } + //DEFAULT + [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/default/network_config")] + public static async Task network_config_cn(HttpContext ctx) + { + string resp = "{\"asset\":\"https://beyond.hg-cdn.com/asset/\",\"hgage\":\"\",\"sdkenv\":\"2\",\"u8root\":\"https://u8.gryphline.com/u8\",\"appcode\":4,\"channel\":\"prod\",\"netlogid\":\"GFz8RRMDN45w\",\"gameclose\":false,\"netlogurl\":\"http://native-log-collect.gryphline.com:32000/\",\"accounturl\":\"https://binding-api-account-prod.gryphline.com\",\"launcherurl\":\"https://launcher.gryphline.com\"}"; + + ctx.Response.StatusCode = 200; + ctx.Response.ContentLength = resp.Length; + ctx.Response.ContentType = "application/json"; + + await ctx.Response.SendAsync(resp); + } + //WINDOWS + [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/Windows/res_version")] + public static async Task cn_res_version(HttpContext ctx) + { + + string resp = "{\"version\": \"2089329-32\", \"kickFlag\": true}"; + + + ctx.Response.StatusCode = 200; + //ctx.Response.ContentLength = resp.Length; + ctx.Response.ContentType = "application/json"; + + await ctx.Response.SendAsync(resp); + } + [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/Windows/game_config")] + public static async Task game_config_cn_windows(HttpContext ctx) + { + string resp = "{\"mockLogin\": false, \"selectSrv\": false, \"enableHotUpdate\": true, \"enableEntitySpawnLog\": false}"; + + ctx.Response.StatusCode = 200; + ctx.Response.ContentLength = resp.Length; + ctx.Response.ContentType = "application/json"; + + await ctx.Response.SendAsync(resp); + } + //ANDROID + [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/Android/res_version")] + public static async Task cn_android_res_version(HttpContext ctx) + { + + string resp = "{\"version\": \"2332867-572\", \"kickFlag\": true}"; + + + ctx.Response.StatusCode = 200; + //ctx.Response.ContentLength = resp.Length; + ctx.Response.ContentType = "application/json"; + + await ctx.Response.SendAsync(resp); + } + [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/Android/game_config")] + public static async Task game_config_cn_android(HttpContext ctx) + { + string resp = "{\"mockLogin\": false, \"selectSrv\": false, \"enableHotUpdate\": true, \"enableEntitySpawnLog\": false}"; + + ctx.Response.StatusCode = 200; + ctx.Response.ContentLength = resp.Length; + ctx.Response.ContentType = "application/json"; + + await ctx.Response.SendAsync(resp); + } + } +} diff --git a/Campofinale/Packets/Cs/HandleCsLogin.cs b/Campofinale/Packets/Cs/HandleCsLogin.cs index 96307fe..6cf7e6d 100644 --- a/Campofinale/Packets/Cs/HandleCsLogin.cs +++ b/Campofinale/Packets/Cs/HandleCsLogin.cs @@ -186,15 +186,38 @@ namespace Campofinale.Packets.Cs ScSyncAllMission m = Newtonsoft.Json.JsonConvert.DeserializeObject(json1); m.TrackMissionId = ""; + session.Send(ScMsgId.ScSyncAllMission, m); - /*session.Send(ScMsgId.ScSyncAllMission, new ScSyncAllMission() + /* session.Send(ScMsgId.ScSyncAllMission, new ScSyncAllMission() { + NewMissionTags = + { + new NewMissionTag() + { + MissionId="e0m0", + QuestId="e0m0_q#1", + } + }, + Missions = { {"e0m0", new Mission() { MissionId="e0m0", MissionState=(int)MissionState.Processing, + SucceedId=-1, + Properties = + { + {1,new DynamicParameter() + { + RealType=1, + ValueType=1, + ValueBoolList = + { + true + } + } } + } } } }, TrackMissionId = "e0m0", @@ -209,8 +232,9 @@ namespace Campofinale.Packets.Cs { new QuestObjective() { - ConditionId="", + ConditionId="f6415b84", + IsComplete=false } } } } diff --git a/Campofinale/Packets/Sc/PacketScSyncCharBagInfo.cs b/Campofinale/Packets/Sc/PacketScSyncCharBagInfo.cs index 4088750..e456948 100644 --- a/Campofinale/Packets/Sc/PacketScSyncCharBagInfo.cs +++ b/Campofinale/Packets/Sc/PacketScSyncCharBagInfo.cs @@ -25,7 +25,10 @@ namespace Campofinale.Packets.Sc }, }; - client.chars.ForEach(c => proto.CharInfo.Add(c.ToProto())); + client.chars.ForEach(c => + { + proto.CharInfo.Add(c.ToProto()); + }); client.teams.ForEach(c => { proto.TeamInfo.Add(new CharTeamInfo() From 8fc6d623b070267161bd3b8197f31f761173210d Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Fri, 16 May 2025 21:32:38 +0200 Subject: [PATCH 42/58] levelscript starting --- Campofinale/ConfigFile.cs | 2 +- Campofinale/Game/GameConstants.cs | 1 - Campofinale/Packets/Cs/HandleCsLogin.cs | 87 ++++--------------- .../Cs/HandleCsSceneSetLevelScriptActive.cs | 53 +++++++++++ .../Packets/Sc/PacketScSelfSceneInfo.cs | 3 +- .../Packets/Sc/PacketScSyncBaseData.cs | 7 +- 6 files changed, 74 insertions(+), 79 deletions(-) create mode 100644 Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs diff --git a/Campofinale/ConfigFile.cs b/Campofinale/ConfigFile.cs index 206b408..15b1281 100644 --- a/Campofinale/ConfigFile.cs +++ b/Campofinale/ConfigFile.cs @@ -10,7 +10,7 @@ } public class ServerOptions { - public int defaultSceneNumId = 98; + public int defaultSceneNumId = 87; public int maxPlayers = 20; public CharactersOptions defaultCharacters = new(); public ServerOptions() diff --git a/Campofinale/Game/GameConstants.cs b/Campofinale/Game/GameConstants.cs index fa458d8..8bc42e0 100644 --- a/Campofinale/Game/GameConstants.cs +++ b/Campofinale/Game/GameConstants.cs @@ -11,7 +11,6 @@ }; public static string GAME_VERSION = "0.5.28"; //CBT 2 - public static string public static string GAME_VERSION_ASSET_URL = "https://beyond.hg-cdn.com/uXUuLlNbIYmMMTlN/0.5/update/6/1/Windows/0.5.28_U1mgxrslUitdn3hb/files";//CBT 2 public static int MAX_TEAMS_NUMBER = 5; //Not used yet public static (long, string) SERVER_UID = (99, "99"); //Not used yet, no friend chat in current Beta diff --git a/Campofinale/Packets/Cs/HandleCsLogin.cs b/Campofinale/Packets/Cs/HandleCsLogin.cs index 6cf7e6d..6828198 100644 --- a/Campofinale/Packets/Cs/HandleCsLogin.cs +++ b/Campofinale/Packets/Cs/HandleCsLogin.cs @@ -12,11 +12,16 @@ namespace Campofinale.Packets.Cs { public class HandleCsLogin { - [Server.Handler(CsMsgId.CsCreateRole)] - public static void HandleCsCreateRole(Player session, CsMsgId cmdId, Packet packet) + [Server.Handler(CsMsgId.CsSetGender)] + public static void HandleCsSetGender(Player session, CsMsgId cmdId, Packet packet) { - CsCreateRole req = packet.DecodeBody(); - + CsSetGender req = packet.DecodeBody(); + ScSetGender rsp = new() + { + Gender = req.Gender, + }; + session.gender = rsp.Gender; + session.Send(ScMsgId.ScSetGender, rsp); } [Server.Handler(CsMsgId.CsLogin)] @@ -121,65 +126,6 @@ namespace Campofinale.Packets.Cs session.Send(new PacketScItemBagScopeSync(session, ItemValuableDepotType.SpecialItem)); session.Send(new PacketScSyncAllMail(session)); session.Send(new PacketScSceneCollectionSync(session)); - /*ScSyncAllMission missions = new() - { - Missions = - { - {"e0m0", - new Mission() - { - MissionId="e0m0", - MissionState=(int)MissionState.Processing, - Properties = - { - {1,new DynamicParameter() - { - ValueType=1, - RealType=1, - ValueBoolList = - { - true - } - } - }, - {2,new DynamicParameter() - { - ValueType=1, - RealType=1, - ValueBoolList = - { - false - } - } - }, - {3,new DynamicParameter() - { - ValueType=1, - RealType=1, - ValueBoolList = - { - false - } - } - } - } - } - } - }, - TrackMissionId= "e0m0", - CurQuests = - { - {"e0m0#1", new Quest(){ - QuestId="e0m0#1", - QuestState=2, - QuestObjectives = - { - - } - }} - } - };*/ - //session.Send(ScMessageId.ScSyncAllMission, missions); string json1 = File.ReadAllText("44_ScSyncAllMission.json"); @@ -187,16 +133,12 @@ namespace Campofinale.Packets.Cs m.TrackMissionId = ""; - session.Send(ScMsgId.ScSyncAllMission, m); - /* session.Send(ScMsgId.ScSyncAllMission, new ScSyncAllMission() + //session.Send(ScMsgId.ScSyncAllMission, m); + session.Send(ScMsgId.ScSyncAllMission, new ScSyncAllMission() { NewMissionTags = { - new NewMissionTag() - { - MissionId="e0m0", - QuestId="e0m0_q#1", - } + }, Missions = @@ -214,7 +156,7 @@ namespace Campofinale.Packets.Cs ValueType=1, ValueBoolList = { - true + false } } } } @@ -224,6 +166,7 @@ namespace Campofinale.Packets.Cs CurQuests = { + {"e0m0_q#1", new Quest() { QuestId="e0m0_q#1", @@ -239,7 +182,7 @@ namespace Campofinale.Packets.Cs } } } } - });*/ + }); session.Send(new PacketScGachaSync(session)); ScSettlementSyncAll settlements = new ScSettlementSyncAll() diff --git a/Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs b/Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs new file mode 100644 index 0000000..4ceb335 --- /dev/null +++ b/Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs @@ -0,0 +1,53 @@ +using Campofinale.Game.Character; +using Campofinale.Game.Entities; +using Campofinale.Network; +using Campofinale.Protocol; + +namespace Campofinale.Packets.Cs +{ + public class HandleCsSceneSetLevelScriptActive + { + [Server.Handler(CsMsgId.CsSceneSetLevelScriptActive)] + public static void Handle(Player session, CsMsgId cmdId, Packet packet) + { + CsSceneSetLevelScriptActive req = packet.DecodeBody(); + + ScSceneLevelScriptStateNotify rsp = new ScSceneLevelScriptStateNotify() + { + SceneNumId = req.SceneNumId, + ScriptId = req.ScriptId, + State = 3 + }; + session.Send(ScMsgId.ScSceneLevelScriptStateNotify, rsp); + + } + + [Server.Handler(CsMsgId.CsSceneSetLevelScriptStart)] + public static void HandleCsSceneSetLevelScriptStart(Player session, CsMsgId cmdId, Packet packet) + { + CsSceneSetLevelScriptStart req = packet.DecodeBody(); + ScSceneLevelScriptStateNotify rsp = new ScSceneLevelScriptStateNotify() + { + SceneNumId = req.SceneNumId, + ScriptId = req.ScriptId, + State = 4 + }; + session.Send(ScMsgId.ScSceneLevelScriptStateNotify, rsp); + + } + + [Server.Handler(CsMsgId.CsSceneLevelScriptEventTrigger)] + public static void HandleCsSceneLevelScriptEventTrigger(Player session, CsMsgId cmdId, Packet packet) + { + CsSceneLevelScriptEventTrigger req = packet.DecodeBody(); + + ScSceneLevelScriptEventTrigger rsp = new ScSceneLevelScriptEventTrigger() + { + + }; + + session.Send(ScMsgId.ScSceneLevelScriptEventTrigger, rsp,packet.csHead.UpSeqid); + + } + } +} \ No newline at end of file diff --git a/Campofinale/Packets/Sc/PacketScSelfSceneInfo.cs b/Campofinale/Packets/Sc/PacketScSelfSceneInfo.cs index a7a86d3..cb08b06 100644 --- a/Campofinale/Packets/Sc/PacketScSelfSceneInfo.cs +++ b/Campofinale/Packets/Sc/PacketScSelfSceneInfo.cs @@ -66,12 +66,13 @@ namespace Campofinale.Packets.Sc { ScriptId = l.scriptId, IsDone = false, - State = 1, + State = 2, }; int i = 0; foreach (var item in l.properties) { + DynamicParameter p=item.ToProto(); if (p != null) script.Properties.Add(l.GetPropertyId(item.key,script.Properties.Keys.ToList()), p); diff --git a/Campofinale/Packets/Sc/PacketScSyncBaseData.cs b/Campofinale/Packets/Sc/PacketScSyncBaseData.cs index cad8c4b..305bc6d 100644 --- a/Campofinale/Packets/Sc/PacketScSyncBaseData.cs +++ b/Campofinale/Packets/Sc/PacketScSyncBaseData.cs @@ -12,13 +12,12 @@ namespace Campofinale.Packets.Sc { Roleid = client.roleId, Level = client.level, - Exp=client.xp, + Exp = client.xp, RoleName = client.nickname, Gender = client.gender, - ShortId="1", - - }; + ShortId = "1", + }; SetData(ScMsgId.ScSyncBaseData, proto); } From 91103aaac80e9e1e5ce7ffdc176cfc0432fe4a7a Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Fri, 16 May 2025 22:53:22 +0200 Subject: [PATCH 43/58] re hardcoded missions from pcap for now --- Campofinale/Packets/Cs/HandleCsLogin.cs | 6 ++--- .../Cs/HandleCsSceneSetLevelScriptActive.cs | 25 +++++++++++++++++-- Campofinale/Resource/LongBitSet.cs | 12 +++++++-- 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/Campofinale/Packets/Cs/HandleCsLogin.cs b/Campofinale/Packets/Cs/HandleCsLogin.cs index 6828198..a72b3f3 100644 --- a/Campofinale/Packets/Cs/HandleCsLogin.cs +++ b/Campofinale/Packets/Cs/HandleCsLogin.cs @@ -133,8 +133,8 @@ namespace Campofinale.Packets.Cs m.TrackMissionId = ""; - //session.Send(ScMsgId.ScSyncAllMission, m); - session.Send(ScMsgId.ScSyncAllMission, new ScSyncAllMission() + session.Send(ScMsgId.ScSyncAllMission, m); + /* session.Send(ScMsgId.ScSyncAllMission, new ScSyncAllMission() { NewMissionTags = { @@ -182,7 +182,7 @@ namespace Campofinale.Packets.Cs } } } } - }); + });*/ session.Send(new PacketScGachaSync(session)); ScSettlementSyncAll settlements = new ScSettlementSyncAll() diff --git a/Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs b/Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs index 4ceb335..17a76e3 100644 --- a/Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs +++ b/Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs @@ -39,14 +39,35 @@ namespace Campofinale.Packets.Cs [Server.Handler(CsMsgId.CsSceneLevelScriptEventTrigger)] public static void HandleCsSceneLevelScriptEventTrigger(Player session, CsMsgId cmdId, Packet packet) { - CsSceneLevelScriptEventTrigger req = packet.DecodeBody(); + CsSceneLevelScriptEventTrigger req = packet.DecodeBody(); + ScSceneUpdateLevelScriptProperty update1 = new() + { + SceneNumId = req.SceneNumId, + ScriptId = req.ScriptId, + + }; + session.Send(ScMsgId.ScSceneUpdateLevelScriptProperty, update1); + ScSceneTriggerClientLevelScriptEvent trigger = new() + { + EventName = req.EventName, + SceneNumId = req.SceneNumId, + ScriptId = req.ScriptId + }; + session.Send(ScMsgId.ScSceneTriggerClientLevelScriptEvent, trigger); + ScSceneUpdateLevelScriptProperty update2 = new() + { + SceneNumId = req.SceneNumId, + ScriptId = req.ScriptId, + + }; + session.Send(ScMsgId.ScSceneUpdateLevelScriptProperty, update2); ScSceneLevelScriptEventTrigger rsp = new ScSceneLevelScriptEventTrigger() { }; - session.Send(ScMsgId.ScSceneLevelScriptEventTrigger, rsp,packet.csHead.UpSeqid); + session.Send(ScMsgId.ScSceneLevelScriptEventTrigger, rsp); } } diff --git a/Campofinale/Resource/LongBitSet.cs b/Campofinale/Resource/LongBitSet.cs index 0e2aca4..b6308a8 100644 --- a/Campofinale/Resource/LongBitSet.cs +++ b/Campofinale/Resource/LongBitSet.cs @@ -32,10 +32,18 @@ max = values.Max(); } InitializeWithBitCount(max); - foreach(var i in values) + try { - SetBit(i, true); + foreach (var i in values) + { + SetBit(i, true); + } } + catch (Exception ex) + { + + } + } public LongBitSet(ulong[] bits) From 27c8a06a4fcd91aeeda6d53731c3f5b5379584f2 Mon Sep 17 00:00:00 2001 From: Hexafluorine Date: Fri, 16 May 2025 14:24:43 -0700 Subject: [PATCH 44/58] Reduce Log Spam --- Campofinale/Network/Packet.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Campofinale/Network/Packet.cs b/Campofinale/Network/Packet.cs index 817f0d9..c1efd84 100644 --- a/Campofinale/Network/Packet.cs +++ b/Campofinale/Network/Packet.cs @@ -186,7 +186,7 @@ namespace Campofinale.Network Array.Copy(byteArray, 3, csHeadBytes, 0, headLength); Array.Copy(byteArray, 3+ headLength, BodyBytes, 0, bodyLength); CSHead csHead_ = CSHead.Parser.ParseFrom(csHeadBytes); - if (Server.config.logOptions.packets) + if (Server.config.logOptions.packets && !Server.csMessageToHide.Contains((CsMsgId)csHead_.Msgid)) { Logger.Print(csHead_.ToString()); } From 4432406caa51d43560c697cd3fd63b39c5d6b4d8 Mon Sep 17 00:00:00 2001 From: Hexafluorine Date: Fri, 16 May 2025 16:40:53 -0700 Subject: [PATCH 45/58] Improve Logging --- Campofinale/ConfigFile.cs | 6 ++++-- Campofinale/Logger.cs | 5 +++++ Campofinale/Network/Packet.cs | 8 ++++---- Campofinale/Packets/Cs/HandleCsMergeMsg.cs | 11 ++++++++--- Campofinale/Player.cs | 7 +++++-- Campofinale/Program.cs | 4 ++-- Campofinale/Server.cs | 14 ++++++++++---- 7 files changed, 38 insertions(+), 17 deletions(-) diff --git a/Campofinale/ConfigFile.cs b/Campofinale/ConfigFile.cs index 15b1281..2f7d1b9 100644 --- a/Campofinale/ConfigFile.cs +++ b/Campofinale/ConfigFile.cs @@ -31,8 +31,10 @@ } public class LogSettings { - public bool packets; - public bool debugPrint=false; + public bool packets = true; + public bool packetWarnings = true; + public bool packetBodies = false; + public bool debugPrint = false; public LogSettings() { diff --git a/Campofinale/Logger.cs b/Campofinale/Logger.cs index 18d62f1..fab9939 100644 --- a/Campofinale/Logger.cs +++ b/Campofinale/Logger.cs @@ -1,3 +1,5 @@ +using Campofinale; + using Pastel; using System.Diagnostics; public static class Logger @@ -44,6 +46,9 @@ public static class Logger /// public static void PrintWarn(string text) { + if (!Server.config.logOptions.packetWarnings) + return; + string className = GetCallingClassName(); Logger.Log(text); string prefix = "<" + "WARN".Pastel("ff9100") + $":{className.Pastel("999")}>"; diff --git a/Campofinale/Network/Packet.cs b/Campofinale/Network/Packet.cs index c1efd84..2e0437c 100644 --- a/Campofinale/Network/Packet.cs +++ b/Campofinale/Network/Packet.cs @@ -134,7 +134,7 @@ namespace Campofinale.Network PutByteArray(data, head.ToByteArray(), 3); PutByteArray(data, body.ToByteArray(), 3+head.ToByteArray().Length); if(Server.config.logOptions.packets && !Server.scMessageToHide.Contains((ScMsgId)msgId)) - Logger.Print($"Sending packet: {((ScMsgId)msgId).ToString().Pastel(Color.LightBlue)} id: {msgId} with {data.Length} bytes"); + Logger.Print($"Sending Packet: {((ScMsgId)msgId).ToString().Pastel(Color.LightBlue)} Id: {msgId} with {data.Length} Bytes"); return data; } @@ -166,7 +166,7 @@ namespace Campofinale.Network PutByteArray(data, head.ToByteArray(), 3); PutByteArray(data, body, 3 + head.ToByteArray().Length); if (Server.config.logOptions.packets && !Server.scMessageToHide.Contains((ScMsgId)msgId)) - Logger.Print($"Sending packet: {((ScMsgId)msgId).ToString().Pastel(Color.LightBlue)} id: {msgId} with {data.Length} bytes"); + Logger.Print($"Sending Packet: {((ScMsgId)msgId).ToString().Pastel(Color.LightBlue)} Id: {msgId} with {data.Length} Bytes"); return data; } @@ -186,10 +186,10 @@ namespace Campofinale.Network Array.Copy(byteArray, 3, csHeadBytes, 0, headLength); Array.Copy(byteArray, 3+ headLength, BodyBytes, 0, bodyLength); CSHead csHead_ = CSHead.Parser.ParseFrom(csHeadBytes); - if (Server.config.logOptions.packets && !Server.csMessageToHide.Contains((CsMsgId)csHead_.Msgid)) + /*if (Server.config.logOptions.packets && !Server.csMessageToHide.Contains((CsMsgId)csHead_.Msgid)) { Logger.Print(csHead_.ToString()); - } + }*/ seqNext = csHead_.UpSeqid; return new Packet() { csHead = csHead_, finishedBody = BodyBytes,cmdId=csHead_.Msgid }; } diff --git a/Campofinale/Packets/Cs/HandleCsMergeMsg.cs b/Campofinale/Packets/Cs/HandleCsMergeMsg.cs index b5e667c..a9deac4 100644 --- a/Campofinale/Packets/Cs/HandleCsMergeMsg.cs +++ b/Campofinale/Packets/Cs/HandleCsMergeMsg.cs @@ -1,6 +1,10 @@ -using Campofinale.Network; +using System.Drawing; + +using Campofinale.Network; using Campofinale.Protocol; +using Pastel; + namespace Campofinale.Packets.Cs { public class HandleCsMergeMsg @@ -30,8 +34,9 @@ namespace Campofinale.Packets.Cs }; if (Server.config.logOptions.packets) { - Logger.Print("CmdId: " + (CsMsgId)packet.csHead.Msgid); - Logger.Print(BitConverter.ToString(packet.finishedBody).Replace("-", string.Empty).ToLower()); + Logger.Print("Recieved Packet: " + ((CsMsgId)packet.csHead.Msgid).ToString().Pastel(Color.LightCyan) + $" Id: {packet.csHead.Msgid} with {packet.finishedBody.Length} Bytes"); + if (Server.config.logOptions.packetBodies) + Logger.Print(BitConverter.ToString(packet.finishedBody).Replace("-", string.Empty).ToLower()); } try diff --git a/Campofinale/Player.cs b/Campofinale/Player.cs index 7690b3e..14fff30 100644 --- a/Campofinale/Player.cs +++ b/Campofinale/Player.cs @@ -14,6 +14,8 @@ using Campofinale.Game.Spaceship; using Campofinale.Game.Dungeons; using Campofinale.Game.Factory; using Campofinale.Game.Mission; +using Pastel; +using System.Drawing; namespace Campofinale @@ -504,8 +506,9 @@ namespace Campofinale if (Server.config.logOptions.packets && !Server.csMessageToHide.Contains((CsMsgId)packet.csHead.Msgid)) { - Logger.Print("CmdId: " + (CsMsgId)packet.csHead.Msgid); - Logger.Print(BitConverter.ToString(packet.finishedBody).Replace("-", string.Empty).ToLower()); + Logger.Print("Recieved Packet: " + ((CsMsgId)packet.csHead.Msgid).ToString().Pastel(Color.LightCyan) + $" Id: {packet.csHead.Msgid} with {packet.finishedBody.Length} Bytes"); + if (Server.config.logOptions.packetBodies) + Logger.Print(BitConverter.ToString(packet.finishedBody).Replace("-", string.Empty).ToLower()); } try diff --git a/Campofinale/Program.cs b/Campofinale/Program.cs index 6b43f01..0d54c17 100644 --- a/Campofinale/Program.cs +++ b/Campofinale/Program.cs @@ -12,7 +12,7 @@ class Program { Console.Title = "Initializing..."; - bool disableLogs = args.Length > 0 && args[0].ToLower() == "nologs"; + //bool disableLogs = args.Length > 0 && args[0].ToLower() == "nologs"; ConfigFile config = new ConfigFile(); if (File.Exists("server_config.json")) @@ -23,7 +23,7 @@ class Program new Thread(() => { - new Server().Start(disableLogs, config); + new Server().Start(config); }).Start(); AppDomain.CurrentDomain.ProcessExit += (_, _) => { diff --git a/Campofinale/Server.cs b/Campofinale/Server.cs index 017f802..f842f0b 100644 --- a/Campofinale/Server.cs +++ b/Campofinale/Server.cs @@ -51,6 +51,8 @@ namespace Campofinale public static string ServerVersion = "1.1.2-dev"; public static bool Initialized = false; public static bool showLogs = true; + public static bool showWarningLogs = true; + public static bool showBodyLogs = false; public static Dispatch dispatch; public static ResourceManager resourceManager; public static ConfigFile config; @@ -60,7 +62,7 @@ namespace Campofinale { return resourceManager; } - public void Start(bool hideLogs = false, ConfigFile config = null) + public void Start(ConfigFile config) { { Assembly assembly = Assembly.GetExecutingAssembly(); @@ -77,10 +79,14 @@ namespace Campofinale } Logger.Initialize(); - Logger.Print($"Starting server version {ServerVersion} with supported client version {GameConstants.GAME_VERSION}"); - showLogs = !hideLogs; - Logger.Print($"Logs are {(showLogs ? "enabled" : "disabled")}"); Server.config = config; + showLogs = config.logOptions.packets; + showWarningLogs = config.logOptions.packetWarnings; + showBodyLogs = config.logOptions.packetBodies; + Logger.Print($"Starting server version {ServerVersion} with supported client version {GameConstants.GAME_VERSION}"); + Logger.Print($"Logs are {(showLogs ? "enabled" : "disabled")}"); + Logger.Print($"Warning logs are {(showWarningLogs ? "enabled" : "disabled")}"); + Logger.Print($"Packet body logs are {(showBodyLogs ? "enabled" : "disabled")}"); StartDBService(); DatabaseManager.Init(); ResourceManager.Init(); From e75ada13c07797047a35c819b34917c37613925c Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sat, 17 May 2025 19:44:21 +0200 Subject: [PATCH 46/58] hardcoded stuff and every entity is sent only one time when the distance is lower than 250 --- Campofinale/Game/SceneManager.cs | 64 +++++++++++++------ Campofinale/Packets/Cs/HandleCsLogin.cs | 46 ++++++++++++- .../Cs/HandleCsSceneSetLevelScriptActive.cs | 56 +++++++++++++++- Campofinale/Resource/ResourceManager.cs | 9 +-- 4 files changed, 147 insertions(+), 28 deletions(-) diff --git a/Campofinale/Game/SceneManager.cs b/Campofinale/Game/SceneManager.cs index 096d1d6..31952cc 100644 --- a/Campofinale/Game/SceneManager.cs +++ b/Campofinale/Game/SceneManager.cs @@ -301,7 +301,7 @@ namespace Campofinale.Game lv_scene.levelData.interactives.ForEach(en => { - if (en.defaultHide || GetOwner().noSpawnAnymore.Contains(en.levelLogicId)) + if (GetOwner().noSpawnAnymore.Contains(en.levelLogicId) && sceneNumId != 87) { return; } @@ -318,7 +318,7 @@ namespace Campofinale.Game }); lv_scene.levelData.factoryRegions.ForEach(en => { - if (en.defaultHide || GetOwner().noSpawnAnymore.Contains(en.levelLogicId)) + if (GetOwner().noSpawnAnymore.Contains(en.levelLogicId) && sceneNumId!=87) { return; } @@ -329,11 +329,12 @@ namespace Campofinale.Game levelLogicId = en.levelLogicId, type = en.entityType, }; + entities.Add(entity); }); lv_scene.levelData.enemies.ForEach(en => { - if(en.defaultHide || GetOwner().noSpawnAnymore.Contains(en.levelLogicId)) return; + if(GetOwner().noSpawnAnymore.Contains(en.levelLogicId) && sceneNumId != 87) return; EntityMonster entity = new(en.entityDataIdKey,en.level,ownerId,en.position,en.rotation, sceneNumId, en.levelLogicId) { type=en.entityType, @@ -344,7 +345,7 @@ namespace Campofinale.Game }); lv_scene.levelData.npcs.ForEach(en => { - if (en.defaultHide) return; + if (en.npcGroupId.Contains("chr")) return; EntityNpc entity = new(en.entityDataIdKey,ownerId,en.position,en.rotation, sceneNumId, en.levelLogicId) { @@ -355,48 +356,71 @@ namespace Campofinale.Game }; entities.Add(entity); }); - /*GetEntityExcludingChar().ForEach(e => + GetEntityExcludingChar().ForEach(e => { - GetOwner().Send(new PacketScObjectEnterView(GetOwner(),new List() { e})); - });*/ + GetOwner().Send(new PacketScObjectEnterView(GetOwner(), new List() { e})); + + }); UpdateShowEntities(); + + } + public void SpawnEntity(Entity en,bool spawnedCheck=true) + { + en.spawned = true; + List toSpawn = new List(); + toSpawn.Add(en); + if (spawnedCheck) + { + foreach (Entity e in GetEntityExcludingChar().FindAll(e => e.belongLevelScriptId == en.belongLevelScriptId && e.spawned == false)) + { + e.spawned = true; + toSpawn.Add(e); + } + } + else + { + foreach (Entity e in GetEntityExcludingChar().FindAll(e => e.belongLevelScriptId == en.belongLevelScriptId && e != en)) + { + e.spawned = true; + toSpawn.Add(e); + } + } + toSpawn.ForEach(e => + { + //GetOwner().Send(new PacketScObjectEnterView(GetOwner(), new List() { e})); + }); + UpdateShowEntities(); } public void UpdateShowEntities() { foreach(Entity en in GetEntityExcludingChar()) { - if (en.Position.Distance(GetOwner().position) < 200) + if (en.Position.Distance(GetOwner().position) < 250) { if (!en.spawned) { - en.spawned = true; - try - { - GetOwner().Send(new PacketScObjectEnterView(GetOwner(), new List() { en })); - } - catch(Exception e) - { - - } + SpawnEntity(en); + } } else { - if (en.spawned) + + /*if (en.spawned) { en.spawned = false; GetOwner().Send(new PacketScObjectLeaveView(GetOwner(), new List() { en.guid })); en.Position=en.BornPos; en.Rotation = en.Rotation; - } + }*/ } } } - + public Player GetOwner() { return Server.clients.Find(c => c.roleId == ownerId); diff --git a/Campofinale/Packets/Cs/HandleCsLogin.cs b/Campofinale/Packets/Cs/HandleCsLogin.cs index a72b3f3..195186d 100644 --- a/Campofinale/Packets/Cs/HandleCsLogin.cs +++ b/Campofinale/Packets/Cs/HandleCsLogin.cs @@ -133,8 +133,8 @@ namespace Campofinale.Packets.Cs m.TrackMissionId = ""; - session.Send(ScMsgId.ScSyncAllMission, m); - /* session.Send(ScMsgId.ScSyncAllMission, new ScSyncAllMission() + // session.Send(ScMsgId.ScSyncAllMission, m); + session.Send(ScMsgId.ScSyncAllMission, new ScSyncAllMission() { NewMissionTags = { @@ -180,9 +180,49 @@ namespace Campofinale.Packets.Cs IsComplete=false } } + } }, + {"e0m0_q#2", new Quest() + { + QuestId="e0m0_q#2", + QuestState=(int)QuestState.Available, + QuestObjectives = + { + new QuestObjective() + { + ConditionId="81736ca7", + IsComplete=false, + } + } + } }, + {"e0m0_q#3", new Quest() + { + QuestId="e0m0_q#3", + QuestState=(int)QuestState.Available, + QuestObjectives = + { + + } + } }, + {"e0m0_q#4", new Quest() + { + QuestId="e0m0_q#4", + QuestState=(int)QuestState.Available, + QuestObjectives = + { + + } + } }, + {"e0m0_q#5", new Quest() + { + QuestId="e0m0_q#5", + QuestState=(int)QuestState.Available, + QuestObjectives = + { + + } } } } - });*/ + }); session.Send(new PacketScGachaSync(session)); ScSettlementSyncAll settlements = new ScSettlementSyncAll() diff --git a/Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs b/Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs index 17a76e3..21f2384 100644 --- a/Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs +++ b/Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs @@ -2,6 +2,7 @@ using Campofinale.Game.Entities; using Campofinale.Network; using Campofinale.Protocol; +using Campofinale.Resource; namespace Campofinale.Packets.Cs { @@ -41,6 +42,59 @@ namespace Campofinale.Packets.Cs { CsSceneLevelScriptEventTrigger req = packet.DecodeBody(); + Logger.Print(req.Properties.ToString()); + if(req.EventName== "#8777e316") + { + session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate() + { + QuestId = "e0m0_q#1", + QuestState = (int)QuestState.Completed, + }); + session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate() + { + QuestId = "e0m0_q#2", + QuestState = (int)QuestState.Processing, + }); + } + if(req.EventName== "#6ea2690d") + { + session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate() + { + QuestId = "e0m0_q#2", + QuestState = (int)QuestState.Completed, + }); + session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate() + { + QuestId = "e0m0_q#3", + QuestState = (int)QuestState.Processing, + }); + } + if (req.EventName == "#bb79de30") + { + session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate() + { + QuestId = "e0m0_q#3", + QuestState = (int)QuestState.Completed, + }); + session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate() + { + QuestId = "e0m0_q#4", + QuestState = (int)QuestState.Processing, + }); + } + if (req.EventName == "#4c76ec3c") + { + session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate() + { + QuestId = "e0m0_q#4", + QuestState = (int)QuestState.Completed, + }); + session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate() + { + QuestId = "e0m0_q#5", + QuestState = (int)QuestState.Processing, + }); + } ScSceneUpdateLevelScriptProperty update1 = new() { SceneNumId = req.SceneNumId, @@ -67,7 +121,7 @@ namespace Campofinale.Packets.Cs }; - session.Send(ScMsgId.ScSceneLevelScriptEventTrigger, rsp); + session.Send(ScMsgId.ScSceneLevelScriptEventTrigger, rsp,packet.csHead.UpSeqid); } } diff --git a/Campofinale/Resource/ResourceManager.cs b/Campofinale/Resource/ResourceManager.cs index 5583c83..c566aee 100644 --- a/Campofinale/Resource/ResourceManager.cs +++ b/Campofinale/Resource/ResourceManager.cs @@ -689,14 +689,15 @@ namespace Campofinale.Resource public float ToFloat() { - int intValueFromBit64 = (int)valueBit64; // Converti long in int - float floatValueFromBit64 = BitConverter.ToSingle(BitConverter.GetBytes(intValueFromBit64), 0); + int intValueFromBit64 = (int)valueBit64; + float floatValueFromBit64 = (float)BitConverter.Int64BitsToDouble(valueBit64); + //float floatValueFromBit64 = BitConverter.ToSingle(BitConverter.GetBytes(intValueFromBit64), 0); return floatValueFromBit64; } public int ToInt() { - int intValueFromBit64 = (int)valueBit64; // Converti long in int - + int intValueFromBit64 = (int)valueBit64; + return intValueFromBit64; } } From 9621cf82744184f16ee7b8ee4b437ed4bbd10f07 Mon Sep 17 00:00:00 2001 From: Hexafluorine Date: Sat, 17 May 2025 12:28:10 -0700 Subject: [PATCH 47/58] Track Missions --- .../Packets/Cs/HandleCsTrackMission.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Campofinale/Packets/Cs/HandleCsTrackMission.cs diff --git a/Campofinale/Packets/Cs/HandleCsTrackMission.cs b/Campofinale/Packets/Cs/HandleCsTrackMission.cs new file mode 100644 index 0000000..28b085e --- /dev/null +++ b/Campofinale/Packets/Cs/HandleCsTrackMission.cs @@ -0,0 +1,20 @@ +using Campofinale.Network; +using Campofinale.Protocol; + +namespace Campofinale.Packets.Cs +{ + internal class HandleCsTrackMission + { + [Server.Handler(CsMsgId.CsTrackMission)] + public static void Handle(Player session, CsMsgId msgId, Packet packet) + { + CsTrackMission req = packet.DecodeBody(); + + ScTrackMissionChange rsp = new() + { + MissionId = req.MissionId + }; + session.Send(ScMsgId.ScTrackMissionChange, rsp); + } + } +} From dab3723540d2bbcfbd78e13cb981b3cb565461d6 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sat, 17 May 2025 23:39:49 +0200 Subject: [PATCH 48/58] entity spawn only once when in range, fixed waypoints for use the depot --- Campofinale/Game/SceneManager.cs | 11 ++++--- Campofinale/Packets/Cs/HandleCsLogin.cs | 33 +++++++++++++++++-- .../Cs/HandleCsSceneSetLevelScriptActive.cs | 27 +++++++++++++++ .../Packets/Cs/HandleCsSceneSetSafeZone.cs | 7 +++- 4 files changed, 69 insertions(+), 9 deletions(-) diff --git a/Campofinale/Game/SceneManager.cs b/Campofinale/Game/SceneManager.cs index 31952cc..b689077 100644 --- a/Campofinale/Game/SceneManager.cs +++ b/Campofinale/Game/SceneManager.cs @@ -358,7 +358,7 @@ namespace Campofinale.Game }); GetEntityExcludingChar().ForEach(e => { - GetOwner().Send(new PacketScObjectEnterView(GetOwner(), new List() { e})); + // GetOwner().Send(new PacketScObjectEnterView(GetOwner(), new List() { e})); }); UpdateShowEntities(); @@ -369,7 +369,7 @@ namespace Campofinale.Game { en.spawned = true; List toSpawn = new List(); - toSpawn.Add(en); + if(en.belongLevelScriptId != 0) if (spawnedCheck) { foreach (Entity e in GetEntityExcludingChar().FindAll(e => e.belongLevelScriptId == en.belongLevelScriptId && e.spawned == false)) @@ -387,17 +387,18 @@ namespace Campofinale.Game } } + toSpawn.Add(en); toSpawn.ForEach(e => { - //GetOwner().Send(new PacketScObjectEnterView(GetOwner(), new List() { e})); + GetOwner().Send(new PacketScObjectEnterView(GetOwner(), new List() { e})); }); - UpdateShowEntities(); + } public void UpdateShowEntities() { foreach(Entity en in GetEntityExcludingChar()) { - if (en.Position.Distance(GetOwner().position) < 250) + if (en.Position.Distance(GetOwner().position) < 100) { if (!en.spawned) { diff --git a/Campofinale/Packets/Cs/HandleCsLogin.cs b/Campofinale/Packets/Cs/HandleCsLogin.cs index 195186d..fe8325c 100644 --- a/Campofinale/Packets/Cs/HandleCsLogin.cs +++ b/Campofinale/Packets/Cs/HandleCsLogin.cs @@ -133,8 +133,8 @@ namespace Campofinale.Packets.Cs m.TrackMissionId = ""; - // session.Send(ScMsgId.ScSyncAllMission, m); - session.Send(ScMsgId.ScSyncAllMission, new ScSyncAllMission() + session.Send(ScMsgId.ScSyncAllMission, m); + /*ession.Send(ScMsgId.ScSyncAllMission, new ScSyncAllMission() { NewMissionTags = { @@ -219,10 +219,37 @@ namespace Campofinale.Packets.Cs QuestObjectives = { + } + } }, + {"e0m0_q#6", new Quest() + { + QuestId="e0m0_q#6", + QuestState=(int)QuestState.Available, + QuestObjectives = + { + + } + } }, + {"e0m0_q#7", new Quest() + { + QuestId="e0m0_q#7", + QuestState=(int)QuestState.Available, + QuestObjectives = + { + + } + } }, + {"e0m0_q#8", new Quest() + { + QuestId="e0m0_q#8", + QuestState=(int)QuestState.Available, + QuestObjectives = + { + } } } } - }); + });*/ session.Send(new PacketScGachaSync(session)); ScSettlementSyncAll settlements = new ScSettlementSyncAll() diff --git a/Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs b/Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs index 21f2384..daab501 100644 --- a/Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs +++ b/Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs @@ -95,6 +95,33 @@ namespace Campofinale.Packets.Cs QuestState = (int)QuestState.Processing, }); } + if (req.EventName == "#251df3ad") + { + session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate() + { + QuestId = "e0m0_q#5", + QuestState = (int)QuestState.Completed, + }); + session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate() + { + QuestId = "e0m0_q#6", + QuestState = (int)QuestState.Processing, + }); + } + if (req.EventName == "#e6ac322b") + { + session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate() + { + QuestId = "e0m0_q#6", + QuestState = (int)QuestState.Completed, + }); + session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate() + { + QuestId = "e0m0_q#7", + QuestState = (int)QuestState.Processing, + }); + } + ScSceneUpdateLevelScriptProperty update1 = new() { SceneNumId = req.SceneNumId, diff --git a/Campofinale/Packets/Cs/HandleCsSceneSetSafeZone.cs b/Campofinale/Packets/Cs/HandleCsSceneSetSafeZone.cs index bdb0dbe..777c92e 100644 --- a/Campofinale/Packets/Cs/HandleCsSceneSetSafeZone.cs +++ b/Campofinale/Packets/Cs/HandleCsSceneSetSafeZone.cs @@ -12,7 +12,12 @@ namespace Campofinale.Packets.Cs public static void Handle(Player session, CsMsgId cmdId, Packet packet) { CsSceneSetSafeZone req = packet.DecodeBody(); - + ScSceneSetSafeZone rsp = new() + { + Id = req.Id, + InZone = req.InZone, + }; + session.Send(ScMsgId.ScSceneSetSafeZone, rsp); if (req.InZone) { var entity = session.sceneManager.GetEntity(req.Id) as EntityInteractive; From cb70fa6f1b6e990453dbca9f2b46785851e03ee2 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sun, 18 May 2025 16:46:05 +0200 Subject: [PATCH 49/58] MissionSystem + Event system (manually re implementation) --- .../Game/Entities/EntityInteractive.cs | 2 +- Campofinale/Game/Entities/EntityMonster.cs | 1 + Campofinale/Game/Mission/MissionSystem.cs | 20 -- Campofinale/Game/MissionSys/MissionSystem.cs | 246 ++++++++++++++++++ Campofinale/Game/SceneManager.cs | 20 +- Campofinale/Packets/Cs/HandleCsLogin.cs | 5 +- .../Packets/Cs/HandleCsSceneLoadFinish.cs | 4 +- .../Cs/HandleCsSceneSetLevelScriptActive.cs | 85 ++++-- .../Packets/Cs/HandleCsTrackMission.cs | 2 +- Campofinale/Player.cs | 93 +++---- Campofinale/Resource/ResourceManager.cs | 3 +- .../Resource/Table/LevelScriptEvent.cs | 30 +++ .../Resource/Table/MissionDataTable.cs | 12 +- 13 files changed, 413 insertions(+), 110 deletions(-) delete mode 100644 Campofinale/Game/Mission/MissionSystem.cs create mode 100644 Campofinale/Game/MissionSys/MissionSystem.cs create mode 100644 Campofinale/Resource/Table/LevelScriptEvent.cs diff --git a/Campofinale/Game/Entities/EntityInteractive.cs b/Campofinale/Game/Entities/EntityInteractive.cs index 4915960..f57fafe 100644 --- a/Campofinale/Game/Entities/EntityInteractive.cs +++ b/Campofinale/Game/Entities/EntityInteractive.cs @@ -54,7 +54,7 @@ namespace Campofinale.Game.Entities Type = (int)5, }, - + //Meta =dependencyGroupId, BattleInfo = new() { diff --git a/Campofinale/Game/Entities/EntityMonster.cs b/Campofinale/Game/Entities/EntityMonster.cs index 48299f3..1f79384 100644 --- a/Campofinale/Game/Entities/EntityMonster.cs +++ b/Campofinale/Game/Entities/EntityMonster.cs @@ -83,6 +83,7 @@ namespace Campofinale.Game.Entities Type =(int) ObjectTypeIndex.Enemy, }, + Attrs = { GetAttributes() diff --git a/Campofinale/Game/Mission/MissionSystem.cs b/Campofinale/Game/Mission/MissionSystem.cs deleted file mode 100644 index 8de3bcc..0000000 --- a/Campofinale/Game/Mission/MissionSystem.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Campofinale.Database; - -namespace Campofinale.Game.Mission -{ - public class MissionSystem - { - public Player owner; - public MissionSystem(Player o) - { - owner = o; - } - public void Save() - { - - } - public void Load() - { - } - } -} diff --git a/Campofinale/Game/MissionSys/MissionSystem.cs b/Campofinale/Game/MissionSys/MissionSystem.cs new file mode 100644 index 0000000..b7d7412 --- /dev/null +++ b/Campofinale/Game/MissionSys/MissionSystem.cs @@ -0,0 +1,246 @@ +using Campofinale.Database; +using Campofinale.Protocol; +using Campofinale.Resource; +using Campofinale.Resource.Table; +using static System.Runtime.InteropServices.JavaScript.JSType; + +namespace Campofinale.Game.MissionSys +{ + public class MissionSystem + { + public Player owner; + public List missions=new(); + public List quests=new(); + public string curMission = "e0m0"; + + public MissionSystem(Player o) + { + owner = o; + } + public ScSyncAllMission ToProto() + { + ScSyncAllMission sync = new ScSyncAllMission(); + sync.TrackMissionId = curMission; + missions.ForEach(m => + { + sync.Missions.Add(m.missionId, new Mission() + { + MissionId = m.missionId, + MissionState = (int)m.state, + + }); + }); + + quests.ForEach(q => + { + Quest quest=new Quest() + { + QuestId = q.questId, + QuestState = (int)q.state, + + }; + var data = GetQuestData(q.questId); + data.objectiveList.ForEach(o => + { + quest.QuestObjectives.Add(new QuestObjective() + { + ConditionId = o.condition.uniqueId, + Values = + { + {o.condition.uniqueId,0 } + } + }); + }); + sync.CurQuests.Add(q.questId, quest); + + }); + return sync; + } + public MissionDataTable.QuestInfo GetQuestData(string id) + { + MissionDataTable.QuestInfo quest = null; + foreach(MissionDataTable m in ResourceManager.missionDataTable) + { + if(m.questDic.TryGetValue(id, out quest)) + { + return quest; + } + }; + + return quest; + } + public void Save() + { + + } + public void Load() + { + //TODO Saving and first initialization + AddMission("e0m0",MissionState.Processing); + } + public void AddMission(string id,MissionState state = MissionState.Available, bool notify=false) + { + MissionDataTable data = ResourceManager.missionDataTable.Find(m=>m.missionId == id); + if (data != null) + { + missions.Add(new GameMission(id, state)); + if (notify) + { + ScMissionStateUpdate s = new() + { + MissionId = data.missionId, + MissionState = (int)state, + SucceedId=-1, + + }; + } + + int i = 0; + foreach (var q in data.questDic.Values) + { + AddQuest(q, false); + } + } + } + public GameQuest GetQuestById(string id) + { + return quests.Find(q => q.questId == id); + } + public void AddQuest(MissionDataTable.QuestInfo data,bool notify=false) + { + GameQuest quest = GetQuestById(data.questId); + if (quest == null) + { + quest = new GameQuest(data.questId); + quest.state = QuestState.Available; + if (notify) + { + ScQuestObjectivesUpdate upd = new() + { + QuestId = data.questId, + + }; + data.objectiveList.ForEach(o => + { + upd.QuestObjectives.Add(new QuestObjective() + { + ConditionId=o.condition.uniqueId, + Values = + { + {o.condition.uniqueId,0 } + } + }); + }); + ScQuestStateUpdate update = new() + { + QuestId = quest.questId, + QuestState = (int)quest.state, + RoleBaseInfo = owner.GetRoleBaseInfo() + }; + owner.Send(ScMsgId.ScQuestStateUpdate, update); + owner.Send(ScMsgId.ScQuestObjectivesUpdate, upd); + } + + quests.Add(quest); + } + } + public void ProcessQuest(string id) + { + GameQuest quest = GetQuestById(id); + if (quest != null) + { + + quest.state = QuestState.Processing; + var data = GetQuestData(id); + ScQuestStateUpdate update = new() + { + QuestId = quest.questId, + QuestState = (int)quest.state, + RoleBaseInfo = owner.GetRoleBaseInfo() + }; + ScQuestObjectivesUpdate upd = new() + { + QuestId = data.questId, + + }; + data.objectiveList.ForEach(o => + { + upd.QuestObjectives.Add(new QuestObjective() + { + ConditionId = o.condition.uniqueId, + Values = + { + {o.condition.uniqueId,0 } + } + }); + }); + owner.Send(ScMsgId.ScQuestObjectivesUpdate, upd); + owner.Send(ScMsgId.ScQuestStateUpdate, update); + + } + } + public void CompleteQuest(string id) + { + GameQuest quest = GetQuestById(id); + if (quest != null) + { + quest.state = QuestState.Completed; + var data = GetQuestData(id); + ScQuestStateUpdate update = new() + { + QuestId = quest.questId, + QuestState=(int)quest.state, + }; + ScQuestObjectivesUpdate upd = new() + { + QuestId = data.questId, + + }; + data.objectiveList.ForEach(o => + { + upd.QuestObjectives.Add(new QuestObjective() + { + ConditionId = o.condition.uniqueId, + IsComplete=true, + Values = + { + {o.condition.uniqueId,1 } + } + }); + }); + owner.Send(ScMsgId.ScQuestObjectivesUpdate, upd); + owner.Send(ScMsgId.ScQuestStateUpdate, update); + quests.Remove(quest); + } + } + } + public class GameQuest + { + public string questId; + public QuestState state; + public GameQuest() + { + + } + public GameQuest(string id, QuestState state = QuestState.Available) + { + questId = id; + this.state = state; + } + } + public class GameMission + { + public string missionId; + public MissionState state; + + public GameMission() + { + + } + public GameMission(string id, MissionState state = MissionState.Available) + { + missionId = id; + this.state = state; + } + } +} diff --git a/Campofinale/Game/SceneManager.cs b/Campofinale/Game/SceneManager.cs index b689077..220ac67 100644 --- a/Campofinale/Game/SceneManager.cs +++ b/Campofinale/Game/SceneManager.cs @@ -335,6 +335,7 @@ namespace Campofinale.Game lv_scene.levelData.enemies.ForEach(en => { if(GetOwner().noSpawnAnymore.Contains(en.levelLogicId) && sceneNumId != 87) return; + if (en.defaultHide) return; EntityMonster entity = new(en.entityDataIdKey,en.level,ownerId,en.position,en.rotation, sceneNumId, en.levelLogicId) { type=en.entityType, @@ -345,7 +346,7 @@ namespace Campofinale.Game }); lv_scene.levelData.npcs.ForEach(en => { - + if (en.defaultHide) return; if (en.npcGroupId.Contains("chr")) return; EntityNpc entity = new(en.entityDataIdKey,ownerId,en.position,en.rotation, sceneNumId, en.levelLogicId) { @@ -426,5 +427,22 @@ namespace Campofinale.Game { return Server.clients.Find(c => c.roleId == ownerId); } + + public void SpawnEnemy(ulong v) + { + LevelScene lv_scene = ResourceManager.GetLevelData(sceneNumId); + LevelEnemyData en = lv_scene.levelData.enemies.Find(e=>e.levelLogicId == v); + if(en!=null) + { + EntityMonster entity = new(en.entityDataIdKey, en.level, ownerId, en.position, en.rotation, sceneNumId, en.levelLogicId) + { + type = en.entityType, + belongLevelScriptId = en.belongLevelScriptId, + levelLogicId = en.levelLogicId + }; + entities.Add(entity); + SpawnEntity(entity); + } + } } } diff --git a/Campofinale/Packets/Cs/HandleCsLogin.cs b/Campofinale/Packets/Cs/HandleCsLogin.cs index fe8325c..8ba75f1 100644 --- a/Campofinale/Packets/Cs/HandleCsLogin.cs +++ b/Campofinale/Packets/Cs/HandleCsLogin.cs @@ -132,7 +132,8 @@ namespace Campofinale.Packets.Cs ScSyncAllMission m = Newtonsoft.Json.JsonConvert.DeserializeObject(json1); m.TrackMissionId = ""; - + //Disabled the hardcoded one and enable the missionSystem one + //session.Send(ScMsgId.ScSyncAllMission, session.missionSystem.ToProto()); session.Send(ScMsgId.ScSyncAllMission, m); /*ession.Send(ScMsgId.ScSyncAllMission, new ScSyncAllMission() { @@ -250,7 +251,7 @@ namespace Campofinale.Packets.Cs } } } });*/ - + session.Send(new PacketScGachaSync(session)); ScSettlementSyncAll settlements = new ScSettlementSyncAll() { diff --git a/Campofinale/Packets/Cs/HandleCsSceneLoadFinish.cs b/Campofinale/Packets/Cs/HandleCsSceneLoadFinish.cs index 2585ef6..55c7904 100644 --- a/Campofinale/Packets/Cs/HandleCsSceneLoadFinish.cs +++ b/Campofinale/Packets/Cs/HandleCsSceneLoadFinish.cs @@ -18,11 +18,11 @@ namespace Campofinale.Packets.Cs session.sceneManager.LoadCurrentTeamEntities(); session.sceneManager.LoadCurrent(); session.LoadFinish = true; - /*session.Send(ScMessageId.ScSceneClientIdInfo, new ScSceneClientIdInfo() + session.Send(ScMsgId.ScSceneClientIdInfo, new ScSceneClientIdInfo() { RoleIdx = (uint)session.roleId, LastMaxIdx = session.random.usedGuids.Max() - });*/ + }); if (session.curSceneNumId == 98) { session.Send(new PacketScSyncGameMode(session, "spaceship")); diff --git a/Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs b/Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs index daab501..48e5f0b 100644 --- a/Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs +++ b/Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs @@ -3,6 +3,8 @@ using Campofinale.Game.Entities; using Campofinale.Network; using Campofinale.Protocol; using Campofinale.Resource; +using Campofinale.Resource.Table; +using Pastel; namespace Campofinale.Packets.Cs { @@ -12,14 +14,19 @@ namespace Campofinale.Packets.Cs public static void Handle(Player session, CsMsgId cmdId, Packet packet) { CsSceneSetLevelScriptActive req = packet.DecodeBody(); - - ScSceneLevelScriptStateNotify rsp = new ScSceneLevelScriptStateNotify() + if (req.IsActive) { - SceneNumId = req.SceneNumId, - ScriptId = req.ScriptId, - State = 3 - }; - session.Send(ScMsgId.ScSceneLevelScriptStateNotify, rsp); + + ScSceneLevelScriptStateNotify rsp = new ScSceneLevelScriptStateNotify() + { + SceneNumId = req.SceneNumId, + ScriptId = req.ScriptId, + + State = 3 + }; + session.Send(ScMsgId.ScSceneLevelScriptStateNotify, rsp); + } + } @@ -27,23 +34,63 @@ namespace Campofinale.Packets.Cs public static void HandleCsSceneSetLevelScriptStart(Player session, CsMsgId cmdId, Packet packet) { CsSceneSetLevelScriptStart req = packet.DecodeBody(); - ScSceneLevelScriptStateNotify rsp = new ScSceneLevelScriptStateNotify() + if (req.IsStart) { - SceneNumId = req.SceneNumId, - ScriptId = req.ScriptId, - State = 4 - }; - session.Send(ScMsgId.ScSceneLevelScriptStateNotify, rsp); + ScSceneLevelScriptStateNotify rsp = new ScSceneLevelScriptStateNotify() + { + SceneNumId = req.SceneNumId, + ScriptId = req.ScriptId, + + State = 4 + }; + session.Send(ScMsgId.ScSceneLevelScriptStateNotify, rsp); + } + } - [Server.Handler(CsMsgId.CsSceneLevelScriptEventTrigger)] + public static void ExecuteEventAction(Player player, ScriptAction action) + { + switch (action.action) + { + case ScriptActionType.CompleteQuest: + player.missionSystem.CompleteQuest(action.valueStr[0]); + break; + case ScriptActionType.ProcessQuest: + player.missionSystem.ProcessQuest(action.valueStr[0]); + break; + case ScriptActionType.SpawnEnemy: + player.sceneManager.GetCurScene().SpawnEnemy(action.valueUlong[0]); + break; + default: + Logger.PrintWarn("Script Action not implemented"); + break; + } + } + [Server.Handler(CsMsgId.CsSceneLevelScriptEventTrigger)] public static void HandleCsSceneLevelScriptEventTrigger(Player session, CsMsgId cmdId, Packet packet) { CsSceneLevelScriptEventTrigger req = packet.DecodeBody(); Logger.Print(req.Properties.ToString()); - if(req.EventName== "#8777e316") + + if (ResourceManager.levelScriptsEvents.TryGetValue(req.EventName, out LevelScriptEvent levelScriptEvent)) + { + Logger.Print($"Event {req.EventName.Pastel(ConsoleColor.Yellow)} Executed."); + Logger.Print($"{levelScriptEvent.comment}"); + levelScriptEvent.actions.ForEach(a => + { + ExecuteEventAction(session, a); + }); + } + else + { + Logger.PrintWarn($"Event {req.EventName.Pastel(ConsoleColor.White)} is NOT implemented. INFO: ["); + Logger.PrintWarn($" Scene: {req.SceneNumId.ToString().Pastel(ConsoleColor.White)}, Pos: {session.position.ToProto().ToString()} "); + Logger.PrintWarn($" ScriptID: {req.ScriptId.ToString().Pastel(ConsoleColor.White)} "); + Logger.PrintWarn($"]"); + } + /*if(req.EventName== "#8777e316") { session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate() { @@ -120,26 +167,28 @@ namespace Campofinale.Packets.Cs QuestId = "e0m0_q#7", QuestState = (int)QuestState.Processing, }); - } + }*/ ScSceneUpdateLevelScriptProperty update1 = new() { SceneNumId = req.SceneNumId, ScriptId = req.ScriptId, - + }; session.Send(ScMsgId.ScSceneUpdateLevelScriptProperty, update1); ScSceneTriggerClientLevelScriptEvent trigger = new() { EventName = req.EventName, SceneNumId = req.SceneNumId, - ScriptId = req.ScriptId + ScriptId = req.ScriptId, + }; session.Send(ScMsgId.ScSceneTriggerClientLevelScriptEvent, trigger); ScSceneUpdateLevelScriptProperty update2 = new() { SceneNumId = req.SceneNumId, ScriptId = req.ScriptId, + }; session.Send(ScMsgId.ScSceneUpdateLevelScriptProperty, update2); diff --git a/Campofinale/Packets/Cs/HandleCsTrackMission.cs b/Campofinale/Packets/Cs/HandleCsTrackMission.cs index 28b085e..b2b07f8 100644 --- a/Campofinale/Packets/Cs/HandleCsTrackMission.cs +++ b/Campofinale/Packets/Cs/HandleCsTrackMission.cs @@ -9,7 +9,7 @@ namespace Campofinale.Packets.Cs public static void Handle(Player session, CsMsgId msgId, Packet packet) { CsTrackMission req = packet.DecodeBody(); - + session.missionSystem.curMission = req.MissionId; ScTrackMissionChange rsp = new() { MissionId = req.MissionId diff --git a/Campofinale/Player.cs b/Campofinale/Player.cs index 14fff30..78f1ddd 100644 --- a/Campofinale/Player.cs +++ b/Campofinale/Player.cs @@ -13,7 +13,7 @@ using Campofinale.Game.Gacha; using Campofinale.Game.Spaceship; using Campofinale.Game.Dungeons; using Campofinale.Game.Factory; -using Campofinale.Game.Mission; +using Campofinale.Game.MissionSys; using Pastel; using System.Drawing; @@ -175,6 +175,7 @@ namespace Campofinale { Initialize(); //only if no account found } + missionSystem.Load(); sceneManager.Load(); factoryManager.Load(); return (data != null); @@ -267,68 +268,6 @@ namespace Campofinale } public void UnlockImportantSystems() { - /*unlockedSystems.Add((int)UnlockSystemType.Watch); - unlockedSystems.Add((int)UnlockSystemType.Weapon); - unlockedSystems.Add((int)UnlockSystemType.Equip); - unlockedSystems.Add((int)UnlockSystemType.EquipEnhance); - unlockedSystems.Add((int)UnlockSystemType.NormalAttack); - unlockedSystems.Add((int)UnlockSystemType.NormalSkill); - unlockedSystems.Add((int)UnlockSystemType.UltimateSkill); - unlockedSystems.Add((int)UnlockSystemType.TeamSkill); - unlockedSystems.Add((int)UnlockSystemType.ComboSkill); - unlockedSystems.Add((int)UnlockSystemType.TeamSwitch); - unlockedSystems.Add((int)UnlockSystemType.Dash); - unlockedSystems.Add((int)UnlockSystemType.Jump); - unlockedSystems.Add((int)UnlockSystemType.Friend); - unlockedSystems.Add((int)UnlockSystemType.SNS); - unlockedSystems.Add((int)UnlockSystemType.Settlement); - unlockedSystems.Add((int)UnlockSystemType.Map); - - unlockedSystems.Add((int)UnlockSystemType.FacTechTree); - unlockedSystems.Add((int)UnlockSystemType.FacZone); - unlockedSystems.Add((int)UnlockSystemType.FacSplitter); - unlockedSystems.Add((int)UnlockSystemType.FacConveyor); - unlockedSystems.Add((int)UnlockSystemType.FacBridge); - unlockedSystems.Add((int)UnlockSystemType.FacPipe); - unlockedSystems.Add((int)UnlockSystemType.FacBuildingPin); - unlockedSystems.Add((int)UnlockSystemType.FacBUS); - unlockedSystems.Add((int)UnlockSystemType.FacPipeConnector); - unlockedSystems.Add((int)UnlockSystemType.FacOverview); - unlockedSystems.Add((int)UnlockSystemType.FacCraftPin); - unlockedSystems.Add((int)UnlockSystemType.FacMerger); - unlockedSystems.Add((int)UnlockSystemType.FacYieldStats); - unlockedSystems.Add((int)UnlockSystemType.FacTransferPort); - unlockedSystems.Add((int)UnlockSystemType.FacHub); - unlockedSystems.Add((int)UnlockSystemType.FacMode); - unlockedSystems.Add((int)UnlockSystemType.FacSystem); - unlockedSystems.Add((int)UnlockSystemType.FacPipeSplitter); - unlockedSystems.Add((int)UnlockSystemType.FacPipeConverger); - unlockedSystems.Add((int)UnlockSystemType.AdventureBook); - unlockedSystems.Add((int)UnlockSystemType.CharUI); - unlockedSystems.Add((int)UnlockSystemType.EquipProduce); - unlockedSystems.Add((int)UnlockSystemType.EquipTech); - unlockedSystems.Add((int)UnlockSystemType.Gacha); - unlockedSystems.Add((int)UnlockSystemType.Inventory); - unlockedSystems.Add((int)UnlockSystemType.ItemQuickBar); - unlockedSystems.Add((int)UnlockSystemType.ItemSubmitRecycle); - unlockedSystems.Add((int)UnlockSystemType.ItemUse); - unlockedSystems.Add((int)UnlockSystemType.Mail); - unlockedSystems.Add((int)UnlockSystemType.ValuableDepot); - unlockedSystems.Add((int)UnlockSystemType.Wiki); - unlockedSystems.Add((int)UnlockSystemType.AIBark); - unlockedSystems.Add((int)UnlockSystemType.AdventureExpAndLv); - unlockedSystems.Add((int)UnlockSystemType.CharTeam); - - - unlockedSystems.Add((int)UnlockSystemType.SpaceshipSystem); - unlockedSystems.Add((int)UnlockSystemType.SpaceshipControlCenter); - - unlockedSystems.Add((int)UnlockSystemType.PRTS); - unlockedSystems.Add((int)UnlockSystemType.Dungeon); - unlockedSystems.Add((int)UnlockSystemType.RacingDungeon); - unlockedSystems.Add((int)UnlockSystemType.CheckIn); - unlockedSystems.Add((int)UnlockSystemType.SubmitEther);*/ - foreach(UnlockSystemType type in Enum.GetValues(typeof(UnlockSystemType))) { unlockedSystems.Add((int)type); @@ -669,5 +608,33 @@ namespace Campofinale return ""; } } + + public RoleBaseInfo GetRoleBaseInfo() + { + long curtimestamp = DateTime.UtcNow.ToUnixTimestampMilliseconds(); + try + { + return new RoleBaseInfo() + { + LeaderCharId = teams[teamIndex].leader, + LeaderPosition = position.ToProto(), + LeaderRotation = rotation.ToProto(), + ServerTs = (ulong)curtimestamp, + SceneName = ResourceManager.levelDatas.Find(l => l.idNum == curSceneNumId).mapIdStr + }; + } + catch (Exception e) + { + + return new RoleBaseInfo() + { + LeaderCharId = teams[teamIndex].leader, + LeaderPosition = position.ToProto(), + LeaderRotation = rotation.ToProto(), + ServerTs = (ulong)curtimestamp + }; + } + + } } } diff --git a/Campofinale/Resource/ResourceManager.cs b/Campofinale/Resource/ResourceManager.cs index c566aee..16adb7a 100644 --- a/Campofinale/Resource/ResourceManager.cs +++ b/Campofinale/Resource/ResourceManager.cs @@ -20,6 +20,7 @@ namespace Campofinale.Resource //TODO Move all tables to separated class public class ResourceManager { + public static Dictionary levelScriptsEvents = new(); // public static Dictionary sceneAreaTable = new(); public static StrIdNumTable strIdNumTable = new StrIdNumTable();// public static Dictionary characterTable = new(); // @@ -67,7 +68,7 @@ namespace Campofinale.Resource public static Dictionary itemTypeTable = new(); // public static Dictionary snsChatTable = new();// public static Dictionary giftItemTable = new(); - public static Dictionary missionDataTable = new(); + public static List missionDataTable = new(); public static InteractiveTable interactiveTable = new(); // public static List levelDatas = new(); diff --git a/Campofinale/Resource/Table/LevelScriptEvent.cs b/Campofinale/Resource/Table/LevelScriptEvent.cs new file mode 100644 index 0000000..ee6fbdc --- /dev/null +++ b/Campofinale/Resource/Table/LevelScriptEvent.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Campofinale.Resource.Table +{ + [TableCfgType("Json/LevelScriptEvents.json", LoadPriority.LOW)] + public class LevelScriptEvent : TableCfgResource + { + public string eventName; + public string comment; + public List actions; + } + public class ScriptAction + { + public ScriptActionType action; + public string[] valueStr; + public ulong[] valueUlong; + } + public enum ScriptActionType + { + None = 0, + CompleteQuest = 1, + ProcessQuest = 2, + SpawnEnemy = 3 + + } +} diff --git a/Campofinale/Resource/Table/MissionDataTable.cs b/Campofinale/Resource/Table/MissionDataTable.cs index 9da1ef7..b85485d 100644 --- a/Campofinale/Resource/Table/MissionDataTable.cs +++ b/Campofinale/Resource/Table/MissionDataTable.cs @@ -6,7 +6,7 @@ { public string missionId; public string rewardId; - public MissionType missionType; + //public MissionType missionType; public string charId; public string levelId; public Dictionary questDic; @@ -22,7 +22,17 @@ public bool autoRestartWhenFailed; public int objectiveConditionNum; public string rewardId; + public List objectiveList; + public class QuestObjective + { + public ObjectiveCond condition; + + public class ObjectiveCond + { + public string uniqueId; + } + } } public enum MissionType { From 4ec1bdb05d03e7ba437e7cab6ebc31af5ed9db75 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Tue, 20 May 2025 19:56:14 +0200 Subject: [PATCH 50/58] testing some things with factory manager --- .../Data/res_versions/2089329-32/index_initial.json | 1 + Campofinale/Data/res_versions/2089329-32/ori.json | 1 + Campofinale/Game/Factory/FactoryManager.cs | 12 +++++++++--- Campofinale/Http/DispatchCN.cs | 6 ++---- 4 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 Campofinale/Data/res_versions/2089329-32/index_initial.json create mode 100644 Campofinale/Data/res_versions/2089329-32/ori.json diff --git a/Campofinale/Data/res_versions/2089329-32/index_initial.json b/Campofinale/Data/res_versions/2089329-32/index_initial.json new file mode 100644 index 0000000..efad5f3 --- /dev/null +++ b/Campofinale/Data/res_versions/2089329-32/index_initial.json @@ -0,0 +1 @@ +{"isInitial":true,"files":[{"index":1,"name":"VFS/CA2A581090AB4133/CA2A581090AB4133.blc","hash":"e75b8886d2426ec6b1e7f362bcd5255d","size":302,"urlPath":null,"manifest":7},{"index":2,"name":"VFS/CA2A581090AB4133/0DBA81C558A36AFC1D7D1C0A5A704A09.chk","hash":null,"size":80879438,"urlPath":null,"manifest":0},{"index":3,"name":"VFS/8F0DD938C04FD953/8F0DD938C04FD953.blc","hash":"d236d4691a5815ba973fa365ff6357f9","size":59,"urlPath":null,"manifest":3},{"index":4,"name":"VFS/16BB5AC00009A71B/16BB5AC00009A71B.blc","hash":"689374e7c7ec263dfd66fd255351fded","size":331,"urlPath":null,"manifest":3},{"index":5,"name":"VFS/16BB5AC00009A71B/6A2B02D8FCE1ED28849D1596D779CFA9.chk","hash":null,"size":14236423,"urlPath":null,"manifest":4},{"index":6,"name":"VFS/16BB5AC00009A71B/DA88C18EED8D9DEE8326BAA9AB78AA78.chk","hash":null,"size":1193655,"urlPath":null,"manifest":4},{"index":7,"name":"VFS/AAD6005BEB6AE986/AAD6005BEB6AE986.blc","hash":"51603590679e7d8590a3a1f908a38ed1","size":27360,"urlPath":null,"manifest":3},{"index":8,"name":"VFS/AAD6005BEB6AE986/1745D582258DFD069CDA135DDC740D34.chk","hash":null,"size":124467976,"urlPath":null,"manifest":4},{"index":9,"name":"VFS/B28236B7FAB03015/B28236B7FAB03015.blc","hash":"1baf1a032b9e204652eac0a7256621a7","size":15912,"urlPath":null,"manifest":7},{"index":10,"name":"VFS/B28236B7FAB03015/86BC72728AE017306E7CBE8DC67C93A9.chk","hash":null,"size":46679427,"urlPath":null,"manifest":0}],"types":null,"version":null} \ No newline at end of file diff --git a/Campofinale/Data/res_versions/2089329-32/ori.json b/Campofinale/Data/res_versions/2089329-32/ori.json new file mode 100644 index 0000000..7f7d19f --- /dev/null +++ b/Campofinale/Data/res_versions/2089329-32/ori.json @@ -0,0 +1 @@ +4Fmf1Xuly6yikdJUcayl2cpjWMibo8erW2rBrVmhocjKr1icY2OEppqdy1RxWomquGZ5o2R4l3BqYJ9ieHpnlZhqZaVzaaNtcWGWa2d5dZiWammQlKPFWmVSzpOqoFWeh5xtl5RvmnBvlJhmaW6Yx5uZZ8dpnZVua5LJlmxqaJnJWWKEpaDcnVtqmWJpZFXZ16OGw6afhHKnpdKeY1qgxdOgnMelq4RycK2SrVmhocjKr1icZGOEppqdy1RxWomquGZ5o2R4l3BqYJ9ieHpnlZhqZZJ2eaNwanObZ295ZpqmfXmTdm6maXxgp2d4b2OYpmdvkJWfzVplUs6TqqBVntOsos5eWdWhs5WIbG9oa5uea2maXlnXqqWAx6afWm3S2qOijlSkw6ailsulq1ptlOJjsYSbpcadsVKgZWNaocXSnFicVI2oi2horGJ7fGyXnXpmlnh7m21sX554Z3x3nZhveZJmfaZxbmOUlKObVZCHn5fVmlmcWp1imWibbGmdlphrmmNsxJlyZ5mYmGtpmcudbJVnbshxW1yIpaCymIafbG+OVKzUpImR2ppZcqHZ0aNihJ+Y0KGfldmmWXJm4ZGyWMugm8ewW2qaXlmmlNHKWXCEiH21Z2pmqHRseXaUlWdmm3Nuk3poYZx0eW10p5VnZpJreJlpe17InppaX4bNmKnKVHGEbnFpmWlrnWrHnJyZlGhqxp6dZpyYm2pomZhsZ8iWnMZaZVLZm7GdVZ6YameOVKzUpImR2ppZcqHZ0aNihJ+Y0KGfldmmWXJm4ZGyWMugm8ewW2qbXlmmlNHKWXCEiH21Z2pmqHRseXaUlWdmm3Nuk3poZqdkeWhlqJ19eadjfKZqcWiaa3tpaJ2be22Za3qoeXJeyZqiWl+GzZipylRx0K2lnJJUqqGtyYdxZ5Zkaphsa2OSVKyqn7TGq56EbKXXpKVciJ+YppzKyqqqhGxr32S0Us+gm52rhp9tYoSgmM+dW2qIiH2LYpWbeXiXc3qSaGlgn3NuaXWTqXhumnVomn1+dJ52cHx4qZ1qaJh0eKNxenKdanh5apyTmp7NVGOEoJqjzlRxpqjQ0WNY1Zuxx1pzYZdram5omZFZq9Seh8OsoVKgoKykn5CHpJfQm53Hq61SoGa0ZK6GzqWax6pZnG9lUtSTpJ1VnoeNfLVheKN8b2CWZ3l9dZqmfG+aaGajeX1mlmJsenimm3h7m2ptkJqlk4heWaCU181ZcIRnaJhobGWfYm1vbMmcm26Xa2fDa5phzGtncJSXnZyak1RjhKuiqstUcWpql5tnYoSnqc6ImqTOVHGmqNDRY1jPk6XLnp6j2lRxa7CQ4Fmf0Jac2lpzaJJUpZmgyYdxWLh4ipF5enScYmdtdamnbXena2+YZ2pnmmd7bWuWl2xupnh7km5yc6pzaGtoqKl6bZZie5VsZ5POnVlkVczGqp6EbKXXpKVciKWgspiGn2holmZtmXFwZpJUrKqftMarnoRspdekpVyIn5imnMrKqqqEbGvfZLRSz6CbnauGn3BihKCYz51baoiIfYtippdvaJVoeZl+enKWZWdpaJOnaW6UZW2kb39xqGJqaGSZk5mixVRjhKCao85UcVpkxsadZ8NiapSacpWYYmtuaJbKmJmSk26UbW9mmGOYb1WQh6qf3JdZnGluaZdkY1qo1tGHl9aaWZymrpzSXlmllNLOnZvVplmcb7Zc4VSgppfJ3Vlwk2JjhKaanctUcVqJqrhmeJRqaZVue2esc3loZpSWbGWaaHmlb2tnmGp4fWOVnGpmmHdupXp+aKp1bW92nZh4b5CVn81aZVLOk6qgVZ7TrKLOXlnVobOViGxrbmmbnmtomV5Z16qlgMemn1pt0tqjoo5UpMOmopbLpatabZTilGKEprDSnaxSoKCspJ+Qh62b1KWg0aZbatSno6Sw \ No newline at end of file diff --git a/Campofinale/Game/Factory/FactoryManager.cs b/Campofinale/Game/Factory/FactoryManager.cs index 91f395c..c30ec1f 100644 --- a/Campofinale/Game/Factory/FactoryManager.cs +++ b/Campofinale/Game/Factory/FactoryManager.cs @@ -1,4 +1,5 @@ -using Campofinale.Game.Factory.Components; +using Campofinale.Game.Entities; +using Campofinale.Game.Factory.Components; using Campofinale.Packets.Sc; using Campofinale.Protocol; using Campofinale.Resource; @@ -127,8 +128,12 @@ namespace Campofinale.Game.Factory GetOwner().Send(new PacketScFactorySyncChapter(GetOwner(), chapterId)); edit.Nodes.Add(node.ToProto()); Logger.Print(Newtonsoft.Json.JsonConvert.SerializeObject(edit, Newtonsoft.Json.Formatting.Indented)); + EntityInteractive e = new(place.TemplateId, GetOwner().roleId, new Vector3f(place.Position), new Vector3f(place.Direction), GetOwner().sceneManager.GetCurScene().sceneNumId, node.guid); + GetOwner().sceneManager.GetCurScene().entities.Add(e); + GetOwner().sceneManager.GetCurScene().SpawnEntity(e); GetOwner().Send(ScMsgId.ScFactoryModifyChapterNodes, edit); GetOwner().Send(new PacketScFactoryOpRet(GetOwner(), node.nodeId,FactoryOpType.Place),seq); + } public FactoryChapter(string chapterId,ulong ownerId) @@ -260,6 +265,7 @@ namespace Campofinale.Game.Factory TemplateId=templateId, StableId= GetStableId(), IsDeactive= deactive, + Power = new() { InPower= InPower(), @@ -272,7 +278,7 @@ namespace Campofinale.Game.Factory Position = position.ToProtoScd(), Direction=direction.ToProtoScd(), MapId=mapId, - + } }; @@ -283,7 +289,7 @@ namespace Campofinale.Game.Factory node.Transform.WorldRotation = direction.ToProto(); node.InteractiveObject = new() { - + ObjectId=guid, }; node.Flag = 0; node.InstKey = ""; diff --git a/Campofinale/Http/DispatchCN.cs b/Campofinale/Http/DispatchCN.cs index 20e00b5..e3bdc5e 100644 --- a/Campofinale/Http/DispatchCN.cs +++ b/Campofinale/Http/DispatchCN.cs @@ -42,9 +42,7 @@ namespace Campofinale.Http public static async Task cn_res_version(HttpContext ctx) { - string resp = "{\"version\": \"2089329-32\", \"kickFlag\": true}"; - - + string resp = "{\"version\": \"2089329-32\", \"kickFlag\": false}"; ctx.Response.StatusCode = 200; //ctx.Response.ContentLength = resp.Length; ctx.Response.ContentType = "application/json"; @@ -67,7 +65,7 @@ namespace Campofinale.Http public static async Task cn_android_res_version(HttpContext ctx) { - string resp = "{\"version\": \"2332867-572\", \"kickFlag\": true}"; + string resp = "{\"version\": \"2361763-612\", \"kickFlag\": false}"; ctx.Response.StatusCode = 200; From e8264118af77fddbc8975eb3622a87542cee1d15 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Thu, 22 May 2025 18:10:24 +0200 Subject: [PATCH 51/58] api changes --- Campofinale/Http/DispatchCN.cs | 17 ++++++++++++++--- .../Packets/Cs/HandleCsSceneMoveStateSet.cs | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Campofinale/Http/DispatchCN.cs b/Campofinale/Http/DispatchCN.cs index e3bdc5e..33bd6da 100644 --- a/Campofinale/Http/DispatchCN.cs +++ b/Campofinale/Http/DispatchCN.cs @@ -29,7 +29,7 @@ namespace Campofinale.Http [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/default/network_config")] public static async Task network_config_cn(HttpContext ctx) { - string resp = "{\"asset\":\"https://beyond.hg-cdn.com/asset/\",\"hgage\":\"\",\"sdkenv\":\"2\",\"u8root\":\"https://u8.gryphline.com/u8\",\"appcode\":4,\"channel\":\"prod\",\"netlogid\":\"GFz8RRMDN45w\",\"gameclose\":false,\"netlogurl\":\"http://native-log-collect.gryphline.com:32000/\",\"accounturl\":\"https://binding-api-account-prod.gryphline.com\",\"launcherurl\":\"https://launcher.gryphline.com\"}"; + string resp = "{\"asset\":\"https://beyond.hycdn.cn/asset/\",\"hgage\":\"\",\"sdkenv\":\"2\",\"u8root\":\"https://u8.gryphline.com/u8\",\"appcode\":4,\"channel\":\"prod\",\"netlogid\":\"GFz8RRMDN45w\",\"gameclose\":false,\"netlogurl\":\"http://native-log-collect.gryphline.com:32000/\",\"accounturl\":\"https://binding-api-account-prod.gryphline.com\",\"launcherurl\":\"https://launcher.gryphline.com\"}"; ctx.Response.StatusCode = 200; ctx.Response.ContentLength = resp.Length; @@ -65,7 +65,7 @@ namespace Campofinale.Http public static async Task cn_android_res_version(HttpContext ctx) { - string resp = "{\"version\": \"2361763-612\", \"kickFlag\": false}"; + string resp = "{\"version\": \"2377591-182\", \"kickFlag\": false}"; ctx.Response.StatusCode = 200; @@ -77,7 +77,18 @@ namespace Campofinale.Http [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/Android/game_config")] public static async Task game_config_cn_android(HttpContext ctx) { - string resp = "{\"mockLogin\": false, \"selectSrv\": false, \"enableHotUpdate\": true, \"enableEntitySpawnLog\": false}"; + string resp = "{\"mockLogin\": false, \"selectSrv\": false, \"enableHotUpdate\": true, \"enableNpcOptimize\": false, \"enableEntitySpawnLog\": false}"; + + ctx.Response.StatusCode = 200; + ctx.Response.ContentLength = resp.Length; + ctx.Response.ContentType = "application/json"; + + await ctx.Response.SendAsync(resp); + } + [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/game/get_latest_game_info")] + public static async Task get_latest_game_info(HttpContext ctx) + { + string resp = "{\"version\":\"0.5.5\",\"action\":0,\"update_type\":0,\"update_info\":{\"package\":null,\"patch\":null,\"custom_info\":\"\",\"source_package\":null},\"client_version\":\"\"}"; ctx.Response.StatusCode = 200; ctx.Response.ContentLength = resp.Length; diff --git a/Campofinale/Packets/Cs/HandleCsSceneMoveStateSet.cs b/Campofinale/Packets/Cs/HandleCsSceneMoveStateSet.cs index 781aff0..fde66ad 100644 --- a/Campofinale/Packets/Cs/HandleCsSceneMoveStateSet.cs +++ b/Campofinale/Packets/Cs/HandleCsSceneMoveStateSet.cs @@ -10,7 +10,7 @@ namespace Campofinale.Packets.Cs public static void Handle(Player session, CsMsgId cmdId, Packet packet) { CsSceneMoveStateSet req = packet.DecodeBody(); - + //req. } From 482197b5feb72acc0b7f0b0746d8241c420c81c1 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Fri, 23 May 2025 20:54:35 +0200 Subject: [PATCH 52/58] let's hope this work --- Campofinale/Game/GameConstants.cs | 14 +++++++++----- Campofinale/Http/Dispatch.cs | 32 +++++++++++++++++++++++++++++++ Campofinale/Http/DispatchCN.cs | 14 ++------------ Campofinale/Http/SDK.cs | 14 +++++++++++--- Campofinale/Server.cs | 4 ++-- 5 files changed, 56 insertions(+), 22 deletions(-) diff --git a/Campofinale/Game/GameConstants.cs b/Campofinale/Game/GameConstants.cs index 8bc42e0..fd35d24 100644 --- a/Campofinale/Game/GameConstants.cs +++ b/Campofinale/Game/GameConstants.cs @@ -4,18 +4,22 @@ { //TODO, have to check if this is really userful for support different platform or if android version doesn't need the GAME_VERSION_ASSET_URL (probably not?) //So, in case is useful only if the android build it's different than 0.5.28 - public static List GAME_VERSIONS = new() + /*public static List GAME_VERSIONS = new() { new GameVersionConst("0.5.28"), //Windows CBT2 - new GameVersionConst("x.x.xx"), //Android CBT2 + new GameVersionConst("0.5.5"), //Android CBT2 - }; + };*/ + + //Not used on top ^ public static string GAME_VERSION = "0.5.28"; //CBT 2 + public static string GAME_VERSION_ANDROID = "0.5.5"; //CBT 2 ANDROID public static string GAME_VERSION_ASSET_URL = "https://beyond.hg-cdn.com/uXUuLlNbIYmMMTlN/0.5/update/6/1/Windows/0.5.28_U1mgxrslUitdn3hb/files";//CBT 2 public static int MAX_TEAMS_NUMBER = 5; //Not used yet public static (long, string) SERVER_UID = (99, "99"); //Not used yet, no friend chat in current Beta } - public class GameVersionConst + + /* public class GameVersionConst { public string GAME_VERSION = "0.5.28"; public string GAME_VERSION_ASSET_URL = "https://beyond.hg-cdn.com/uXUuLlNbIYmMMTlN/0.5/update/6/1/Windows/0.5.28_U1mgxrslUitdn3hb/files";//CBT 2 @@ -25,5 +29,5 @@ { this.GAME_VERSION = version; } - } + }*/ } diff --git a/Campofinale/Http/Dispatch.cs b/Campofinale/Http/Dispatch.cs index aa372cd..210dd9d 100644 --- a/Campofinale/Http/Dispatch.cs +++ b/Campofinale/Http/Dispatch.cs @@ -74,6 +74,7 @@ namespace Campofinale.Http await ctx.Response.SendAsync(resp); } + //WINDOWS [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/game/get_latest")] public static async Task get_latest(HttpContext ctx) { @@ -86,6 +87,18 @@ namespace Campofinale.Http await ctx.Response.SendAsync(resp); } + //ANDROID + [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/game/get_latest_game_info")] + public static async Task get_latest_game_info(HttpContext ctx) + { + string resp = "{\"version\":\""+ GameConstants.GAME_VERSION_ANDROID + "\",\"action\":0,\"update_type\":0,\"update_info\":{\"package\":null,\"patch\":null,\"custom_info\":\"\",\"source_package\":null},\"client_version\":\"\"}"; + + ctx.Response.StatusCode = 200; + ctx.Response.ContentLength = resp.Length; + ctx.Response.ContentType = "application/json"; + + await ctx.Response.SendAsync(resp); + } [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/1003/prod-cbt/default/default/network_config")] public static async Task network_config(HttpContext ctx) { @@ -128,8 +141,27 @@ namespace Campofinale.Http [StaticRoute(HttpServerLite.HttpMethod.GET, "/app/v1/config")] public static async Task config_check(HttpContext ctx) { + string appCode = ctx.Request.Query.Elements["appCode"]; + + string resp = "{\"data\":{\"agreementUrl\":{\"register\":\"https://user.gryphline.com/{language}/protocol/plain/terms_of_service\",\"privacy\":\"https://user.gryphline.com/{language}/protocol/plain/privacy_policy\",\"unbind\":\"https://user.gryphline.com/{language}/protocol/plain/endfield/privacy_policy\",\"account\":\"https://user.gryphline.com/{language}/protocol/plain/terms_of_service\",\"game\":\"https://user.gryphline.com/{language}/protocol/plain/endfield/privacy_policy\"},\"app\":{\"googleAndroidClientId\":\"\",\"googleIosClientId\":\"\",\"enableAutoLogin\":true,\"enablePayment\":true,\"enableGuestRegister\":false,\"needShowName\":true,\"displayName\":{\"en-us\":\"Arknights: Endfield\",\"ja-jp\":\"アークナイツ:エンドフィールド\",\"ko-kr\":\"명일방주:엔드필드\",\"zh-cn\":\"明日方舟:终末地\",\"zh-tw\":\"明日方舟:終末地\"},\"unbindAgreement\":[],\"unbindLimitedDays\":30,\"unbindCoolDownDays\":14,\"customerServiceUrl\":\"https://gryphline.helpshift.com/hc/{language}/4-arknights-endfield\",\"enableUnbindGrant\":false},\"customerServiceUrl\":\"https://gryphline.helpshift.com/hc/{language}/4-arknights-endfield\",\"thirdPartyRedirectUrl\":\"https://web-api.gryphline.com/callback/thirdPartyAuth.html\",\"scanUrl\":{\"login\":\"yj://scan_login\"},\"loginChannels\":[],\"userCenterUrl\":\"https://user.gryphline.com/pcSdk/userInfo?language={language}\"},\"msg\":\"OK\",\"status\":0,\"type\":\"A\"}"; + if(appCode == "a65356244d22261b") + { + resp = "{ \"data\": { \"antiAddiction\": { \"minorPeriodEnd\": 21, \"minorPeriodStart\": 20 }, \"payment\": [ { \"key\": \"alipay\", \"recommend\": true }, { \"key\": \"wechat\", \"recommend\": false }, { \"key\": \"pcredit\", \"recommend\": false } ], \"customerServiceUrl\": \"https://chat.hypergryph.com/chat/h5/v2/index.html?sysnum=889ee281e3564ddf883942fe85764d44&channelid=2\", \"cancelDeactivateUrl\": \"https://user-stable.hypergryph.com/cancellation\", \"agreementUrl\": { \"game\": \"https://hg-protocol-static-web-stable.hypergryph.net/protocol/plain/ak/index\", \"unbind\": \"https://hg-protocol-static-web-stable.hypergryph.net/protocol/plain/ak/cancellation\", \"gameService\": \"https://hg-protocol-static-web-stable.hypergryph.net/protocol/plain/ak/service\", \"account\": \"https://user.hypergryph.com/protocol/plain/index\", \"privacy\": \"https://user.hypergryph.com/protocol/plain/privacy\", \"register\": \"https://user.hypergryph.com/protocol/plain/registration\", \"updateOverview\": \"https://user.hypergryph.com/protocol/plain/overview_of_changes\", \"childrenPrivacy\": \"https://user.hypergryph.com/protocol/plain/children_privacy\" }, \"app\": { \"enablePayment\": true, \"enableAutoLogin\": true, \"enableAuthenticate\": true, \"enableAntiAddiction\": true, \"enableUnbindGrant\": true, \"wechatAppId\": \"wxeea7cc50e03edb28\", \"alipayAppId\": \"2021004129658342\", \"oneLoginAppId\": \"496b284079be97612a46266a9fdbfbd7\", \"enablePaidApp\": false, \"appName\": \"明日方舟终末地\", \"appAmount\": 600, \"needShowName\": true, \"customerServiceUrl\": \"https://web-biz-platform-cs-center-stable.hypergryph.net/hg/?hg_token={hg_token}&source_from=sdk\", \"needAntiAddictionAlert\": true, \"enableScanLogin\": false, \"deviceCheckMode\": 0, \"enableGiftCode\": false }, \"scanUrl\": { \"login\": \"hypergryph://scan_login\" }, \"userCenterUrl\": \"https://user-center-account-stable.hypergryph.net/pcSdk/userInfo\" }, \"msg\": \"OK\", \"status\": 0, \"type\": \"A\"}"; + } + + ctx.Response.StatusCode = 200; + //ctx.Response.ContentLength = resp.Length; + ctx.Response.ContentType = "application/json"; + + await ctx.Response.SendAsync(resp); + } + [StaticRoute(HttpServerLite.HttpMethod.GET, "/general/v1/server_time")] + public static async Task server_time(HttpContext ctx) + { + string resp = "{\"data\":{\"serverTime\":1748021408,\"isHoliday\":true},\"msg\":\"OK\",\"status\":0,\"type\":\"A\"}"; + ctx.Response.StatusCode = 200; diff --git a/Campofinale/Http/DispatchCN.cs b/Campofinale/Http/DispatchCN.cs index 33bd6da..dac444d 100644 --- a/Campofinale/Http/DispatchCN.cs +++ b/Campofinale/Http/DispatchCN.cs @@ -29,7 +29,7 @@ namespace Campofinale.Http [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/default/network_config")] public static async Task network_config_cn(HttpContext ctx) { - string resp = "{\"asset\":\"https://beyond.hycdn.cn/asset/\",\"hgage\":\"\",\"sdkenv\":\"2\",\"u8root\":\"https://u8.gryphline.com/u8\",\"appcode\":4,\"channel\":\"prod\",\"netlogid\":\"GFz8RRMDN45w\",\"gameclose\":false,\"netlogurl\":\"http://native-log-collect.gryphline.com:32000/\",\"accounturl\":\"https://binding-api-account-prod.gryphline.com\",\"launcherurl\":\"https://launcher.gryphline.com\"}"; + string resp = "{ \"asset\": \"https://beyond.hycdn.cn/asset/\", \"hgage\": \"https://web.hycdn.cn/endfield/protocol/cadpa-age.txt\", \"sdkenv\": \"2\", \"u8root\": \"https://as.hypergryph.com/u8\", \"appcode\": 4, \"channel\": \"prod\", \"netlogid\": \"56RqF5G2gU9j\", \"gameclose\": false, \"netlogurl\": \"http://native-log-collect.hypergryph.com:32000\", \"accounturl\": \"https://binding-api-account-prod.hypergryph.com\", \"launcherurl\": \"https://launcher.hypergryph.com\"}"; ctx.Response.StatusCode = 200; ctx.Response.ContentLength = resp.Length; @@ -85,16 +85,6 @@ namespace Campofinale.Http await ctx.Response.SendAsync(resp); } - [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/game/get_latest_game_info")] - public static async Task get_latest_game_info(HttpContext ctx) - { - string resp = "{\"version\":\"0.5.5\",\"action\":0,\"update_type\":0,\"update_info\":{\"package\":null,\"patch\":null,\"custom_info\":\"\",\"source_package\":null},\"client_version\":\"\"}"; - - ctx.Response.StatusCode = 200; - ctx.Response.ContentLength = resp.Length; - ctx.Response.ContentType = "application/json"; - - await ctx.Response.SendAsync(resp); - } + } } diff --git a/Campofinale/Http/SDK.cs b/Campofinale/Http/SDK.cs index 1a8b599..6543039 100644 --- a/Campofinale/Http/SDK.cs +++ b/Campofinale/Http/SDK.cs @@ -72,8 +72,12 @@ namespace Campofinale.Http await ctx.Response.SendAsync(resp); } - - + + [StaticRoute(HttpServerLite.HttpMethod.GET, "/batch_event")] + public static async Task batch_event(HttpContext ctx) + { + await ctx.Response.SendAsync("OK"); + } [StaticRoute(HttpServerLite.HttpMethod.GET, "/user/info/v1/basic")] public static async Task account_info_get(HttpContext ctx) { @@ -82,7 +86,10 @@ namespace Campofinale.Http string resp = "{\"data\":{\"hgId\":\"1799321925\",\"email\":\"dispatch@endfield.ps\",\"realEmail\":\"dispatch@endfield.ps\",\"isLatestUserAgreement\":true,\"nickName\":\"Campofinale\"},\"msg\":\"OK\",\"status\":0,\"type\":1}"; if (account != null) { - resp = "{\"data\":{\"idCardNum\": 110102200610048887,\"hgId\":\"" + account.id + "\",\"email\":\"" + account.username +Server.config.dispatchServer.emailFormat +"\",\"realEmail\":\"" + account.username + Server.config.dispatchServer.emailFormat + "\",\"isLatestUserAgreement\":true,\"nickName\":\"" + account.username + "\",\"name\":\"AAAA\"},\"msg\":\"OK\",\"status\":0,\"type\":1}"; + /* + * {"data":{"hgId":"1326618825955","phone":"153****5243","email":null,"identityNum":"5002**********1619","identityName":"金*","isMinor":false,"isLatestUserAgreement":true},"msg":"OK","status":0,"type":"A"} + */ + resp = "{\"data\":{\"phone\":\"153****5243\", \"identityNum\": \"5002**********1619\",\"identityName\":\"金*\",\"isMinor\":false,\"hgId\":\"" + account.id + "\",\"email\":\"" + account.username +Server.config.dispatchServer.emailFormat +"\",\"realEmail\":\"" + account.username + Server.config.dispatchServer.emailFormat + "\",\"isLatestUserAgreement\":true,\"nickName\":\"" + account.username + "\"},\"msg\":\"OK\",\"status\":0,\"type\":\"A\"}"; } else { @@ -132,6 +139,7 @@ namespace Campofinale.Http string resp = "{\"msg\": \"Error\", \"status\": 2, \"type\": \"A\"}"; if (account != null) { + resp = "{\"data\": { \"uid\": \"" + account.id + "\", \"code\": \"" + account.grantToken + "\" }, \"msg\": \"OK\", \"status\": 0, \"type\": \"A\"}"; } diff --git a/Campofinale/Server.cs b/Campofinale/Server.cs index f842f0b..9f80031 100644 --- a/Campofinale/Server.cs +++ b/Campofinale/Server.cs @@ -48,7 +48,7 @@ namespace Campofinale public delegate void HandlerDelegate(Player sender, string command, string[] args, Player target); } public static List clients = new List(); - public static string ServerVersion = "1.1.2-dev"; + public static string ServerVersion = "1.1.5-dev"; public static bool Initialized = false; public static bool showLogs = true; public static bool showWarningLogs = true; @@ -83,7 +83,7 @@ namespace Campofinale showLogs = config.logOptions.packets; showWarningLogs = config.logOptions.packetWarnings; showBodyLogs = config.logOptions.packetBodies; - Logger.Print($"Starting server version {ServerVersion} with supported client version {GameConstants.GAME_VERSION}"); + Logger.Print($"Starting server version {ServerVersion} with supported client version: WINDOWS-{GameConstants.GAME_VERSION} and MOBILE-{GameConstants.GAME_VERSION_ANDROID}"); Logger.Print($"Logs are {(showLogs ? "enabled" : "disabled")}"); Logger.Print($"Warning logs are {(showWarningLogs ? "enabled" : "disabled")}"); Logger.Print($"Packet body logs are {(showBodyLogs ? "enabled" : "disabled")}"); From 62df1581a93d8dd2a5740a2e6948d868fa98b372 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Fri, 23 May 2025 23:11:58 +0200 Subject: [PATCH 53/58] i hope some fix --- Campofinale/Http/SDK.cs | 2 +- Campofinale/Packets/Cs/HandleCsLogin.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Campofinale/Http/SDK.cs b/Campofinale/Http/SDK.cs index 6543039..f6261a4 100644 --- a/Campofinale/Http/SDK.cs +++ b/Campofinale/Http/SDK.cs @@ -140,7 +140,7 @@ namespace Campofinale.Http if (account != null) { - resp = "{\"data\": { \"uid\": \"" + account.id + "\", \"code\": \"" + account.grantToken + "\" }, \"msg\": \"OK\", \"status\": 0, \"type\": \"A\"}"; + resp = "{\"data\": { \"token\": \"" + account.token + "\", \"uid\": \"" + account.id + "\", \"code\": \"" + account.grantToken + "\" }, \"msg\": \"OK\", \"status\": 0, \"type\": \"A\"}"; } ctx.Response.StatusCode = 200; diff --git a/Campofinale/Packets/Cs/HandleCsLogin.cs b/Campofinale/Packets/Cs/HandleCsLogin.cs index 8ba75f1..78c475d 100644 --- a/Campofinale/Packets/Cs/HandleCsLogin.cs +++ b/Campofinale/Packets/Cs/HandleCsLogin.cs @@ -57,7 +57,7 @@ namespace Campofinale.Packets.Cs // rsp.ServerPublicKey = ByteString.CopyFrom(encryptedEncKey); CSChaCha20 cipher = new CSChaCha20(encKey, serverEncrypNonce, 1); - if (req.ClientVersion == GameConstants.GAME_VERSION) + if (req.ClientVersion == GameConstants.GAME_VERSION || req.ClientVersion == GameConstants.GAME_VERSION_ANDROID) { if (account == null) { From 4c25f00235f3e0eac559eb185029e5945a3a773f Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Fri, 23 May 2025 23:19:43 +0200 Subject: [PATCH 54/58] fix for a log --- Campofinale/Server.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Campofinale/Server.cs b/Campofinale/Server.cs index 9f80031..5b5d97a 100644 --- a/Campofinale/Server.cs +++ b/Campofinale/Server.cs @@ -109,11 +109,20 @@ namespace Campofinale if (clientSocket.Connected) { - Player client = new Player(clientSocket); - clients.Add(client); - client.receivorThread.Start(); + Logger.Print("Connected new client: " + clients.Count()+1); + try + { + Player client = new Player(clientSocket); + clients.Add(client); + client.receivorThread.Start(); + } + catch (Exception e) + { + Logger.PrintError($" {e.Message}"); + } + - Logger.Print("Connected new client: " + clients.Count()); + } From 0cef94edfc62e7c88e183e7fd363ee5d8d1bed6c Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sun, 25 May 2025 14:19:00 +0200 Subject: [PATCH 55/58] enableCBT2AccessForbidden on FALSE OMG --- Campofinale/Http/Dispatch.cs | 2 +- Campofinale/Http/DispatchCN.cs | 4 ++-- Campofinale/Packets/Sc/PacketScSyncCharBagInfo.cs | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Campofinale/Http/Dispatch.cs b/Campofinale/Http/Dispatch.cs index 210dd9d..9d2e621 100644 --- a/Campofinale/Http/Dispatch.cs +++ b/Campofinale/Http/Dispatch.cs @@ -114,7 +114,7 @@ namespace Campofinale.Http [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/1003/prod-cbt/default/Windows/game_config")] public static async Task game_config(HttpContext ctx) { - string resp = "{\"mockLogin\": false, \"selectSrv\": false, \"enableHotUpdate\": false, \"enableEntitySpawnLog\": false}"; + string resp = "{\"mockLogin\": false, \"selectSrv\": false, \"enableHotUpdate\": false, \"enableEntitySpawnLog\": false, \"enableCBT2AccessForbidden\": false}"; ctx.Response.StatusCode = 200; ctx.Response.ContentLength = resp.Length; diff --git a/Campofinale/Http/DispatchCN.cs b/Campofinale/Http/DispatchCN.cs index dac444d..9040582 100644 --- a/Campofinale/Http/DispatchCN.cs +++ b/Campofinale/Http/DispatchCN.cs @@ -52,7 +52,7 @@ namespace Campofinale.Http [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/Windows/game_config")] public static async Task game_config_cn_windows(HttpContext ctx) { - string resp = "{\"mockLogin\": false, \"selectSrv\": false, \"enableHotUpdate\": true, \"enableEntitySpawnLog\": false}"; + string resp = "{\"mockLogin\": false, \"selectSrv\": false, \"enableHotUpdate\": true, \"enableEntitySpawnLog\": false, \"enableCBT2AccessForbidden\": false}"; ctx.Response.StatusCode = 200; ctx.Response.ContentLength = resp.Length; @@ -77,7 +77,7 @@ namespace Campofinale.Http [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/Android/game_config")] public static async Task game_config_cn_android(HttpContext ctx) { - string resp = "{\"mockLogin\": false, \"selectSrv\": false, \"enableHotUpdate\": true, \"enableNpcOptimize\": false, \"enableEntitySpawnLog\": false}"; + string resp = "{\"mockLogin\": false, \"selectSrv\": false, \"enableHotUpdate\": true, \"enableNpcOptimize\": false, \"enableEntitySpawnLog\": false, \"enableCBT2AccessForbidden\": false}"; ctx.Response.StatusCode = 200; ctx.Response.ContentLength = resp.Length; diff --git a/Campofinale/Packets/Sc/PacketScSyncCharBagInfo.cs b/Campofinale/Packets/Sc/PacketScSyncCharBagInfo.cs index e456948..2fdc500 100644 --- a/Campofinale/Packets/Sc/PacketScSyncCharBagInfo.cs +++ b/Campofinale/Packets/Sc/PacketScSyncCharBagInfo.cs @@ -10,6 +10,7 @@ namespace Campofinale.Packets.Sc ScSyncCharBagInfo proto = new() { + ScopeName=1, CharInfo = From 7b6541a35ba4f3a1dadf86c67c6b51df5eb50ca9 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sun, 25 May 2025 17:30:19 +0200 Subject: [PATCH 56/58] disabling watermark --- Campofinale/Http/DispatchCN.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Campofinale/Http/DispatchCN.cs b/Campofinale/Http/DispatchCN.cs index 9040582..44b3daf 100644 --- a/Campofinale/Http/DispatchCN.cs +++ b/Campofinale/Http/DispatchCN.cs @@ -77,7 +77,7 @@ namespace Campofinale.Http [StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/Android/game_config")] public static async Task game_config_cn_android(HttpContext ctx) { - string resp = "{\"mockLogin\": false, \"selectSrv\": false, \"enableHotUpdate\": true, \"enableNpcOptimize\": false, \"enableEntitySpawnLog\": false, \"enableCBT2AccessForbidden\": false}"; + string resp = "{\"mockLogin\": false, \"selectSrv\": false, \"enableHotUpdate\": true, \"enableNpcOptimize\": false, \"enableEntitySpawnLog\": false, \"enableCBT2AccessForbidden\": false, \"enableMobileFullScreenWaterMark\": false}"; ctx.Response.StatusCode = 200; ctx.Response.ContentLength = resp.Length; From d55e35aae0415ec12037afc6f3119d4b883b136b Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sun, 25 May 2025 17:31:00 +0200 Subject: [PATCH 57/58] 1.1.5 final so i can plan new version features --- Campofinale/Server.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Campofinale/Server.cs b/Campofinale/Server.cs index 5b5d97a..502d443 100644 --- a/Campofinale/Server.cs +++ b/Campofinale/Server.cs @@ -48,7 +48,7 @@ namespace Campofinale public delegate void HandlerDelegate(Player sender, string command, string[] args, Player target); } public static List clients = new List(); - public static string ServerVersion = "1.1.5-dev"; + public static string ServerVersion = "1.1.5"; public static bool Initialized = false; public static bool showLogs = true; public static bool showWarningLogs = true; From f65555fbcf3e74401ea7db8420e9a1c03ac214b8 Mon Sep 17 00:00:00 2001 From: AlessandroCH Date: Sun, 25 May 2025 17:43:00 +0200 Subject: [PATCH 58/58] mission data not required --- Campofinale/Game/MissionSys/MissionSystem.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Campofinale/Game/MissionSys/MissionSystem.cs b/Campofinale/Game/MissionSys/MissionSystem.cs index b7d7412..04ea850 100644 --- a/Campofinale/Game/MissionSys/MissionSystem.cs +++ b/Campofinale/Game/MissionSys/MissionSystem.cs @@ -75,6 +75,12 @@ namespace Campofinale.Game.MissionSys } public void Load() { + + if (ResourceManager.missionDataTable.Count < 1) + { + //Disabling if no missions + return; + } //TODO Saving and first initialization AddMission("e0m0",MissionState.Processing); }