mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Added new method for handling data
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#include "logger.h"
|
||||
|
||||
namespace CommandPriority {
|
||||
enum CommandPriorities { LOW, MEDIUM, HIGH };
|
||||
enum CommandPriorities { LOW, MEDIUM, HIGH, IMMEDIATE };
|
||||
};
|
||||
|
||||
namespace SetCommandType {
|
||||
@@ -151,7 +151,7 @@ public:
|
||||
location(location),
|
||||
immediate(immediate)
|
||||
{
|
||||
priority = CommandPriority::LOW;
|
||||
priority = immediate? CommandPriority::IMMEDIATE: CommandPriority::LOW;
|
||||
};
|
||||
virtual wstring getString(lua_State* L);
|
||||
virtual int getLoad() { return 100 * !immediate; }
|
||||
@@ -175,7 +175,7 @@ public:
|
||||
airbaseName(airbaseName),
|
||||
immediate(immediate)
|
||||
{
|
||||
priority = CommandPriority::LOW;
|
||||
priority = immediate ? CommandPriority::IMMEDIATE : CommandPriority::LOW;
|
||||
};
|
||||
virtual wstring getString(lua_State* L);
|
||||
virtual int getLoad() { return 100 * !immediate; }
|
||||
|
||||
@@ -15,6 +15,8 @@ public:
|
||||
|
||||
void start(lua_State* L);
|
||||
void stop(lua_State* L);
|
||||
json::value& getUpdateJson() { return updateJson; }
|
||||
json::value& getRefreshJson() { return refreshJson; }
|
||||
|
||||
private:
|
||||
std::thread* serverThread;
|
||||
@@ -27,6 +29,8 @@ private:
|
||||
void task();
|
||||
|
||||
atomic<bool> runListener;
|
||||
json::value updateJson;
|
||||
json::value refreshJson;
|
||||
|
||||
wstring password = L"";
|
||||
};
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
void setDefaults(bool force = false);
|
||||
int getID() { return ID; }
|
||||
void runAILoop();
|
||||
void updateExportData(json::value json);
|
||||
void updateExportData(json::value json, double dt = 0);
|
||||
void updateMissionData(json::value json);
|
||||
json::value getData(long long time, bool getAll = false);
|
||||
virtual wstring getCategory() { return L"No category"; };
|
||||
|
||||
@@ -10,16 +10,18 @@ public:
|
||||
UnitsManager(lua_State* L);
|
||||
~UnitsManager();
|
||||
|
||||
map<int, Unit*>& getUnits() { return units; };
|
||||
Unit* getUnit(int ID);
|
||||
bool isUnitInGroup(Unit* unit);
|
||||
bool isUnitGroupLeader(Unit* unit);
|
||||
Unit* getGroupLeader(int ID);
|
||||
Unit* getGroupLeader(Unit* unit);
|
||||
vector<Unit*> getGroupMembers(wstring groupName);
|
||||
void updateExportData(lua_State* L);
|
||||
void updateExportData(lua_State* L, double dt = 0);
|
||||
void updateMissionData(json::value missionData);
|
||||
void runAILoop();
|
||||
void getData(json::value& answer, long long time);
|
||||
void getUnitData(json::value& answer, long long time);
|
||||
void appendUnitData(int ID, json::value& answer, long long time);
|
||||
void deleteUnit(int ID, bool explosion);
|
||||
void acquireControl(int ID);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user