darope@0: darope@0: darope@0: darope@0: darope@0:
darope@0:darope@0:
darope@0: Register your console variables here.darope@0:
darope@0: This gets called one time when the game is initialied.
darope@0: Initialize the game (one-time call after loading of game .dll)
darope@0:
comments:
darope@0:
darope@0: Called just after hlds reports "Dll loaded for mod Half-Life". darope@0:darope@0: darope@0:
darope@0:
comments:
darope@0:
darope@0: 0==Success, -1==Failure ? darope@0:darope@0: darope@0:
darope@0: darope@0:
darope@0: darope@0:
darope@0: darope@0:
darope@0: darope@0:
darope@0: darope@0:
darope@0: darope@0:
darope@0:
comments:
darope@0:
darope@0: 0==Success, -1==Failure ? darope@0:darope@0: darope@0:
darope@0: darope@0:
darope@0: darope@0:
darope@0: darope@0:
darope@0: darope@0:
darope@0: darope@0:
darope@0: darope@0:
darope@0:
darope@0: Called when a player connects to a server. darope@0:darope@0:
comments:
darope@0:
darope@0: Called on initial connect, just after hlds reports "connected", ie: darope@0:darope@0: darope@0:"John<1><WON:9856723>" connected, address "127.0.0.1:27005"darope@0: This is before the user begins downloading, or anything else. darope@0:
darope@0:
darope@0: Called when a player disconnects from a server.darope@0:
darope@0: GLOBALS ASSUMED SET: g_fGameOver darope@0:
comments:
darope@0:
darope@0: This is not the opposite of ClientConnect, despite the similar name. darope@0: It appears to only be called if the client was PutInServer first. If darope@0: the client disconnects before being PutInServer, no API routine is darope@0: called. This would be more appropriately named ClientRemoveFromServer. darope@0:darope@0: darope@0:
darope@0:
darope@0: Player entered the suicide command.darope@0:
darope@0: GLOBALS ASSUMED SET: g_ulModelIndexPlayer darope@0:
comments:
darope@0:
darope@0: When the client typed "kill" in the console? darope@0:darope@0: darope@0:
darope@0:
darope@0: Called each time a player is spawned. darope@0:darope@0:
comments:
darope@0:
darope@0: Called after the client has uploaded/download all necessary resources, darope@0: just after hlds reports "entered the game", ie: darope@0:darope@0: darope@0:"John<1>" has entered the gamedarope@0:
darope@0:
darope@0: Called each time a player uses a "cmd" command. darope@0: Use CMD_ARGS, CMD_ARGV, and CMD_ARGC to get pointers to the character darope@0: string command. darope@0:darope@0: darope@0:
darope@0:
darope@0: Called after the player changes userinfo - gives dll a chance to modify darope@0: it before it gets sent into the rest of the engine. darope@0:darope@0:
comments:
darope@0:
darope@0: Called when user issues "setinfo" from the console. Also appears to be darope@0: called whenever the user returns to the game from the ESC menu. darope@0:darope@0: darope@0:
darope@0:
darope@0: Every call to ServerActivate should be matched by a call to darope@0: ServerDeactivate. darope@0:darope@0:
comments:
darope@0:
darope@0: Added in SDK 2.0. darope@0: Apparently called when the server has loaded the map, but before it darope@0: precaches from the .res file. darope@0:darope@0: darope@0:
darope@0:
darope@0: Peform any shutdown operations here.darope@0:
darope@0: It's possible that the engine will call this function more times than darope@0: is necessary. Therefore, only run it one time for each call to darope@0: ServerActivate.
darope@0:
comments:
darope@0:
darope@0: Called upon "quit" or "changelevel" . darope@0:darope@0: darope@0:
darope@0:
darope@0: Called every frame before physics are run. darope@0:darope@0: darope@0:
darope@0:
darope@0: Called every frame after physics are run. darope@0:darope@0: darope@0:
darope@0:
darope@0: GLOBALS ASSUMED SET: g_ulFrameCount darope@0:darope@0: darope@0:
darope@0: darope@0:
darope@0: darope@0:
darope@0:
darope@0: Returns string describing current .dll game.darope@0: darope@0:
darope@0: Returns the descriptive name of this .dll. E.g., Half-Life, or Team darope@0: Fortress 2.
darope@0: This function might be called before the world has spawned, and the game darope@0: rules initialized.
darope@0:
darope@0:
darope@0: Notifies .dll of new customization for player.darope@0: darope@0:
darope@0: A new player customization has been registered on the server. darope@0: UNDONE: This only sets the # of frames of the spray can logo animation darope@0: right now.
darope@0:
darope@0:
darope@0: Called when spectator joins server.darope@0: darope@0:
darope@0: A spectator has joined the game.
darope@0:
darope@0:
darope@0: Called when spectator leaves the server.darope@0: darope@0:
darope@0: A spectator has left the game.
darope@0:
darope@0:
darope@0: Called when spectator sends a command packet (usercmd_t).darope@0: darope@0:
darope@0: A spectator has sent a usercmd.
darope@0:
darope@0:
darope@0: Called when engine has encountered an error.darope@0:
darope@0: Notify game .dll that engine is going to shut down.
darope@0: Engine is going to shut down, allows setting a breakpoint in game dll darope@0: to catch that occasion.
darope@0: Add code ( e.g., _asm { int 3 }; here to cause a breakpoint for darope@0: debugging your game .dlls.
darope@0:
comments:
darope@0:
darope@0: Added in SDK 2.0. darope@0:darope@0: darope@0:
darope@0:
darope@0: This modume implements the shared player physics code between darope@0: any particular game and the engine. The same PM_Move routine is built darope@0: into the game .dll and the client .dll and is invoked by each side as darope@0: appropriate. There should be no distinction, internally, between server darope@0: and client. This will ensure that prediction behaves appropriately. darope@0:darope@0:
comments:
darope@0:
darope@0: Added in SDK 2.0. darope@0:darope@0: darope@0:
darope@0:
darope@0: Server version of player movement initialization. darope@0:darope@0:
comments:
darope@0:
darope@0: Added in SDK 2.0. darope@0:darope@0: darope@0:
darope@0:
comments:
darope@0:
darope@0: Added in SDK 2.0. darope@0:darope@0: darope@0:
darope@0: from dlls/client.cpp: darope@0:
darope@0: Set up PVS and PAS for networking for this client. darope@0:darope@0:darope@0: A client can have a separate "view entity" indicating darope@0: that his/her view should depend on the origin of that view entity. If darope@0: that's the case, then pViewEntity will be non-NULL and will be used. darope@0: Otherwise, the current entity's origin is used. Either is offset by the darope@0: view_ofs to get the eye position. darope@0:
darope@0: From the eye position, we set up the PAS and PVS to use for filtering darope@0: network messages to the client. At this point, we could override the darope@0: actual PAS or PVS values, or use a different origin. darope@0:
darope@0: NOTE: Do not cache the values of pas and pvs, as they depend on darope@0: reusable memory in the engine, they are only good for this one frame darope@0:
comments:
darope@0:
darope@0: Added in SDK 2.0. darope@0:darope@0: darope@0:
darope@0:
darope@0: Set up data sent only to specific client.darope@0:
darope@0: Data sent to current client only.
darope@0: Engine sets argument 'cd' to 0 before calling.
darope@0:
comments:
darope@0:
darope@0: Added in SDK 2.0. darope@0:darope@0: darope@0:
darope@0:
darope@0: Return 1 if the entity state has been filled in for the ent and the darope@0: entity will be propagated to the client, 0 otherwise. darope@0:darope@0:darope@0: State is the server maintained copy of the state info that is darope@0: transmitted to the client. A MOD could alter values copied into state darope@0: to send the "host" a different look for a particular entity update, darope@0: etc. darope@0:
darope@0: Arguments 'e' and 'ent' are the entity that is being added to the darope@0: update, if 1 is returneds. Host is the player's edict of the player darope@0: whom we are sending the update to. Player is 1 if the ent/e is a darope@0: player and 0 otherwise. Argument 'pSet' is either the PAS or PVS that darope@0: we previous set up. We can use it to ask the engine to filter the darope@0: entity against the PAS or PVS. darope@0:
darope@0: We could also use the pas/ pvs that we set in SetupVisibility, if we darope@0: wanted to. Caching the value is valid in that case, but still only for darope@0: the current frame. darope@0:
comments:
darope@0:
darope@0: Added in SDK 2.0. darope@0:darope@0: darope@0:
darope@0:
darope@0: Tweak entity baseline for network encoding, allows setup of player darope@0: baselines, too.darope@0:
darope@0: Creates baselines used for network encoding, especially for player data darope@0: since players are not spawned until connect time.
darope@0:
comments:
darope@0:
darope@0: Added in SDK 2.0. darope@0:darope@0: darope@0:
darope@0:
darope@0: Callbacks for network encoding.darope@0:
darope@0: Allows game .dll to override network encoding of certain types of darope@0: entities and tweak values, etc.
darope@0:
comments:
darope@0:
darope@0: Added in SDK 2.0. darope@0:darope@0: darope@0:
darope@0:
comments:
darope@0:
darope@0: Added in SDK 2.0. darope@0:darope@0: darope@0:
darope@0:
darope@0: We're about to run this usercmd for the specified player. We can set darope@0: up groupinfo and masking here, etc. This is the time to examine the darope@0: usercmd for anything extra. This call happens even if think does not. darope@0:darope@0:
comments:
darope@0:
darope@0: Added in SDK 2.0. darope@0:darope@0: darope@0:
darope@0:
darope@0: Each cmdstart is exactly matched with a cmd end, clean up any darope@0: group trace flags, etc. here. darope@0:darope@0:
comments:
darope@0:
darope@0: Added in SDK 2.0. darope@0:darope@0: darope@0:
darope@0: Return 1 if the packet is valid. Set response_buffer_size if you want darope@0: to send a response packet. Incoming, it holds the max size of the darope@0: response_buffer, so you must zero it out if you choose not to respond. darope@0:darope@0:
comments:
darope@0:
darope@0: Added in SDK 2.0. darope@0:darope@0: darope@0:
darope@0:
darope@0: Engine calls this to enumerate player collision hulls, darope@0: for prediction. Return 0 if the hullnumber doesn't exist. darope@0:darope@0:
comments:
darope@0:
darope@0: Added in SDK 2.0. darope@0:darope@0: darope@0:
darope@0:
darope@0: Tweak entity baseline for network encoding, allows setup of player baselines, too.darope@0:
darope@0: Create pseudo-baselines for items that aren't placed in the map at darope@0: spawn time, but which are likely to be created during play (e.g., darope@0: grenades, ammo packs, projectiles, corpses, etc.).
darope@0:
comments:
darope@0:
darope@0: Added in SDK 2.0. darope@0:darope@0: darope@0:
darope@0: One of the ENGINE_FORCE_UNMODIFIED files failed the consistency check darope@0: for the specified player Return 0 to allow the client to continue, 1 to darope@0: force immediate disconnection (with an optional disconnect message of darope@0: up to 256 characters). darope@0:darope@0:
comments:
darope@0:
darope@0: Added in SDK 2.0. darope@0:darope@0: darope@0:
darope@0:
darope@0: The game .dll should return 1 if lag compensation should be allowed darope@0: (could also just set the sv_unlag cvar. Most games right now should darope@0: return 0, until client-side weapon prediction code is written and darope@0: tested for them (note you can predict weapons, but not do lag darope@0: compensation, too, if you want. darope@0:darope@0:
comments:
darope@0:
darope@0: Added in SDK 2.0. darope@0:darope@0: darope@0:
darope@0: