Skip to content

Commit

Permalink
Merge pull request #385 from Lotendan/feature/PascalStringLength
Browse files Browse the repository at this point in the history
Add more length restrictions to WritePascalStringIntLE
  • Loading branch information
NetDwarf authored May 2, 2022
2 parents 480ca38 + 07e5472 commit 6231ce1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions GameServer/packets/Server/PacketLib1125.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public override void SendVersionAndCryptKey()
//Construct the new packet
using (var pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.CryptKey)))
{
pak.WritePascalStringIntLE((((int)m_gameClient.Version) / 1000) + "." + (((int)m_gameClient.Version) - 1000) + m_gameClient.MinorRev);
pak.WritePascalStringIntLE((((int)m_gameClient.Version) / 1000) + "." + (((int)m_gameClient.Version) - 1000) + m_gameClient.MinorRev, 0x20);
//// Same as the trailing two bytes sent in first client to server packet
pak.WriteByte(m_gameClient.MajorBuild); // last seen : 0x2A 0x07
pak.WriteByte(m_gameClient.MinorBuild);
Expand Down Expand Up @@ -581,30 +581,30 @@ public override void SendMarketExplorerWindow(IList<InventoryItem> items, byte p

if (item.Count > 1)
{
pak.WritePascalStringIntLE(item.Count + " " + item.Name);
pak.WritePascalStringIntLE(item.Count + " " + item.Name, 0x30);
}
else if (item.PackSize > 1)
{
pak.WritePascalStringIntLE(item.PackSize + " " + item.Name + bpPrice);
pak.WritePascalStringIntLE(item.PackSize + " " + item.Name + bpPrice, 0x30);
}
else
{
pak.WritePascalStringIntLE(item.Name + bpPrice);
pak.WritePascalStringIntLE(item.Name + bpPrice, 0x30);
}
}
else
{
if (item.Count > 1)
{
pak.WritePascalStringIntLE(item.Count + " " + item.Name);
pak.WritePascalStringIntLE(item.Count + " " + item.Name, 0x30);
}
else if (item.PackSize > 1)
{
pak.WritePascalStringIntLE(item.PackSize + " " + item.Name);
pak.WritePascalStringIntLE(item.PackSize + " " + item.Name, 0x30);
}
else
{
pak.WritePascalStringIntLE(item.Name);
pak.WritePascalStringIntLE(item.Name, 0x30);
}
}
}
Expand Down

0 comments on commit 6231ce1

Please sign in to comment.