Fix game packets.

This commit is contained in:
Ray Koopa 2020-07-10 23:00:16 +02:00
parent 02a644abe9
commit 20d7c3c743

View File

@ -395,7 +395,8 @@ namespace Syroot.Worms.Worms2.GameServer
private void OnCreateGame(PacketConnection connection, Packet packet)
{
User? fromUser = GetUser(connection);
if (fromUser == null || packet.Value2 == null || packet.Data == null || packet.Session == null)
if (fromUser == null || packet.Value1 != 0 || packet.Value2 == null || packet.Value4 != 0x800
|| packet.Data == null || packet.Name == null || packet.Session == null)
return;
// Require valid room ID.
@ -410,8 +411,9 @@ namespace Syroot.Worms.Worms2.GameServer
foreach (User user in _users.Where(x => x != fromUser))
{
SendPacket(user.Connection, new Packet(PacketCode.CreateGame,
value1: newGame.ID,
value2: newGame.RoomID,
value4: newGame.ID,
value4: 0x800,
data: newGame.IPAddress.ToString(),
name: newGame.Name,
session: newGame.Session));