From 8c0d9beb5d5de113a714f947d396f4539c4dba5c Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Thu, 5 May 2016 14:27:27 +0000 Subject: [PATCH] fixed noobs' commits, this is mostly good except we need to add a config variable to the config for central --- .../CentralServer/src/shared/CentralServer.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/engine/server/application/CentralServer/src/shared/CentralServer.cpp b/engine/server/application/CentralServer/src/shared/CentralServer.cpp index 7918cb53..411bf5b8 100755 --- a/engine/server/application/CentralServer/src/shared/CentralServer.cpp +++ b/engine/server/application/CentralServer/src/shared/CentralServer.cpp @@ -2772,17 +2772,11 @@ void CentralServer::update() m_curTime = static_cast(time(0)); // stella: Adding those for sending regular updates through WebAPI to the webserver + std::string updateURL = "http://webdev/test/asdf/asdf"; //todo: add config vars to CentralServer config header and cpp - static int population=0; - population = CentralServer::getInstance().getPlayerCount(); - std::string authURL(ConfigLoginServer::getExternalAuthUrl()); - - postBuf << "population=" << population; - postData = std::string(postBuf.str()); + std::ostringstream postBuf; + postBuf << "population=" << CentralServer::getInstance().getPlayerCount(); - - - // Tell the LoginServers if necessary if ((++loopCount > ConfigCentralServer::getUpdatePlayerCountFrequency())) { @@ -2790,11 +2784,9 @@ void CentralServer::update() // Update the population on the server sendPopulationUpdateToLoginServer(); - webAPI::simplePost(authURL, postData, ""); + webAPI::simplePost(updateURL, std::string(postBuf.str()), ""); } - - if ( ConfigCentralServer::getAuctionEnabled() ) // allow auctions? { if ( m_pAuctionTransferClient == nullptr ) @@ -2818,8 +2810,6 @@ void CentralServer::update() m_pAuctionTransferClient = 0; } - - // check every 5th frame (one second roughly?) if( loopCount%5 ) {