All pastes #580825 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-06-21 08:09 UTC
rendered paste body

				int xPos1 = bytes[6];
				int xPos2 = bytes[7];
				int xPos = (xPos2 << 8) | xPos1;
				int yPos1 = bytes[8];
				int yPos2 = bytes[9];
				int yPos = (yPos2 << 8) | yPos1;
				_hero.xPos = xPos;
				_hero.yPos = yPos;           


void OSTPPKGameModule::InvInteract(int objectId)
{
	int offset = 0;
	unsigned char buffer[13];
	buffer[offset++] = 0x20;
	*reinterpret_cast<int*>(buffer+offset) = objectId;
	offset+= sizeof(int);
	*reinterpret_cast<int*>(buffer+offset) = _hero.xPos;
	offset+= sizeof(int);
	*reinterpret_cast<int*>(buffer+offset) = _hero.yPos;
	offset+= sizeof(int);

	IPacket* packet = _proxy->CreatePacket(buffer, offset);
	_proxy->RelayDataToServer(packet, this);
	delete packet;
}





 uint myUID = 2156306886;
            uint toX = 5106;
            uint toY = 5042;
            uint fromX = 5098;
            uint fromY = 5012;
            /*
            [00:44] <AntiRush> 0x00 (BYTE) 0F
            [00:44] <AntiRush> 0x01 (BYTE) Client Type (always 0x00)
            [00:44] <AntiRush> 0x02 (DWORD) Client ID
            [00:44] <AntiRush> 0x06 (BYTE) Run/Walk (0x01 for walk, 0x17 for run)
            [00:44] <AntiRush> 0x07 (DWORD) Location to walk to
            [00:44] <AntiRush> 0x0B (BYTE) Unknown, always 0x00
            [00:44] <AntiRush> 0x0C (DWORD) Current location of the client
            */
            new byte[] 
                { 
                    0x0F, // PlayerMove
                    0x00, // Client Type (always 0x00)
                    (byte)(myUID & 0xFF), (byte)((myUID >> 8) & 0xFF), (byte)((myUID >> 16) & 0xFF), (byte)(myUID >> 24), // Client ID
                    0x17, // Run/Walk (0x01 for walk, 0x17 for run)
                    (byte)(toX & 0xFF), (byte)((toX >> 8) & 0xFF), (byte)((toX >> 16) & 0xFF), (byte)(toX >> 24), // Location to walk to
                    (byte)(toY & 0xFF), (byte)((toY >> 8) & 0xFF), (byte)((toY >> 16) & 0xFF), (byte)(toY >> 24), // Location to walk to
                    0x00, // Unknown, always 0x00
                    (byte)(fromX & 0xFF), (byte)((fromX >> 8) & 0xFF), (byte)((fromX >> 16) & 0xFF), (byte)(fromX >> 24), // Current location of the client
                    (byte)(fromY & 0xFF), (byte)((fromY >> 8) & 0xFF), (byte)((fromY >> 16) & 0xFF), (byte)(fromY >> 24)  // Current location of the client
                };