Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages | Examples

ClientPacket Class Reference
[GanefClient]

This packet is used from the client-side when sending/receiving packets. More...

#include <clientpacket.h>

Inheritance diagram for ClientPacket:

FrameworkPacket List of all members.

Public Member Functions

 ClientPacket (char *data, unsigned int size)
 Constructor used when receiving packets.
 ClientPacket (const ClientData *fdata, unsigned char type=4, unsigned char priority=1, bool reliable=false)
 Constructor used when client-data is signaling back.
 ~ClientPacket ()
void makeSendReady ()
 This method makes the packet ready for sending (htonl(...) is called on header fields).
unsigned int getUserID () const
 Will return the ID of the user for whom that packet is from/to.
Readers
Exceptions:
PacketError is thrown if you try to read beyond the size of the packet.
The following methods are used when reading from a packet.

template<class T>
void readPtr (ClientData *receiver, T **ptrptr, ClientFramework *framework)
 The class T must be a subclass of ClientData.
template<class T>
T * readObject (ClientFramework *f)
 The class T must be a subclass of ClientData.
ClientPacketreadPacket (unsigned int psize)
 This method will create a new packet of size psize from current possition.

Static Public Member Functions

static ClientPacketcreateAckPacket (ClientPacket *packet)
 This will create an ack-packet.
static ClientPacketcreateDummyPacket ()
static ClientPacketcreateSystemPacket (ClientFramework *f, FrameworkPacket::SpecialReceivers receiver)
static ClientPacketcreatePluginPacket (const Plugin< ClientPacket > *plugin, const ClientPacket *_packet)
 Will create a plugin packet from a plugin.

Protected Member Functions

 ClientPacket (ClientFramework *f, unsigned int receiver, unsigned char type=4, unsigned char priority=1, unsigned int bodysize=INITIAL_BODY_SIZE, bool reliable=false)
 Constructor used when client-data is signaling back.

Detailed Description

This packet is used from the client-side when sending/receiving packets.

Author:
Lars Langer and Emanuel Greisen
Examples:

testclient/testclientframework.cpp, testclient/testclientframework.h, testclient/testclientsnakebite.cpp, and testclient/testclientsnakebite.h.

Definition at line 40 of file clientpacket.h.


The documentation for this class was generated from the following files:
Generated on Mon Feb 6 12:24:52 2006 for Ganef by  doxygen 1.4.4