summaryrefslogtreecommitdiffhomepage
path: root/src/engineapi.h
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2022-05-03 04:20:27 +0100
committerMichael Smith <mikesmiffy128@gmail.com>2022-05-03 16:55:46 +0100
commit6d0db0d5bee0201b732149616a691827367cfb35 (patch)
tree842936f4ec6cb8e27ce10682de77728a4ea93bf9 /src/engineapi.h
parent19d96b65e1a840407a7280ab1f99d48d62932620 (diff)
Add entity property finding and L4D warp testing
This was a lot more code than expected, but it might be finally close to time to release the next beta... We'll see if any more rabbit holes present themselves to jump into, though.
Diffstat (limited to 'src/engineapi.h')
-rw-r--r--src/engineapi.h47
1 files changed, 43 insertions, 4 deletions
diff --git a/src/engineapi.h b/src/engineapi.h
index dcf3bbe..6def65b 100644
--- a/src/engineapi.h
+++ b/src/engineapi.h
@@ -42,13 +42,11 @@ struct VEngineClient {
void **vtable;
/* opaque fields */
};
-extern struct VEngineClient *engclient;
struct VEngineServer {
void **vtable;
/* opaque fields */
};
-extern struct VEngineServer *engserver;
struct CUtlMemory {
void *mem;
@@ -61,10 +59,14 @@ struct CUtlVector {
};
struct edict {
+ // CBaseEdict
int stateflags;
int netserial;
void *ent_networkable;
void *ent_unknown;
+ // edict_t
+ // NOTE! *REMOVED* in l4d-based branches. don't iterate over edict pointers!
+ float freetime;
};
struct vec3f { float x, y, z; };
@@ -84,15 +86,52 @@ struct CMoveData {
struct vec3f origin;
};
+#define SENDPROP_INT 0
+#define SENDPROP_FLOAT 1
+#define SENDPROP_VEC 2
+#define SENDPROP_VECXY 3
+#define SENDPROP_STR 4
+#define SENDPROP_ARRAY 5
+#define SENDPROP_DTABLE 6
+#define SENDPROP_INT64 7
+
+// these have to be opaque because, naturally, they're unstable between
+// branches - access stuff using gamedata offsets as usual
+struct RecvProp;
+struct SendProp;
+
+// these two things seem to be stable enough for our purposes
+struct SendTable {
+ struct SendProp *props;
+ int nprops;
+ char *tablename;
+ void *precalc;
+ bool inited : 1;
+ bool waswritten : 1;
+ /* "has props encoded against current tick count" ??? */
+ bool haspropsenccurtickcnt : 1;
+};
+struct ServerClass {
+ char *name;
+ struct SendTable *table;
+ struct ServerClass *next;
+ int id;
+ int instbaselineidx;
+};
+
/// }}}
+extern struct VEngineClient *engclient;
+extern struct VEngineServer *engserver;
+extern void *globalvars;
+
/*
* Called on plugin init to attempt to initialise various core interfaces.
* Doesn't return an error result, because the plugin can still load even if
* this stuff is missing.
*
- * Also performs additional gametype detection after con_init(), before
- * gamedata_init().
+ * Also performs additional gametype detection after con_init(), and calls
+ * gamedata_init() to setup offsets and such.
*/
void engineapi_init(void);