ServerBrowserCollect Class Reference

#include <ServerBrowserCollect.h>

Inheritance diagram for ServerBrowserCollect:

NetMessageHandlerI

List of all members.

Public Member Functions

 ServerBrowserCollect (ServerBrowserServerList &list)
virtual ~ServerBrowserCollect ()
bool fetchServerList (const char *masterListServer, const char *masterListServerURI)
bool fetchLANList ()
bool fetchFavoritesList ()
std::set< std::stringgetFavourites ()
void setFavourites (std::set< std::string > &favs)
void setCancel (bool cancel)
virtual void processMessage (NetMessage &message)

Protected Attributes

ServerBrowserServerListlist_
bool cancel_
bool complete_
UDPpacket * sendPacket_
UDPpacket * recvPacket_
NetServerTCP netServer_
NetBuffer sendNetBuffer_


Detailed Description

Definition at line 28 of file ServerBrowserCollect.h.


Constructor & Destructor Documentation

ServerBrowserCollect::ServerBrowserCollect ( ServerBrowserServerList list  ) 

Definition at line 30 of file ServerBrowserCollect.cpp.

References netServer_, recvPacket_, sendPacket_, and NetServerTCP::setMessageHandler().

ServerBrowserCollect::~ServerBrowserCollect (  )  [virtual]

Definition at line 44 of file ServerBrowserCollect.cpp.


Member Function Documentation

bool ServerBrowserCollect::fetchServerList ( const char *  masterListServer,
const char *  masterListServerURI 
)

Definition at line 48 of file ServerBrowserCollect.cpp.

References NetBuffer::addDataToBuffer(), cancel_, ServerBrowserServerList::clear(), complete_, NetServerTCP::connect(), NetServerTCP::disconnectAllClients(), S3D::formatStringBuffer(), OptionsMasterListServer::getMasterListServerTimeout(), ServerBrowserServerList::getNoEntries(), OptionsMasterListServer::instance(), int(), list_, netServer_, NetServerTCP::processMessages(), NetBuffer::reset(), NetServerTCP::sendMessageServer(), and sendNetBuffer_.

Referenced by ServerBrowser::threadFunc().

bool ServerBrowserCollect::fetchLANList (  ) 

Definition at line 108 of file ServerBrowserCollect.cpp.

References ServerBrowserEntry::addAttribute(), ServerBrowserServerList::addEntry(), cancel_, ServerBrowserServerList::clear(), complete_, NetInterface::getIpName(), OptionsMasterListServer::getMasterListServerTimeout(), OptionsMasterListServer::instance(), list_, recvPacket_, S3D::ScorchedPort, sendPacket_, and snprintf.

Referenced by ServerBrowser::threadFunc().

bool ServerBrowserCollect::fetchFavoritesList (  ) 

Definition at line 228 of file ServerBrowserCollect.cpp.

References ServerBrowserEntry::addAttribute(), ServerBrowserServerList::addEntry(), ServerBrowserServerList::clear(), getFavourites(), and list_.

Referenced by ServerBrowser::threadFunc().

std::set< std::string > ServerBrowserCollect::getFavourites (  ) 

Definition at line 249 of file ServerBrowserCollect.cpp.

References S3D::dialogMessage(), file, S3D::formatStringBuffer(), XMLNode::getChildren(), XMLNode::getContent(), XMLFile::getParserError(), XMLFile::getRootNode(), S3D::getSettingsFile(), and XMLFile::readFile().

Referenced by NetworkSelectDialog::buttonDown(), and fetchFavoritesList().

void ServerBrowserCollect::setFavourites ( std::set< std::string > &  favs  ) 

Definition at line 281 of file ServerBrowserCollect.cpp.

References XMLNode::addChild(), S3D::getSettingsFile(), and XMLNode::writeToFile().

Referenced by NetworkSelectDialog::buttonDown().

void ServerBrowserCollect::setCancel ( bool  cancel  )  [inline]

Definition at line 44 of file ServerBrowserCollect.h.

References cancel_.

Referenced by ServerBrowser::cancel(), and ServerBrowser::threadFunc().

void ServerBrowserCollect::processMessage ( NetMessage message  )  [virtual]

Implements NetMessageHandlerI.

Definition at line 162 of file ServerBrowserCollect.cpp.

References ServerBrowserEntry::addAttribute(), NetBuffer::addDataToBuffer(), ServerBrowserServerList::addEntry(), NetMessage::BufferMessage, complete_, NetMessage::ConnectMessage, XMLStringBuffer::create(), NetMessage::DisconnectMessage, NetBuffer::getBuffer(), NetMessage::getBuffer(), XMLNode::getChildren(), NetMessage::getMessageType(), XMLNode::getName(), XMLNode::getNamedChild(), XMLStringBuffer::getRootNode(), list_, LangStringUtil::strcmp(), and LangStringUtil::strlen().


Member Data Documentation

ServerBrowserServerList& ServerBrowserCollect::list_ [protected]

Definition at line 50 of file ServerBrowserCollect.h.

Referenced by fetchFavoritesList(), fetchLANList(), fetchServerList(), and processMessage().

bool ServerBrowserCollect::cancel_ [protected]

Definition at line 51 of file ServerBrowserCollect.h.

Referenced by fetchLANList(), fetchServerList(), and setCancel().

bool ServerBrowserCollect::complete_ [protected]

Definition at line 52 of file ServerBrowserCollect.h.

Referenced by fetchLANList(), fetchServerList(), and processMessage().

UDPpacket* ServerBrowserCollect::sendPacket_ [protected]

Definition at line 53 of file ServerBrowserCollect.h.

Referenced by fetchLANList(), and ServerBrowserCollect().

UDPpacket* ServerBrowserCollect::recvPacket_ [protected]

Definition at line 54 of file ServerBrowserCollect.h.

Referenced by fetchLANList(), and ServerBrowserCollect().

NetServerTCP ServerBrowserCollect::netServer_ [protected]

Definition at line 55 of file ServerBrowserCollect.h.

Referenced by fetchServerList(), and ServerBrowserCollect().

NetBuffer ServerBrowserCollect::sendNetBuffer_ [protected]

Definition at line 56 of file ServerBrowserCollect.h.

Referenced by fetchServerList().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:06 2009 for Scorched3D by  doxygen 1.5.3