Skip to content

Commit cb09131

Browse files
committed
Preserve edits until client update
1 parent 266b807 commit cb09131

File tree

5 files changed

+255
-141
lines changed

5 files changed

+255
-141
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Extract/copy the files into the game folder.
77
Currently the extension only supports 32-bit TF2, but it can in idea work with other games by expanding the gamedata.
88

99
## Usage
10-
The extension works with entity properties, the same that you're used to with the `SetEntProp[Type]` functions, except it doesn't set the entity property itself, but instead modifies the sent value. Since not all properties are networkable the extension allows you to verify if an entity property is networkable through `HasNetworkableProp`. After you know a property is networkable, you can set its sent value with `SetSendVar`, replace it only if its already going to be sent with `ReplaceSendVar`, or prevent it from being sent with `OmitSendVar`. `SetSendVar` and `ReplaceSendVar` take a custom value that are stored in a handle. These handles can be created with the `SendVar[Type]` functions, where `Type` is the type of the property. All handles are automatically freed after everything has been sent out, so you can use `SendVar[Type]` directly in the argument of `[Set/Replace]SendVar` without worry. It is not guaranteed that a client will receive an update every frame, so a misstimed call to `SetSendVar` might not do anything. This can be circumvented by applying your edit inside the forward `OnCheckTransmit` that notifies you when a client will get sent an update. The forward can also be used to control what entities get sent to the client in cases where hiding or transmitting an entity through walls is desirable. The extension also includes the forwards `OnSendClientMessages` and `OnSendClientMessagesPost` to let you know whenever the server is preparing to send out updates to clients and when it is done doing so.
10+
The extension works with entity properties, the same that you're used to with the `SetEntProp[Type]` functions, except it doesn't set the entity property itself, but instead modifies the sent value. Since not all properties are networkable, the extension allows you to verify if an entity property is networkable through `HasNetworkableProp`. After you know a property is networkable, you can set its sent value with `SetSendVar`, replace it only if its already going to be sent with `ReplaceSendVar`, or prevent it from being sent with `OmitSendVar`. `SetSendVar` and `ReplaceSendVar` take a custom value that are stored in a handle. These handles can be created with the `SendVar[Type]` functions, where `Type` is the sent type of the property. All handles are automatically freed at the end of the frame, so you can use `SendVar[Type]` directly in the argument of `[Set/Replace]SendVar` without worry. Some properties go through a conversion function called a proxy that might even change its sent type, so make sure to use the proxy output instead if it exists. The extension provides a few such proxies named `SendProxy[Type]` for convenience. It is not guaranteed that a client will receive an update every frame (`cl_updaterate` < tickrate), so the the extension will remember every edit until then to make sure no action ends up missing its mark. It is possible get notified when such a client update will happen by subscribing to the forward `OnCheckTransmit`. The forward can also be used to control what entities get sent to the client in cases where hiding or transmitting an entity through walls is desirable. The extension additionally includes the forwards `OnSendClientMessages` and `OnSendClientMessagesPost` to let you know whenever the server is preparing to send out updates to clients and when it is done doing so.
1111

1212
## Compiling
1313
1. Install AMBuild.

0 commit comments

Comments
 (0)