💪 All in one Garry's Mod binary module for x86 (x32) Linux/Windows dedicated server that provide access to various SourceEngine/GMOD methods and callbacks. Make your serverside lua scripts more optimized, powerfull and secure!
💡 Originally designed to replace the tracking of many events that require gm_sourcenet (which produces lua panic crashes, corrupted netchannel buffer read/write, and decreased optimization).
🪛 Currently under development. Feel free to request any new lua bindings you need, I can probably add them!
Check example for detailed usage. All functions placed in global gmnetwork table.
CBaseServer:
GetNumClients GetNumProxies GetNumFakeClients GetMaxClients GetUDPPort GetClientCount GetTime GetTick GetTickInterval GetName GetMapName GetSpawnCount GetNumClasses GetClassBits GetNetStats GetNumPlayers GetCPUUsage IsActive IsLoading IsDedicated IsPaused IsMultiplayer IsPausable IsHLTV IsReplay GetPassword SetMaxClients SetPaused SetPassword DisconnectClient DisconnectClientSilent
IVEngineServer:
GMOD_RawServerCommand
HandleClientError:
EnableClientErrHandle
[Hook] GmNetwork.OnClientErr (ply_id: number, err: string) -> prevent_default: bool
ProcessCmd:
EnableClientProcessCmd
[Hook] GmNetwork.ProcessCmd (ply_id: number, cmd: string) -> prevent_default: any bool
LuaAutoRefresh:
EnableLuaAutoRefreshHandle
[Hook] GmNetwork.OnLuaRefresh (file_path: string) -> prevent_default: any bool
Other:
Version (string) (nil|string) GetEnv (string)
- Integrate bindings into existing glua classes/libraries, or create new ones.
- Simplified version of
ClientLuaErrorfromgm_luaerror, allow parsing errors on lua side - Bindings for most of
CBaseServermethods- Bindings for
CBaseServerbroadcast methods
- Bindings for
- Bindings for most of
IVEngineServermethods- Binding to RawServerCommand
- Binding a hook when client want execute serverside concommand (ProcessCmd) like binary module from myarena hosting, allow to block executing
- Some GmodDataPack bindings (personal request from one server owner)
- Binding a hook when datapack handle a lua file refresh
- Block a lua refresh in this hook (probably needed too)
- Binding to datapack HandleChange_Lua method like metastruct old code do
- Create method to mark entities with method like
SetTransmitControl - Binding a hook when marked entities change their PVS for players. Needed do a some magic with
sv_ents_write.cpp(probably useful for own networked entity values system) - Binding a hook when marked entities and their childrens about to be writen in
svc_PacketEntities, allow to suppress. Useful for accurate admin vanish instead spammingSetPreventTransmitcalls - Bindings for
CGameEventManagerwith ability suppress and create events. Also useful for ideal vanish - Binding a hook when server handle new value of
FCVAR_USERINFOconvar from client. Allow handle changes without spammingGetInfo/GetInfoNumcalls. (Requested by me #1995 in garrysmod-requests) - Some bindings for
vphysics(Most of this done in my other private module)- Bindings to some
CCollisionEventcallbacks (detouring a friction system warning already used by my as good anticrash addition, i also seen this hook in metastruct old code) - Bindings to
IPhysicsObjectEventcallbacks (related toCCollisionEventbindings, just for #1923 in garrysmod-requests about adding hook when physobj going sleep) - Bindings to
CPhysicsObject, including methods that are not exposed toIPhysicsObject(including #2234 in garrysmod-requests about addingPhysObj:GetBuoyancyRatio) - Binding to
PhysIsInCallback(mentioned by #894 in garrysmod-requests) - Binding to
PhysicsGameSystemand fields likem_bPausedthat allow pause a physics - Bindings to
IPhysicsEnvironment(probably)
- Bindings to some
- Garrysmod Common - A framework to facilitate the creation of compilations files (Visual Studio, make, XCode, etc). Simply set the environment variable
GARRYSMOD_COMMONor the premake option--gmcommon=pathto the path of your local copy of garrysmod_common. - Scanning Advanced - My helpful module contains symbols for sigscanning with garrysmod_common. Should be installed in
third-partyfolder with name gmc_scanning_advanced. - (Linux) Installed
gcc-multilibandg++-multilibpackages.
All requirements already added in repository as submodules. Make sure that you clone them with recursive!
git clone https://github.com/klen-list/gmsv_network --recursive
- Download or install premake5
- Enter the project folder and run:
./premake5.exe vs2022(Windows with installedVisual Studio 2022and locally placed premake5.exe)./premake5 gmake(Linux with installedbuild-essentialand locally placed premake5)
⚠️ If you catchError: module 'premake-export-compile-commands/export-compile-commands' not foundyou didn't clone submodules correctly! Read above about clone command.
- Move to
projects/{os_platform}/{vs2022|gmake}and runnetwork.sln(Windows) or runmakecommand (Linux)