Packet Class PW

04/21/2015 15:38 Desmond Hume#1
Works with PW's packets for reading and writing.

Functions:
[Only registered and activated users can see links. Click Here To Register...]

For example, you can get role nick by id (see also struct GRoleBase):

PHP Code:
<?
include("packet_class.php");
$GetRoleBase = new WritePacket();
$GetRoleBase -> WriteUInt32(-1); // always
$GetRoleBase -> WriteUInt32(1024); // userid
$GetRoleBase -> Pack(0xBC5);

if (!
$GetRoleBase -> Send("localhost"29400)) // send to gamedbd
return;

$GetRoleBase_Re = new ReadPacket($GetRoleBase); // reading packet from stream
$packetinfo $GetRoleBase_Re -> ReadPacketInfo(); // read opcode and length
$GetRoleBase_Re -> ReadUInt32(); // always
$GetRoleBase_Re -> ReadUInt32(); // retcode
$GetRoleBase_Re -> ReadUByte(); // version
$GetRoleBase_Re -> ReadUInt32(); // id
echo $GetRoleBase_Re -> ReadUString(); // show rolename
?>
04/21/2015 19:07 auxiliarus#2
Why not just use the PacketSend?
04/22/2015 09:11 Sᴡoosh#3
auxiliarus, you have not understoof what this is commonly used for. It's for serversided interaction.
04/24/2015 19:18 Desmond Hume#4
Quote:
Originally Posted by auxiliarus View Post
Why not just use the PacketSend?
Lol what?

Oh good. Try to write char's data in gamedbd via PacketSend.
And report the results right here.