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

packet.cpp File Reference

#include "packet.h"
#include <stdio.h>

Include dependency graph for packet.cpp:

Go to the source code of this file.

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)


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, msgstruct::msg, packetChatMsg::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:29 2005 for Defacto by  doxygen 1.4.3