Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarClientContext.hpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 14:33:09 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 14:33:09 +1000
commit6352e8e3196f78388b6c771073f9e03eaa612673 (patch)
treee23772f79a7fbc41bc9108951e9e136857484bf4 /source/game/StarClientContext.hpp
parent6741a057e5639280d85d0f88ba26f000baa58f61 (diff)
everything everywhere
all at once
Diffstat (limited to 'source/game/StarClientContext.hpp')
-rw-r--r--source/game/StarClientContext.hpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/source/game/StarClientContext.hpp b/source/game/StarClientContext.hpp
new file mode 100644
index 0000000..22db10f
--- /dev/null
+++ b/source/game/StarClientContext.hpp
@@ -0,0 +1,61 @@
+#ifndef STAR_CLIENT_CONTEXT_HPP
+#define STAR_CLIENT_CONTEXT_HPP
+
+#include "StarNetElementSystem.hpp"
+#include "StarJsonRpc.hpp"
+#include "StarGameTypes.hpp"
+#include "StarDamageTypes.hpp"
+#include "StarCelestialCoordinate.hpp"
+#include "StarWarping.hpp"
+#include "StarWorldStorage.hpp"
+#include "StarPlayerTypes.hpp"
+
+namespace Star {
+
+STAR_CLASS(CelestialLog);
+STAR_CLASS(ClientContext);
+
+class ClientContext {
+public:
+ ClientContext(Uuid serverUuid);
+
+ Uuid serverUuid() const;
+
+ // The coordinate for the world which the player's ship is currently
+ // orbiting.
+ CelestialCoordinate shipCoordinate() const;
+
+ Maybe<pair<WarpAction, WarpMode>> orbitWarpAction() const;
+
+ // The current world id of the player
+ WorldId playerWorldId() const;
+
+ bool isAdmin() const;
+ EntityDamageTeam team() const;
+
+ JsonRpcInterfacePtr rpcInterface() const;
+
+ WorldChunks newShipUpdates();
+ ShipUpgrades shipUpgrades() const;
+
+ void readUpdate(ByteArray data);
+ ByteArray writeUpdate();
+
+private:
+ Uuid m_serverUuid;
+ JsonRpcPtr m_rpc;
+
+ NetElementTopGroup m_netGroup;
+ NetElementData<Maybe<pair<WarpAction, WarpMode>>> m_orbitWarpActionNetState;
+ NetElementData<WorldId> m_playerWorldIdNetState;
+ NetElementBool m_isAdminNetState;
+ NetElementData<EntityDamageTeam> m_teamNetState;
+ NetElementData<ShipUpgrades> m_shipUpgrades;
+ NetElementData<CelestialCoordinate> m_shipCoordinate;
+
+ WorldChunks m_newShipUpdates;
+};
+
+}
+
+#endif