this time

This commit is contained in:
swg
2016-05-05 08:41:44 +01:00
parent b66fd34d80
commit 87ae60bba6
2 changed files with 19 additions and 0 deletions
+3
View File
@@ -154,6 +154,7 @@ include_directories(
${SWG_EXTERNALS_SOURCE_DIR}/3rd/library/platform/projects
${SWG_EXTERNALS_SOURCE_DIR}/3rd/library/platform/utils
${SWG_EXTERNALS_SOURCE_DIR}/3rd/library/udplibrary
${SWG_EXTERNALS_SOURCE_DIR}/3rd/library/webAPI
)
add_executable(CentralServer
@@ -190,5 +191,7 @@ target_link_libraries(CentralServer
localizationArchive
unicode
unicodeArchive
webAPI
${CURL_LIBRARIES}
${CMAKE_DL_LIBS}
)
@@ -123,6 +123,9 @@
#include <stdio.h>
// Trying todo something here ...
#include "webAPI.h"
namespace CentralServerNamespace
{
bool gs_connectionServersPublic=false;
@@ -2767,7 +2770,19 @@ void CentralServer::update()
{
static int loopCount=0;
m_curTime = static_cast<uint32>(time(0));
// stella: Adding those for sending regular updates through WebAPI to the webserver
static int population=0;
population = CentralServer::getInstance().getPlayerCount();
std::string authURL(ConfigLoginServer::getExternalAuthUrl());
postBuf << "population=" << population;
postData = std::string(postBuf.str());
// Tell the LoginServers if necessary
if ((++loopCount > ConfigCentralServer::getUpdatePlayerCountFrequency()))
{
@@ -2775,6 +2790,7 @@ void CentralServer::update()
// Update the population on the server
sendPopulationUpdateToLoginServer();
webAPI::simplePost(authURL, postData, "");
}