Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Packet Class PW

Newbie Spellweaver
Joined
Oct 29, 2014
Messages
16
Reaction score
25
Works with PW's packets for reading and writing.

Functions:
Desmond Hume - Packet Class PW - RaGEZONE Forums


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:
Initiate Mage
Joined
Mar 8, 2015
Messages
1
Reaction score
2
ChatBroadCast

Code:
[COLOR=#141414]PROTOCOL_CHATBROADCAST = 0x78[/COLOR]
[COLOR=#141414]struct __cppobj ChatBroadCast : Protocol[/COLOR]
[COLOR=#141414]{[/COLOR]
[COLOR=#141414]  unsigned __int8 channel;[/COLOR]
[COLOR=#141414]  unsigned __int8 emotion;[/COLOR]
[COLOR=#141414]  int srcroleid;[/COLOR]
[COLOR=#141414]  Octets msg;[/COLOR]
[COLOR=#141414]  Octets data;[/COLOR]
[COLOR=#141414]};
[/COLOR]


PHP:
$ChatBroadCast = new WritePacket();
        $ChatBroadCast -> WriteUByte(9); //Chanel
        $ChatBroadCast -> WriteUByte(0); //Emotion
        $ChatBroadCast -> WriteUInt32(0); //Roleid
        $ChatBroadCast -> WriteUString("Message in game"); //Text
        $ChatBroadCast -> WriteOctets(""); //Data
        $ChatBroadCast -> Pack(0x78); //Opcode
        $ChatBroadCast -> Send("localhost", 29300);

Bans

PHP:
$Packet = new WritePacket();
        $Packet -> WriteUInt32(-1); // gmroleid
        $Packet -> WriteUInt32(0); // ssid
        $Packet -> WriteUInt32(16); // ID role/account
        $Packet -> WriteUInt32(3600); // Time
        $Packet -> WriteUString("Violation of the game rules"); //Reason
        switch($_POST['type'])
        {
            case 1:
                $Packet -> Pack(0x162); //Ban account
                break;
            case 2:
                $Packet -> Pack(0x164); //Ban chat account
                break;
            case 3:
                $Packet -> Pack(0x16A); //Ban chat role
                break;
            case 4:
                $Packet -> Pack(0x168); //Ban role
                break;
            default:
                return;
        }
        $Packet -> Send("localhost", 29100);
 
Newbie Spellweaver
Joined
Jul 1, 2009
Messages
33
Reaction score
1
How to start/stop a trigger from npcgen?
PHP:
$Packet = new WritePacket();
        $Packet -> WriteUInt32(-1); //xid?
        $Packet -> WriteUInt32(1);     // worldtag 1 for world?
        $Packet -> WriteOctets(""); //Data
        $Packet -> Pack(0x17c); //Opcode
        $Packet -> Send("localhost", 29100);
1. what is xid?
2.is 1 worldtag for world?
3.trigger id or trigger GM_ID should be used and how?
4.29100 or 29300?
5.is GMContolGame 0x17c right packet/opcode for this
6.is it possible to start/stop a trigger using packets?
:unsure:
 
Back
Top