rehlds / reapi

AMX Mod X module, using API regamedll & rehlds
GNU General Public License v3.0
158 stars 105 forks source link

Add new Host_Error hook #224

Open RauliTop opened 3 years ago

RauliTop commented 3 years ago

The idea is hook errors to create a log with them. https://github.com/dreamstalker/rehlds/blob/1196646dcfc5e62e4801a08860596476d0e3d77f/rehlds/engine/host.cpp#L108#L139

Well, I don't know if it will work because maybe it's too late and HLDS process is closed. Anyways, can someone test it?

The purpose is something like this: https://amxmodx-es.com/showthread.php?tid=8113

StevenKal commented 3 years ago

Well, if this is only for logging, ReHLDS already has a CVar "syserror_logfile" to log such errors (in game directory), besides, you can also trying using DLL API's "pfnSys_Error" function for such logging. But having both "<Host|Sys>_Error" functions as a hook in ReHLDS could be useful in order to prevent the server from crashing in some situations where "it could be prevented depending on the kind of error passed". So better to request such hook chain in ReHLDS repository.