aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/shared/gamepresence.h
diff options
context:
space:
mode:
authorEmma Miler <emma.pi@protonmail.com>2023-04-11 20:49:16 +0200
committerGitHub <noreply@github.com>2023-04-11 20:49:16 +0200
commit450d0b1ed437cf37b4309af952af8904f3f07768 (patch)
tree3f0fd39b5663b5c3f4b9e76c70cc4987f22d66c7 /NorthstarDLL/shared/gamepresence.h
parent72da1da5b4c04ccc1154853a308cab6459c60b79 (diff)
downloadNorthstarLauncher-450d0b1ed437cf37b4309af952af8904f3f07768.tar.gz
NorthstarLauncher-450d0b1ed437cf37b4309af952af8904f3f07768.zip
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>
Diffstat (limited to 'NorthstarDLL/shared/gamepresence.h')
-rw-r--r--NorthstarDLL/shared/gamepresence.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/NorthstarDLL/shared/gamepresence.h b/NorthstarDLL/shared/gamepresence.h
new file mode 100644
index 00000000..167f83ab
--- /dev/null
+++ b/NorthstarDLL/shared/gamepresence.h
@@ -0,0 +1,48 @@
+
+#pragma once
+#include "pch.h"
+#include "server/serverpresence.h"
+
+class GameStateServerPresenceReporter : public ServerPresenceReporter
+{
+ void RunFrame(double flCurrentTime, const ServerPresence* pServerPresence);
+};
+
+class GameStatePresence
+{
+ public:
+ std::string id;
+ std::string name;
+ std::string description;
+ std::string password; // NOTE: May be empty
+
+ bool isServer;
+ bool isLocal = false;
+ bool isLoading;
+ bool isLobby;
+ std::string loadingLevel;
+
+ std::string uiMap;
+
+ std::string map;
+ std::string mapDisplayname;
+ std::string playlist;
+ std::string playlistDisplayname;
+
+ int currentPlayers;
+ int maxPlayers;
+
+ int ownScore;
+ int otherHighestScore; // NOTE: The highest score OR the second highest score if we have the highest
+ int maxScore;
+
+ int timestampEnd;
+
+ GameStatePresence();
+ void RunFrame();
+
+ protected:
+ GameStateServerPresenceReporter m_GameStateServerPresenceReporter;
+};
+
+extern GameStatePresence* g_pGameStatePresence;