From 9a6da5d717fcba9f8bf9693f025e6b5e9fe72017 Mon Sep 17 00:00:00 2001 From: Kyle Belanger Date: Thu, 11 Apr 2024 01:21:06 -0400 Subject: [PATCH] Some namespace cleanup --- AscNet.Common/Common.cs | 11 ++++------ AscNet.GameServer/Handlers/AccountModule.cs | 1 - AscNet.GameServer/Handlers/CharacterModule.cs | 22 +++++++++---------- AscNet.GameServer/Handlers/EquipModule.cs | 2 +- .../Handlers/ExhibitionModule.cs | 2 +- AscNet.GameServer/Handlers/FightModule.cs | 10 ++++----- AscNet.GameServer/Handlers/ItemModule.cs | 5 ----- AscNet.GameServer/Handlers/MailModule.cs | 3 +-- AscNet.GameServer/Handlers/ShopModule.cs | 1 - AscNet.GameServer/Handlers/TRPGModule.cs | 1 - 10 files changed, 23 insertions(+), 35 deletions(-) diff --git a/AscNet.Common/Common.cs b/AscNet.Common/Common.cs index 0d389e9..ba4d417 100644 --- a/AscNet.Common/Common.cs +++ b/AscNet.Common/Common.cs @@ -1,11 +1,5 @@ -using System.Reflection; -using AscNet.Common.Database; +using Config.Net; using MongoDB.Driver; -using Config.Net; -using MongoDB.Bson.Serialization; -using MongoDB.Bson.Serialization.Options; -using Newtonsoft.Json; -using AscNet.Common.Util; namespace AscNet.Common { @@ -29,6 +23,7 @@ namespace AscNet.Common db = mongoClient.GetDatabase(config.Database.Name); } + /* public static void DumpTables() { IEnumerable tableTypes = Assembly.GetAssembly(typeof(Table.V2.client.activity.ActivityGroupTable))!.GetTypes().Where(t => typeof(ITable).IsAssignableFrom(t)); @@ -57,7 +52,9 @@ namespace AscNet.Common } } } + */ } + public class ServerCodeException : Exception { public int Code { get; set; } diff --git a/AscNet.GameServer/Handlers/AccountModule.cs b/AscNet.GameServer/Handlers/AccountModule.cs index 859263c..c3c90ce 100644 --- a/AscNet.GameServer/Handlers/AccountModule.cs +++ b/AscNet.GameServer/Handlers/AccountModule.cs @@ -4,7 +4,6 @@ using AscNet.Common.Util; using AscNet.Table.V2.share.chat; using AscNet.Table.V2.share.guide; using AscNet.Table.V2.share.photomode; -using AscNet.Table.V2.share.trpg; using MessagePack; using System.Diagnostics; diff --git a/AscNet.GameServer/Handlers/CharacterModule.cs b/AscNet.GameServer/Handlers/CharacterModule.cs index dbe1bb0..6c842fb 100644 --- a/AscNet.GameServer/Handlers/CharacterModule.cs +++ b/AscNet.GameServer/Handlers/CharacterModule.cs @@ -1,15 +1,15 @@ -using AscNet.Common.Database; +using AscNet.Common; +using AscNet.Common.Database; using AscNet.Common.MsgPack; using AscNet.Common.Util; -using AscNet.Table.V2.share.item; using AscNet.Table.V2.share.character; -using AscNet.Table.V2.share.character.grade; -using MessagePack; -using AscNet.Common; -using AscNet.Table.V2.share.character.quality; -using MongoDB.Driver.Linq; -using AscNet.Table.V2.share.character.skill; using AscNet.Table.V2.share.character.enhanceskill; +using AscNet.Table.V2.share.character.grade; +using AscNet.Table.V2.share.character.quality; +using AscNet.Table.V2.share.character.skill; +using AscNet.Table.V2.share.item; +using MessagePack; +using MongoDB.Driver.Linq; namespace AscNet.GameServer.Handlers { @@ -39,7 +39,7 @@ namespace AscNet.GameServer.Handlers { public int Code; } - + [MessagePackObject(true)] public class CharacterLevelUpRequest { @@ -184,7 +184,7 @@ namespace AscNet.GameServer.Handlers } character.Grade = nextGrade; - + session.SendPush(new NotifyCharacterDataList() { CharacterDataList = { character } @@ -275,7 +275,7 @@ namespace AscNet.GameServer.Handlers // CharacterManagerGetQualityFragmentTemplateNotFound throw new ServerCodeException("Character quality fragment table data not found!", 20009004); } - + if (TableReaderV2.Parse().Any(x => x.Type == characterData?.Type && x.Quality == character?.Quality + 1)) { if (characterQualityFragment.PromoteUseCoin is not null && characterQualityFragment.PromoteUseCoin > 0) diff --git a/AscNet.GameServer/Handlers/EquipModule.cs b/AscNet.GameServer/Handlers/EquipModule.cs index 3060c67..42c9a1e 100644 --- a/AscNet.GameServer/Handlers/EquipModule.cs +++ b/AscNet.GameServer/Handlers/EquipModule.cs @@ -2,9 +2,9 @@ using AscNet.Common.Database; using AscNet.Common.MsgPack; using AscNet.Common.Util; +using AscNet.Table.V2.share.attrib; using AscNet.Table.V2.share.equip; using AscNet.Table.V2.share.item; -using AscNet.Table.V2.share.attrib; using MessagePack; namespace AscNet.GameServer.Handlers diff --git a/AscNet.GameServer/Handlers/ExhibitionModule.cs b/AscNet.GameServer/Handlers/ExhibitionModule.cs index 50a1c94..3fd882d 100644 --- a/AscNet.GameServer/Handlers/ExhibitionModule.cs +++ b/AscNet.GameServer/Handlers/ExhibitionModule.cs @@ -1,7 +1,7 @@ using MessagePack; using AscNet.Common.MsgPack; -using AscNet.Table.V2.share.exhibition; using AscNet.Common.Util; +using AscNet.Table.V2.share.exhibition; using AscNet.Table.V2.share.reward; namespace AscNet.GameServer.Handlers diff --git a/AscNet.GameServer/Handlers/FightModule.cs b/AscNet.GameServer/Handlers/FightModule.cs index 084529d..328e2e5 100644 --- a/AscNet.GameServer/Handlers/FightModule.cs +++ b/AscNet.GameServer/Handlers/FightModule.cs @@ -1,14 +1,14 @@ -using AscNet.Common.Database; +using AscNet.Common; +using AscNet.Common.Database; using AscNet.Common.MsgPack; using AscNet.Common.Util; -using AscNet.Common; +using AscNet.GameServer.Handlers.Drops; +using AscNet.Table.V2.share.character.skill; using AscNet.Table.V2.share.fuben; using AscNet.Table.V2.share.item; using AscNet.Table.V2.share.reward; -using MessagePack; -using AscNet.GameServer.Handlers.Drops; using AscNet.Table.V2.share.robot; -using AscNet.Table.V2.share.character.skill; +using MessagePack; namespace AscNet.GameServer.Handlers { diff --git a/AscNet.GameServer/Handlers/ItemModule.cs b/AscNet.GameServer/Handlers/ItemModule.cs index 617153c..682c021 100644 --- a/AscNet.GameServer/Handlers/ItemModule.cs +++ b/AscNet.GameServer/Handlers/ItemModule.cs @@ -1,9 +1,4 @@ using MessagePack; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace AscNet.GameServer.Handlers { diff --git a/AscNet.GameServer/Handlers/MailModule.cs b/AscNet.GameServer/Handlers/MailModule.cs index 7e140fc..1ee8bfe 100644 --- a/AscNet.GameServer/Handlers/MailModule.cs +++ b/AscNet.GameServer/Handlers/MailModule.cs @@ -1,5 +1,4 @@ -using AscNet.Common.MsgPack; -using MessagePack; +using MessagePack; namespace AscNet.GameServer.Handlers { diff --git a/AscNet.GameServer/Handlers/ShopModule.cs b/AscNet.GameServer/Handlers/ShopModule.cs index bfb7513..85d68dc 100644 --- a/AscNet.GameServer/Handlers/ShopModule.cs +++ b/AscNet.GameServer/Handlers/ShopModule.cs @@ -1,5 +1,4 @@ using AscNet.Common.MsgPack; -using MessagePack; namespace AscNet.GameServer.Handlers { diff --git a/AscNet.GameServer/Handlers/TRPGModule.cs b/AscNet.GameServer/Handlers/TRPGModule.cs index eca9483..499860d 100644 --- a/AscNet.GameServer/Handlers/TRPGModule.cs +++ b/AscNet.GameServer/Handlers/TRPGModule.cs @@ -1,6 +1,5 @@ using AscNet.Common.MsgPack; using AscNet.Common.Util; -using AscNet.Table.V2.share.reward; using AscNet.Table.V2.share.trpg; using MessagePack;