Skip to content

D2GAME_PACKETS_SendPacket0xA0_A1_A2_6FC3D610 Uses Incorrect Packets #172

@Necrolis

Description

@Necrolis

D2GAME_PACKETS_SendPacket0xA0_A1_A2_6FC3D610 branches between 3 packets, one for 8bit, one for 16bit and one for 32bit values; however each of these packets has been typedefd to a shared packet, leading to incorrect sizes and value truncation:

using D2GSPacketSrvA0 = D2GSPacketSrvStatAndGuid;

these require there own packets, or for the base packet to be a templated, eg:

template<typename T>
struct D2GSPacketSrvStatAndGuid	//size of 0x08 (originally 0x07)
{
	uint8_t nHeader;			//0x00
	PacketStatId nStat;			//0x01
	uint32_t dwGUID;			//0x03 (Originally 0x02)
	T nValue;				//0x07 (Originally 0x06)
};

using D2GSPacketSrvA0 = D2GSPacketSrvStatAndGuid<uint32_t>;
using D2GSPacketSrvA1 = D2GSPacketSrvStatAndGuid<uint8_t>;
using D2GSPacketSrvA2 = D2GSPacketSrvStatAndGuid<uint16_t>;

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions