Main Page Modules Namespaces C++ Classes Compound List File List Index
TNL: Zap::GameConnection Class Reference

# Zap::GameConnection Class Reference

`#include <gameConnection.h>`

Inheritance diagram for Zap::GameConnection:

## Public Types

enum | MessageColors { ColorWhite, ColorRed, ColorGreen, ColorBlue,
ColorAqua,
ColorYellow,
ColorNuclearGreen,
ColorCount
}

## Public Member Functions

| GameConnection ()
| ~GameConnection ()
void | setClientName (const char *string)
void | setClientRef (ClientRef *theRef)
ClientRef * | getClientRef ()
StringTableEntryRef | getClientName ()
bool | isAdmin ()
void | setIsAdmin (bool admin)
| TNL_DECLARE_RPC (c2sAdminPassword,(StringPtr pass))
| TNL_DECLARE_RPC (s2cSetIsAdmin,())
| TNL_DECLARE_RPC (c2sAdminPlayerAction,(StringTableEntry playerName, U32 actionIndex))
bool | isInCommanderMap ()
| TNL_DECLARE_RPC (c2sRequestCommanderMap,())
| TNL_DECLARE_RPC (c2sReleaseCommanderMap,())
| TNL_DECLARE_RPC (c2sRequestLoadout,(Vector< U32 > loadout))
| TNL_DECLARE_RPC (s2cDisplayMessageESI,(RangedU32< 0, ColorCount > color, RangedU32< 0, NumSFXBuffers > sfx, StringTableEntry formatString, Vector< StringTableEntry > e, Vector< StringPtr > s, Vector< S32 > i))
| TNL_DECLARE_RPC (s2cDisplayMessageE,(RangedU32< 0, ColorCount > color, RangedU32< 0, NumSFXBuffers > sfx, StringTableEntry formatString, Vector< StringTableEntry > e))
| TNL_DECLARE_RPC (s2cDisplayMessage,(RangedU32< 0, ColorCount > color, RangedU32< 0, NumSFXBuffers > sfx, StringTableEntry formatString))
| TNL_DECLARE_RPC (s2cAddLevel,(StringTableEntry name, StringTableEntry type))
| TNL_DECLARE_RPC (c2sRequestLevelChange,(S32 newLevelIndex))
GameConnection * | getNextClient ()
const Vector< U32 > & | getLoadout ()
void | writeConnectRequest (BitStream *stream)
| Writes the NetEvent class count into the stream, so that the remote host can negotiate a class count for the connection.
bool | readConnectRequest (BitStream *stream, const char **errorString)
| Reads the NetEvent class count max that the remote host is requesting.
void | onConnectionEstablished ()
| Called when the connection is successfully established with the remote host.
void | onConnectTerminated (TerminationReason r, const char *)
| Called when a pending connection is terminated.
void | onConnectionTerminated (TerminationReason r, const char *string)
| Called when this established connection is terminated for any reason.
| TNL_DECLARE_NETCONNECTION (GameConnection)

## Static Public Member Functions

static GameConnection * | getClientList ()

## Data Fields

Vector< StringTableEntry > | mLevelNames
Vector< StringTableEntry > | mLevelTypes

## Private Types

typedef ControlObjectConnection | Parent

## Private Member Functions

void | linkToClientList ()

## Private Attributes

GameConnection * | mNext
GameConnection * | mPrev
bool | mInCommanderMap
bool | mIsAdmin
StringTableEntry | mClientName
Vector< U32 > | mLoadout
SafePtr< ClientRef > | mClientRef

## Static Private Attributes

static GameConnection | gClientList

## Member Typedef Documentation

typedef ControlObjectConnection Zap::GameConnection::Parent`[private]`

Reimplemented from Zap::ControlObjectConnection.

## Member Enumeration Documentation

enum Zap::GameConnection::MessageColors

Enumerator:

  ColorWhite |
  ColorRed |
  ColorGreen |
  ColorBlue |
  ColorAqua |
  ColorYellow |
  ColorNuclearGreen |
  ColorCount |

## Constructor & Destructor Documentation

Zap::GameConnection::GameConnection | ( |  | ) |

Zap::GameConnection::~GameConnection | ( |  | ) |

## Member Function Documentation

void Zap::GameConnection::linkToClientList | ( |  | ) | `[private]`

void Zap::GameConnection::setClientName | ( | const char * | string | ) | `[inline]`

void Zap::GameConnection::setClientRef | ( | ClientRef * | theRef | ) |

ClientRef* Zap::GameConnection::getClientRef | ( |  | ) |

StringTableEntryRef Zap::GameConnection::getClientName | ( |  | ) | `[inline]`

bool Zap::GameConnection::isAdmin | ( |  | ) | `[inline]`

void Zap::GameConnection::setIsAdmin | ( | bool | admin | ) | `[inline]`

Zap::GameConnection::TNL_DECLARE_RPC | ( | c2sAdminPassword | ,
|  | (StringPtr pass) |  |
| ) |  |  |

Zap::GameConnection::TNL_DECLARE_RPC | ( | s2cSetIsAdmin | ,
|  | () |  |
| ) |  |  |

Zap::GameConnection::TNL_DECLARE_RPC | ( | c2sAdminPlayerAction | ,
|  | (StringTableEntry playerName, U32 actionIndex) |  |
| ) |  |  |

bool Zap::GameConnection::isInCommanderMap | ( |  | ) | `[inline]`

Zap::GameConnection::TNL_DECLARE_RPC | ( | c2sRequestCommanderMap | ,
|  | () |  |
| ) |  |  |

Zap::GameConnection::TNL_DECLARE_RPC | ( | c2sReleaseCommanderMap | ,
|  | () |  |
| ) |  |  |

Zap::GameConnection::TNL_DECLARE_RPC | ( | c2sRequestLoadout | ,
|  | (Vector< U32 > loadout) |  |
| ) |  |  |

Zap::GameConnection::TNL_DECLARE_RPC | ( | s2cDisplayMessageESI | ,
|  | (RangedU32< 0, ColorCount > color, RangedU32< 0, NumSFXBuffers > sfx, StringTableEntry formatString, Vector< StringTableEntry > e, Vector< StringPtr > s, Vector< S32 > i) |  |
| ) |  |  |

Zap::GameConnection::TNL_DECLARE_RPC | ( | s2cDisplayMessageE | ,
|  | (RangedU32< 0, ColorCount > color, RangedU32< 0, NumSFXBuffers > sfx, StringTableEntry formatString, Vector< StringTableEntry > e) |  |
| ) |  |  |

Zap::GameConnection::TNL_DECLARE_RPC | ( | s2cDisplayMessage | ,
|  | (RangedU32< 0, ColorCount > color, RangedU32< 0, NumSFXBuffers > sfx, StringTableEntry formatString) |  |
| ) |  |  |

Zap::GameConnection::TNL_DECLARE_RPC | ( | s2cAddLevel | ,
|  | (StringTableEntry name, StringTableEntry type) |  |
| ) |  |  |

Zap::GameConnection::TNL_DECLARE_RPC | ( | c2sRequestLevelChange | ,
|  | (S32 newLevelIndex) |  |
| ) |  |  |

static GameConnection* Zap::GameConnection::getClientList | ( |  | ) | `[static]`

GameConnection* Zap::GameConnection::getNextClient | ( |  | ) |

const Vector<U32>& Zap::GameConnection::getLoadout | ( |  | ) | `[inline]`

void Zap::GameConnection::writeConnectRequest | ( | BitStream * | stream | ) | `[virtual]`

Writes the NetEvent class count into the stream, so that the remote host can negotiate a class count for the connection.

Reimplemented from TNL::EventConnection.

bool Zap::GameConnection::readConnectRequest | ( | BitStream * | stream,
|  | const char ** | errorString |
| ) |  |  | `[virtual]`

Reads the NetEvent class count max that the remote host is requesting.

If this host has MORE NetEvent classes declared, the mEventClassCount is set to the requested count, and is verified to lie on a boundary between versions.

Reimplemented from TNL::EventConnection.

void Zap::GameConnection::onConnectionEstablished | ( |  | ) | `[virtual]`

Called when the connection is successfully established with the remote host.

Reimplemented from TNL::NetConnection.

void Zap::GameConnection::onConnectTerminated | ( | TerminationReason | reason,
|  | const char * | rejectionString |
| ) |  |  | `[virtual]`

Called when a pending connection is terminated.

Reimplemented from TNL::NetConnection.

void Zap::GameConnection::onConnectionTerminated | ( | TerminationReason | ,
|  | const char * | errorDisconnectString |
| ) |  |  | `[virtual]`

Called when this established connection is terminated for any reason.

Reimplemented from TNL::NetConnection.

Zap::GameConnection::TNL_DECLARE_NETCONNECTION | ( | GameConnection |  | ) |

## Field Documentation

GameConnection* Zap::GameConnection::mNext`[private]`

GameConnection* Zap::GameConnection::mPrev`[private]`

GameConnection Zap::GameConnection::gClientList`[static, private]`

bool Zap::GameConnection::mInCommanderMap`[private]`

bool Zap::GameConnection::mIsAdmin`[private]`

StringTableEntry Zap::GameConnection::mClientName`[private]`

Vector<U32> Zap::GameConnection::mLoadout`[private]`

SafePtr<ClientRef> Zap::GameConnection::mClientRef`[private]`

Vector<StringTableEntry> Zap::GameConnection::mLevelNames

Vector<StringTableEntry> Zap::GameConnection::mLevelTypes