Page 1 of 1

[CS:GO] json in the server start string

Posted: Sat Jan 26, 2019 9:01 am
by copyerfiled
Tell me, is there a way to pass json as a variable in the server startup string on linux?

for example:

Code: Select all

./srcds_run -game csgo -console -usercon -myvar {"key": "value",...}

Re: [CS:GO] json in the server start string

Posted: Sun Jan 27, 2019 11:46 am
by Ayuto
You can, but you won't be able to simply grab and use it, because sys.argv contains the following:

Syntax: Select all

[..., '-myvar', '{"key":', 'value', '}']

It's much easier to simply create a JSON file and pass the file name to the command line:

Code: Select all

./srcds_run -game csgo -console -usercon -jsonfile my_json_file.json

Re: [CS:GO] json in the server start string

Posted: Mon Jan 28, 2019 10:36 am
by copyerfiled
Thanks!