mirror of
https://github.com/SWG-Source/src.git
synced 2026-08-02 02:15:58 -04:00
revert to using 32 bit ints for station id's because...it breaks legacy ones if we don't
This commit is contained in:
+18
@@ -72,6 +72,24 @@ std::unordered_map<int, std::string> webAPI::getStringMap(const std::string &slo
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::unordered_map<uint32_t, std::string> webAPI::getStringMapU32(const std::string &slot) {
|
||||
std::unordered_map<uint32_t, std::string> ret = std::unordered_map<uint32_t, std::string>();
|
||||
|
||||
if (!responseData.empty() && !slot.empty() && responseData.count(slot) && !responseData[slot].is_null()) {
|
||||
|
||||
nlohmann::json j = responseData[slot];
|
||||
|
||||
for (nlohmann::json::iterator it = j.begin(); it != j.end(); ++it) {
|
||||
uint32_t k = std::stoi(it.key());
|
||||
std::string val = it.value();
|
||||
|
||||
ret.insert({k, val});
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::unordered_map<int64_t, std::string> webAPI::getStringMap64(const std::string &slot) {
|
||||
std::unordered_map<int64_t, std::string> ret = std::unordered_map<int64_t, std::string>();
|
||||
|
||||
|
||||
Vendored
+3
@@ -66,6 +66,9 @@ namespace StellaBellum {
|
||||
// get a vector of strings from a given slot
|
||||
std::unordered_map<int, std::string> getStringMap(const std::string &slot);
|
||||
|
||||
// return the above as unsigned to make various things happy
|
||||
std::unordered_map<uint32_t, std::string> getStringMapU32(const std::string &slot);
|
||||
|
||||
// get a 64 bit keyed vector of strings from a given slot
|
||||
std::unordered_map<int64_t, std::string> getStringMap64(const std::string &slot);
|
||||
|
||||
|
||||
+2
-1
@@ -14,7 +14,8 @@
|
||||
#include <sys/bitypes.h>
|
||||
typedef int64_t int64;
|
||||
typedef u_int64_t uint64;
|
||||
typedef int64 StationId;
|
||||
|
||||
#include "../../../../../../engine/shared/library/sharedFoundation/src/shared/StationId.h"
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user