From 450d0b1ed437cf37b4309af952af8904f3f07768 Mon Sep 17 00:00:00 2001 From: Emma Miler Date: Tue, 11 Apr 2023 20:49:16 +0200 Subject: Plugin system v2 (#343) * Some work * Rewrite gamestate presence * Add plugin system logger * Format changes * Format chjange * Fix gamestate stuff * some callback stuff * move around invite stuff * move invite to funcs * fix presence server data * Actually call InformSQVMCreated * bruh * Fix TODO's * Formatting * Fix filters * Add InformDLLLoads * Fix plugin handle always being 0 * Formatting * Fix merge issues * Formatting * Mods can add files compiled at SQVM init * Some Small Fixes * Add changes from review * Fix load failure * Add new squirrel functions * actually call InformSQVMDestroyed * add CreateObject function * answers to complaints * remove snake cases from GameStatePresence --------- Co-authored-by: cat_or_not <41955154+catornot@users.noreply.github.com> --- NorthstarDLL/masterserver/masterserver.cpp | 9 ++++++--- NorthstarDLL/masterserver/masterserver.h | 5 ++++- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'NorthstarDLL/masterserver') diff --git a/NorthstarDLL/masterserver/masterserver.cpp b/NorthstarDLL/masterserver/masterserver.cpp index 37301886..8087237c 100644 --- a/NorthstarDLL/masterserver/masterserver.cpp +++ b/NorthstarDLL/masterserver/masterserver.cpp @@ -572,7 +572,7 @@ void MasterServerManager::AuthenticateWithOwnServer(const char* uid, const char* requestThread.detach(); } -void MasterServerManager::AuthenticateWithServer(const char* uid, const char* playerToken, const char* serverId, const char* password) +void MasterServerManager::AuthenticateWithServer(const char* uid, const char* playerToken, RemoteServerInfo server, const char* password) { // dont wait, just stop if we're trying to do 2 auth requests at once if (m_bAuthenticatingWithGameServer) @@ -584,11 +584,11 @@ void MasterServerManager::AuthenticateWithServer(const char* uid, const char* pl std::string uidStr(uid); std::string tokenStr(playerToken); - std::string serverIdStr(serverId); + std::string serverIdStr(server.id); std::string passwordStr(password); std::thread requestThread( - [this, uidStr, tokenStr, serverIdStr, passwordStr]() + [this, uidStr, tokenStr, serverIdStr, passwordStr, server]() { // esnure that any persistence saving is done, so we know masterserver has newest while (m_bSavingPersistentData) @@ -684,6 +684,9 @@ void MasterServerManager::AuthenticateWithServer(const char* uid, const char* pl m_bHasPendingConnectionInfo = true; m_bSuccessfullyAuthenticatedWithGameServer = true; + + m_currentServer = server; + m_sCurrentServerPassword = passwordStr; } else { diff --git a/NorthstarDLL/masterserver/masterserver.h b/NorthstarDLL/masterserver/masterserver.h index bded9952..21082e2f 100644 --- a/NorthstarDLL/masterserver/masterserver.h +++ b/NorthstarDLL/masterserver/masterserver.h @@ -113,6 +113,9 @@ class MasterServerManager bool m_bHasMainMenuPromoData = false; MainMenuPromoData m_sMainMenuPromoData; + std::optional m_currentServer; + std::string m_sCurrentServerPassword; + public: MasterServerManager(); @@ -121,7 +124,7 @@ class MasterServerManager void RequestMainMenuPromos(); void AuthenticateOriginWithMasterServer(const char* uid, const char* originToken); void AuthenticateWithOwnServer(const char* uid, const char* playerToken); - void AuthenticateWithServer(const char* uid, const char* playerToken, const char* serverId, const char* password); + void AuthenticateWithServer(const char* uid, const char* playerToken, RemoteServerInfo server, const char* password); void WritePlayerPersistentData(const char* playerId, const char* pdata, size_t pdataSize); }; -- cgit v1.2.3