Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <packet.h>
Public Member Functions | |
Packet () | |
Packet (const void *buffer, size_t sz) | |
Packet (PacketMem &buffer) | |
Packet (const Packet &a) | |
~Packet () | |
Packet & | operator= (const Packet &a) |
void | copyfrom (const Packet &a) |
bool | operator== (const Packet &p) const |
int | send (Cmd cmd, ObjSerial nserial, const char *buf, unsigned int length, int flags, const AddressIP *dst, const SOCKETALT &sock, const char *caller_file, int caller_line) |
flags is a bitwise OR of PCKTFLAGS More... | |
void | bc_create (Cmd cmd, ObjSerial nserial, const char *buf, unsigned int length, int flags, const char *caller_file, int caller_line) |
flags is a bitwise OR of PCKTFLAGS More... | |
int | bc_send (const AddressIP &dst, const SOCKETALT &sock) |
void | display (const char *file, int line) |
void | displayHex () |
unsigned int | getDataLength () const |
ObjSerial | getSerial () const |
unsigned int | getTimestamp () const |
Cmd | getCommand () const |
unsigned short | getFlags () const |
void | setFlag (enum PCKTFLAGS fl) |
void | setFlags (unsigned short fl) |
const char * | getData () const |
const char * | getSendBuffer () const |
int | getSendBufferLength () const |
void | reset () |
Static Public Member Functions | |
static unsigned short | getHeaderLength () |
Packet::Packet | ( | ) |
Packet::Packet | ( | const void * | buffer, |
size_t | sz | ||
) |
Definition at line 44 of file packet.cpp.
References __LINE__NOMSC, COMPRESSED, COUT, display(), int, and MAKE_VALID.
Packet::Packet | ( | PacketMem & | buffer) |
Definition at line 81 of file packet.cpp.
References __LINE__NOMSC, buffer, COMPRESSED, COUT, display(), PacketMem::getConstBuf(), int, PacketMem::len(), and MAKE_VALID.
Packet::Packet | ( | const Packet & | a) |
Definition at line 122 of file packet.cpp.
References copyfrom(), and MAKE_VALID.
Packet::~Packet | ( | ) |
Definition at line 129 of file packet.cpp.
References CHECK_VALID, and MAKE_INVALID.
|
inline |
flags is a bitwise OR of PCKTFLAGS
Definition at line 76 of file packet.h.
Referenced by NetServer::broadcast(), NetServer::BroadcastCargoUpgrade(), NetServer::BroadcastFire(), NetServer::BroadcastUnfire(), NetServer::sendDamages(), NetServer::sendDockAuthorize(), NetServer::sendKill(), NetServer::sendMessage(), NetServer::sendNewUnitQueue(), and NetServer::sendUnDock().
Definition at line 87 of file packet.h.
References send().
Referenced by ZoneMgr::broadcast(), ZoneMgr::broadcastNoSelf(), ZoneMgr::broadcastSample(), and ZoneMgr::broadcastText().
void Packet::copyfrom | ( | const Packet & | a) |
Definition at line 135 of file packet.cpp.
References CHECK_VALID.
Referenced by operator=(), Packet(), and VsnetTCPSocket::recvbuf().
void Packet::display | ( | const char * | file, |
int | line | ||
) |
Definition at line 255 of file packet.cpp.
References CHECK_VALID, PacketMem::dump(), and getDataLength().
Referenced by Packet(), and VsnetUDPSocket::sendbuf().
void Packet::displayHex | ( | ) |
Definition at line 266 of file packet.cpp.
References CHECK_VALID, PacketMem::getConstBuf(), i, and PacketMem::len().
|
inline |
Definition at line 110 of file packet.h.
Referenced by ZoneMgr::broadcast(), AccountServer::recvMsg(), VsnetUDPSocket::sendbuf(), and NetClient::synchronizeTime().
const char * Packet::getData | ( | ) | const |
Definition at line 330 of file packet.cpp.
References c, CHECK_VALID, and PacketMem::getConstBuf().
Referenced by NetClient::loginAccept(), NetClient::loginChooseShip(), AccountServer::recvMsg(), AccountServer::sendAlreadyConnected(), AccountServer::sendAuthorized(), AccountServer::sendUnauthorized(), and NetClient::synchronizeTime().
unsigned int Packet::getDataLength | ( | ) | const |
Definition at line 337 of file packet.cpp.
References PacketMem::len().
Referenced by NetClient::authenticate(), display(), NetClient::loginAccept(), NetClient::loginAuth(), NetClient::loginChooseShip(), AccountServer::recvMsg(), AccountServer::sendAlreadyConnected(), AccountServer::sendAuthorized(), AccountServer::sendUnauthorized(), and NetClient::synchronizeTime().
|
inline |
|
inlinestatic |
Definition at line 97 of file packet.h.
Referenced by NetClient::authenticate().
const char * Packet::getSendBuffer | ( | ) | const |
Definition at line 344 of file packet.cpp.
References c, CHECK_VALID, and PacketMem::getConstBuf().
Referenced by VsnetUDPSocket::sendbuf().
int Packet::getSendBufferLength | ( | ) | const |
Definition at line 351 of file packet.cpp.
Referenced by VsnetUDPSocket::sendbuf(), and VsnetTCPSocket::sendbuf().
|
inline |
Definition at line 102 of file packet.h.
Referenced by NetClient::loginAccept(), AccountServer::recvMsg(), and AccountServer::writeSave().
|
inline |
Definition at line 49 of file packet.h.
References copyfrom().
|
inline |
int Packet::send | ( | Cmd | cmd, |
ObjSerial | nserial, | ||
const char * | buf, | ||
unsigned int | length, | ||
int | flags, | ||
const AddressIP * | dst, | ||
const SOCKETALT & | sock, | ||
const char * | caller_file, | ||
int | caller_line | ||
) |
flags is a bitwise OR of PCKTFLAGS
Definition at line 146 of file packet.cpp.
References CHECK_VALID.
Referenced by VsnetDownload::Server::Manager::addCmdDownload(), NetClient::authenticate(), bc_send(), ZoneMgr::broadcastDamage(), ZoneMgr::broadcastSnapshots(), NetServer::BroadcastTarget(), NetClient::init(), NetClient::loginAuth(), NetClient::logout(), AccountServer::recvMsg(), NetClient::respawnRequest(), NetServer::saveAccount(), NetClient::selectShip(), NetClient::send(), NetClient::sendAlive(), AccountServer::sendAlreadyConnected(), AccountServer::sendAuthorized(), NetServer::sendCargoSnapshot(), NetServer::sendCommunication(), NetServer::sendCredits(), NetServer::sendCustom(), NetServer::sendForcePosition(), NetServer::sendJumpFinal(), NetworkCommunication::SendMessage(), NetServer::sendMessage(), NetServer::sendMission(), NetServer::sendSaveData(), AccountServer::sendServerData(), NetworkCommunication::SendSound(), AccountServer::sendUnauthorized(), NetClient::startCommunication(), NetClient::stopCommunication(), NetClient::synchronizeTime(), and NetClient::textMessage().
|
inline |
|
inline |