https://www.byond.com/docs/ref/#/world/proc/GetConfig states
"If no parameter is specified, a list of the names of all available parameters is returned."
but when making a call like world.GetConfig("admin") you get an invalid result (just a list a single item with empty sting as the ckey).
Basically this means there's no programic way to clear admins using GetConfig from the cfg/admin.txt. But despite the GetConfig not working, it *seems* like SetConfig is working. It'll make a cfg/admin.txt like this:
someoneelse role=admin
drathek role=admin
someone role=admin
Also of note, I cannot for the life of me get profiling procs to work reliably launched with -profile and or #define DEBUG. I don't know if its because of this issue, or something else, but I guess I can explore that more once this is working correctly (and is sort of what caused this investigation in the first place).
Numbered Steps to Reproduce Problem:
1. Run code snippet
2. View output in dreamdaemon log
Code Snippet (if applicable) to Reproduce Problem:
#define DEBUG
#define TESTER_CKEY "drathek"
var/list/ckeys_with_access = list("SomeoneElse", TESTER_CKEY, "Someone")
/world
fps = 25
icon_size = 32
/world/New()
check_config("Before clean")
//Clear access
for(var/admin in world.GetConfig("admin")) // This is supposed to be a list of all, but it doesn't work
world.log << "Clearing [admin] from APP/admin."
world.SetConfig("APP/admin", admin, null)
check_config("After clean")
//Set access
for(var/admin in ckeys_with_access)
world.log << "Setting [ckey(admin)] as APP/admin."
world.SetConfig("APP/admin", ckey(admin), "role=admin")
check_config("After assignment")
/world/proc/check_config(message, test_ckey=TESTER_CKEY)
world.log << ""
world.log << "------------ [message] ------------"
world.log << "world.GetConfig(\"admin\"):"
world.log << json_encode(world.GetConfig("admin"))
world.log << "world.GetConfig(\"admin\", \"[test_ckey]\"):"
world.log << json_encode(world.GetConfig("admin", test_ckey))
world.log << "for(var/admin in world.GetConfig(\"admin\")):"
var/i = 1
for(var/admin in world.GetConfig("admin")) // This is supposed to be a list of all, but it doesn't work
world.log << "[i++]: [admin]"
world.log << "------------ [message] ------------"
world.log << ""
/client/verb/ProfilerAccess()
set category = "Testing"
winset(usr, null, "command=.profile")
Expected Results:
Something like:
------------ Before clean ------------
world.GetConfig("admin"):
Either json_encoded list of admins, or []
world.GetConfig("admin", "drathek"):
Either "role=admin" or null
for(var/admin in world.GetConfig("admin")):
Either numbered list of admins or nothing
------------ Before clean ------------
Either a series of "Clearing SOMEKEY from APP/admin." or nothing
------------ After clean ------------
world.GetConfig("admin"):
[]
world.GetConfig("admin", "drathek"):
null
for(var/admin in world.GetConfig("admin")):
------------ After clean ------------
Setting someoneelse as APP/admin.
Setting drathek as APP/admin.
Setting someone as APP/admin.
------------ After assignment ------------
world.GetConfig("admin"):
{\"someoneelse\":\"role=admin\",\"drathek\":\"role=admin\",\"someone\":\"role=admin\"}
world.GetConfig("admin", "drathek"):
"role=admin"
for(var/admin in world.GetConfig("admin")):
1: someoneelse
2: drathek
3: someone
------------ After assignment ------------
Actual Results:
------------ Before clean ------------
world.GetConfig("admin"):
{"":"role=admin"}
world.GetConfig("admin", "drathek"):
"role=admin"
for(var/admin in world.GetConfig("admin")):
1:
------------ Before clean ------------
Clearing from APP/admin.
------------ After clean ------------
world.GetConfig("admin"):
{"":"role=admin"}
world.GetConfig("admin", "drathek"):
"role=admin"
for(var/admin in world.GetConfig("admin")):
1:
------------ After clean ------------
Setting someoneelse as APP/admin.
Setting drathek as APP/admin.
Setting someone as APP/admin.
------------ After assignment ------------
world.GetConfig("admin"):
{"":"role=admin"}
world.GetConfig("admin", "drathek"):
"role=admin"
for(var/admin in world.GetConfig("admin")):
1:
------------ After assignment ------------
Does the problem occur:
Every time? Or how often? Yes
In other games? Yes
In other user accounts? Yes
On other computers? Yes
When does the problem NOT occur?
Unknown
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
Unknown - broken on 514.1589 too.
Workarounds:
Unknown