[CS:GO] json in the server start string

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
copyerfiled
Junior Member
Posts: 6
Joined: Wed Jan 23, 2019 9:40 am

[CS:GO] json in the server start string

Postby copyerfiled » Sat Jan 26, 2019 9:01 am

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",...}
User avatar
Ayuto
Project Leader
Posts: 1933
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

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

Postby Ayuto » Sun Jan 27, 2019 11:46 am

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
User avatar
copyerfiled
Junior Member
Posts: 6
Joined: Wed Jan 23, 2019 9:40 am

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

Postby copyerfiled » Mon Jan 28, 2019 10:36 am

Thanks!

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 4 guests