aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/masterserver/masterserver.cpp
diff options
context:
space:
mode:
authorpg9182 <96569817+pg9182@users.noreply.github.com>2023-03-05 18:43:07 -0500
committerpg9182 <96569817+pg9182@users.noreply.github.com>2023-04-17 14:50:10 -0400
commit35e91aa12002f089f8624b63421f370f17e3f4c7 (patch)
treeaedafb2d63ddd22d96c3f1d864aa5a1127ed32d0 /NorthstarDLL/masterserver/masterserver.cpp
parent29c6aeca11a52339025b46ce7854e6f81e119fd4 (diff)
downloadNorthstarLauncher-35e91aa12002f089f8624b63421f370f17e3f4c7.tar.gz
NorthstarLauncher-35e91aa12002f089f8624b63421f370f17e3f4c7.zip
Implement Atlas sigreq1 connectionless packet
Consists of a JSON object including a type key and a HMAC-SHA256 signature using the gameserver-specific token from the masterserver as the key.
Diffstat (limited to 'NorthstarDLL/masterserver/masterserver.cpp')
-rw-r--r--NorthstarDLL/masterserver/masterserver.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/NorthstarDLL/masterserver/masterserver.cpp b/NorthstarDLL/masterserver/masterserver.cpp
index 8087237c..9b439027 100644
--- a/NorthstarDLL/masterserver/masterserver.cpp
+++ b/NorthstarDLL/masterserver/masterserver.cpp
@@ -763,6 +763,31 @@ void MasterServerManager::WritePlayerPersistentData(const char* playerId, const
requestThread.detach();
}
+void MasterServerManager::ProcessConnectionlessPacketSigreq1(std::string data)
+{
+ rapidjson_document obj;
+ obj.Parse(data);
+
+ if (obj.HasParseError())
+ {
+ // note: it's okay to print the data as-is since we've already checked that it actually came from Atlas
+ spdlog::error("invalid Atlas connectionless packet request ({}): {}", data, GetParseError_En(obj.GetParseError()));
+ return;
+ }
+
+ if (!obj.HasMember("type") || !obj["type"].IsString())
+ {
+ spdlog::error("invalid Atlas connectionless packet request ({}): missing type", data);
+ return;
+ }
+
+ std::string type = obj["type"].GetString();
+
+ // TODO
+
+ spdlog::error("invalid Atlas connectionless packet request: unknown type {}", type);
+}
+
void ConCommand_ns_fetchservers(const CCommand& args)
{
g_pMasterServerManager->RequestServerList();