summaryrefslogtreecommitdiffhomepage
path: root/StarsEx/NetUtil.h
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-04-01 21:23:39 +0200
committerAki <please@ignore.pl>2022-04-01 21:23:39 +0200
commit3c487c5cd69c53d6fea948643c0a76df03516605 (patch)
tree72730c7b8b26a5ef8fc9a987ec4c16129efd5aac /StarsEx/NetUtil.h
parent8f353abd0bfe18baddd8a8250ab7c4f2d1c83a6e (diff)
downloadstarshatter-3c487c5cd69c53d6fea948643c0a76df03516605.zip
starshatter-3c487c5cd69c53d6fea948643c0a76df03516605.tar.gz
starshatter-3c487c5cd69c53d6fea948643c0a76df03516605.tar.bz2
Moved Stars45 to StarsEx
Diffstat (limited to 'StarsEx/NetUtil.h')
-rw-r--r--StarsEx/NetUtil.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/StarsEx/NetUtil.h b/StarsEx/NetUtil.h
new file mode 100644
index 0000000..d64f56f
--- /dev/null
+++ b/StarsEx/NetUtil.h
@@ -0,0 +1,55 @@
+/* Starshatter: The Open Source Project
+ Copyright (c) 2021-2022, Starshatter: The Open Source Project Contributors
+ Copyright (c) 2011-2012, Starshatter OpenSource Distribution Contributors
+ Copyright (c) 1997-2006, Destroyer Studios LLC.
+
+ AUTHOR: John DiCamillo
+
+
+ OVERVIEW
+ ========
+ Utility class to simplify sending NetData messages.
+*/
+
+
+#ifndef NetUtil_h
+#define NetUtil_h
+
+#include "Types.h"
+#include "Geometry.h"
+
+// +-------------------------------------------------------------------+
+
+class Element;
+class Instruction;
+class SimObject;
+class Ship;
+class Shot;
+class System;
+class Weapon;
+
+// +-------------------------------------------------------------------+
+
+class NetUtil
+{
+public:
+ static void SendObjDamage(SimObject* obj, double damage, Shot* shot=0);
+ static void SendObjKill(Ship* obj, const Ship* killer, int type=0, int deck=0);
+ static void SendObjHyper(Ship* obj, const char* rgn, const Point& loc, const Ship* fc1=0, const Ship* fc2=0, int ttype=0);
+ static void SendObjTarget(Ship* obj);
+ static void SendObjEmcon(Ship* obj);
+ static void SendSysDamage(Ship* obj, System* sys, double damage);
+ static void SendSysStatus(Ship* obj, System* sys);
+ static void SendWepTrigger(Weapon* wep, int count=1);
+ static void SendWepRelease(Weapon* wep, Shot* shot);
+ static void SendWepDestroy(Shot* shot);
+ static void SendChat(DWORD dst, const char* name, const char* text);
+ static void SendElemRequest(const char* name);
+ static void SendElemCreate(Element* elem, int squadron, int* slots, bool alert, bool in_flight=false);
+ static void SendShipLaunch(Ship* carrier, int squadron, int slot);
+ static void SendNavData(bool add, Element* elem, int index, Instruction* navpt);
+ static void SendNavDelete(Element* elem, int index);
+ static void SendSelfDestruct(Ship* ship, double damage);
+};
+
+#endif // NetUtil_h \ No newline at end of file