mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Fixed setting skill level
This commit is contained in:
@@ -165,12 +165,11 @@ private:
|
||||
class SpawnGroundUnits : public Command
|
||||
{
|
||||
public:
|
||||
SpawnGroundUnits(string coalition, vector<SpawnOptions> spawnOptions, string country, string skill, bool immediate, function<void(void)> callback = [](){}) :
|
||||
SpawnGroundUnits(string coalition, vector<SpawnOptions> spawnOptions, string country, bool immediate, function<void(void)> callback = [](){}) :
|
||||
Command(callback),
|
||||
coalition(coalition),
|
||||
spawnOptions(spawnOptions),
|
||||
country(country),
|
||||
skill(skill),
|
||||
immediate(immediate)
|
||||
{
|
||||
priority = immediate? CommandPriority::IMMEDIATE: CommandPriority::LOW;
|
||||
@@ -182,7 +181,6 @@ private:
|
||||
const string coalition;
|
||||
const vector<SpawnOptions> spawnOptions;
|
||||
const string country;
|
||||
const string skill;
|
||||
const bool immediate;
|
||||
};
|
||||
|
||||
@@ -190,12 +188,11 @@ private:
|
||||
class SpawnNavyUnits : public Command
|
||||
{
|
||||
public:
|
||||
SpawnNavyUnits(string coalition, vector<SpawnOptions> spawnOptions, string country, string skill, bool immediate, function<void(void)> callback = [](){}) :
|
||||
SpawnNavyUnits(string coalition, vector<SpawnOptions> spawnOptions, string country, bool immediate, function<void(void)> callback = [](){}) :
|
||||
Command(callback),
|
||||
coalition(coalition),
|
||||
spawnOptions(spawnOptions),
|
||||
country(country),
|
||||
skill(skill),
|
||||
immediate(immediate)
|
||||
{
|
||||
priority = immediate ? CommandPriority::IMMEDIATE : CommandPriority::LOW;
|
||||
@@ -207,7 +204,6 @@ private:
|
||||
const string coalition;
|
||||
const vector<SpawnOptions> spawnOptions;
|
||||
const string country;
|
||||
const string skill;
|
||||
const bool immediate;
|
||||
};
|
||||
|
||||
@@ -215,13 +211,12 @@ private:
|
||||
class SpawnAircrafts : public Command
|
||||
{
|
||||
public:
|
||||
SpawnAircrafts(string coalition, vector<SpawnOptions> spawnOptions, string airbaseName, string country, string skill, bool immediate, function<void(void)> callback = [](){}) :
|
||||
SpawnAircrafts(string coalition, vector<SpawnOptions> spawnOptions, string airbaseName, string country, bool immediate, function<void(void)> callback = [](){}) :
|
||||
Command(callback),
|
||||
coalition(coalition),
|
||||
spawnOptions(spawnOptions),
|
||||
airbaseName(airbaseName),
|
||||
country(country),
|
||||
skill(skill),
|
||||
immediate(immediate)
|
||||
{
|
||||
priority = immediate ? CommandPriority::IMMEDIATE : CommandPriority::LOW;
|
||||
@@ -234,7 +229,6 @@ private:
|
||||
const vector<SpawnOptions> spawnOptions;
|
||||
const string airbaseName;
|
||||
const string country;
|
||||
const string skill;
|
||||
const bool immediate;
|
||||
};
|
||||
|
||||
@@ -242,13 +236,12 @@ private:
|
||||
class SpawnHelicopters : public Command
|
||||
{
|
||||
public:
|
||||
SpawnHelicopters(string coalition, vector<SpawnOptions> spawnOptions, string airbaseName, string country, string skill, bool immediate, function<void(void)> callback = [](){}) :
|
||||
SpawnHelicopters(string coalition, vector<SpawnOptions> spawnOptions, string airbaseName, string country, bool immediate, function<void(void)> callback = [](){}) :
|
||||
Command(callback),
|
||||
coalition(coalition),
|
||||
spawnOptions(spawnOptions),
|
||||
airbaseName(airbaseName),
|
||||
country(country),
|
||||
skill(skill),
|
||||
immediate(immediate)
|
||||
{
|
||||
priority = immediate ? CommandPriority::IMMEDIATE : CommandPriority::LOW;
|
||||
@@ -261,7 +254,6 @@ private:
|
||||
const vector<SpawnOptions> spawnOptions;
|
||||
const string airbaseName;
|
||||
const string country;
|
||||
const string skill;
|
||||
const bool immediate;
|
||||
};
|
||||
|
||||
|
||||
@@ -46,8 +46,9 @@ string SpawnGroundUnits::getString()
|
||||
<< "unitType = " << "\"" << spawnOptions[i].unitType << "\"" << ", "
|
||||
<< "lat = " << spawnOptions[i].location.lat << ", "
|
||||
<< "lng = " << spawnOptions[i].location.lng << ", "
|
||||
<< "skill = \"" << spawnOptions[i].skill << "\"" << ", "
|
||||
<< "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << " }, ";
|
||||
<< "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << ", "
|
||||
<< "skill = \"" << spawnOptions[i].skill << "\"" << "}, ";
|
||||
|
||||
}
|
||||
|
||||
std::ostringstream commandSS;
|
||||
@@ -56,7 +57,6 @@ string SpawnGroundUnits::getString()
|
||||
<< "category = " << "\"" << "GroundUnit" << "\"" << ", "
|
||||
<< "coalition = " << "\"" << coalition << "\"" << ", "
|
||||
<< "country = \"" << country << "\", "
|
||||
<< "skill = \"" << skill << "\", "
|
||||
<< "units = " << "{" << unitsSS.str() << "}" << "}";
|
||||
return commandSS.str();
|
||||
}
|
||||
@@ -72,8 +72,8 @@ string SpawnNavyUnits::getString()
|
||||
<< "unitType = " << "\"" << spawnOptions[i].unitType << "\"" << ", "
|
||||
<< "lat = " << spawnOptions[i].location.lat << ", "
|
||||
<< "lng = " << spawnOptions[i].location.lng << ", "
|
||||
<< "skill = \"" << spawnOptions[i].skill << "\"" << ", "
|
||||
<< "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << " }, ";
|
||||
<< "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << ", "
|
||||
<< "skill = \"" << spawnOptions[i].skill << "\"" << "}, ";
|
||||
}
|
||||
|
||||
std::ostringstream commandSS;
|
||||
@@ -82,7 +82,6 @@ string SpawnNavyUnits::getString()
|
||||
<< "category = " << "\"" << "NavyUnit" << "\"" << ", "
|
||||
<< "coalition = " << "\"" << coalition << "\"" << ", "
|
||||
<< "country = \"" << country << "\", "
|
||||
<< "skill = \"" << skill << "\", "
|
||||
<< "units = " << "{" << unitsSS.str() << "}" << "}";
|
||||
return commandSS.str();
|
||||
}
|
||||
@@ -99,8 +98,8 @@ string SpawnAircrafts::getString()
|
||||
<< "lng = " << spawnOptions[i].location.lng << ", "
|
||||
<< "alt = " << spawnOptions[i].location.alt << ", "
|
||||
<< "loadout = \"" << spawnOptions[i].loadout << "\"" << ", "
|
||||
<< "skill = \"" << spawnOptions[i].skill << "\"" << ", "
|
||||
<< "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << " }, ";
|
||||
<< "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << ", "
|
||||
<< "skill = \"" << spawnOptions[i].skill << "\"" << "}, ";
|
||||
}
|
||||
|
||||
std::ostringstream commandSS;
|
||||
@@ -110,7 +109,6 @@ string SpawnAircrafts::getString()
|
||||
<< "coalition = " << "\"" << coalition << "\"" << ", "
|
||||
<< "airbaseName = \"" << airbaseName << "\", "
|
||||
<< "country = \"" << country << "\", "
|
||||
<< "skill = \"" << skill << "\", "
|
||||
<< "units = " << "{" << unitsSS.str() << "}" << "}";
|
||||
return commandSS.str();
|
||||
}
|
||||
@@ -128,8 +126,8 @@ string SpawnHelicopters::getString()
|
||||
<< "lng = " << spawnOptions[i].location.lng << ", "
|
||||
<< "alt = " << spawnOptions[i].location.alt << ", "
|
||||
<< "loadout = \"" << spawnOptions[i].loadout << "\"" << ", "
|
||||
<< "skill = \"" << spawnOptions[i].skill << "\"" << ", "
|
||||
<< "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << " }, ";
|
||||
<< "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << ", "
|
||||
<< "skill = \"" << spawnOptions[i].skill << "\"" << "}, ";
|
||||
}
|
||||
|
||||
std::ostringstream commandSS;
|
||||
@@ -139,7 +137,6 @@ string SpawnHelicopters::getString()
|
||||
<< "coalition = " << "\"" << coalition << "\"" << ", "
|
||||
<< "airbaseName = \"" << airbaseName << "\", "
|
||||
<< "country = \"" << country << "\", "
|
||||
<< "skill = \"" << skill << "\", "
|
||||
<< "units = " << "{" << unitsSS.str() << "}" << "}";
|
||||
return commandSS.str();
|
||||
}
|
||||
|
||||
@@ -191,7 +191,6 @@ void Scheduler::handleRequest(string key, json::value value, string username, js
|
||||
string coalition = to_string(value[L"coalition"]);
|
||||
string airbaseName = to_string(value[L"airbaseName"]);
|
||||
string country = to_string(value[L"country"]);
|
||||
string skill = "";
|
||||
|
||||
|
||||
int spawnPoints = value[L"spawnPoints"].as_number().to_int32();
|
||||
@@ -206,16 +205,16 @@ void Scheduler::handleRequest(string key, json::value value, string username, js
|
||||
Coords location; location.lat = lat; location.lng = lng; location.alt = alt;
|
||||
string loadout = to_string(unit[L"loadout"]);
|
||||
string liveryID = to_string(unit[L"liveryID"]);
|
||||
skill = to_string(unit[L"skill"]);
|
||||
string skill = to_string(unit[L"skill"]);
|
||||
|
||||
spawnOptions.push_back({unitType, location, loadout, liveryID});
|
||||
log(username + " spawned a " + coalition + " " + unitType, true);
|
||||
spawnOptions.push_back({unitType, location, loadout, skill, liveryID});
|
||||
log(username + " spawned a " + coalition + " " + unitType , true);
|
||||
}
|
||||
|
||||
if (key.compare("spawnAircrafts") == 0)
|
||||
command = dynamic_cast<Command*>(new SpawnAircrafts(coalition, spawnOptions, airbaseName, country, skill, immediate));
|
||||
command = dynamic_cast<Command*>(new SpawnAircrafts(coalition, spawnOptions, airbaseName, country, immediate));
|
||||
else
|
||||
command = dynamic_cast<Command*>(new SpawnHelicopters(coalition, spawnOptions, airbaseName, country, skill, immediate));
|
||||
command = dynamic_cast<Command*>(new SpawnHelicopters(coalition, spawnOptions, airbaseName, country, immediate));
|
||||
}
|
||||
/************************/
|
||||
else if (key.compare("spawnGroundUnits") == 0 || key.compare("spawnNavyUnits") == 0)
|
||||
@@ -223,7 +222,6 @@ void Scheduler::handleRequest(string key, json::value value, string username, js
|
||||
bool immediate = value[L"immediate"].as_bool();
|
||||
string coalition = to_string(value[L"coalition"]);
|
||||
string country = to_string(value[L"country"]);
|
||||
string skill = "";
|
||||
|
||||
int spawnPoints = value[L"spawnPoints"].as_number().to_int32();
|
||||
if (!checkSpawnPoints(spawnPoints, coalition)) return;
|
||||
@@ -235,16 +233,16 @@ void Scheduler::handleRequest(string key, json::value value, string username, js
|
||||
double lng = unit[L"location"][L"lng"].as_double();
|
||||
Coords location; location.lat = lat; location.lng = lng;
|
||||
string liveryID = to_string(unit[L"liveryID"]);
|
||||
skill = to_string(unit[L"skill"]);
|
||||
string skill = to_string(unit[L"skill"]);
|
||||
|
||||
spawnOptions.push_back({ unitType, location, "", liveryID });
|
||||
spawnOptions.push_back({ unitType, location, "", skill, liveryID});
|
||||
log(username + " spawned a " + coalition + " " + unitType, true);
|
||||
}
|
||||
|
||||
if (key.compare("spawnGroundUnits") == 0)
|
||||
command = dynamic_cast<Command*>(new SpawnGroundUnits(coalition, spawnOptions, country, skill, immediate));
|
||||
command = dynamic_cast<Command*>(new SpawnGroundUnits(coalition, spawnOptions, country, immediate));
|
||||
else
|
||||
command = dynamic_cast<Command*>(new SpawnNavyUnits(coalition, spawnOptions, country, skill, immediate));
|
||||
command = dynamic_cast<Command*>(new SpawnNavyUnits(coalition, spawnOptions, country, immediate));
|
||||
}
|
||||
/************************/
|
||||
else if (key.compare("attackUnit") == 0)
|
||||
|
||||
Reference in New Issue
Block a user