Add ChannelEnterFinishReply.

This commit is contained in:
Ray Koopa 2019-01-04 19:57:38 +01:00
parent 1a5bbe714f
commit 41991d6d78
5 changed files with 29 additions and 4 deletions

View File

@ -142,6 +142,7 @@ namespace Syroot.Worms.OnlineWorms.Server
public void HandleChannelUnkInfo(ChannelUnkInfoQuery packet)
{
// Send player rank infos.
ChannelUnkInfoReply reply = new ChannelUnkInfoReply
{
UnknownA = "Test",
@ -158,7 +159,8 @@ namespace Syroot.Worms.OnlineWorms.Server
}
SendPacket(reply);
SendPacket(new RawPacket(PacketType.Channel, 0x44, (byte)0x00));
// This is the last channel info packet, tell the client to go to the channel screen.
SendPacket(new ChannelEnterFinishReply());
}
#if DEBUG

View File

@ -167,9 +167,11 @@ namespace Syroot.Worms.OnlineWorms.Server.Net
{
OnPrePacketSend(packet);
// Serialize the raw packet data.
// Serialize the raw packet data, which must consist of at least 1 byte (at least for channels).
_sendStream.Position = 0;
packet.Serialize(_sendStream);
if (_sendStream.Position == 0)
_sendStream.WriteByte(0);
ushort dataSize = (ushort)_sendStream.Position;
// Send the data and return success.

View File

@ -0,0 +1,18 @@
using System;
namespace Syroot.Worms.OnlineWorms.Server.Net
{
/// <summary>
/// Represents an additional server response to a <see cref="ChannelUnkInfoQuery"/>, causing the client to switch
/// to the channel screen (game lobby).
/// </summary>
[Packet(PacketType.Channel, 0x44)]
internal class ChannelEnterFinishReply : Packet
{
// ---- METHODS (INTERNAL) -------------------------------------------------------------------------------------
internal override void Deserialize(PacketStream stream) => throw new NotImplementedException();
internal override void Serialize(PacketStream stream) { }
}
}

View File

@ -14,7 +14,7 @@ namespace Syroot.Worms.OnlineWorms.Server.Net
public string UnknownA { get; set; } // Max. 30 chars
public IList<ChannelUnkInfo> UnkInfos { get; set; } // Client always requests 20 elements.
public IList<ChannelUnkInfo> UnkInfos { get; set; } // Apparently ranks. Client always requests 20 elements.
// ---- METHODS (INTERNAL) -------------------------------------------------------------------------------------
@ -32,6 +32,9 @@ namespace Syroot.Worms.OnlineWorms.Server.Net
}
}
/// <summary>
/// Represents a player channel rank, apparently.
/// </summary>
public class ChannelUnkInfo
{
public ushort UnknownA { get; set; }

View File

@ -1,5 +1,5 @@
{
"IP": "87.123.189.212", // external IP sent to clients to connect to
"IP": "127.0.0.1", // external IP sent to clients to connect to
"Port": 17022,
"Name": "Online Worms Private Server",
"Region": "Global",