Page MenuHomeFeedback Tracker

Capability to read strings from serverDZ.cfg
New, UrgentPublic

Description

Similar to the CGame::ServerConfigGetInt(string name) method, I am proposing a method to retrieve strings from the server configuration. This has a few benefits, primarily being able to store data like API keys or other more sensitive data as a server configuration, akin to environment variables.

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
General
Steps To Reproduce

N/A

Additional Information

N/A

Event Timeline

broman created this task.Nov 4 2020, 6:30 AM

The problem with the server.cfg is that it contains sensitive data that malicious mods could access. Such as Rcon access and admin password.

New patch 1.10 has added the ability to read from the globlas.xml, you could make use of that.

GetCEApi().GetCEGlobalInt(string varName);
GetCEApi().GetCEGlobalFloat(string varName);
GetCEApi().GetCEGlobalString(string varName);

You can automate your configuration and append the XML, however that might be more work rather than just setting up your own configuration loading/saving within the $profiles or $saves dir

broman added a comment.EditedNov 5 2020, 12:48 AM

@Arkensor It is already possible to read from the file with methods provided by CommunityFramework as seen here. It would be just more convienient to have it built-in alongside the already existing method

@markkoky44 this is a good work-around, but I'm hoping that they can simply add reading serverDZ.cfg directly. Currently I read from a text file, so it's not like this missing feature hinders me at all