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

CMortalNetwork Class Reference
[Networking layer]

Mortal Network messages:. More...

#include <MortalNetwork.h>

Inheritance diagram for CMortalNetwork:

CMortalNetworkImpl List of all members.

Public Member Functions

virtual bool Start (const char *a_pcServerName)=0
virtual void Stop ()=0
virtual bool IsConnectionAlive ()=0
virtual void Update ()=0
virtual const char * GetLastError ()=0
virtual bool IsMaster ()=0
virtual const char * GetRemoteUsername ()=0
virtual void SendMsg (const char *a_rsMsg)=0
virtual bool IsMsgAvailable ()=0
virtual const char * GetMsg ()=0
virtual bool IsRemoteFighterAvailable (FighterEnum a_enFighter)=0
virtual FighterEnum GetRemoteFighter ()=0
virtual bool IsRemoteSideReady ()=0
virtual void SendFighter (FighterEnum a_enFighter)=0
virtual void SendReady ()=0
virtual void SendGameParams (int a_iGameSpeed, int a_iGameTime, int a_iHitPoints, int a_iBackgroundNumber)=0
virtual SGameParams GetGameParams ()=0
virtual bool SynchStartRound ()=0
virtual void SendGameData (const char *a_pcGameData)=0
virtual const char * GetLatestGameData ()=0
virtual void SendKeystroke (int a_iTime, int a_iKey, bool a_bPressed)=0
virtual bool GetKeystroke (int &a_riOutTime, int &a_riOutKey, bool &a_rbPressed)=0
virtual void SendGameTick (int a_iGameTick)=0
virtual int GetGameTick ()=0
virtual void SendHurryup (int a_iHurryUpCode)=0
virtual int GetHurryup ()=0
virtual void SendRoundOver (int a_iWhoWon, bool a_bGameOver)=0
virtual bool IsRoundOver ()=0
virtual bool IsGameOver ()=0
virtual int GetWhoWon ()=0

Static Public Member Functions

static void Create ()

Classes

struct  SGameParams

Detailed Description

Mortal Network messages:.

TYPICAL MESSAGE FLOW:

<connection is="" established=""> Introduction messages are sent (version checking, usernames)

<players go="" to="" the="" character="" selection="" screen=""> 1. F <number> messages go both ways as players choose their characters. 2. R message goes in both direction when players have finished choosing.

<both sides="" go="" to="" the="" game="" screen=""> In odd rounds, the "server" if the "master" and the "client" is the "slave" In even rounds, the "client" if the "master" and the "server" is the "slave"

Both the master and the slave send an S message to synchronize the game start.

The master sends G <text> messages to update the backend on the slave side. The slave sends K <number> <bool> messages to communicate keystrokes to the master side. The master sends O <number> <bool> message when the round is over.

Back to game start synchronization.

<both sides go to final judgement - may disconnect the game>

<both sides="" go="" back="" to="" the="" character="" selection="" screen="">

OTHERS:

Msgs can be send on the character selection screen with M <text>. The connection can be broken at any time. IsConnectionAlive() must be called periodically.

The "server" is always appears as player 1, the "client" is always player 2. However, they both use the "Player 1" keys.


Member Function Documentation

void CMortalNetwork::Create  )  [static]
 

virtual SGameParams CMortalNetwork::GetGameParams  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual int CMortalNetwork::GetGameTick  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual int CMortalNetwork::GetHurryup  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual bool CMortalNetwork::GetKeystroke int &  a_riOutTime,
int &  a_riOutKey,
bool &  a_rbPressed
[pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual const char* CMortalNetwork::GetLastError  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual const char* CMortalNetwork::GetLatestGameData  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual const char* CMortalNetwork::GetMsg  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual FighterEnum CMortalNetwork::GetRemoteFighter  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual const char* CMortalNetwork::GetRemoteUsername  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual int CMortalNetwork::GetWhoWon  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual bool CMortalNetwork::IsConnectionAlive  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual bool CMortalNetwork::IsGameOver  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual bool CMortalNetwork::IsMaster  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual bool CMortalNetwork::IsMsgAvailable  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual bool CMortalNetwork::IsRemoteFighterAvailable FighterEnum  a_enFighter  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual bool CMortalNetwork::IsRemoteSideReady  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual bool CMortalNetwork::IsRoundOver  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual void CMortalNetwork::SendFighter FighterEnum  a_enFighter  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual void CMortalNetwork::SendGameData const char *  a_pcGameData  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual void CMortalNetwork::SendGameParams int  a_iGameSpeed,
int  a_iGameTime,
int  a_iHitPoints,
int  a_iBackgroundNumber
[pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual void CMortalNetwork::SendGameTick int  a_iGameTick  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual void CMortalNetwork::SendHurryup int  a_iHurryUpCode  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual void CMortalNetwork::SendKeystroke int  a_iTime,
int  a_iKey,
bool  a_bPressed
[pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual void CMortalNetwork::SendMsg const char *  a_rsMsg  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual void CMortalNetwork::SendReady  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual void CMortalNetwork::SendRoundOver int  a_iWhoWon,
bool  a_bGameOver
[pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual bool CMortalNetwork::Start const char *  a_pcServerName  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual void CMortalNetwork::Stop  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual bool CMortalNetwork::SynchStartRound  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.

virtual void CMortalNetwork::Update  )  [pure virtual]
 

Implemented in CMortalNetworkImpl.


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