mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Added logs on client
Airplanes are now shown with silhouettes
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
<ClInclude Include="include\scriptloader.h" />
|
||||
<ClInclude Include="include\server.h" />
|
||||
<ClInclude Include="include\unit.h" />
|
||||
<ClInclude Include="include\unitsfactory.h" />
|
||||
<ClInclude Include="include\unitsmanager.h" />
|
||||
<ClInclude Include="include\weapon.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -58,7 +58,7 @@
|
||||
<ClCompile Include="src\scriptloader.cpp" />
|
||||
<ClCompile Include="src\server.cpp" />
|
||||
<ClCompile Include="src\unit.cpp" />
|
||||
<ClCompile Include="src\unitsfactory.cpp" />
|
||||
<ClCompile Include="src\unitsmanager.cpp" />
|
||||
<ClCompile Include="src\weapon.cpp" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<ClInclude Include="include\unit.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\unitsfactory.h">
|
||||
<ClInclude Include="include\unitsmanager.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\weapon.h">
|
||||
@@ -80,7 +80,7 @@
|
||||
<ClCompile Include="src\unit.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\unitsfactory.cpp">
|
||||
<ClCompile Include="src\unitsmanager.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\weapon.cpp">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
using namespace web::http;
|
||||
using namespace web::http::experimental::listener;
|
||||
|
||||
class UnitsFactory;
|
||||
class UnitsManager;
|
||||
class Scheduler;
|
||||
|
||||
class Server
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
class Unit;
|
||||
|
||||
class UnitsFactory
|
||||
class UnitsManager
|
||||
{
|
||||
public:
|
||||
UnitsFactory(lua_State* L);
|
||||
~UnitsFactory();
|
||||
UnitsManager(lua_State* L);
|
||||
~UnitsManager();
|
||||
|
||||
Unit* getUnit(int ID);
|
||||
void updateExportData(lua_State* L);
|
||||
@@ -1,11 +1,11 @@
|
||||
#include "scheduler.h"
|
||||
#include "logger.h"
|
||||
#include "dcstools.h"
|
||||
#include "unitsFactory.h"
|
||||
#include "unitsManager.h"
|
||||
#include "utils.h"
|
||||
#include "unit.h"
|
||||
|
||||
extern UnitsFactory* unitsFactory;
|
||||
extern UnitsManager* unitsManager;
|
||||
|
||||
Scheduler::Scheduler(lua_State* L)
|
||||
{
|
||||
@@ -36,9 +36,6 @@ void Scheduler::execute(lua_State* L)
|
||||
{
|
||||
log(L"Error executing command " + commandString);
|
||||
}
|
||||
{
|
||||
log(L"Command " + commandString + L" executed succesfully");
|
||||
}
|
||||
commands.remove(command);
|
||||
return;
|
||||
}
|
||||
@@ -55,7 +52,7 @@ void Scheduler::handleRequest(wstring key, json::value value)
|
||||
if (key.compare(L"setPath") == 0)
|
||||
{
|
||||
int ID = value[L"ID"].as_integer();
|
||||
Unit* unit = unitsFactory->getUnit(ID);
|
||||
Unit* unit = unitsManager->getUnit(ID);
|
||||
if (unit != nullptr)
|
||||
{
|
||||
wstring unitName = unit->getUnitName();
|
||||
@@ -71,7 +68,7 @@ void Scheduler::handleRequest(wstring key, json::value value)
|
||||
newPath.push_back(dest);
|
||||
}
|
||||
|
||||
Unit* unit = unitsFactory->getUnit(ID);
|
||||
Unit* unit = unitsManager->getUnit(ID);
|
||||
if (unit != nullptr)
|
||||
{
|
||||
unit->setPath(newPath);
|
||||
@@ -118,8 +115,8 @@ void Scheduler::handleRequest(wstring key, json::value value)
|
||||
int ID = value[L"ID"].as_integer();
|
||||
int targetID = value[L"targetID"].as_integer();
|
||||
|
||||
Unit* unit = unitsFactory->getUnit(ID);
|
||||
Unit* target = unitsFactory->getUnit(targetID);
|
||||
Unit* unit = unitsManager->getUnit(ID);
|
||||
Unit* target = unitsManager->getUnit(targetID);
|
||||
|
||||
wstring unitName;
|
||||
wstring targetName;
|
||||
@@ -141,7 +138,7 @@ void Scheduler::handleRequest(wstring key, json::value value)
|
||||
else if (key.compare(L"stopAttack") == 0)
|
||||
{
|
||||
int ID = value[L"ID"].as_integer();
|
||||
Unit* unit = unitsFactory->getUnit(ID);
|
||||
Unit* unit = unitsManager->getUnit(ID);
|
||||
if (unit != nullptr)
|
||||
unit->setState(State::REACH_DESTINATION);
|
||||
else
|
||||
@@ -150,28 +147,28 @@ void Scheduler::handleRequest(wstring key, json::value value)
|
||||
else if (key.compare(L"changeSpeed") == 0)
|
||||
{
|
||||
int ID = value[L"ID"].as_integer();
|
||||
Unit* unit = unitsFactory->getUnit(ID);
|
||||
Unit* unit = unitsManager->getUnit(ID);
|
||||
if (unit != nullptr)
|
||||
unit->changeSpeed(value[L"change"].as_string());
|
||||
}
|
||||
else if (key.compare(L"changeAltitude") == 0)
|
||||
{
|
||||
int ID = value[L"ID"].as_integer();
|
||||
Unit* unit = unitsFactory->getUnit(ID);
|
||||
Unit* unit = unitsManager->getUnit(ID);
|
||||
if (unit != nullptr)
|
||||
unit->changeAltitude(value[L"change"].as_string());
|
||||
}
|
||||
else if (key.compare(L"setSpeed") == 0)
|
||||
{
|
||||
int ID = value[L"ID"].as_integer();
|
||||
Unit* unit = unitsFactory->getUnit(ID);
|
||||
Unit* unit = unitsManager->getUnit(ID);
|
||||
if (unit != nullptr)
|
||||
unit->setTargetSpeed(value[L"speed"].as_double());
|
||||
}
|
||||
else if (key.compare(L"setAltitude") == 0)
|
||||
{
|
||||
int ID = value[L"ID"].as_integer();
|
||||
Unit* unit = unitsFactory->getUnit(ID);
|
||||
Unit* unit = unitsManager->getUnit(ID);
|
||||
if (unit != nullptr)
|
||||
unit->setTargetAltitude(value[L"altitude"].as_double());
|
||||
}
|
||||
@@ -187,7 +184,7 @@ void Scheduler::handleRequest(wstring key, json::value value)
|
||||
else if (key.compare(L"setLeader") == 0)
|
||||
{
|
||||
int ID = value[L"ID"].as_integer();
|
||||
Unit* unit = unitsFactory->getUnit(ID);
|
||||
Unit* unit = unitsManager->getUnit(ID);
|
||||
bool isLeader = value[L"isLeader"].as_bool();
|
||||
if (isLeader)
|
||||
{
|
||||
@@ -197,7 +194,7 @@ void Scheduler::handleRequest(wstring key, json::value value)
|
||||
{
|
||||
for (auto itr = wingmenIDs.as_array().begin(); itr != wingmenIDs.as_array().end(); itr++)
|
||||
{
|
||||
Unit* wingman = unitsFactory->getUnit(itr->as_integer());
|
||||
Unit* wingman = unitsManager->getUnit(itr->as_integer());
|
||||
if (wingman != nullptr)
|
||||
wingmen.push_back(wingman);
|
||||
}
|
||||
@@ -214,28 +211,28 @@ void Scheduler::handleRequest(wstring key, json::value value)
|
||||
else if (key.compare(L"setFormation") == 0)
|
||||
{
|
||||
int ID = value[L"ID"].as_integer();
|
||||
Unit* unit = unitsFactory->getUnit(ID);
|
||||
Unit* unit = unitsManager->getUnit(ID);
|
||||
wstring formation = value[L"formation"].as_string();
|
||||
unit->setFormation(formation);
|
||||
}
|
||||
else if (key.compare(L"setROE") == 0)
|
||||
{
|
||||
int ID = value[L"ID"].as_integer();
|
||||
Unit* unit = unitsFactory->getUnit(ID);
|
||||
Unit* unit = unitsManager->getUnit(ID);
|
||||
wstring ROE = value[L"ROE"].as_string();
|
||||
unit->setROE(ROE);
|
||||
}
|
||||
else if (key.compare(L"setReactionToThreat") == 0)
|
||||
{
|
||||
int ID = value[L"ID"].as_integer();
|
||||
Unit* unit = unitsFactory->getUnit(ID);
|
||||
Unit* unit = unitsManager->getUnit(ID);
|
||||
wstring reactionToThreat = value[L"reactionToThreat"].as_string();
|
||||
unit->setReactionToThreat(reactionToThreat);
|
||||
}
|
||||
else if (key.compare(L"landAt") == 0)
|
||||
{
|
||||
int ID = value[L"ID"].as_integer();
|
||||
Unit* unit = unitsFactory->getUnit(ID);
|
||||
Unit* unit = unitsManager->getUnit(ID);
|
||||
double lat = value[L"location"][L"lat"].as_double();
|
||||
double lng = value[L"location"][L"lng"].as_double();
|
||||
Coords loc; loc.lat = lat; loc.lng = lng;
|
||||
@@ -244,7 +241,7 @@ void Scheduler::handleRequest(wstring key, json::value value)
|
||||
else if (key.compare(L"deleteUnit") == 0)
|
||||
{
|
||||
int ID = value[L"ID"].as_integer();
|
||||
unitsFactory->deleteUnit(ID);
|
||||
unitsManager->deleteUnit(ID);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
#include "commands.h"
|
||||
#include "scheduler.h"
|
||||
#include "defines.h"
|
||||
#include "unitsFactory.h"
|
||||
#include "unitsManager.h"
|
||||
|
||||
#include <GeographicLib/Geodesic.hpp>
|
||||
using namespace GeographicLib;
|
||||
|
||||
extern Scheduler* scheduler;
|
||||
extern UnitsFactory* unitsFactory;
|
||||
extern UnitsManager* unitsManager;
|
||||
|
||||
Unit::Unit(json::value json, int ID) :
|
||||
ID(ID)
|
||||
@@ -159,7 +159,7 @@ wstring Unit::getTarget()
|
||||
{
|
||||
if (isTargetAlive())
|
||||
{
|
||||
Unit* target = unitsFactory->getUnit(targetID);
|
||||
Unit* target = unitsManager->getUnit(targetID);
|
||||
if (target != nullptr)
|
||||
return target->getUnitName();
|
||||
}
|
||||
@@ -171,7 +171,7 @@ bool Unit::isTargetAlive()
|
||||
if (targetID == NULL)
|
||||
return false;
|
||||
|
||||
Unit* target = unitsFactory->getUnit(targetID);
|
||||
Unit* target = unitsManager->getUnit(targetID);
|
||||
if (target != nullptr)
|
||||
return target->alive;
|
||||
else
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
#include "commands.h"
|
||||
#include "scheduler.h"
|
||||
#include "defines.h"
|
||||
#include "unitsFactory.h"
|
||||
#include "unitsManager.h"
|
||||
|
||||
#include <GeographicLib/Geodesic.hpp>
|
||||
using namespace GeographicLib;
|
||||
|
||||
extern Scheduler* scheduler;
|
||||
extern UnitsFactory* unitsFactory;
|
||||
extern UnitsManager* unitsManager;
|
||||
|
||||
/* Aircraft */
|
||||
Aircraft::Aircraft(json::value json, int ID) : AirUnit(json, ID)
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
#include "commands.h"
|
||||
#include "scheduler.h"
|
||||
#include "defines.h"
|
||||
#include "unitsFactory.h"
|
||||
#include "unitsManager.h"
|
||||
|
||||
#include <GeographicLib/Geodesic.hpp>
|
||||
using namespace GeographicLib;
|
||||
|
||||
extern Scheduler* scheduler;
|
||||
extern UnitsFactory* unitsFactory;
|
||||
extern UnitsManager* unitsManager;
|
||||
|
||||
/* Air unit */
|
||||
AirUnit::AirUnit(json::value json, int ID) : Unit(json, ID)
|
||||
@@ -59,7 +59,7 @@ void AirUnit::setState(int newState)
|
||||
}
|
||||
case State::ATTACK: {
|
||||
if (isTargetAlive()) {
|
||||
Unit* target = unitsFactory->getUnit(targetID);
|
||||
Unit* target = unitsManager->getUnit(targetID);
|
||||
Coords targetPosition = Coords(target->getLatitude(), target->getLongitude(), 0);
|
||||
activePath.clear();
|
||||
activePath.push_front(targetPosition);
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#include "dcstools.h"
|
||||
#include "logger.h"
|
||||
#include "defines.h"
|
||||
#include "unitsFactory.h"
|
||||
#include "unitsManager.h"
|
||||
#include "server.h"
|
||||
#include "scheduler.h"
|
||||
#include "scriptLoader.h"
|
||||
#include "luatools.h"
|
||||
|
||||
auto before = std::chrono::system_clock::now();
|
||||
UnitsFactory* unitsFactory = nullptr;
|
||||
UnitsManager* unitsManager = nullptr;
|
||||
Server* server = nullptr;
|
||||
Scheduler* scheduler = nullptr;
|
||||
json::value airbasesData;
|
||||
@@ -24,7 +24,7 @@ extern "C" DllExport int coreDeinit(lua_State* L)
|
||||
|
||||
log("Olympus coreDeinit called successfully");
|
||||
|
||||
delete unitsFactory;
|
||||
delete unitsManager;
|
||||
delete server;
|
||||
delete scheduler;
|
||||
|
||||
@@ -36,7 +36,7 @@ extern "C" DllExport int coreDeinit(lua_State* L)
|
||||
/* Called when DCS simulation starts. All singletons are instantiated, and the custom Lua functions are registered in the Lua state. */
|
||||
extern "C" DllExport int coreInit(lua_State* L)
|
||||
{
|
||||
unitsFactory = new UnitsFactory(L);
|
||||
unitsManager = new UnitsManager(L);
|
||||
server = new Server(L);
|
||||
scheduler = new Scheduler(L);
|
||||
|
||||
@@ -59,9 +59,9 @@ extern "C" DllExport int coreFrame(lua_State* L)
|
||||
// TODO make intervals editable
|
||||
if (duration.count() > UPDATE_TIME_INTERVAL)
|
||||
{
|
||||
if (unitsFactory != nullptr)
|
||||
if (unitsManager != nullptr)
|
||||
{
|
||||
unitsFactory->updateExportData(L);
|
||||
unitsManager->updateExportData(L);
|
||||
}
|
||||
|
||||
// TODO allow for different intervals
|
||||
@@ -87,7 +87,7 @@ extern "C" DllExport int coreMissionData(lua_State * L)
|
||||
json::value missionData = luaTableToJSON(L, -1);
|
||||
|
||||
if (missionData.has_object_field(L"unitsData"))
|
||||
unitsFactory->updateMissionData(missionData[L"unitsData"]);
|
||||
unitsManager->updateMissionData(missionData[L"unitsData"]);
|
||||
if (missionData.has_object_field(L"airbases"))
|
||||
airbasesData = missionData[L"airbases"];
|
||||
if (missionData.has_object_field(L"bullseye"))
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
#include "commands.h"
|
||||
#include "scheduler.h"
|
||||
#include "defines.h"
|
||||
#include "unitsFactory.h"
|
||||
#include "unitsManager.h"
|
||||
|
||||
#include <GeographicLib/Geodesic.hpp>
|
||||
using namespace GeographicLib;
|
||||
|
||||
extern Scheduler* scheduler;
|
||||
extern UnitsFactory* unitsFactory;
|
||||
extern UnitsManager* unitsManager;
|
||||
|
||||
/* Ground unit */
|
||||
GroundUnit::GroundUnit(json::value json, int ID) : Unit(json, ID)
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
#include "commands.h"
|
||||
#include "scheduler.h"
|
||||
#include "defines.h"
|
||||
#include "unitsFactory.h"
|
||||
#include "unitsManager.h"
|
||||
|
||||
#include <GeographicLib/Geodesic.hpp>
|
||||
using namespace GeographicLib;
|
||||
|
||||
extern Scheduler* scheduler;
|
||||
extern UnitsFactory* unitsFactory;
|
||||
extern UnitsManager* unitsManager;
|
||||
|
||||
/* Helicopter */
|
||||
Helicopter::Helicopter(json::value json, int ID) : AirUnit(json, ID)
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
#include "commands.h"
|
||||
#include "scheduler.h"
|
||||
#include "defines.h"
|
||||
#include "unitsFactory.h"
|
||||
#include "unitsManager.h"
|
||||
|
||||
#include <GeographicLib/Geodesic.hpp>
|
||||
using namespace GeographicLib;
|
||||
|
||||
extern Scheduler* scheduler;
|
||||
extern UnitsFactory* unitsFactory;
|
||||
extern UnitsManager* unitsManager;
|
||||
|
||||
/* Navy Unit */
|
||||
NavyUnit::NavyUnit(json::value json, int ID) : Unit(json, ID)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#include "server.h"
|
||||
#include "logger.h"
|
||||
#include "defines.h"
|
||||
#include "unitsFactory.h"
|
||||
#include "unitsManager.h"
|
||||
#include "scheduler.h"
|
||||
#include "luatools.h"
|
||||
#include <exception>
|
||||
#include <stdexcept>
|
||||
|
||||
extern UnitsFactory* unitsFactory;
|
||||
extern UnitsManager* unitsManager;
|
||||
extern Scheduler* scheduler;
|
||||
extern json::value airbasesData;
|
||||
extern json::value bullseyeData;
|
||||
@@ -62,9 +62,15 @@ void Server::handle_get(http_request request)
|
||||
auto answer = json::value::object();
|
||||
std::exception_ptr eptr;
|
||||
try {
|
||||
unitsFactory->updateAnswer(answer);
|
||||
unitsManager->updateAnswer(answer);
|
||||
answer[L"airbases"] = airbasesData;
|
||||
answer[L"bullseye"] = bullseyeData;
|
||||
answer[L"logs"] = json::value::object();
|
||||
|
||||
int i = 0;
|
||||
for (auto log : getLogs())
|
||||
answer[L"logs"][to_wstring(i++)] = json::value::string(to_wstring(log));
|
||||
|
||||
response.set_body(answer);
|
||||
}
|
||||
catch (...) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "framework.h"
|
||||
#include "unitsFactory.h"
|
||||
#include "unitsManager.h"
|
||||
#include "logger.h"
|
||||
#include "unit.h"
|
||||
#include "aircraft.h"
|
||||
@@ -12,17 +12,17 @@
|
||||
|
||||
extern Scheduler* scheduler;
|
||||
|
||||
UnitsFactory::UnitsFactory(lua_State* L)
|
||||
UnitsManager::UnitsManager(lua_State* L)
|
||||
{
|
||||
LogInfo(L, "Units Factory constructor called successfully");
|
||||
}
|
||||
|
||||
UnitsFactory::~UnitsFactory()
|
||||
UnitsManager::~UnitsManager()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Unit* UnitsFactory::getUnit(int ID)
|
||||
Unit* UnitsManager::getUnit(int ID)
|
||||
{
|
||||
if (units.find(ID) == units.end()) {
|
||||
return nullptr;
|
||||
@@ -32,7 +32,7 @@ Unit* UnitsFactory::getUnit(int ID)
|
||||
}
|
||||
}
|
||||
|
||||
void UnitsFactory::updateExportData(lua_State* L)
|
||||
void UnitsManager::updateExportData(lua_State* L)
|
||||
{
|
||||
map<int, json::value> unitJSONs = getAllUnits(L);
|
||||
|
||||
@@ -94,7 +94,7 @@ void UnitsFactory::updateExportData(lua_State* L)
|
||||
}
|
||||
}
|
||||
|
||||
void UnitsFactory::updateMissionData(json::value missionData)
|
||||
void UnitsManager::updateMissionData(json::value missionData)
|
||||
{
|
||||
/* Update all units */
|
||||
for (auto const& p : units)
|
||||
@@ -107,7 +107,7 @@ void UnitsFactory::updateMissionData(json::value missionData)
|
||||
}
|
||||
}
|
||||
|
||||
void UnitsFactory::updateAnswer(json::value& answer)
|
||||
void UnitsManager::updateAnswer(json::value& answer)
|
||||
{
|
||||
// TODO THREAT SAFEY!
|
||||
auto unitsJson = json::value::object();
|
||||
@@ -120,7 +120,7 @@ void UnitsFactory::updateAnswer(json::value& answer)
|
||||
answer[L"units"] = unitsJson;
|
||||
}
|
||||
|
||||
void UnitsFactory::deleteUnit(int ID)
|
||||
void UnitsManager::deleteUnit(int ID)
|
||||
{
|
||||
if (getUnit(ID) != nullptr)
|
||||
{
|
||||
@@ -4,13 +4,13 @@
|
||||
#include "commands.h"
|
||||
#include "scheduler.h"
|
||||
#include "defines.h"
|
||||
#include "unitsFactory.h"
|
||||
#include "unitsmanager.h"
|
||||
|
||||
#include <GeographicLib/Geodesic.hpp>
|
||||
using namespace GeographicLib;
|
||||
|
||||
extern Scheduler* scheduler;
|
||||
extern UnitsFactory* unitsFactory;
|
||||
extern UnitsManager* unitsManager;
|
||||
|
||||
/* Weapon */
|
||||
Weapon::Weapon(json::value json, int ID) : Unit(json, ID)
|
||||
|
||||
@@ -3,3 +3,4 @@
|
||||
|
||||
void DllExport log(const std::string& sMessage);
|
||||
void DllExport log(const std::wstring& sMessage);
|
||||
std::list<std::string> DllExport getLogs();
|
||||
|
||||
@@ -7,6 +7,7 @@ class Logger
|
||||
public:
|
||||
void Log(const string& sMessage);
|
||||
void Log(const wstring& sMessage);
|
||||
std::list<std::string> getLogs() { return m_logs; };
|
||||
|
||||
static Logger* GetLogger();
|
||||
private:
|
||||
@@ -17,6 +18,7 @@ private:
|
||||
static const string m_sFileName;
|
||||
static Logger* m_pThis;
|
||||
static ofstream m_Logfile;
|
||||
static std::list<std::string> m_logs;
|
||||
|
||||
void Open();
|
||||
void Close();
|
||||
|
||||
@@ -12,4 +12,9 @@ void log(const string& message)
|
||||
void log(const wstring& message)
|
||||
{
|
||||
LOGGER->Log(message);
|
||||
}
|
||||
|
||||
std::list<std::string> getLogs()
|
||||
{
|
||||
return LOGGER->getLogs();
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
const string Logger::m_sFileName = LOG_NAME;
|
||||
Logger* Logger::m_pThis = NULL;
|
||||
ofstream Logger::m_Logfile;
|
||||
std::list<std::string> Logger::m_logs;
|
||||
|
||||
Logger::Logger()
|
||||
{
|
||||
@@ -37,6 +38,7 @@ void Logger::Log(const string& message)
|
||||
Open();
|
||||
m_Logfile << CurrentDateTime() << ":\t";
|
||||
m_Logfile << message << "\n";
|
||||
m_logs.push_back(CurrentDateTime() + ": " + message);
|
||||
Close();
|
||||
}
|
||||
|
||||
@@ -45,5 +47,6 @@ void Logger::Log(const wstring& message)
|
||||
Open();
|
||||
m_Logfile << CurrentDateTime() << ":\t";
|
||||
m_Logfile << to_string(message) << "\n";
|
||||
m_logs.push_back(CurrentDateTime() + ": " + to_string(message));
|
||||
Close();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
#define VERSION "v0.0.1"
|
||||
#define LOG_NAME "Olympus_log.txt"
|
||||
#define REST_ADDRESS L"http://136.243.170.132:30000/restdemo"
|
||||
#define REST_ADDRESS L"http://localhost:30000/restdemo"
|
||||
|
||||
#define UPDATE_TIME_INTERVAL 0.25
|
||||
Reference in New Issue
Block a user