Skip to content

Commit

Permalink
Wrap version string, in Login packet, in version check
Browse files Browse the repository at this point in the history
  • Loading branch information
jo3bingham committed Jul 22, 2020
1 parent f71c0b7 commit 95e39f4
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions TibiaAPI/Network/ClientPackets/Login.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ public override void ParseFromNetworkMessage(NetworkMessage message)
ClientType = message.ReadUInt16();
ProtocolVersion = message.ReadUInt16();
ClientVersion = message.ReadUInt32();
Version = message.ReadString();

if (Client.VersionNumber >= 124010030)
{
Version = message.ReadString();
}

DatRevision = message.ReadUInt16();
ClientPreviewState = message.ReadByte();

Expand Down Expand Up @@ -69,7 +74,12 @@ public override void AppendToNetworkMessage(NetworkMessage message)
message.Write(ClientType);
message.Write(ProtocolVersion);
message.Write(ClientVersion);
message.Write(Version);

if (Client.VersionNumber >= 124010030)
{
message.Write(Version);
}

message.Write(DatRevision);
message.Write(ClientPreviewState);
message.Write((byte)0); // Start RSA block.
Expand Down

0 comments on commit 95e39f4

Please sign in to comment.