about summary refs log tree commit diff
path: root/src/game/server/gamecontext.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/server/gamecontext.hpp')
-rw-r--r--src/game/server/gamecontext.hpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/game/server/gamecontext.hpp b/src/game/server/gamecontext.hpp
new file mode 100644
index 00000000..c4035b3f
--- /dev/null
+++ b/src/game/server/gamecontext.hpp
@@ -0,0 +1,38 @@
+
+#include "eventhandler.hpp"
+#include "gamecontroller.hpp"
+#include "gameworld.hpp"
+
+class GAMECONTEXT
+{
+public:
+	GAMECONTEXT();
+	void clear();
+	
+	EVENTHANDLER events;
+	PLAYER players[MAX_CLIENTS];
+	
+	GAMECONTROLLER *controller;
+	GAMEWORLD world;
+
+	void tick();
+	void snap(int client_id);
+
+	// helper functions
+	void create_damageind(vec2 p, float angle_mod, int amount);
+	void create_explosion(vec2 p, int owner, int weapon, bool bnodamage);
+	void create_smoke(vec2 p);
+	void create_playerspawn(vec2 p);
+	void create_death(vec2 p, int who);
+	void create_sound(vec2 pos, int sound, int mask=-1);
+	void create_sound_global(int sound, int target=-1);	
+
+	// network
+	void send_chat(int cid, int team, const char *text);
+	void send_emoticon(int cid, int emoticon);
+	void send_weapon_pickup(int cid, int weapon);
+	void send_broadcast(const char *text, int cid);
+	void send_info(int who, int to_who);
+};
+
+extern GAMECONTEXT game;