From 29cfee79226be164809429a2d681b8cee1ef2714 Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Wed, 16 May 2018 06:22:56 +0000 Subject: [PATCH] Revert "revert to using 32 bit ints for station id's because...it breaks legacy ones if we don't" This reverts commit 1b49c7e742a43ef2cc2cd43a331a8d1cb8f549be. --- .../src/shared/ClientConnection.cpp | 2 +- .../src/shared/CharacterNameLocator.h | 2 +- .../sharedFoundation/src/shared/StationId.h | 2 +- external/3rd/library/webAPI/webAPI.cpp | 18 ------------------ external/3rd/library/webAPI/webAPI.h | 3 --- .../ours/library/archive/src/shared/Archive.h | 3 +-- .../src/shared/generated/Schema_h.template | 5 ++--- .../src/shared/tasks/TaskRestoreCharacter.h | 2 +- 8 files changed, 7 insertions(+), 30 deletions(-) diff --git a/engine/server/application/LoginServer/src/shared/ClientConnection.cpp b/engine/server/application/LoginServer/src/shared/ClientConnection.cpp index 8e3aec10..dc5bd08f 100755 --- a/engine/server/application/LoginServer/src/shared/ClientConnection.cpp +++ b/engine/server/application/LoginServer/src/shared/ClientConnection.cpp @@ -181,7 +181,7 @@ void ClientConnection::validateClient(const std::string &id, const std::string & authOK = true; parentAccount = api.getString("mainAccount"); - childAccounts = api.getStringMapU32("subAccounts"); + childAccounts = api.getStringMap64("subAccounts"); if (!ConfigLoginServer::getUseOldSuidGenerator()) { user_id = static_cast(api.getNullableValue("user_id")); diff --git a/engine/server/library/serverDatabase/src/shared/CharacterNameLocator.h b/engine/server/library/serverDatabase/src/shared/CharacterNameLocator.h index 8cb9e864..6227b30e 100755 --- a/engine/server/library/serverDatabase/src/shared/CharacterNameLocator.h +++ b/engine/server/library/serverDatabase/src/shared/CharacterNameLocator.h @@ -33,7 +33,7 @@ class CharacterNameLocator : public ObjectLocator struct CharacterNameRow { DB::BindableNetworkId character_id; - DB::BindableLong character_station_id; + DB::BindableInt64 character_station_id; DB::BindableString<127> character_name; DB::BindableString<127> character_full_name; DB::BindableInt64 character_create_time; diff --git a/engine/shared/library/sharedFoundation/src/shared/StationId.h b/engine/shared/library/sharedFoundation/src/shared/StationId.h index 48bdbf39..8633f774 100755 --- a/engine/shared/library/sharedFoundation/src/shared/StationId.h +++ b/engine/shared/library/sharedFoundation/src/shared/StationId.h @@ -10,7 +10,7 @@ // ====================================================================== -typedef uint32_t StationId; +typedef int64 StationId; // ====================================================================== diff --git a/external/3rd/library/webAPI/webAPI.cpp b/external/3rd/library/webAPI/webAPI.cpp index 4fd4c533..faf7d11b 100644 --- a/external/3rd/library/webAPI/webAPI.cpp +++ b/external/3rd/library/webAPI/webAPI.cpp @@ -72,24 +72,6 @@ std::unordered_map webAPI::getStringMap(const std::string &slo return ret; } -std::unordered_map webAPI::getStringMapU32(const std::string &slot) { - std::unordered_map ret = std::unordered_map(); - - 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 webAPI::getStringMap64(const std::string &slot) { std::unordered_map ret = std::unordered_map(); diff --git a/external/3rd/library/webAPI/webAPI.h b/external/3rd/library/webAPI/webAPI.h index 080dd0d2..2209b8f5 100644 --- a/external/3rd/library/webAPI/webAPI.h +++ b/external/3rd/library/webAPI/webAPI.h @@ -66,9 +66,6 @@ namespace StellaBellum { // get a vector of strings from a given slot std::unordered_map getStringMap(const std::string &slot); - // return the above as unsigned to make various things happy - std::unordered_map getStringMapU32(const std::string &slot); - // get a 64 bit keyed vector of strings from a given slot std::unordered_map getStringMap64(const std::string &slot); diff --git a/external/ours/library/archive/src/shared/Archive.h b/external/ours/library/archive/src/shared/Archive.h index 21870ec7..20a2ce2e 100755 --- a/external/ours/library/archive/src/shared/Archive.h +++ b/external/ours/library/archive/src/shared/Archive.h @@ -14,8 +14,7 @@ #include typedef int64_t int64; typedef u_int64_t uint64; - -#include "../../../../../../engine/shared/library/sharedFoundation/src/shared/StationId.h" +typedef int64 StationId; //--------------------------------------------------------------------- diff --git a/game/server/application/SwgDatabaseServer/src/shared/generated/Schema_h.template b/game/server/application/SwgDatabaseServer/src/shared/generated/Schema_h.template index 97c0dbe7..1bd7c287 100644 --- a/game/server/application/SwgDatabaseServer/src/shared/generated/Schema_h.template +++ b/game/server/application/SwgDatabaseServer/src/shared/generated/Schema_h.template @@ -14,7 +14,6 @@ #include "sharedDatabaseInterface/BindableNetworkId.h" #include "sharedDatabaseInterface/BufferString.h" #include "sharedDatabaseInterface/DbRow.h" -#include "sharedFoundation/StationId.h" namespace DBSchema { @@ -24,7 +23,7 @@ struct PlayerObjectRow : public DB::Row enum {QUEST_DATA_SIZE=4000}; DB::BindableNetworkId object_id; - DB::BindableLong station_id; + DB::BindableInt64 station_id; DB::BindableNetworkId house_id; DB::BindableLong account_num_lots; DB::BindableBool account_is_outcast; @@ -81,7 +80,7 @@ struct PlayerObjectRow : public DB::Row struct PlayerObjectBufferRow : public DB::Row { DB::BindableNetworkId object_id; - DB::BindableLong station_id; + DB::BindableInt64 station_id; DB::BindableNetworkId house_id; DB::BindableLong account_num_lots; DB::BindableBool account_is_outcast; diff --git a/game/server/application/SwgDatabaseServer/src/shared/tasks/TaskRestoreCharacter.h b/game/server/application/SwgDatabaseServer/src/shared/tasks/TaskRestoreCharacter.h index 2e043f3d..f48e415a 100755 --- a/game/server/application/SwgDatabaseServer/src/shared/tasks/TaskRestoreCharacter.h +++ b/game/server/application/SwgDatabaseServer/src/shared/tasks/TaskRestoreCharacter.h @@ -45,7 +45,7 @@ class TaskRestoreCharacter:public DB::TaskRequest //output: DB::BindableLong result; DB::BindableString<127> character_name; - DB::BindableLong account; + DB::BindableInt64 account; DB::BindableLong template_id; private: