Facepunch / garrysmod-requests

Feature requests for Garry's Mod
84 stars 24 forks source link

Hook - Game Requesting Full Update ( It's called on demo record, etc ) #204

Closed Acecool closed 3 years ago

Acecool commented 10 years ago

I'd like a new hook for when the Game Requests Full Update. The reason demos don't play back properly is because not everyone uses expensive NWVars ( https://dl.dropboxusercontent.com/u/26074909/tutoring/benchmarking_tips/benchmarking_nw_vars.lua ) which automatically resync. When a demo is created, it is like a new player connected and only variables set after the recording are monitored. This causes issues with playback.

If we had a hook, those of us using our own net-system can resync all data when a user starts a demo so the demo plays back flawlessly.

Python1320 commented 9 years ago

Pretty sure this can be done by checking for local player entity recreation

LeQuackers commented 3 years ago

Bump?

robotboy655 commented 3 years ago

Do you want this only clientside when it requests a full update? Not when the client actually receives one? Because I am not sure where I'd hook onto for the latter.

robotboy655 commented 3 years ago

The code you linked is for server side, and it doesn't fit the initial request.

LeQuackers commented 3 years ago

Because he mentioned resyncing net message stuff I figured this was a request for a server side full update hook. I'll just make a new request for it.

robotboy655 commented 3 years ago

Maybe I am wrong idk. I will wait for other opinions on what this hook should be.

LeQuackers commented 3 years ago

For client side stuff:

Client requesting a full update packet: https://github.com/VSES/SourceEngine2007/blob/master/src_main/engine/baseclient.h#L138

Client receiving a full update packet: If SVC_PacketEntities.m_bIsDelta/CEntityReadInfo.m_bIsDelta is false it should be a full update packet. https://github.com/VSES/SourceEngine2007/blob/master/src_main/engine/cl_ents_parse.cpp#L563-L587

robotboy655 commented 3 years ago

Added serverside as OnRequestFullUpdate game event, we can't really have Lua in engine.dll It has all the same data as player_connect_client event, save for bot field.

If people really need those clientside variations, don't hesitate to let us know.