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

ServerPacket Class Reference
[GanefServer]

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

#include <serverpacket.h>

Inheritance diagram for ServerPacket:

FrameworkPacket List of all members.

Public Member Functions

 ServerPacket (char *data, unsigned int size)
 Constructor used when receiving packets.
 ServerPacket (const ServerData *fdata, unsigned char type, unsigned char priority, bool reliable)
 ~ServerPacket ()
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 client for whom this packet is to/from.
Writers
Exceptions:
PacketError is thrown if you try to write beyond the hard-coded max-size of the packet.
The following methods are used when writing to a packet.

void writePtr (const ServerData *obj)
void writeObject (const ServerData *obj)
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.

ServerPacketreadPacket (unsigned int psize)
 This method will create a new packet of size psize from current possition.

Static Public Member Functions

static ServerPacketinitCreateObjectPacket (const ServerData *fdata, unsigned char prio)
 This will init a "Create-object" packet.
static ServerPacketinitDestroyObjectPacket (const ServerData *fdata, unsigned char prio)
 This will init a "Destroy-object" packet.
static ServerPacketcreateAckPacket (ServerPacket *packet)
 Used to ack packets.
static ServerPacketcreateDummyPacket ()
 Will create an empty dummy packet ready for writing into.
static ServerPacketcreateSystemPacket (FrameworkPacket::SpecialReceivers receiver)
 Will create a system packet.
static ServerPacketcreatePluginPacket (const Plugin< ServerPacket > *plugin, const ServerPacket *packet)
 Will create a plugin packet from a plugin.

Public Attributes

Clientclient

Detailed Description

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

Author:
Lars Langer and Emanuel Greisen
Examples:

testserver/testserverframework.cpp, testserver/testserverframework.h, testserver/testserversnakebite.cpp, and testserver/testserversnakebite.h.

Definition at line 39 of file serverpacket.h.


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