_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

Public Member Functions | Public Attributes | List of all members
Context Class Reference
Inheritance diagram for Context:
OnlineContext

Public Member Functions

 Context ()
 
 ~Context ()
 
bool isConnected ()
 
bool isConnecting ()
 
bool isDisconnected ()
 
void disconnect ()
 
void sendText (std::string txt, bool silent=false)
 
void requestExternalAddress ()
 
void requestExtraUserInfo (std::string username)
 
void punchNAT (std::string username)
 
void refreshChannels ()
 
void refreshGames ()
 
void refreshFriends ()
 
virtual void joinGame (std::string username, std::string pw)
 
virtual void leaveGame ()
 
virtual void startAdvertising (bool isStarted=false)
 
virtual void stopAdvertising ()
 
virtual void reportGameResult ()
 
void joinChannel (std::string name)
 
void sendUdpConnectionInfo ()
 
void setCurrentChannel (std::string name)
 
std::string getCurrentChannel ()
 
void setGamelist (std::vector< Game * > games)
 
std::vector< Game * > getGames ()
 
void setFriendslist (std::vector< Friend * > friends)
 
std::vector< Friend * > getFriends ()
 
void reportUserdata (uint32_t id, std::vector< std::string > values)
 
std::queue< std::string > * getInfo ()
 
void showInfo (std::string arg)
 
void showError (std::string arg)
 
void showChat (std::string arg)
 
void addUser (std::string name)
 
void removeUser (std::string name)
 
std::set< std::string > getUsers ()
 
void setChannels (std::vector< std::string > channels)
 
std::vector< std::string > getChannels ()
 
std::string getUsername ()
 
void setUsername (std::string arg)
 
uint32_t * getPassword1 ()
 
void setPassword (std::string pw)
 
void setCreateAccount (bool flag)
 
bool shouldCreateAccount ()
 
CHostgetHost ()
 
void setHost (CHost *arg)
 
CUDPSocketgetUDPSocket ()
 
CTCPSocketgetTCPSocket ()
 
BNCSInputStreamgetMsgIStream ()
 
virtual void doOneStep ()
 
virtual bool handleUDP (const unsigned char *buffer, int len, CHost host)
 
void setState (OnlineState *newState)
 
- Public Member Functions inherited from OnlineContext
virtual ~OnlineContext ()
 

Public Attributes

uint32_t clientToken
 
uint32_t serverToken
 
uint32_t udpToken
 
LuaCallbackAddUser = NULL
 
LuaCallbackRemoveUser = NULL
 
LuaCallbackSetFriends = NULL
 
LuaCallbackSetGames = NULL
 
LuaCallbackSetChannels = NULL
 
LuaCallbackSetActiveChannel = NULL
 
LuaCallbackShowError = NULL
 
LuaCallbackShowInfo = NULL
 
LuaCallbackShowChat = NULL
 
LuaCallbackShowUserInfo = NULL
 

Constructor & Destructor Documentation

◆ Context()

Context::Context ( )
inline

◆ ~Context()

Context::~Context ( )
inline

Member Function Documentation

◆ addUser()

void Context::addUser ( std::string  name)
inline

◆ disconnect()

void Context::disconnect ( )
inline

◆ doOneStep()

virtual void Context::doOneStep ( )
inlinevirtual

Implements OnlineContext.

◆ getChannels()

std::vector<std::string> Context::getChannels ( )
inline

◆ getCurrentChannel()

std::string Context::getCurrentChannel ( )
inline

◆ getFriends()

std::vector<Friend*> Context::getFriends ( )
inline

◆ getGames()

std::vector<Game*> Context::getGames ( )
inline

◆ getHost()

CHost* Context::getHost ( )
inline

◆ getInfo()

std::queue<std::string>* Context::getInfo ( )
inline

◆ getMsgIStream()

BNCSInputStream* Context::getMsgIStream ( )
inline

◆ getPassword1()

uint32_t* Context::getPassword1 ( )
inline

◆ getTCPSocket()

CTCPSocket* Context::getTCPSocket ( )
inline

◆ getUDPSocket()

CUDPSocket* Context::getUDPSocket ( )
inline

◆ getUsername()

std::string Context::getUsername ( )
inline

◆ getUsers()

std::set<std::string> Context::getUsers ( )
inline

◆ handleUDP()

virtual bool Context::handleUDP ( const unsigned char *  buffer,
int  len,
CHost  host 
)
inlinevirtual

Implements OnlineContext.

◆ isConnected()

bool Context::isConnected ( )
inline

◆ isConnecting()

bool Context::isConnecting ( )
inline

◆ isDisconnected()

bool Context::isDisconnected ( )
inline

◆ joinChannel()

void Context::joinChannel ( std::string  name)
inline

◆ joinGame()

virtual void Context::joinGame ( std::string  username,
std::string  pw 
)
inlinevirtual

Implements OnlineContext.

◆ leaveGame()

virtual void Context::leaveGame ( )
inlinevirtual

Implements OnlineContext.

◆ punchNAT()

void Context::punchNAT ( std::string  username)
inline

◆ refreshChannels()

void Context::refreshChannels ( )
inline

◆ refreshFriends()

void Context::refreshFriends ( )
inline

◆ refreshGames()

void Context::refreshGames ( )
inline

◆ removeUser()

void Context::removeUser ( std::string  name)
inline

◆ reportGameResult()

virtual void Context::reportGameResult ( )
inlinevirtual

Implements OnlineContext.

◆ reportUserdata()

void Context::reportUserdata ( uint32_t  id,
std::vector< std::string >  values 
)
inline

◆ requestExternalAddress()

void Context::requestExternalAddress ( )
inline

◆ requestExtraUserInfo()

void Context::requestExtraUserInfo ( std::string  username)
inline

◆ sendText()

void Context::sendText ( std::string  txt,
bool  silent = false 
)
inline

◆ sendUdpConnectionInfo()

void Context::sendUdpConnectionInfo ( )
inline

◆ setChannels()

void Context::setChannels ( std::vector< std::string >  channels)
inline

◆ setCreateAccount()

void Context::setCreateAccount ( bool  flag)
inline

◆ setCurrentChannel()

void Context::setCurrentChannel ( std::string  name)
inline

◆ setFriendslist()

void Context::setFriendslist ( std::vector< Friend * >  friends)
inline

◆ setGamelist()

void Context::setGamelist ( std::vector< Game * >  games)
inline

◆ setHost()

void Context::setHost ( CHost arg)
inline

◆ setPassword()

void Context::setPassword ( std::string  pw)
inline

◆ setState()

void Context::setState ( OnlineState newState)
inline

◆ setUsername()

void Context::setUsername ( std::string  arg)
inline

◆ shouldCreateAccount()

bool Context::shouldCreateAccount ( )
inline

◆ showChat()

void Context::showChat ( std::string  arg)
inline

◆ showError()

void Context::showError ( std::string  arg)
inline

◆ showInfo()

void Context::showInfo ( std::string  arg)
inline

◆ startAdvertising()

virtual void Context::startAdvertising ( bool  isStarted = false)
inlinevirtual

Implements OnlineContext.

◆ stopAdvertising()

virtual void Context::stopAdvertising ( )
inlinevirtual

Implements OnlineContext.

Member Data Documentation

◆ AddUser

LuaCallback* Context::AddUser = NULL

◆ clientToken

uint32_t Context::clientToken

◆ RemoveUser

LuaCallback* Context::RemoveUser = NULL

◆ serverToken

uint32_t Context::serverToken

◆ SetActiveChannel

LuaCallback* Context::SetActiveChannel = NULL

◆ SetChannels

LuaCallback* Context::SetChannels = NULL

◆ SetFriends

LuaCallback* Context::SetFriends = NULL

◆ SetGames

LuaCallback* Context::SetGames = NULL

◆ ShowChat

LuaCallback* Context::ShowChat = NULL

◆ ShowError

LuaCallback* Context::ShowError = NULL

◆ ShowInfo

LuaCallback* Context::ShowInfo = NULL

◆ ShowUserInfo

LuaCallback* Context::ShowUserInfo = NULL

◆ udpToken

uint32_t Context::udpToken

The documentation for this class was generated from the following file:
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.