src/engine/eNetGameObject.cpp File Reference

#include "eNetGameObject.h"
#include "ePlayer.h"
#include "eLagCompensation.h"
#include "eTimer.h"
#include "uInput.h"
#include "eGrid.h"
#include "eTeam.h"
#include "eTess2.h"

Include dependency graph for eNetGameObject.cpp:

Go to the source code of this file.

Defines

#define MAX_PING_OVERFLOW   3
#define PING_OVERFLOW_TS   .1

Functions

static REAL se_GetPing (ePlayerNetID *player)
nMessageoperator<< (nMessage &m, const eCoord &x)
nMessageoperator>> (nMessage &m, eCoord &x)

Variables

static tCallbackOrtransfer_anchor


Define Documentation

#define MAX_PING_OVERFLOW   3

Definition at line 39 of file eNetGameObject.cpp.

Referenced by eNetGameObject::ReceiveControlNet().

#define PING_OVERFLOW_TS   .1

Definition at line 40 of file eNetGameObject.cpp.

Referenced by eNetGameObject::Timestep().


Function Documentation

nMessage& operator<< ( nMessage m,
const eCoord &  x 
)

Definition at line 355 of file eNetGameObject.cpp.

00355                                                     {
00356     m << x.x;
00357     m << x.y;
00358 
00359     return m;
00360 }

nMessage& operator>> ( nMessage m,
eCoord &  x 
)

Definition at line 362 of file eNetGameObject.cpp.

00362                                               {
00363     m >> x.x;
00364     m >> x.y;
00365 
00366     return m;
00367 }

static REAL se_GetPing ( ePlayerNetID player  )  [static]

Definition at line 43 of file eNetGameObject.cpp.

References nSERVER, nNetObject::Owner(), nConnectionInfo::ping, ePlayerNetID::ping, REAL, sn_Connections, sn_GetNetState(), sn_myNetID, and sn_pingCharityServer.

Referenced by eNetGameObject::SetPlayer(), and eNetGameObject::Timestep().

00044 {
00045     REAL peer_ping=0;
00046     REAL my_ping=0;
00047 
00048     if (bool(player) && player->Owner()!=::sn_myNetID)
00049     {
00050         if (sn_GetNetState()!=nSERVER)
00051             peer_ping+=player->ping;
00052         else
00053             peer_ping+=sn_Connections[player->Owner()].ping;
00054     }
00055     if (sn_GetNetState()!=nSERVER && (!player || player->Owner()!=::sn_myNetID))
00056         my_ping+=sn_Connections[0].ping;
00057 
00058     REAL ping = (peer_ping+my_ping)*.5;
00059 
00060     if (ping>my_ping+sn_pingCharityServer*.001)
00061         ping=my_ping+sn_pingCharityServer*.001;
00062 
00063     if (ping<my_ping-sn_pingCharityServer*.001)
00064         ping=my_ping-sn_pingCharityServer*.001;
00065 
00066     return ping;
00067 }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

tCallbackOr* transfer_anchor [static]

Definition at line 343 of file eNetGameObject.cpp.


Generated on Sat Mar 15 22:57:28 2008 for Armagetron Advanced by  doxygen 1.5.4