summaryrefslogtreecommitdiffhomepage
path: root/Stars45/NetUtil.h
diff options
context:
space:
mode:
authorFWoltermann@gmail.com <FWoltermann@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544>2011-12-08 14:53:40 +0000
committerFWoltermann@gmail.com <FWoltermann@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544>2011-12-08 14:53:40 +0000
commite33e19d0587146859d48a134ec9fd94e7b7ba5cd (patch)
tree69d048c8801858d2756ab3a487090a7a1b74bf14 /Stars45/NetUtil.h
downloadstarshatter-e33e19d0587146859d48a134ec9fd94e7b7ba5cd.zip
starshatter-e33e19d0587146859d48a134ec9fd94e7b7ba5cd.tar.gz
starshatter-e33e19d0587146859d48a134ec9fd94e7b7ba5cd.tar.bz2
Initial upload
Diffstat (limited to 'Stars45/NetUtil.h')
-rw-r--r--Stars45/NetUtil.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/Stars45/NetUtil.h b/Stars45/NetUtil.h
new file mode 100644
index 0000000..d0b277e
--- /dev/null
+++ b/Stars45/NetUtil.h
@@ -0,0 +1,56 @@
+/* Project STARSHATTER
+ John DiCamillo
+ Copyright © 1997-2002. All Rights Reserved.
+
+ SUBSYSTEM: Stars.exe
+ FILE: NetUtil.h
+ 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