Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

packet.h File Reference

#include <Windows.h>
#include <string.h>
#include "Message.h"

Include dependency graph for packet.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  packetHeader
struct  packetConnect
struct  packetConnectionResponse
struct  packetChatMsg
struct  packetPlayerInfo
struct  packetRequestAllPlayersInfo
struct  packetDisconnect
struct  packetPlayerPosition
struct  packetAttack
struct  packetPlayerState
struct  packetPlayerScore
struct  packetPlayerAction
struct  packetPlayerKilled
struct  packetPlayerExtras
struct  packetDealExtras
struct  packetPlayerName
struct  packetInfo

Defines

#define uint16_t   unsigned short int
#define PKT_CONNECTION_REQUEST   1
#define PKT_CONNECTION_RESPONSE   2
#define PKT_PLAYER_INFO   3
#define PKT_CHAT_MSG   4
#define PKT_REQUEST_PLAYERS   5
#define PKT_DISCONNECT   6
#define PKT_PLAYER_POSITION   7
#define PKT_ATTACK   8
#define PKT_PLAYER_STATE   9
#define PKT_PLAYER_SCORE   10
#define PKT_PLAYER_ACTION   11
#define PKT_PLAYER_KILLED   12
#define PKT_PLAYER_EXTRAS   13
#define PKT_DEAL_EXTRAS   14
#define PKT_PLAYER_NAME   15
#define PKT_INFO   16

Functions

void setTimeStamp (packetHeader *header)
void setPacketFrom (packetHeader *header, int id)
packetChatMsg createPacketChatMsg (int playerid, const char *msg)
packetConnect createPacketConnect (int vid)
packetConnectionResponse createPacketConnectionResponse (bool flag)
packetPlayerInfo createPacketPlayerInfo (const char name[25], int id)
packetRequestAllPlayersInfo createPacketRequestAllPlayersInfo ()
packetDisconnect createPacketDisconnect (int id)
packetPlayerPosition createPacketPlayerPosition (int id, int rotation, int move, float x, float y, float angle, bool overwriteself)
packetAttack createPacketAttack (int playerid, int type, float x, float y, float z, float dx, float dy, float dz)
packetPlayerState createPacketPlayerState (int id, int state)
packetPlayerScore createPacketPlayerScore (int id, int kills, int frags, int deaths)
packetPlayerAction createPacketPlayerAction (int id, int action)
packetPlayerKilled createPacketPlayerKilled (int id, int killer)
packetPlayerExtras createPacketPlayerExtras (int id, int extras, int value)
packetDealExtras createPacketDealExtras (int detype, float x, float y, int flag)
packetPlayerName createPacketPlayerName (int playerid, const char *name, int flag)
packetInfo createPacketInfo (int playerid, int valA, int valB, int valC)


Define Documentation

#define PKT_ATTACK   8
 

Definition at line 16 of file packet.h.

Referenced by Gne::aPlayer(), Gne::clientThread(), and createPacketAttack().

#define PKT_CHAT_MSG   4
 

Definition at line 12 of file packet.h.

Referenced by Gne::aPlayer(), Gne::clientThread(), and createPacketChatMsg().

#define PKT_CONNECTION_REQUEST   1
 

Definition at line 9 of file packet.h.

Referenced by createPacketConnect(), and Gne::listen().

#define PKT_CONNECTION_RESPONSE   2
 

Definition at line 10 of file packet.h.

Referenced by createPacketConnectionResponse(), and Gne::joinServer().

#define PKT_DEAL_EXTRAS   14
 

Definition at line 22 of file packet.h.

Referenced by Gne::aPlayer(), Gne::clientThread(), and createPacketDealExtras().

#define PKT_DISCONNECT   6
 

Definition at line 14 of file packet.h.

Referenced by Gne::aPlayer(), Gne::clientThread(), and createPacketDisconnect().

#define PKT_INFO   16
 

Definition at line 24 of file packet.h.

Referenced by Gne::clientThread(), and createPacketInfo().

#define PKT_PLAYER_ACTION   11
 

Definition at line 19 of file packet.h.

Referenced by Gne::aPlayer(), Gne::clientThread(), and createPacketPlayerAction().

#define PKT_PLAYER_EXTRAS   13
 

Definition at line 21 of file packet.h.

Referenced by Gne::aPlayer(), Gne::clientThread(), and createPacketPlayerExtras().

#define PKT_PLAYER_INFO   3
 

Definition at line 11 of file packet.h.

Referenced by Gne::clientThread(), createPacketPlayerInfo(), Gne::joinServer(), and Gne::listen().

#define PKT_PLAYER_KILLED   12
 

Definition at line 20 of file packet.h.

Referenced by Gne::aPlayer(), Gne::clientThread(), and createPacketPlayerKilled().

#define PKT_PLAYER_NAME   15
 

Definition at line 23 of file packet.h.

Referenced by Gne::aPlayer(), Gne::clientThread(), and createPacketPlayerName().

#define PKT_PLAYER_POSITION   7
 

Definition at line 15 of file packet.h.

Referenced by Gne::aPlayer(), Gne::clientThread(), and createPacketPlayerPosition().

#define PKT_PLAYER_SCORE   10
 

Definition at line 18 of file packet.h.

Referenced by Gne::aPlayer(), Gne::clientThread(), and createPacketPlayerScore().

#define PKT_PLAYER_STATE   9
 

Definition at line 17 of file packet.h.

Referenced by Gne::aPlayer(), Gne::clientThread(), and createPacketPlayerState().

#define PKT_REQUEST_PLAYERS   5
 

Definition at line 13 of file packet.h.

Referenced by Gne::aPlayer(), and createPacketRequestAllPlayersInfo().

#define uint16_t   unsigned short int
 

Definition at line 8 of file packet.h.


Function Documentation

packetAttack createPacketAttack int  playerid,
int  type,
float  x,
float  y,
float  z,
float  dx,
float  dy,
float  dz
 

Definition at line 87 of file packet.cpp.

References packetAttack::attack, packetAttack::dx, packetAttack::dy, packetAttack::dz, packetAttack::header, packetAttack::id, PKT_ATTACK, packetHeader::pktLen, packetHeader::pktType, packetAttack::x, packetAttack::y, and packetAttack::z.

Referenced by Gne::sendAttackNT().

packetChatMsg createPacketChatMsg int  playerid,
const char msg
 

Definition at line 16 of file packet.cpp.

References packetChatMsg::header, packetChatMsg::len, packetChatMsg::msg, msgstruct::msg, PKT_CHAT_MSG, packetHeader::pktLen, packetHeader::pktType, and msgstruct::playerid.

Referenced by Gne::sendChatMsg().

packetConnect createPacketConnect int  vid  ) 
 

Definition at line 31 of file packet.cpp.

References packetConnect::header, PKT_CONNECTION_REQUEST, packetHeader::pktLen, packetHeader::pktType, and packetConnect::vid.

Referenced by Gne::joinServer().

packetConnectionResponse createPacketConnectionResponse bool  flag  ) 
 

Definition at line 39 of file packet.cpp.

References packetConnectionResponse::acceptionFlag, packetConnectionResponse::header, PKT_CONNECTION_RESPONSE, packetHeader::pktLen, and packetHeader::pktType.

Referenced by Gne::listen().

packetDealExtras createPacketDealExtras int  detype,
float  x,
float  y,
int  flag
 

Definition at line 156 of file packet.cpp.

References packetDealExtras::detype, packetDealExtras::flag, packetDealExtras::header, PKT_DEAL_EXTRAS, packetHeader::pktLen, packetHeader::pktType, packetDealExtras::x, and packetDealExtras::y.

Referenced by Gne::dealExtras().

packetDisconnect createPacketDisconnect int  id  ) 
 

Definition at line 63 of file packet.cpp.

References packetDisconnect::header, packetDisconnect::id, PKT_DISCONNECT, packetHeader::pktLen, and packetHeader::pktType.

Referenced by Gne::disconnect().

packetInfo createPacketInfo int  playerid,
int  valA,
int  valB,
int  valC
 

Definition at line 179 of file packet.cpp.

References packetInfo::header, packetInfo::id, PKT_INFO, packetHeader::pktLen, packetHeader::pktType, packetInfo::valA, packetInfo::valB, and packetInfo::valC.

Referenced by Gne::sendInfo().

packetPlayerAction createPacketPlayerAction int  id,
int  action
 

Definition at line 125 of file packet.cpp.

References packetPlayerAction::action, packetPlayerAction::header, packetPlayerAction::id, PKT_PLAYER_ACTION, packetHeader::pktLen, and packetHeader::pktType.

Referenced by Gne::setPlayerActionNT().

packetPlayerExtras createPacketPlayerExtras int  id,
int  extras,
int  value
 

Definition at line 145 of file packet.cpp.

References packetPlayerExtras::extras, packetPlayerExtras::header, packetPlayerExtras::id, PKT_PLAYER_EXTRAS, packetHeader::pktLen, packetHeader::pktType, and packetPlayerExtras::value.

Referenced by Gne::setPlayerExtras().

packetPlayerInfo createPacketPlayerInfo const char  name[25],
int  id
 

Definition at line 47 of file packet.cpp.

References packetPlayerInfo::header, packetPlayerInfo::id, packetPlayerInfo::name, PKT_PLAYER_INFO, packetHeader::pktLen, and packetHeader::pktType.

Referenced by Gne::joinServer(), and Gne::sendPlayer().

packetPlayerKilled createPacketPlayerKilled int  id,
int  killer
 

Definition at line 135 of file packet.cpp.

References packetPlayerKilled::header, packetPlayerKilled::id, packetPlayerKilled::killer, PKT_PLAYER_KILLED, packetHeader::pktLen, and packetHeader::pktType.

Referenced by Gne::setPlayerDeath().

packetPlayerName createPacketPlayerName int  playerid,
const char name,
int  flag
 

Definition at line 168 of file packet.cpp.

References packetPlayerName::flag, packetPlayerName::header, packetPlayerName::id, packetPlayerName::name, PKT_PLAYER_NAME, packetHeader::pktLen, and packetHeader::pktType.

Referenced by Gne::setPlayerName().

packetPlayerPosition createPacketPlayerPosition int  id,
int  rotation,
int  move,
float  x,
float  y,
float  angle,
bool  overwriteself
 

Definition at line 72 of file packet.cpp.

References packetPlayerPosition::angle, packetPlayerPosition::header, packetPlayerPosition::id, packetPlayerPosition::move, packetPlayerPosition::overwriteself, PKT_PLAYER_POSITION, packetHeader::pktLen, packetHeader::pktType, packetPlayerPosition::rotation, packetPlayerPosition::x, and packetPlayerPosition::y.

Referenced by Gne::setPlayerPos().

packetPlayerScore createPacketPlayerScore int  id,
int  kills,
int  frags,
int  deaths
 

Definition at line 113 of file packet.cpp.

References packetPlayerScore::deaths, packetPlayerScore::frags, packetPlayerScore::header, packetPlayerScore::id, packetPlayerScore::kills, PKT_PLAYER_SCORE, packetHeader::pktLen, and packetHeader::pktType.

Referenced by Gne::setPlayerScore().

packetPlayerState createPacketPlayerState int  id,
int  state
 

Definition at line 103 of file packet.cpp.

References packetPlayerState::header, packetPlayerState::id, PKT_PLAYER_STATE, packetHeader::pktLen, packetHeader::pktType, and packetPlayerState::state.

Referenced by Gne::setPlayerState().

packetRequestAllPlayersInfo createPacketRequestAllPlayersInfo  ) 
 

Definition at line 56 of file packet.cpp.

References packetRequestAllPlayersInfo::header, PKT_REQUEST_PLAYERS, packetHeader::pktLen, and packetHeader::pktType.

Referenced by Gne::updatePlayersFromServer().

void setPacketFrom packetHeader header,
int  id
 

Definition at line 10 of file packet.cpp.

References packetHeader::from.

Referenced by Gne::dealExtras(), Gne::disconnect(), Gne::joinServer(), Gne::listen(), Gne::sendAttackNT(), Gne::sendChatMsg(), Gne::sendDisconnectToAll(), Gne::sendInfo(), Gne::sendPlayer(), Gne::sendPlayerPosToAll(), Gne::setPlayerActionNT(), Gne::setPlayerDeath(), Gne::setPlayerExtras(), Gne::setPlayerName(), Gne::setPlayerPos(), Gne::setPlayerScore(), Gne::setPlayerState(), and Gne::updatePlayersFromServer().

void setTimeStamp packetHeader header  ) 
 

Definition at line 5 of file packet.cpp.

References packetHeader::timeStamp.

Referenced by Gne::aPlayer(), Gne::dealExtras(), Gne::disconnect(), Gne::joinServer(), Gne::listen(), Gne::sendAttackNT(), Gne::sendChatMsg(), Gne::sendDisconnectToAll(), Gne::sendInfo(), Gne::sendPlayer(), Gne::sendPlayerPosToAll(), Gne::setPlayerActionNT(), Gne::setPlayerDeath(), Gne::setPlayerExtras(), Gne::setPlayerName(), Gne::setPlayerPos(), Gne::setPlayerScore(), Gne::setPlayerState(), and Gne::updatePlayersFromServer().


Generated on Sun Jun 5 15:48:30 2005 for Defacto by  doxygen 1.4.3