A Garry's Mod binary serverside module that provide GLua access to basic server and client functions. Designed to replace the tracking of many events that require gm_sourcenet
(which produces lua panic on many servers, corrupted message buffer reads, and decreased optimization). Currently under development.
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)
Method to mark entities with function like SetTransmitControl
Hook when marked entities about to be writen in svc_PacketEntities
, allow to suppress
Methods/Hooks for g_GameEventManager
with ability suppress and create events
Hook when clients send net_SetConVar
to server
Some methods and hooks for vphysics
interface (?)
Hook when ents change their PVS for player (literally magic with sv_ents_write.cpp
)
- Garrysmod Common - A framework to facilitate the creation of compilations files (Visual Studio, make, XCode, etc). Simply set the environment variable
GARRYSMOD_COMMON
or the premake option--gmcommon=path
to 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-party
folder with name gmc_scanning_advanced. - (Linux) Installed
gcc-multilib
andg++-multilib
packages.
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 vs2019
(Windows with installedVisual Studio 2019
and locally placed premake5.exe)./premake5 gmake
(Linux with installedbuild-essential
and locally placed premake5)
⚠️ If you catchError: module 'premake-export-compile-commands/export-compile-commands' not found
you didn't clone submodules correctly! Read above about clone command.
- Move to
projects/{os_platform}/{vs2019|gmake}
and rungm_network.sln
(Windows) or runmake
command (Linux)