diff options
Diffstat (limited to 'src/game-server/accountconnection.cpp')
| -rw-r--r-- | src/game-server/accountconnection.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/game-server/accountconnection.cpp b/src/game-server/accountconnection.cpp index 41f7162..13c924a 100644 --- a/src/game-server/accountconnection.cpp +++ b/src/game-server/accountconnection.cpp @@ -67,11 +67,14 @@ bool AccountConnection::start() Configuration::getValue("net_gameServerAddress", "localhost"); const int gameServerPort = Configuration::getValue("net_gameServerPort", DEFAULT_SERVER_PORT + 3); + const std::string password = + Configuration::getValue("net_password", "P@s$w0rd"); // Register with the account server and send the list of maps we handle MessageOut msg(GAMSG_REGISTER); msg.writeString(gameServerAddress); msg.writeShort(gameServerPort); + msg.writeString(password); msg.writeLong(ItemManager::GetDatabaseVersion()); const MapManager::Maps &m = MapManager::getMaps(); for (MapManager::Maps::const_iterator i = m.begin(), i_end = m.end(); @@ -113,6 +116,12 @@ void AccountConnection::processMessage(MessageIn &msg) { LOG_DEBUG("Local item database is in sync with account server."); } + if (msg.readShort() != PASSWORD_OK) + { + LOG_ERROR("This game server sent a invaild password"); + stop(); + exit(1); + } } break; case AGMSG_PLAYER_ENTER: |
