MantisBT - Zandronum
View Issue Details
0002674Zandronum[All Projects] Bugpublic2016-03-17 17:292018-09-30 21:42
StrikerMan780 
Dusk 
normalmajorN/A
closedfixed 
MicrosoftWindowsXP/Vista/7
3.0-beta 
3.03.0 
0002674: GetUserCVar doesn't work as it's supposed to, missing functionality.
GetUserCVar should get the value of a User CVar, from the player specified. However, in Zandronum, it only gets the value of said CVar from the server.

I have a possible solution: Clients send the values of their User CVars on connect, and if those Cvars are changed, they are then updated on the server much in the same way as changing your name/color/autoaim or other user settings.
No tags attached.
has duplicate 0002848closed  GetUserCVar ignores "user" types of cvars 
? debugtest.pk3 (2,731) 2016-10-02 14:24
https://zandronum.com/tracker/file_download.php?file_id=1894&type=bug
Issue History
2016-03-17 17:29StrikerMan780New Issue
2016-03-17 17:33StrikerMan780Note Added: 0014583
2016-03-20 12:28Torr SamahoNote Added: 0014585
2016-10-02 10:13FusedNote Added: 0015726
2016-10-02 10:41FusedNote Edited: 0015726bug_revision_view_page.php?bugnote_id=15726#r9566
2016-10-02 11:18Torr SamahoNote Added: 0015727
2016-10-02 13:49FusedNote Added: 0015728
2016-10-02 14:24Torr SamahoFile Added: debugtest.pk3
2016-10-02 14:36Torr SamahoNote Added: 0015729
2016-10-02 15:03FusedNote Added: 0015730
2016-10-02 15:04FusedNote Edited: 0015730bug_revision_view_page.php?bugnote_id=15730#r9568
2016-10-02 15:08FusedNote Edited: 0015730bug_revision_view_page.php?bugnote_id=15730#r9569
2016-10-02 20:04fr-bloodNote Added: 0015736
2016-10-02 21:05Edward-sanRelationship addedhas duplicate 0002848
2016-10-28 17:38DuskAssigned To => Dusk
2016-10-28 17:38DuskStatusnew => assigned
2016-12-24 22:42DuskTarget Version => 3.0
2017-01-04 20:46DuskNote Added: 0016600
2017-01-05 14:45DuskNote Added: 0016602
2017-01-05 14:45DuskStatusassigned => needs review
2017-01-05 14:45DuskNote Edited: 0016602bug_revision_view_page.php?bugnote_id=16602#r10019
2017-01-05 14:49DuskNote Edited: 0016602bug_revision_view_page.php?bugnote_id=16602#r10020
2017-01-05 14:49DuskNote Edited: 0016602bug_revision_view_page.php?bugnote_id=16602#r10021
2017-01-05 14:49DuskNote Edited: 0016602bug_revision_view_page.php?bugnote_id=16602#r10022
2017-01-06 06:43WaTaKiDNote Added: 0016609
2017-01-24 06:59Torr SamahoNote Added: 0016676
2017-01-24 07:00Torr SamahoStatusneeds review => needs testing
2017-01-25 20:22StrikerMan780Note Added: 0016686
2017-01-25 20:22StrikerMan780Note Edited: 0016686bug_revision_view_page.php?bugnote_id=16686#r10077
2017-02-17 01:27StrikerMan780Note Edited: 0016686bug_revision_view_page.php?bugnote_id=16686#r10195
2017-02-19 20:35Torr SamahoNote Added: 0016882
2017-02-19 20:35Torr SamahoNote Edited: 0016882bug_revision_view_page.php?bugnote_id=16882#r10205
2017-02-19 20:35Torr SamahoNote Revision Dropped: 16882: 0010204
2017-02-19 20:46StrikerMan780Note Added: 0016884
2017-02-19 20:47StrikerMan780Note Edited: 0016884bug_revision_view_page.php?bugnote_id=16884#r10209
2017-02-19 20:48StrikerMan780Note Edited: 0016884bug_revision_view_page.php?bugnote_id=16884#r10210
2017-02-19 20:48Torr SamahoNote Added: 0016885
2017-02-19 20:49StrikerMan780Note Added: 0016886
2017-02-19 20:51StrikerMan780Note Edited: 0016886bug_revision_view_page.php?bugnote_id=16886#r10212
2017-04-19 22:58CombinebobntNote Added: 0017230
2017-04-20 00:55Ru5tK1ngNote Added: 0017236
2017-04-20 00:55Ru5tK1ngStatusneeds testing => feedback
2017-06-18 10:17Torr SamahoNote Added: 0017832
2017-06-18 10:31StrikerMan780Note Added: 0017833
2017-06-18 10:31StrikerMan780Statusfeedback => assigned
2017-06-18 15:28Torr SamahoNote Added: 0017835
2017-06-18 15:29Torr SamahoStatusassigned => needs testing
2017-08-10 17:35Ru5tK1ngNote Added: 0018156
2017-08-10 17:35Ru5tK1ngStatusneeds testing => resolved
2017-08-10 17:35Ru5tK1ngResolutionopen => fixed
2017-08-10 17:35Ru5tK1ngFixed in Version => 3.0
2018-09-30 21:42Blzut3Statusresolved => closed

Notes
(0014583)
StrikerMan780   
2016-03-17 17:33   
Hope my suggestion is a good one. This really needs to be fixed, retrieving user settings without this can be a NIGHTMARE, usually involving changing TIDs, storing said TID, and then puking scripts with the TID as an argument, setting the activator, and then performing the necessary actions. This is extremely inefficient, and isn't guaranteed to work in all situations... plus, depending on how it's applied, it can be a bandwidth eater.
(0014585)
Torr Samaho   
2016-03-20 12:28   
I agree. The user cvars should be synced like the existing hard coded user settings.
(0015726)
Fused   
2016-10-02 10:13   
(edited on: 2016-10-02 10:41)
Any progress on this? This is still broken in current builds and quite a big necessity in my case.

(0015727)
Torr Samaho   
2016-10-02 11:18   
Can you post a minimal example wad that allows to test this?
(0015728)
Fused   
2016-10-02 13:49   
Here you go:'http://allfearthesentinel.net/download?file=debugtest.pk3 [^]'
This is one of the functions I have that uses this feature. Offline it works fine, but online it doesnt work. Locally it doesn't either.
(0015729)
Torr Samaho   
2016-10-02 14:36   
Thanks for the example! Can you tell me how to activate it, what is happening and what is supposed to happen? Just loading the wad doesn't seem to change anything and I'd prefer not to guess what's supposed to happen by dissecting source of the example.
(0015730)
Fused   
2016-10-02 15:03   
(edited on: 2016-10-02 15:08)
You're welcome. I made sure I attached a menu to enable debug, otherwise just set cl_ZH_ShowDebug 1 and cl_ZH_MaxDebugSlots 14 or something to make it work.

Offline, when puking 1, there will be a list of debug messages appearing, with the amount of debug messages set with cl_ZH_MaxDebugSlots.

Online or in a local server, the debug wont show up at all. After debugging it shows it wont go past this part of the code:


if (!PlayerInGame(j) || !GetUserCVar(j, "cl_ZH_ShowDebug"))
            continue;


This is because GetUserCVar will not check the player, but most likely rather the server. This isn't intended behaviour, because GetCvar should only be doing this, so it will always be false as the server doesnt have this cvar stored.

(0015736)
fr-blood   
2016-10-02 20:04   
I can confirm that the problem is still here.
I use that cvar "user bool afd_mapstart = TRUE;", to check if the player wants or not to have a map intro with some details and it still happens online even if it's turned off.

Here is the script:
Script 1 ENTER
{// Map Information
GiveInventory("SpecialMap",1);
if(GetUserCVar(PlayerNumber(),"afd_mapstart") == TRUE)
{
    SetPlayerProperty(0,1,PROP_TOTALLYFROZEN);
    FadeTo(0,0,0,1.0,1.0);
    SetFont("BIGFONT");
    Information("Thursday 14th October 2257","Nemezis, UAC Outpost Post B-411","Sergeant","Defend the post");
    Delay(35*8);
    FadeTo(255,255,255,0.0,2.0);
    SetPlayerProperty(0,0,PROP_TOTALLYFROZEN);
}
delay(35*5);
MapName("\ciOutpost Under Attack","\cgBlood");
}
(0016600)
Dusk   
2017-01-04 20:46   
This is turning out very annoying to fix because I have to overhaul userinfo handling. Be prepared for a large diff.
(0016602)
Dusk   
2017-01-05 14:45   
(edited on: 2017-01-05 14:49)
Fixed.

God this one was annoying but at least it should behave properly now.

This will require through testing of:
* all userinfo entries (name, gender, color, …)
* user CVars and their behavior in serverside as well as clientside dealing with own and others' user cvars
* account name in playerinfo, including cl_hideaccount, because that previously was tied to userinfo syncing

(0016609)
WaTaKiD   
2017-01-06 06:43   
this 3.0 build contains the above fix: 'https://www.dropbox.com/s/4g2n99qzlpg0994/zandronum-3.0-r170106-0628-d29d636-windows.zip?dl=0 [^]'
(0016676)
Torr Samaho   
2017-01-24 06:59   
Patch added.
(0016686)
StrikerMan780   
2017-01-25 20:22   
(edited on: 2017-02-17 01:27)
Seems to work exceptionally well, no issues so far. Though, how does one define an unsynched cvar in CVARINFO? (For certain things that don't need, or shouldn't be synchronized.)

(0016882)
Torr Samaho   
2017-02-19 20:35   
IIRC user and server cvars are always synced. cvars that are neither 'server' nor 'user' are not synced.

(0016884)
StrikerMan780   
2017-02-19 20:46   
(edited on: 2017-02-19 20:48)
Server and User are the only CVar types available in cvarinfo...

"The CVAR_UNSYNCED_USERINFO flag means that even if the cvar is userinfo, it won't be synced to the server. Otherwise all userinfo is synced. This flag cannot imply CVAR_USERINFO because that would conflict with the copies created into userinfo_t."

I'd like to be able to harness this.

(0016885)
Torr Samaho   
2017-02-19 20:48   
Oh, I thought that there are "untyped" custom cvars, but I didn't check this. Then, there is no way to create an unsynced cvar. What do you need this for?
(0016886)
StrikerMan780   
2017-02-19 20:49   
(edited on: 2017-02-19 20:51)
Clientside settings that don't need to be synchronized with other players, to save bandwidth and prevent user info change floods.

A nosync keyword like noarchive would be nice.

(0017230)
Combinebobnt   
2017-04-19 22:58   
tested debugtest.pk3 in r170416-0710 and it the debug menu popped up correctly online. Based on what strikerman said, this should be good (although I hope he ran thru the full deal in dusk's note)
(0017236)
Ru5tK1ng   
2017-04-20 00:55   
I think the last part of the ticket involves the nosync keyword. So there may be still a bit to do with this issue.
(0017832)
Torr Samaho   
2017-06-18 10:17   
Did anybody have a chance to test whether'https://bitbucket.org/Torr_Samaho/zandronum/pull-requests/207/added-the-ability-to-make-local-cvars-in/diff [^]' works as intended to supply a "nosync" solution?
(0017833)
StrikerMan780   
2017-06-18 10:31   
Seems to be alright.
(0017835)
Torr Samaho   
2017-06-18 15:28   
Ok, I added Dusk's patch.
(0018156)
Ru5tK1ng   
2017-08-10 17:35   
Since this has been in 3.0 for a while now and the usual complainers haven't brought up anything, I'll be marking this as resolved.