comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
Executes a server command, as if typed at the console (ie "exec myconfig.cfg", or "quit"). Note that it appears no commands are executed until after GameDLLInit is called. If ServerCommand is called earlier than that, the command is delayed until then.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
Begin a network message to send to the client.
msg_type should be a number returned by RegUserMsg.
msg_dest is one of:
- MSG_BROADCAST - "unreliable to all"
- MSG_ONE - "reliable to one (msg_entity)"
- MSG_ALL - "reliable to all"
- MSG_INIT - "write to the init string"
- MSG_PVS - "Ents in PVS of org" (PVS=potentially visible set)
- MSG_PAS - "Ents in PAS of org" (PAS=potentially audible set)
- MSG_PVS_R - "Reliable to PVS"
- MSG_PAS_R - "Reliable to PAS"
- MSG_ONE_UNRELIABLE - "Send to one client, but don't put in reliable stream, put in unreliable datagram (could be dropped)"
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
Register a new cvar (server variable).
comments:
Return the float value of a cvar.
comments:
Return the string value of a cvar.
comments:
Set the float value of a cvar.
comments:
Set the string value of a cvar.
comments:
Print an alert message.
atype is one of:
- at_notice
- at_console - "same as at_notice, but forces a ConPrintf, not a message box". Prints output to server console, but only shown if 'developer' is set.
- at_aiconsole - "same as at_console, but only shown if developer level is 2!"
- at_warning
- at_error
- at_logged - "Server print to console (only in multiplayer games)." Prints output to server logs and console.
comments:
.
comments:
.
comments:
Returns a pointer to the base class type of the given edict. For instance:CBaseEntity *pPlayer=(CBaseEntity *)GET_PRIVATE(pEntity);
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
Returns the server slot (ie 1 to maxplayers) of the given player edict.
comments:
Returns the edict for the player in the given server slot (ie 1 to maxplayers).
comments:
.
comments:
.
comments:
Register a network message type with the given name, and size if known. Returns the number assigned for the network message, to be used with MessageBegin. It appears that message ID's 1-63 are reserved for the Engine, and that GameDLL messages are allocated IDs starting at 64. The SDK dlls/util.h appears to define six Engine messages:
- SVC_TEMPENTITY = 23
- SVC_INTERMISSION = 30
- SVC_CDTRACK = 32
- SVC_WEAPONANIM = 35
- SVC_ROOMTYPE = 37
- SVC_HLTV = 50
comments:
.
comments:
.
comments:
Apparently, this finds the given exported function name string in the GameDLL, and returns a pointer to said function (much like unix dlsym or win32 GetProcAddress?). This appears to be used in GameDLL code for loading savegames, as the savegames contain names of exported functions in the GameDLL. Basically, this is the opposite of NameForFunction.
comments:
Basically, the opposite of FunctionFromName. Finds the given function pointer address in the GameDLL, and returns the string name for the corresponding function. This appears to be used in GameDLL code for saving games, taking known function pointers and converting them to function name strings to be stored in the savegames, so that they can be converted back to function pointers upon game load.
JOHN: engine callbacks so game DLL can print messages to individual clients
comments:
.
comments:
Prints output to the server console.
these 3 added so game DLL can easily access client 'cmd' strings
comments:
Returns the arguments for a command, as a single string. The command string itself is not included, and must be queried with CMD_ARGV(0). For use in DLLAPI ClientCommand, or in the function provided to AddServerCommand.
comments:
Returns the nth argument to the command. CMD_ARGV(0) returns the command name itself.
comments:
Returns the number of arguments given to the command.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
Opens the given filename (relative to the gamedir, or relative to the hlds directory, in that order), and returns a pointer to a byte array (character string) with the contents of the file. NULL-termination of the array indicates end of file. Length of the file in bytes is returned in the given int pointer.
comments:
Free the byte array of the given buffer which was returned by LoadFileForMe.
trigger_endsection
comments:
.
comments:
.
comments:
Copies the pathname of the game directory into the given buffer. Note that there's no way to inform the engine how big the buffer is, so be forewarned.Prior to HL 1.1.1.1 (CS 1.6), this gave the full pathname of the game directory, ie "/usr/local/half-life/cstrike" or "C:\Games\Half-Life\cstrike". Now, it is only the string passed to hlds as the argument to "-game", ie "cstrike".
comments:
.
comments:
.
comments:
.
returns NULL if fake client can't be created
comments:
Creates "bots" (?).
comments:
.
comments:
.
passing in NULL gets the serverinfo
comments:
Returns the InfoKeyBuffer for the given edict. This is basically the fields from "setinfo" at the client console, and includes things like the player name.The sourcecode comment ("passing in NULL gets the serverinfo") isn't entirely accurate. There appear to be two server-side info buffers available, "serverinfo" and "localinfo", both accessible from the console by those two commands, respectively.
Calling GetInfoKeyBuffer(NULL) will return the localinfo buffer. Calling GetInfoKeyBuffer(PEntityOfEntIndex(0)), ie passing the entity of slot 0, will return the serverinfo buffer.
comments:
Returns the value for the given key in the given InfoKeyBuffer.
comments:
Adds or sets a key/value pair in the given InfoKeyBuffer. Appears to work for only server info, and not client info. For clients, use SetClientKeyValue.
comments:
Adds or sets a key/value pair in a client's InfoKeyBuffer, by server slot (ie 1 to maxplayers).
comments:
.
comments:
.
comments:
.
returns the server assigned userid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients
comments:
Returns the session userid for the given player edict. As of server x106, this is constant for the life of the player connection, and unique for the life of the server process. Each time a client connects, they are given a userid of 1 plus the userid of the previous connecting client. When the server starts/restarts, the server starts again at userid 1.
comments:
.
is this a dedicated server?
comments:
.
comments:
Returns a pointer to a cvar_t struct for the given cvar (server variable) name.
returns the server assigned WONid for this player. useful for logging frags, etc. returns -1 if the edict couldn't be found in the list of clients
comments:
Returns the WON id for the given player edict. As of server x106, this should be unique per client CD KEY, and should be consistent across all WON auth servers.
YWB 8/1/99 TFF Physics additions
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
comments:
.
Forces the client and server to be running with the same version of the specified file ( e.g., a player model ). Calling this has no effect in single player.
comments:
.