PDA

View Full Version : Cookies/new classes/bug


Diablo3
04-04-2010, 17:33
Hello,
I added new zombie class to server, and now everyone who join to server, spawn as human and automatically get this new zombie class! (human with zombie class!!!)

Also all classes settings in cookies resets. Everyone should choose human class again.

But the problem is that new player get a zombie class :/
I don't know how exactly it happen, but admins gets default human class, default player - new added zombie class.

Previous I see all those setting were in cookie file stored in game dir, sql lite..
Now I open the sql file - the file is empty :cry:

rhelgeby
04-04-2010, 18:21
Reset cookies, whether it's SQLite or a MySQL database.

If you don't want to reset everything you can manually reset just the saved class indexes (zr_humanclass, zr_zombieclass, zr_adminclass) to 0 with a SQL query.

Released a new patch (r607), try it.

Diablo3
04-05-2010, 03:15
Reset cookies, whether it's SQLite or a MySQL database.

If you don't want to reset everything you can manually reset just the saved class indexes (zr_humanclass, zr_zombieclass, zr_adminclass) to 0 with a SQL query.

Released a new patch (r607), try it.

I sure I try it :)
How I should reset ? I want to know if I need this later in future. Maybe my sql browser is broken, because as I say my sql looks like empty...

P.S what changes is made in cstrike/addons/sourcemod/configs/zr/playerclasses.txt file ? I can't find difference :|

rhelgeby
04-05-2010, 05:00
Look in zrdocs/changes in the patch. There are diff-files with info about changes in configs that were done in each patch.

There were only changes in playerclasses.txt in r555 and r580.

Diablo3
04-05-2010, 05:00
I update to 607 patch, and still when changemap classes not save in cookies, only weapon rebuy. If weapon rebuy it seems that my sql working ? :/

Diablo3
04-05-2010, 05:19
I reset my cookies in database, but no lucky , weapons rebuys , class - not assign

rhelgeby
04-05-2010, 06:02
There might be a timing issue with cookies.

Diablo3
04-05-2010, 06:24
There might be a timing issue with cookies.
what does it mean ?

I I want to ask, how to correct set this option "team_default" ?
I have default human class with "team_default" "yes", so my VIP and ADMIN class also are humans, so I should set "team_default" yes or no ?
P.S I have 2 admins classes assigned to difference groups.

please look at my file and say if all team default settings are correct:



"human_normal"
{
// General
"enabled" "yes"
"team" "1"
"team_default" "yes"
...

"human_vip"
{
// General
"enabled" "Yes"
"team" "1"
"team_default" "no"
"flags" "0"
"group" "VIP"
...

"human_admin"
{
// General
"enabled" "yes"
"team" "1"
"team_default" "no"
"flags" "1"
"group" "Fulladmin"
....

"human_Admin_L"
{
// General
"enabled" "yes"
"team" "1"
"team_default" "no"
"flags" "1"
"group" "Lightadmin"
....



each group must have default team or just one for all humans ?
Maybe I must have one admin class without group and set team_default yes ?

rhelgeby
04-05-2010, 06:47
The team_default attribute is supposed to only be set on one class per team. That is one zombie class and one human class can be marked as default.

Admin-only, VIP and mother zombie classes can't be marked as default in playerclasses.txt, only regular classes that everyone have access to.

The timing issue with cookies aren't confirmed, but cookie settings may be loaded a bit late on some servers, or ZR is trying to use cookie settings before they're loaded.

Diablo3
04-05-2010, 06:51
Hmm so you should change playerclasses.txt in new and old patches , because in this file human_vip and human_normal both have team_default set to "yes"

rhelgeby
04-05-2010, 08:55
That happens when we copy-paste classes.

It doesn't break anything, it's just that the last "default" class isn't considered a default class by ZR. I'll make the class validator give a warning about this in the next version.

Diablo3
04-05-2010, 09:13
ok, but I still having problem with sql and cookies :/
I use auth system - ip adress and try assign skins to groups. Everything is working perfect until I added new class, and some plugins... Now I delete that new plugins and delete new class - nothing :/ Weapons loading from cookie normally, classes - no...

maybe try add not local, but remote database ?
And what about sv_pure 1 ? Maybe it cause the problem ?...

Diablo3
04-05-2010, 11:32
Maybe you can look at my database. I think where I marked red color should be "1" not "0" value ?

http://img85.**************/img85/5638/mysql1l.th.jpg (http://img85.**************/i/mysql1l.jpg/)http://img59.**************/img59/3729/mysql2.th.jpg (http://img59.**************/i/mysql2.jpg/)

I change it to 1, but when reconnect it automatically reset in database to 0...

rhelgeby
04-05-2010, 12:45
Admin mode classes are not implemented. Don't confuse this with admin-only classes where they are regular classes with a flag. Admin mode classes is considered a separate team.

Cookie id 2 and 3 (human and zombie) does have saved class indexes.

Diablo3
04-05-2010, 13:17
so where is the problem to load class from cookie ? :/ Database looks good 2id set to 1, but as I say when change map I get default class automatic :/
I use ip authorization...

Here in cookies I see steam_id stored (player), it is possible to change? But maybe not need that, because all have unique id...

Too difficult for me to find what is wrong...

If weapons rebuys normally , so the problem not in database ? So when I connect get default human class, this means default overrides save from cookie ?

rhelgeby
04-05-2010, 14:17
I've already explained that, probably a timing issue.

Diablo3
04-05-2010, 14:42
I've already explained that, probably a timing issue.

So what should I do to solve timing issue? Just wait or something to do ?

I think it's really something bad with time.. sometimes cookies work only several rounds...then class change :/

Diablo3
04-05-2010, 15:53
04/05/2010 - 23:24:10: [SM] Native "GetUserAdmin" reported: Client 2 is not connected
L 04/05/2010 - 23:24:10: [SM] Displaying call stack trace for plugin "zombiereloaded.smx":
L 04/05/2010 - 23:24:10: [SM] [0] Line 297, zr/zombiereloaded.inc::ZRIsClientAdmin()
L 04/05/2010 - 23:24:10: [SM] [1] Line 991, zr/playerclasses/playerclasses.inc::ClassClientSetDefaultIndex es()
L 04/05/2010 - 23:24:10: [SM] [2] Line 137, zr/playerclasses/classevents.inc::ClassOnCookiesCached()
L 04/05/2010 - 23:24:10: [SM] [3] Line 264, zombiereloaded.sp::OnClientCookiesCached()
L 04/05/2010 - 23:30:24: [SM] Native "GetUserAdmin" reported: Client 1 is not connected
L 04/05/2010 - 23:30:24: [SM] Displaying call stack trace for plugin "zombiereloaded.smx":
L 04/05/2010 - 23:30:24: [SM] [0] Line 297, zr/zombiereloaded.inc::ZRIsClientAdmin()
L 04/05/2010 - 23:30:24: [SM] [1] Line 991, zr/playerclasses/playerclasses.inc::ClassClientSetDefaultIndex es()
L 04/05/2010 - 23:30:24: [SM] [2] Line 137, zr/playerclasses/classevents.inc::ClassOnCookiesCached()
L 04/05/2010 - 23:30:24: [SM] [3] Line 264, zombiereloaded.sp::OnClientCookiesCached()


maybe here is the problem ? I found it in error logs

rhelgeby
04-05-2010, 16:22
Ok, thanks for reporting. I think I got an idea on how to fix this.

Diablo3
04-05-2010, 16:35
Ok, thanks for reporting. I think I got an idea on how to fix this.

thanks you for helping! waiting a good news from you :wink:

KyleS
04-05-2010, 16:39
Ok, thanks for reporting. I think I got an idea on how to fix this. That's the very error I told you how to fix on Steam :grrr:

The issue with the old system IIRC was Z:R would check for cookies before they were loaded, since it couldn't find the cookies for that specific player they would be cleared the second that clientprefs was loaded. On Dev it's been fixed for ages and I thought I saw it go into the stable branch a while ago as well. The last issue that I'm having with cookies is with the ZMarket feature not giving players their weapons on map change (However after talking to Rhelgeby last night, I think I'm blaming the wrong feature).

Diablo3
04-05-2010, 16:43
http://forums.alliedmods.net/showpost.php?p=1140563&postcount=6

Here I post some errors with zmarket, maybe it exact what you talking about.

Diablo3
04-05-2010, 17:03
P.S I'm back to 599 and first look that classes from cookies loaded normally. But I'm not sure how long it be :)

Diablo3
04-06-2010, 11:51
Interesting thing, I notice that only when I add new class to server, cookies breaks :/

KyleS
04-06-2010, 13:39
Interesting thing, I notice that only when I add new class to server, cookies breaks :/ I found clearing out my clientprefs database after doing major changes to a plugin makes the majority of the errors go away :P

rhelgeby
04-06-2010, 14:07
That's because we didn't validate cookie data properly. I added extra validation for saved classes in r607, but I think the rest of the cookie values are blindly trusted by ZR.

This is why resetting cookies/clientprefs eliminates most errors after config changes, because ZR is recreating cookies with valid data.

Diablo3
04-09-2010, 09:24
no good news how to fix it...class/cookies bug ?

rhelgeby
04-09-2010, 11:11
Something weird is going on when restoring classes from cookies now. It's unpredictable, like cookies sometimes doesn't load at all.

Could someone verify that saved weapon setup is restored properly from cookies on map change, and after a server restart? If that still works I screwed up in classes somewhere... :cry:

UPDATE: I think I'm onto something now. For developers who are interested: classevents.inc:ClassOnModulesLoaded (called from zombiereloaded.sp:OnConfigsExecuted) is resetting class indexes to default settings. This might be a timing conflict with cookie loading and admin checking. Classes saved in cookies are loaded after both admin check and cookie loading is done, but I think configs may be executing after that again, so class indexes are reset.

UPDATE 2: Didn't work. Either the class settings on connecting players are garbage so they are reset to default classes, or something is resetting class indexes after cookies are loaded.