OpenMortal Apocalypse mirror
Sourceforge mirror
SourceForge.net Logo
      News | Info | Characters | Arenas | Screenshots | Forums | Download  
Developer: Making of | Character-HOWTO | AI Design | Submit a Character
Documentation: Main Page | Modules | Class Hierarchy | Class List | File List

CKeyQueue Class Reference
[Game logic (frontend + backend connection)]

CKeyQueue is used to introduce a certain amount of negative or positive lag to keystrokes. More...

#include <Game.h>

List of all members.

Public Member Functions

 CKeyQueue ()
 ~CKeyQueue ()
void Reset ()
void EnqueueKey (int a_iAtTime, int a_iPlayer, int a_iKey, bool a_bDown)
void DequeueKeys (int a_iToTime)
 If.

Protected Types

typedef std::list< SEnqueuedKeyTEnqueuedKeyList

Protected Attributes

TEnqueuedKeyList m_oKeys

Classes

struct  SEnqueuedKey


Detailed Description

CKeyQueue is used to introduce a certain amount of negative or positive lag to keystrokes.

The keys are sent to the backend and the remote site set to a future time. The time is measured in the backend's game ticks. So if the current key is pressed at game time 80, and enqueued to game time 90, there will be an artificial lag of 10 game ticks.

The actual length of game ticks depends on the game speed (set in the menu), for a normal game its 1000/80 = 12.5 ms. This artificial lag is useful for network games.


Member Typedef Documentation

typedef std::list<SEnqueuedKey> CKeyQueue::TEnqueuedKeyList [protected]
 


Constructor & Destructor Documentation

CKeyQueue::CKeyQueue  ) 
 

CKeyQueue::~CKeyQueue  ) 
 


Member Function Documentation

void CKeyQueue::DequeueKeys int  a_iToTime  ) 
 

If.

void CKeyQueue::EnqueueKey int  a_iAtTime,
int  a_iPlayer,
int  a_iKey,
bool  a_bDown
 

void CKeyQueue::Reset  ) 
 


Member Data Documentation

TEnqueuedKeyList CKeyQueue::m_oKeys [protected]
 


The documentation for this class was generated from the following files: