#include <game_server.h>
Inherits Game.
Inheritance diagram for GameServer:


Public Member Functions | |
| GameServer () | |
| virtual | ~GameServer () |
| virtual void | run () |
| Start the game. | |
| double | getSpeedMultiplicator () |
| Get curret game speed. | |
| void | setSpeedMultiplicator (double speedMultiplicator) |
| Set new game speed. | |
| virtual void | init () |
| Init data structures for game. | |
| virtual void | clean () |
| Clean data structures for game. | |
| virtual bool | loadMap (const std::string mapName) |
| Load new map. | |
| virtual void | unloadMap () |
| Clear all objects from map. | |
| void | loadNewMap (const std::string mapName) |
| Clean old map and load new. | |
| std::string | getMapName () |
| Return name of current map. | |
Private Member Functions | |
| void | setMapName (const std::string mapName) |
| Set new map name. | |
| GameServer (GameServer ©) | |
| Program killer - trap. | |
Private Attributes | |
| double | mSpeedMultiplicator |
| Modification of game speed. | |
| std::string | mMapName |
| Name of currentply played map. Use mMapNameMutex when access. | |
| Mutex | mMapNameMutex |
| Mutex for access to mMapName. | |
Definition at line 9 of file game_server.h.
|
|
Definition at line 19 of file game_server.cpp. References g_settings, Settings::getDouble(), mSpeedMultiplicator, and TIN. Here is the call graph for this function: ![]() |
|
|
Definition at line 26 of file game_server.cpp. References TIN. |
|
|
Program killer - trap. From security reasons we don't allow anyone to create copy of GameServer since it is probably a mistake. Anyway calling this constructor will kill program.
Definition at line 32 of file game_server.cpp. References DIE(), LOGE, and TIN. Here is the call graph for this function: ![]() |
|
|
Clean data structures for game.
Reimplemented from Game. Definition at line 249 of file game_server.cpp. References Game::clean(). Here is the call graph for this function: ![]() |
|
|
Return name of current map. This is usefull if some client ask for map the network code may answer without need to wait for main loop. This call is thread safe.
Definition at line 256 of file game_server.cpp. References Mutex::lock(), mMapName, mMapNameMutex, and Mutex::unlock(). Referenced by unloadMap(). Here is the call graph for this function: ![]() |
|
|
Get curret game speed.
Definition at line 229 of file game_server.cpp. References mSpeedMultiplicator. Referenced by TaskSimulationServer::update(). |
|
|
Init data structures for game.
Implements Game. Definition at line 243 of file game_server.cpp. Referenced by ApplicationServer::run(). |
|
|
Load new map.
Reimplemented from Game. Definition at line 41 of file game_server.cpp. References Game::loadMap(), LOGI, setMapName(), and TIN. Referenced by loadNewMap(). Here is the call graph for this function: ![]() |
|
|
Clean old map and load new.
Definition at line 76 of file game_server.cpp. References loadMap(), setMapName(), Game::setRunning(), and unloadMap(). Here is the call graph for this function: ![]() |
|
|
Start the game.
Implements Game. Definition at line 95 of file game_server.cpp. References TaskManager::add(), getAppServer(), World::getLandscape(), Game::getTaskManager(), Landscape::getTerrain(), Game::getWorld(), Terrain::initServer(), TaskManager::initTasks(), Game::mEndFun, Game::mTaskManager, Game::recreateWorld(), Thread::reshedule(), Game::setRunning(), Thread::start(), TIN, and TaskManager::update(). Referenced by ApplicationServer::run(). Here is the call graph for this function: ![]() |
|
|
Set new map name. The name is set in loadNewMap or loadMap
Definition at line 267 of file game_server.cpp. References Mutex::lock(), mMapName, mMapNameMutex, and Mutex::unlock(). Referenced by loadMap(), and loadNewMap(). Here is the call graph for this function: ![]() |
|
|
Set new game speed. The value is also saved to settings.
Definition at line 235 of file game_server.cpp. References g_settings, Settings::getDouble(), and mSpeedMultiplicator. Here is the call graph for this function: ![]() |
|
|
Clear all objects from map.
Definition at line 59 of file game_server.cpp. References getMapName(), LOGI, and TIN. Referenced by loadNewMap(). Here is the call graph for this function: ![]() |
|
|
Name of currentply played map. Use mMapNameMutex when access.
Definition at line 111 of file game_server.h. Referenced by getMapName(), and setMapName(). |
|
|
Mutex for access to mMapName.
Definition at line 112 of file game_server.h. Referenced by getMapName(), and setMapName(). |
|
|
Modification of game speed. The speed is double number where 1.0 means normal speed, 0.5 means half speed and 2.0 means double. This number is used vhen counting how often tick() for server is called. Definition at line 109 of file game_server.h. Referenced by GameServer(), getSpeedMultiplicator(), and setSpeedMultiplicator(). |
1.4.5