source-sdk-2013 icon indicating copy to clipboard operation
source-sdk-2013 copied to clipboard

Usercmd question

Open Mine228 opened this issue 7 years ago • 1 comments

So I would like to ask if it is possible to send a CHandle information to the server through usercmd. So far I haven't seen any Write commands that would be specifically designed for sending CHandles so is it even possible?

Mine228 avatar Feb 15 '18 22:02 Mine228

A CHandle is simply the entry index and serial number as you would see on an ehandle. It can be serialized simply as a long: https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/game/server/gameinterface.cpp#L3386

as additional data in WriteUsercmd and ReadUsercmd.

If you had a CHandle on the server, you would refresh it with CBaseHandle::Init. If the entity only exists on the client, then it won't resolve to anything on the server.

azuisleet avatar Mar 08 '18 22:03 azuisleet