Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
LANAPIInterface Class Referenceabstract

#include <LANAPI.h>

Inherits SubsystemInterface.

Inherited by LANAPI.

Public Types

enum  ChatType { LANCHAT_NORMAL = 0 , LANCHAT_EMOTE , LANCHAT_SYSTEM , LANCHAT_MAX }
 
enum  ReturnType {
  RET_OK , RET_TIMEOUT , RET_GAME_FULL , RET_DUPLICATE_NAME ,
  RET_CRC_MISMATCH , RET_SERIAL_DUPE , RET_GAME_STARTED , RET_GAME_EXISTS ,
  RET_GAME_GONE , RET_BUSY , RET_UNKNOWN , RET_MAX
}
 

Public Member Functions

virtual ~LANAPIInterface ()
 
virtual void init (void)=0
 Initialize or re-initialize the instance.
 
virtual void reset (void)=0
 reset the logic system
 
virtual void update (void)=0
 update the world
 
virtual void setIsActive (Bool isActive)=0
 Tell TheLAN whether or not the app is active.
 
virtual void RequestLocations (void)=0
 Request everybody to respond with where they are.
 
virtual void RequestGameJoin (LANGameInfo *game, UnsignedInt ip=0)=0
 Request to join a game.
 
virtual void RequestGameJoinDirectConnect (UnsignedInt ipaddress)=0
 Request to join a game at an IP address.
 
virtual void RequestGameLeave (void)=0
 Tell everyone we're leaving.
 
virtual void RequestAccept (void)=0
 Indicate we're OK with the game options.
 
virtual void RequestHasMap (void)=0
 Send our map status.
 
virtual void RequestChat (UnicodeString message, ChatType format)=0
 Send a chat message.
 
virtual void RequestGameStart (void)=0
 Tell everyone the game is starting.
 
virtual void RequestGameStartTimer (Int seconds)=0
 
virtual void RequestGameOptions (AsciiString gameOptions, Bool isPublic, UnsignedInt ip=0)=0
 Change the game options.
 
virtual void RequestGameCreate (UnicodeString gameName, Bool isDirectConnect)=0
 Try to host a game.
 
virtual void RequestGameAnnounce (void)=0
 Sound out current game info if host.
 
virtual void RequestSetName (UnicodeString newName)=0
 Pick a new name.
 
virtual void RequestLobbyLeave (Bool forced)=0
 Announce that we're leaving the lobby.
 
virtual void ResetGameStartTimer (void)=0
 
UnicodeString getErrorStringFromReturnType (ReturnType ret)
 
virtual void OnGameList (LANGameInfo *gameList)=0
 List of games.
 
virtual void OnPlayerList (LANPlayer *playerList)=0
 List of players in the Lobby.
 
virtual void OnGameJoin (ReturnType ret, LANGameInfo *theGame)=0
 Did we get in the game?
 
virtual void OnPlayerJoin (Int slot, UnicodeString playerName)=0
 Someone else joined our game (host only; joiners get a slotlist)
 
virtual void OnHostLeave (void)=0
 Host left the game.
 
virtual void OnPlayerLeave (UnicodeString player)=0
 Someone left the game.
 
virtual void OnAccept (UnsignedInt playerIP, Bool status)=0
 Someone's accept status changed.
 
virtual void OnHasMap (UnsignedInt playerIP, Bool status)=0
 Someone's map status changed.
 
virtual void OnChat (UnicodeString player, UnsignedInt ip, UnicodeString message, ChatType format)=0
 Chat message from someone.
 
virtual void OnGameStart (void)=0
 The game is starting.
 
virtual void OnGameStartTimer (Int seconds)=0
 
virtual void OnGameOptions (UnsignedInt playerIP, Int playerSlot, AsciiString options)=0
 Someone sent game options.
 
virtual void OnGameCreate (ReturnType ret)=0
 Your game is created.
 
virtual void OnNameChange (UnsignedInt IP, UnicodeString newName)=0
 Someone has morphed.
 
virtual LANGameInfoLookupGame (UnicodeString gameName)=0
 return a pointer to a game we know about
 
virtual LANGameInfoLookupGameByListOffset (Int offset)=0
 return a pointer to a game we know about
 
virtual Bool SetLocalIP (UnsignedInt localIP)=0
 For multiple NIC machines.
 
virtual void SetLocalIP (AsciiString localIP)=0
 For multiple NIC machines.
 
virtual Bool AmIHost (void)=0
 Am I hosting a game?
 
virtual UnicodeString GetMyName (void)=0
 What's my name?
 
virtual LANGameInfoGetMyGame (void)=0
 What's my Game?
 
virtual void fillInLANMessage (LANMessage *msg)=0
 Fill in default params.
 
virtual void checkMOTD (void)=0
 
- Public Member Functions inherited from SubsystemInterface
 SubsystemInterface ()
 
virtual ~SubsystemInterface ()
 
virtual void postProcessLoad ()
 
virtual void draw (void)
 
void UPDATE (void)
 
void DRAW (void)
 
AsciiString getName (void)
 
void setName (AsciiString name)
 

Additional Inherited Members

- Protected Attributes inherited from SubsystemInterface
AsciiString m_name
 

Detailed Description

The LANAPI class is used to instantiate a singleton which implements the interface to all LAN broadcast communications.

Definition at line 60 of file LANAPI.h.

Member Enumeration Documentation

◆ ChatType

Enumerator
LANCHAT_NORMAL 
LANCHAT_EMOTE 
LANCHAT_SYSTEM 
LANCHAT_MAX 

Definition at line 73 of file LANAPI.h.

◆ ReturnType

Enumerator
RET_OK 
RET_TIMEOUT 
RET_GAME_FULL 
RET_DUPLICATE_NAME 
RET_CRC_MISMATCH 
RET_SERIAL_DUPE 
RET_GAME_STARTED 
RET_GAME_EXISTS 
RET_GAME_GONE 
RET_BUSY 
RET_UNKNOWN 
RET_MAX 

Definition at line 100 of file LANAPI.h.

Constructor & Destructor Documentation

◆ ~LANAPIInterface()

virtual LANAPIInterface::~LANAPIInterface ( )
inlinevirtual

Definition at line 64 of file LANAPI.h.

Member Function Documentation

◆ AmIHost()

virtual Bool LANAPIInterface::AmIHost ( void )
pure virtual

Am I hosting a game?

Implemented in LANAPI.

◆ checkMOTD()

virtual void LANAPIInterface::checkMOTD ( void )
pure virtual

Implemented in LANAPI.

◆ fillInLANMessage()

virtual void LANAPIInterface::fillInLANMessage ( LANMessage * msg)
pure virtual

Fill in default params.

Implemented in LANAPI.

◆ getErrorStringFromReturnType()

UnicodeString LANAPIInterface::getErrorStringFromReturnType ( ReturnType ret)

Definition at line 72 of file LANAPICallbacks.cpp.

◆ GetMyGame()

virtual LANGameInfo * LANAPIInterface::GetMyGame ( void )
inlinepure virtual

What's my Game?

Implemented in LANAPI.

◆ GetMyName()

virtual UnicodeString LANAPIInterface::GetMyName ( void )
inlinepure virtual

What's my name?

Implemented in LANAPI.

◆ init()

virtual void LANAPIInterface::init ( void )
pure virtual

Initialize or re-initialize the instance.

Implements SubsystemInterface.

Implemented in LANAPI.

◆ LookupGame()

virtual LANGameInfo * LANAPIInterface::LookupGame ( UnicodeString gameName)
pure virtual

return a pointer to a game we know about

Implemented in LANAPI.

◆ LookupGameByListOffset()

virtual LANGameInfo * LANAPIInterface::LookupGameByListOffset ( Int offset)
pure virtual

return a pointer to a game we know about

Implemented in LANAPI.

◆ OnAccept()

virtual void LANAPIInterface::OnAccept ( UnsignedInt playerIP,
Bool status )
pure virtual

Someone's accept status changed.

Implemented in LANAPI.

◆ OnChat()

virtual void LANAPIInterface::OnChat ( UnicodeString player,
UnsignedInt ip,
UnicodeString message,
ChatType format )
pure virtual

Chat message from someone.

Implemented in LANAPI.

◆ OnGameCreate()

virtual void LANAPIInterface::OnGameCreate ( ReturnType ret)
pure virtual

Your game is created.

Implemented in LANAPI.

◆ OnGameJoin()

virtual void LANAPIInterface::OnGameJoin ( ReturnType ret,
LANGameInfo * theGame )
pure virtual

Did we get in the game?

Implemented in LANAPI.

◆ OnGameList()

virtual void LANAPIInterface::OnGameList ( LANGameInfo * gameList)
pure virtual

List of games.

Implemented in LANAPI.

◆ OnGameOptions()

virtual void LANAPIInterface::OnGameOptions ( UnsignedInt playerIP,
Int playerSlot,
AsciiString options )
pure virtual

Someone sent game options.

Implemented in LANAPI.

◆ OnGameStart()

virtual void LANAPIInterface::OnGameStart ( void )
pure virtual

The game is starting.

Implemented in LANAPI.

◆ OnGameStartTimer()

virtual void LANAPIInterface::OnGameStartTimer ( Int seconds)
pure virtual

Implemented in LANAPI.

◆ OnHasMap()

virtual void LANAPIInterface::OnHasMap ( UnsignedInt playerIP,
Bool status )
pure virtual

Someone's map status changed.

Implemented in LANAPI.

◆ OnHostLeave()

virtual void LANAPIInterface::OnHostLeave ( void )
pure virtual

Host left the game.

Implemented in LANAPI.

◆ OnNameChange()

virtual void LANAPIInterface::OnNameChange ( UnsignedInt IP,
UnicodeString newName )
pure virtual

Someone has morphed.

Implemented in LANAPI.

◆ OnPlayerJoin()

virtual void LANAPIInterface::OnPlayerJoin ( Int slot,
UnicodeString playerName )
pure virtual

Someone else joined our game (host only; joiners get a slotlist)

Implemented in LANAPI.

◆ OnPlayerLeave()

virtual void LANAPIInterface::OnPlayerLeave ( UnicodeString player)
pure virtual

Someone left the game.

Implemented in LANAPI.

◆ OnPlayerList()

virtual void LANAPIInterface::OnPlayerList ( LANPlayer * playerList)
pure virtual

List of players in the Lobby.

Implemented in LANAPI.

◆ RequestAccept()

virtual void LANAPIInterface::RequestAccept ( void )
pure virtual

Indicate we're OK with the game options.

Implemented in LANAPI.

◆ RequestChat()

virtual void LANAPIInterface::RequestChat ( UnicodeString message,
ChatType format )
pure virtual

Send a chat message.

Implemented in LANAPI.

◆ RequestGameAnnounce()

virtual void LANAPIInterface::RequestGameAnnounce ( void )
pure virtual

Sound out current game info if host.

Implemented in LANAPI.

◆ RequestGameCreate()

virtual void LANAPIInterface::RequestGameCreate ( UnicodeString gameName,
Bool isDirectConnect )
pure virtual

Try to host a game.

Implemented in LANAPI.

◆ RequestGameJoin()

virtual void LANAPIInterface::RequestGameJoin ( LANGameInfo * game,
UnsignedInt ip = 0 )
pure virtual

Request to join a game.

Implemented in LANAPI.

◆ RequestGameJoinDirectConnect()

virtual void LANAPIInterface::RequestGameJoinDirectConnect ( UnsignedInt ipaddress)
pure virtual

Request to join a game at an IP address.

Implemented in LANAPI.

◆ RequestGameLeave()

virtual void LANAPIInterface::RequestGameLeave ( void )
pure virtual

Tell everyone we're leaving.

Implemented in LANAPI.

◆ RequestGameOptions()

virtual void LANAPIInterface::RequestGameOptions ( AsciiString gameOptions,
Bool isPublic,
UnsignedInt ip = 0 )
pure virtual

Change the game options.

Implemented in LANAPI.

◆ RequestGameStart()

virtual void LANAPIInterface::RequestGameStart ( void )
pure virtual

Tell everyone the game is starting.

Implemented in LANAPI.

◆ RequestGameStartTimer()

virtual void LANAPIInterface::RequestGameStartTimer ( Int seconds)
pure virtual

Implemented in LANAPI.

◆ RequestHasMap()

virtual void LANAPIInterface::RequestHasMap ( void )
pure virtual

Send our map status.

Implemented in LANAPI.

◆ RequestLobbyLeave()

virtual void LANAPIInterface::RequestLobbyLeave ( Bool forced)
pure virtual

Announce that we're leaving the lobby.

Implemented in LANAPI.

◆ RequestLocations()

virtual void LANAPIInterface::RequestLocations ( void )
pure virtual

Request everybody to respond with where they are.

Implemented in LANAPI.

◆ RequestSetName()

virtual void LANAPIInterface::RequestSetName ( UnicodeString newName)
pure virtual

Pick a new name.

Implemented in LANAPI.

◆ reset()

virtual void LANAPIInterface::reset ( void )
pure virtual

reset the logic system

Implements SubsystemInterface.

Implemented in LANAPI.

◆ ResetGameStartTimer()

virtual void LANAPIInterface::ResetGameStartTimer ( void )
pure virtual

Implemented in LANAPI.

◆ setIsActive()

virtual void LANAPIInterface::setIsActive ( Bool isActive)
pure virtual

Tell TheLAN whether or not the app is active.

Implemented in LANAPI.

◆ SetLocalIP() [1/2]

virtual void LANAPIInterface::SetLocalIP ( AsciiString localIP)
pure virtual

For multiple NIC machines.

Implemented in LANAPI.

◆ SetLocalIP() [2/2]

virtual Bool LANAPIInterface::SetLocalIP ( UnsignedInt localIP)
pure virtual

For multiple NIC machines.

Implemented in LANAPI.

◆ update()

virtual void LANAPIInterface::update ( void )
pure virtual

update the world

Implements SubsystemInterface.

Implemented in LANAPI.


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