From 9a0d8730fa977f666b5c12e4c5901e7d0391e245 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Sat, 29 Jul 2023 14:32:06 +0100 Subject: Make various preparations for upcoming features A lot of this is random WIP from a while back, at least a month ago, and is being committed now to get it out of the way so that other patches can be brought in and integrated against it without causing headaches. Also rolled into this commit is a way to distinguish plugin_unload from exiting the game. This is required for another soon-to-be-integrated feature to avoid crashing on exit, and could in theory also be used to speed up unloading on exit in future. While we're at it, this also avoids the need to linearly scan through the plugin list to do the old branch unloading fix, because we can. Rough summary of the other smaller stuff I can remember doing: - Rework bitbuf a bit - Add some cryptographic nonsense in ac.c (not final at all) - Introduce the first couple of "chunklets" libraries as a sort-of subproject of this one - Tidy up random small bits and bobs - Add source for a small keypair generation tool - Rework democustom to be very marginally more useful --- src/sst.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/sst.h') diff --git a/src/sst.h b/src/sst.h index 8c10798..f7e4bb4 100644 --- a/src/sst.h +++ b/src/sst.h @@ -24,10 +24,17 @@ DECL_EVENT(ClientActive, struct edict */*player*/) DECL_EVENT(Tick, bool /*simulating*/) +DECL_PREDICATE(AllowPluginLoading, void) +DECL_EVENT(PluginLoaded, void) +DECL_EVENT(PluginUnloaded, void) + extern void *clientlib; /* occasionally useful: quick query to determine how sst was loaded */ extern bool sst_earlyloaded; +/* similar query for how we are being unloaded - ONLY valid during unload */ +// TODO(opt): we can skip a whole bunch of cleanup when exiting the game! +extern bool sst_userunloaded; #endif -- cgit v1.2.3