Newbie Spellweaver
- Joined
- Oct 29, 2014
- Messages
- 16
- Reaction score
- 25
Works with PW's packets for reading and writing.
Functions:
For example, you can get role nick by id (see also struct GRoleBase):
Download: View attachment packet_class.zip
Functions:
For example, you can get role nick by id (see also struct GRoleBase):
Code:
struct __cppobj __attribute__((aligned(2))) GRoleBase : Rpc::Data
{
char version;
unsigned int id;
Octets name;
int race;
int cls;
unsigned __int8 gender;
Octets custom_data;
Octets config_data;
unsigned int custom_stamp;
unsigned __int8 status;
int delete_time;
int create_time;
int lastlogin_time;
GRoleForbidVector forbid;
Octets help_states;
unsigned int spouse;
unsigned int userid;
Octets cross_data;
unsigned __int8 reserved2;
unsigned __int8 reserved3;
unsigned __int8 reserved4;
};
PHP:
<?
include("packet_class.php");
$GetRoleBase = new WritePacket();
$GetRoleBase -> WriteUInt32(-1); // always
$GetRoleBase -> WriteUInt32(1024); // userid
$GetRoleBase -> Pack(0xBC5); // opcode
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
?>
Download: View attachment packet_class.zip
Attachments
You must be registered for see attachments list
Last edited: