From dd20c7f6148cc8b8b627028e25e817cc1cab063b Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Fri, 2 Dec 2011 23:53:45 +0100 Subject: 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 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. --- src/game-server/accountconnection.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/game-server/accountconnection.cpp') diff --git a/src/game-server/accountconnection.cpp b/src/game-server/accountconnection.cpp index 3b58e347..0507eb09 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 -- cgit v1.2.3-70-g09d2