Raised This Month: $51 Target: $400
 12% 

Why does SMAC_CVars replicate convars?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ProdigySim
SourceMod Plugin Approver
Join Date: Feb 2010
Old 06-08-2012 , 17:27   Why does SMAC_CVars replicate convars?
Reply With Quote #1

I've run into a really awkward issue where running SendConVarValue() on the mp_gamemode cvar in L4D2 (even without changing the value) will cause clients to crash in certain scenarios. For 99% of users there's no issue here, but we're doing some nasty things on the l4d2 clients and I imagine the ConVar_Changed hook on mp_gamemode is dying in our particular situation.

Anyway, when smac_cvars loads it runs a SendConVarValue() for each FCVAR_REPLICATED convar on the server, and it will also do so whenever a replicated convar is changed on server side. I'm wondering if this is really necessary or useful in any way.

Aren't replicated cvars automatically replicated to clients by the game/engine anyway? Why does smac_cvars perform this manual SendConVarValue()? If someone was bypassing cvar replication, wouldn't they also bypass SendConVarValue()?

To deal with our issue we're probably going to have to make a patched version of this plugin. I'm wondering if there's any point in this replication code at all, or if I should just make a special exception for mp_gamemode.
ProdigySim is offline
TheAvengers2
BANNED
Join Date: Jul 2011
Old 06-08-2012 , 17:45   Re: Why does SMAC_CVars replicate convars?
Reply With Quote #2

Quote:
Originally Posted by GoD-Tony
The module was ported over from KAC, and due to the amount of code it hasn't been properly looked over.
Anyway, one of the comments say, "so that nothing interferes with the replication." I'm thinking it's a sanity check or might be for either of the following two reasons. The player might not properly receive the updated ConVar due to packet loss or something. Alternatively, it may be to ensure plugins and maps don't make a mess of replicated ConVars.

Last edited by TheAvengers2; 06-08-2012 at 18:15.
TheAvengers2 is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 06-09-2012 , 03:55   Re: Why does SMAC_CVars replicate convars?
Reply With Quote #3

This module was originally from KAC with EP1 CS:S in mind, so I imagine there was trouble with the game properly replicating cvars to clients, which caused effects not to be applied or legit players to be banned. It explains the 1 tick delay before replicating anyway.

It also updates the checklist so that players aren't banned for cvars such as sv_consistency when it's disable server-side. The OnLoad SendConVarValue is probably to handle late-load situations.

Quote:
Originally Posted by ProdigySim View Post
To deal with our issue we're probably going to have to make a patched version of this plugin. I'm wondering if there's any point in this replication code at all, or if I should just make a special exception for mp_gamemode.
I think I'll immediately add an exception for this cvar, and then when I have time I should review the rest of the replication code. It might not need to run on L4D+ engines at all, but I can't confirm that just yet.
__________________
GoD-Tony is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 06-09-2012 , 06:18   Re: Why does SMAC_CVars replicate convars?
Reply With Quote #4

Out of curiousity, how did you track it down to SendConVarValue and mp_gamemode?

Someone had reported a client crash while using a "custom client" with SMAC/L4D2 but couldn't give any details. It's probably what you're describing.
__________________

Last edited by GoD-Tony; 06-09-2012 at 06:23.
GoD-Tony is offline
ProdigySim
SourceMod Plugin Approver
Join Date: Feb 2010
Old 06-09-2012 , 15:23   Re: Why does SMAC_CVars replicate convars?
Reply With Quote #5

Quote:
Originally Posted by GoD-Tony View Post
Out of curiousity, how did you track it down to SendConVarValue and mp_gamemode?

Someone had reported a client crash while using a "custom client" with SMAC/L4D2 but couldn't give any details. It's probably what you're describing.
We only had the issue when the plugin loaded, so we figured it was the SendConVarValue() calls. I hacked together a plugin to run SendConVarValue() on each replicated convar, triggered by a client running a command. Then I just set up a wait-loop on the client to run the command over and over every couple of seconds and waited for a crash, then checked logs to see what the last one sent was.
ProdigySim is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:55.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode