forked from ValveSoftware/source-sdk-2013
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
This workaround will network updates to UserInfo, but only if it changes after being initially set.
experiment-source/src/engine/detours/baseclient_connect.cpp
Lines 229 to 247 in a9fa521
| void Engine_PlayerAllowNewUserInfo( CBasePlayer *pPlayer, const char *userInfoName ) | |
| { | |
| unsigned short index = connectedClients.Find( pPlayer->GetUserID() ); | |
| if ( index == connectedClients.InvalidIndex() ) | |
| { | |
| DevWarning( "No client connect object found for player.\n" ); | |
| return; | |
| } | |
| ClientWithNetChannel info = connectedClients.Element( index ); | |
| KeyValues *conVars = GET_MEMORY_PTR( info.client, s_OffsetConVars, KeyValues ); | |
| if ( conVars->GetString( userInfoName, nullptr ) == nullptr ) | |
| { | |
| conVars->SetString( userInfoName, "" ); | |
| } | |
| } |
We need to somehow signal the client to quickly change and then reset that userinfo, otherwise it won't be networked...
] lua_run print(player.GetByID(1):GetInfo("dynamite_model"))
<nothing>
] dynamite_model "models/dav0r/tnt/tnt.mdl" // Setting to the same value doesn't cause it to be networked
] lua_run print(player.GetByID(1):GetInfo("dynamite_model"))
<nothing>
] dynamite_model "something else"
] lua_run print(player.GetByID(1):GetInfo("dynamite_model"))
something else
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working