diff --git a/src/GameServer/RemoteView/ChatCommandListViewPlugIn.cs b/src/GameServer/RemoteView/ChatCommandListViewPlugIn.cs index b095dd5..1c93027 100644 --- a/src/GameServer/RemoteView/ChatCommandListViewPlugIn.cs +++ b/src/GameServer/RemoteView/ChatCommandListViewPlugIn.cs @@ -85,16 +85,16 @@ public class ChatCommandListViewPlugIn : IChatCommandListViewPlugIn return connection.SendAsync(Write); } - private static ChatCommandInfo.ChatCommandParameterType GetParameterType(string typeName) + private static ChatCommandParameterType GetParameterType(string typeName) { return typeName switch { - nameof(Boolean) => ChatCommandInfo.ChatCommandParameterType.Boolean, + nameof(Boolean) => ChatCommandParameterType.Boolean, nameof(Byte) or nameof(SByte) or nameof(Int16) or nameof(UInt16) or nameof(Int32) or nameof(UInt32) - or nameof(Int64) or nameof(UInt64) => ChatCommandInfo.ChatCommandParameterType.Number, - _ => ChatCommandInfo.ChatCommandParameterType.Text, + or nameof(Int64) or nameof(UInt64) => ChatCommandParameterType.Number, + _ => ChatCommandParameterType.Text, }; } } diff --git a/src/Network/Packets/ServerToClient/ServerToClientPackets.cs b/src/Network/Packets/ServerToClient/ServerToClientPackets.cs index 8ab4fe4..054452e 100644 --- a/src/Network/Packets/ServerToClient/ServerToClientPackets.cs +++ b/src/Network/Packets/ServerToClient/ServerToClientPackets.cs @@ -31730,3 +31730,24 @@ public readonly struct ScoreEntry White = 7, } + /// + /// The kind of value which a chat command parameter expects. + /// + public enum ChatCommandParameterType + { + /// + /// The parameter expects a text. + /// + Text = 0, + + /// + /// The parameter expects a number. + /// + Number = 1, + + /// + /// The parameter expects a 0 or a 1. + /// + Boolean = 2, + } + diff --git a/src/Network/Packets/ServerToClient/ServerToClientPackets.xml b/src/Network/Packets/ServerToClient/ServerToClientPackets.xml index 9646bb3..5ee31db 100644 --- a/src/Network/Packets/ServerToClient/ServerToClientPackets.xml +++ b/src/Network/Packets/ServerToClient/ServerToClientPackets.xml @@ -11345,29 +11345,6 @@ - - - ChatCommandParameterType - The kind of value which a chat command parameter expects. - - - Text - The parameter expects a text. - 0 - - - Number - The parameter expects a number. - 1 - - - Boolean - The parameter expects a 0 or a 1. - 2 - - - - @@ -11938,5 +11915,26 @@ + + ChatCommandParameterType + The kind of value which a chat command parameter expects. + + + Text + The parameter expects a text. + 0 + + + Number + The parameter expects a number. + 1 + + + Boolean + The parameter expects a 0 or a 1. + 2 + + + diff --git a/tests/MUnique.OpenMU.Tests/ChatCommandPacketTest.cs b/tests/MUnique.OpenMU.Tests/ChatCommandPacketTest.cs index ae01dd3..effb27d 100644 --- a/tests/MUnique.OpenMU.Tests/ChatCommandPacketTest.cs +++ b/tests/MUnique.OpenMU.Tests/ChatCommandPacketTest.cs @@ -37,18 +37,18 @@ public class ChatCommandPacketTest group.Name = "Group"; group.ShortName = "group"; group.IsRequired = true; - group.Type = ChatCommandInfo.ChatCommandParameterType.Number; + group.Type = ChatCommandParameterType.Number; var ancient = written[1]; ancient.Name = "Ancient"; ancient.ShortName = "anc"; ancient.ValidValues = "0|1|2"; - ancient.Type = ChatCommandInfo.ChatCommandParameterType.Number; + ancient.Type = ChatCommandParameterType.Number; var skill = written[2]; skill.Name = "Skill"; skill.ShortName = "sk"; - skill.Type = ChatCommandInfo.ChatCommandParameterType.Boolean; + skill.Type = ChatCommandParameterType.Boolean; var read = new ChatCommandInfoRef(data); @@ -73,7 +73,7 @@ public class ChatCommandPacketTest Assert.That(read[1].IsRequired, Is.False); Assert.That(read[2].Name, Is.EqualTo("Skill")); - Assert.That(read[2].Type, Is.EqualTo(ChatCommandInfo.ChatCommandParameterType.Boolean)); + Assert.That(read[2].Type, Is.EqualTo(ChatCommandParameterType.Boolean)); } ///