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

MortalNetworkImpl.cpp File Reference

#include "MortalNetworkImpl.h"
#include "State.h"
#include "PlayerSelect.h"
#include "common.h"
#include "config.h"

Defines

#define MORTALNETWORKPORT   0x3A22
#define MAXSTRINGLENGTH   900
#define RETURNNOERROR
#define RETURNWITHERROR
#define RETURNWITHADDITIONALERROR
#define DISCONNECTONCOMMUNICATIONERROR
#define DISCONNECTWITH(A)
#define CHECKCONNECTION   if ( NS_DISCONNECTED == m_enState ) return;

Functions

void MortalNetworkResetMessages (bool a_bClear)
void MortalNetworkMessage (const char *format,...)
bool MortalNetworkCheckKey ()
const char * GetGameTimeString (int a_iValue)
const char * GetGameSpeedString (int a_iValue)
const char * GetHitPointsString (int a_iValue)
template<class InputIterator, class EqualityComparable>
InputIterator MszFind (InputIterator first, InputIterator last, const EqualityComparable &value)
 Unfortunately not all STL are created equal...

Variables

CMortalNetworkg_poNetwork = NULL

Define Documentation

#define CHECKCONNECTION   if ( NS_DISCONNECTED == m_enState ) return;
 

#define DISCONNECTONCOMMUNICATIONERROR
 

Value:

{                                   \
        m_sLastError = Translate("Communication error. Disconnecting.");    \
        Stop();                                                             \
        return; }

#define DISCONNECTWITH  ) 
 

Value:

{                                               \
        m_sLastError = Translate("Communication error. Disconnecting.");    \
        Stop();                                                             \
        return(A); }

#define MAXSTRINGLENGTH   900
 

#define MORTALNETWORKPORT   0x3A22
 

#define RETURNNOERROR
 

Value:

{                               \
        debug( "%s\n", m_sLastError.c_str() );      \
        return false; }

#define RETURNWITHADDITIONALERROR
 

Value:

{                   \
        m_sLastError += SDLNet_GetError();          \
        debug( "%s\n", m_sLastError.c_str() );      \
        return false; }

#define RETURNWITHERROR
 

Value:

{                           \
        m_sLastError = SDLNet_GetError();           \
        debug( "%s\n", m_sLastError.c_str() );      \
        return false; }


Function Documentation

const char* GetGameSpeedString int  a_iValue  ) 
 

const char* GetGameTimeString int  a_iValue  ) 
 

const char* GetHitPointsString int  a_iValue  ) 
 

bool MortalNetworkCheckKey  ) 
 

void MortalNetworkMessage const char *  format,
  ...
 

void MortalNetworkResetMessages bool  a_bClear  ) 
 

template<class InputIterator, class EqualityComparable>
InputIterator MszFind InputIterator  first,
InputIterator  last,
const EqualityComparable &  value
 

Unfortunately not all STL are created equal...

Some do not have the find algorithm. So, here is our feeble implementation...


Variable Documentation

CMortalNetwork* g_poNetwork = NULL