diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2011-12-02 23:53:45 +0100 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2013-02-24 20:44:13 +0100 |
commit | dd20c7f6148cc8b8b627028e25e817cc1cab063b (patch) | |
tree | b7c9900c8b01aa67a496cd92276a166450817761 /src/game-server | |
parent | 9860dacbb6526138ae8edf57adc42ddc3e6073fa (diff) | |
download | manaserv-dd20c7f6148cc8b8b627028e25e817cc1cab063b.tar.gz manaserv-dd20c7f6148cc8b8b627028e25e817cc1cab063b.tar.xz manaserv-dd20c7f6148cc8b8b627028e25e817cc1cab063b.zip |
Added possibility to reserve maps
If you set net_gameServerName you can now reserve maps in the maps.xml.
There you have to add the servername - property to the <map> tag.
Then the map will only be activated by that server.
Also changed the activate sequence that the account server now tells the game
server what maps to activate (previously the server requested all maps and the
account server said yes or no).
TODO: Fix general inter server map switching.
Diffstat (limited to 'src/game-server')
-rw-r--r-- | src/game-server/accountconnection.cpp | 11 | ||||
-rw-r--r-- | src/game-server/main-game.cpp | 12 |
2 files changed, 5 insertions, 18 deletions
diff --git a/src/game-server/accountconnection.cpp b/src/game-server/accountconnection.cpp index 3b58e34..0507eb0 100644 --- a/src/game-server/accountconnection.cpp +++ b/src/game-server/accountconnection.cpp @@ -77,6 +77,8 @@ bool AccountConnection::start(int gameServerPort) LOG_INFO("Connection established to the account server."); + const std::string gameServerName = + Configuration::getValue("net_gameServerName", "server1"); const std::string gameServerAddress = Configuration::getValue("net_publicGameHost", Configuration::getValue("net_gameHost", @@ -84,18 +86,13 @@ bool AccountConnection::start(int gameServerPort) const std::string password = Configuration::getValue("net_password", "changeMe"); - // Register with the account server and send the list of maps we handle + // Register with the account server MessageOut msg(GAMSG_REGISTER); + msg.writeString(gameServerName); msg.writeString(gameServerAddress); msg.writeInt16(gameServerPort); msg.writeString(password); msg.writeInt32(itemManager->getDatabaseVersion()); - const MapManager::Maps &m = MapManager::getMaps(); - for (MapManager::Maps::const_iterator i = m.begin(), i_end = m.end(); - i != i_end; ++i) - { - msg.writeInt16(i->first); - } send(msg); // initialize sync buffer diff --git a/src/game-server/main-game.cpp b/src/game-server/main-game.cpp index f76189f..2533a16 100644 --- a/src/game-server/main-game.cpp +++ b/src/game-server/main-game.cpp @@ -20,6 +20,7 @@ */ #include "common/configuration.h" +#include "common/defines.h" #include "common/permissionmanager.h" #include "common/resourcemanager.h" #include "game-server/accountconnection.h" @@ -64,19 +65,8 @@ using utils::Logger; -// Default options that automake should be able to override. #define DEFAULT_LOG_FILE "manaserv-game.log" -#define DEFAULT_ITEMSDB_FILE "items.xml" -#define DEFAULT_EQUIPDB_FILE "equip.xml" -#define DEFAULT_SKILLSDB_FILE "skills.xml" -#define DEFAULT_ATTRIBUTEDB_FILE "attributes.xml" -#define DEFAULT_MAPSDB_FILE "maps.xml" -#define DEFAULT_MONSTERSDB_FILE "monsters.xml" -#define DEFAULT_STATUSDB_FILE "status-effects.xml" -#define DEFAULT_PERMISSION_FILE "permissions.xml" #define DEFAULT_MAIN_SCRIPT_FILE "scripts/main.lua" -#define DEFAULT_SPECIALSDB_FILE "specials.xml" -#define DEFAULT_EMOTESDB_FILE "emotes.xml" static int const WORLD_TICK_SKIP = 2; /** tolerance for lagging behind in world calculation) **/ |