diff --git a/AscNet.Common/Common.cs b/AscNet.Common/Common.cs index 0d389e9e..ba4d4174 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 859263c8..c3c90cec 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 dbe1bb02..6c842fb7 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 3060c67a..42c9a1e6 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 50a1c94b..3fd882d2 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 084529d7..328e2e55 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 617153ce..682c021f 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 7e140fc1..1ee8bfe2 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 bfb75133..85d68dce 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 eca9483b..499860d4 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;