1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#![feature(option_result_unwrap_unchecked)]
#![feature(abi_thiscall)]

#[macro_use]
extern crate gmod;

macro_rules! rubat_plz {
	($msg:literal $(, $concat:tt)*) => {
		concat!($msg, $($concat,)* " - complain here: https://github.com/Facepunch/garrysmod-requests/issues/1917")
	};
}

mod util;
mod hooks;
mod state;
mod sigs;

pub use hooks::HookFn;

#[no_mangle]
pub unsafe extern "C" fn init() {
	#[cfg(debug_assertions)]
	println!("gmserverplugin: init");

	if !state::is_hooked() {
		hooks::hook();
	}
}

pub use hooks::{
	after_init::after_init,
	before_init::before_init,
	newstate::newstate
};