ServerFileServer Class Reference

#include <ServerFileServer.h>

List of all members.

Public Member Functions

void simulate (float timeDifference)

Static Public Member Functions

static ServerFileServerinstance ()

Protected Member Functions

void sendBytes (Tank *tank, unsigned int size)
bool sendNextFile (ComsFileMessage &message, Tank *tank, unsigned int size, unsigned int &sentSize)

Protected Attributes

unsigned int lastTime_
unsigned int bytesSent_

Static Protected Attributes

static ServerFileServerinstance_ = 0

Private Member Functions

 ServerFileServer ()
virtual ~ServerFileServer ()


Detailed Description

Definition at line 27 of file ServerFileServer.h.


Constructor & Destructor Documentation

ServerFileServer::ServerFileServer (  )  [private]

Definition at line 45 of file ServerFileServer.cpp.

ServerFileServer::~ServerFileServer (  )  [private, virtual]

Definition at line 49 of file ServerFileServer.cpp.


Member Function Documentation

ServerFileServer * ServerFileServer::instance (  )  [static]

Definition at line 36 of file ServerFileServer.cpp.

References instance_.

Referenced by serverLoop().

void ServerFileServer::simulate ( float  timeDifference  ) 

Definition at line 53 of file ServerFileServer.cpp.

References bytesSent_, Tank::getDestinationId(), TankMod::getFiles(), TankMod::getInit(), Tank::getMod(), ScorchedContext::getOptionsGame(), TankContainer::getPlayingTanks(), TankMod::getReadyToReceive(), TankMod::getSent(), TankState::getState(), Tank::getState(), ScorchedContext::getTankContainer(), ScorchedServer::instance(), int(), lastTime_, sendBytes(), ComsMessageSender::sendToSingleClient(), TankMod::setReadyToReceive(), TankMod::setSent(), TankState::setState(), TankState::sInitializing, and TankState::sLoading.

Referenced by serverLoop().

void ServerFileServer::sendBytes ( Tank tank,
unsigned int  size 
) [protected]

Definition at line 187 of file ServerFileServer.cpp.

References NetBuffer::addToBuffer(), ComsFileMessage::fileBuffer, Tank::getDestinationId(), sendNextFile(), and ComsMessageSender::sendToSingleClient().

Referenced by simulate().

bool ServerFileServer::sendNextFile ( ComsFileMessage message,
Tank tank,
unsigned int  size,
unsigned int &  sentSize 
) [protected]

Definition at line 206 of file ServerFileServer.cpp.

References NetBuffer::addDataToBuffer(), NetBuffer::addToBuffer(), DIALOG_ASSERT, ComsFileMessage::fileBuffer, ModIdentifierEntry::fileName, ModFiles::getFiles(), TankMod::getFiles(), Tank::getMod(), ScorchedContext::getModFiles(), TankMod::getTotalLeft(), ScorchedServer::instance(), ModIdentifierEntry::length, MIN, TankMod::rmFile(), and TankMod::setTotalLeft().

Referenced by sendBytes().


Member Data Documentation

ServerFileServer * ServerFileServer::instance_ = 0 [static, protected]

Definition at line 35 of file ServerFileServer.h.

Referenced by instance().

unsigned int ServerFileServer::lastTime_ [protected]

Definition at line 36 of file ServerFileServer.h.

Referenced by simulate().

unsigned int ServerFileServer::bytesSent_ [protected]

Definition at line 37 of file ServerFileServer.h.

Referenced by simulate().


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