From cc84ed3d5f2b5c73ce366a8721e0574debc4d8a7 Mon Sep 17 00:00:00 2001 From: Ray Koopa Date: Mon, 21 Jan 2019 20:09:53 +0100 Subject: [PATCH] Typo --- .../Client.WorldPartyAqua.Channel.cs | 15 ++++++-- .../WorldPartyAqua/Channel/CmdPacket.cs | 3 +- .../WorldPartyAqua/Channel/CmdQuery.cs | 3 +- .../WorldPartyAqua/Channel/CmdReply.cs | 3 +- .../Channel/StartSingleGameQueryData.cs | 2 +- .../Channel/StartSingleGameReplyData.cs | 2 +- .../Channel/Unknown6QueryData.cs | 27 ++++++++++++++ .../Channel/Unknown6ReplyData.cs | 35 +++++++++++++++++++ src/Syroot.Worms/Core/Algebra.cs | 2 +- 9 files changed, 84 insertions(+), 8 deletions(-) create mode 100644 src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/Unknown6QueryData.cs create mode 100644 src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/Unknown6ReplyData.cs diff --git a/src/Syroot.Worms.Mgame.GameServer/Client.WorldPartyAqua.Channel.cs b/src/Syroot.Worms.Mgame.GameServer/Client.WorldPartyAqua.Channel.cs index 09e2587..13b5ccd 100644 --- a/src/Syroot.Worms.Mgame.GameServer/Client.WorldPartyAqua.Channel.cs +++ b/src/Syroot.Worms.Mgame.GameServer/Client.WorldPartyAqua.Channel.cs @@ -11,8 +11,11 @@ namespace Syroot.Worms.Mgame.GameServer { switch (packet.Data) { - case StartSingleGameQueryData startSingleGameQuery: - HandleWwpaChannelCmdStartGame(startSingleGameQuery); + case StartSingleGameQueryData startSingleGame: + HandleWwpaChannelCmdStartGame(startSingleGame); + break; + case Unknown6QueryData unknown6: + HandleWwpaChannelCmdUnknown6(unknown6); break; } } @@ -75,5 +78,13 @@ namespace Syroot.Worms.Mgame.GameServer } })); } + + private void HandleWwpaChannelCmdUnknown6(Unknown6QueryData unknown6) + { + SendPacket(new CmdReply(new Unknown6ReplyData + { + Result = Unknown6Status.Disconnect + })); + } } } diff --git a/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/CmdPacket.cs b/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/CmdPacket.cs index 00ff8e9..5de08f8 100644 --- a/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/CmdPacket.cs +++ b/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/CmdPacket.cs @@ -52,7 +52,8 @@ namespace Syroot.Worms.Mgame.GameServer.Packets.WorldPartyAqua.Channel internal enum Cmd : int { - StartSingleGameQuery = 5 + StartSingleGameQuery = 5, + Unknown6 = 6 } internal interface ICmdData diff --git a/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/CmdQuery.cs b/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/CmdQuery.cs index 23d67af..f5908bc 100644 --- a/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/CmdQuery.cs +++ b/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/CmdQuery.cs @@ -13,7 +13,8 @@ namespace Syroot.Worms.Mgame.GameServer.Packets.WorldPartyAqua.Channel private static readonly Dictionary _queryClasses = new Dictionary { - [Cmd.StartSingleGameQuery] = typeof(StartSingleGameQueryData) + [Cmd.StartSingleGameQuery] = typeof(StartSingleGameQueryData), + [Cmd.Unknown6] = typeof(Unknown6QueryData) }; // ---- METHODS (PROTECTED) ------------------------------------------------------------------------------------ diff --git a/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/CmdReply.cs b/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/CmdReply.cs index a8187eb..f31868f 100644 --- a/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/CmdReply.cs +++ b/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/CmdReply.cs @@ -13,7 +13,8 @@ namespace Syroot.Worms.Mgame.GameServer.Packets.WorldPartyAqua.Channel private static readonly Dictionary _replyClasses = new Dictionary { - [Cmd.StartSingleGameQuery] = typeof(StartSingleGameReplyData) + [Cmd.StartSingleGameQuery] = typeof(StartSingleGameReplyData), + [Cmd.Unknown6] = typeof(Unknown6ReplyData) }; // ---- CONSTRUCTORS & DESTRUCTOR ------------------------------------------------------------------------------ diff --git a/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/StartSingleGameQueryData.cs b/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/StartSingleGameQueryData.cs index e1e2b56..b220513 100644 --- a/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/StartSingleGameQueryData.cs +++ b/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/StartSingleGameQueryData.cs @@ -3,7 +3,7 @@ namespace Syroot.Worms.Mgame.GameServer.Packets.WorldPartyAqua.Channel { /// - /// Represents the client request for a . + /// Represents the client request for a . /// internal class StartSingleGameQueryData : ICmdData { diff --git a/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/StartSingleGameReplyData.cs b/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/StartSingleGameReplyData.cs index 37eb35f..7b38cbc 100644 --- a/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/StartSingleGameReplyData.cs +++ b/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/StartSingleGameReplyData.cs @@ -5,7 +5,7 @@ using Syroot.BinaryData.Memory; namespace Syroot.Worms.Mgame.GameServer.Packets.WorldPartyAqua.Channel { /// - /// Represents the server response to a . + /// Represents the server response to a . /// internal class StartSingleGameReplyData : ICmdData { diff --git a/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/Unknown6QueryData.cs b/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/Unknown6QueryData.cs new file mode 100644 index 0000000..994b2cc --- /dev/null +++ b/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/Unknown6QueryData.cs @@ -0,0 +1,27 @@ +using System.Net; +using Syroot.BinaryData.Memory; + +namespace Syroot.Worms.Mgame.GameServer.Packets.WorldPartyAqua.Channel +{ + /// + /// Represents the client request for a . + /// + internal class Unknown6QueryData : ICmdData + { + // ---- PROPERTIES --------------------------------------------------------------------------------------------- + + public int UnknownA { get; set; } // Always 1 + + public IPAddress ClientIP { get; set; } + + // ---- METHODS (PUBLIC) --------------------------------------------------------------------------------------- + + public void Load(ref SpanReader reader) + { + UnknownA = reader.ReadInt32(); + ClientIP = IPAddress.Parse(reader.ReadString2()); + } + + public void Save(ref SpanWriter writer) { } + } +} diff --git a/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/Unknown6ReplyData.cs b/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/Unknown6ReplyData.cs new file mode 100644 index 0000000..4e61c2e --- /dev/null +++ b/src/Syroot.Worms.Mgame.GameServer/Packets/WorldPartyAqua/Channel/Unknown6ReplyData.cs @@ -0,0 +1,35 @@ +using System; +using Syroot.BinaryData.Memory; + +namespace Syroot.Worms.Mgame.GameServer.Packets.WorldPartyAqua.Channel +{ + /// + /// Represents the server response to a . + /// + internal class Unknown6ReplyData : ICmdData + { + // ---- PROPERTIES --------------------------------------------------------------------------------------------- + + public Unknown6Status Result { get; set; } + + public ushort Port { get; set; } // Unknown2 = x + 6, Unknown3 = x + + // ---- METHODS (PUBLIC) --------------------------------------------------------------------------------------- + + public void Load(ref SpanReader reader) => throw new NotImplementedException(); + + public void Save(ref SpanWriter writer) + { + writer.WriteEnumSafe(Result); + if (Result != Unknown6Status.Disconnect) + writer.WriteUInt16(Port); + } + } + + internal enum Unknown6Status : int + { + Unknown2 = 2, + Unknown3 = 3, + Disconnect = 4 + } +} diff --git a/src/Syroot.Worms/Core/Algebra.cs b/src/Syroot.Worms/Core/Algebra.cs index 68c9a76..38e779d 100644 --- a/src/Syroot.Worms/Core/Algebra.cs +++ b/src/Syroot.Worms/Core/Algebra.cs @@ -1,7 +1,7 @@ namespace Syroot.Worms.Core { /// - /// Represents mathemtical helper utilities. + /// Represents mathematical helper utilities. /// public static class Algebra {