Page MenuHomeFeedback Tracker

Serverside mod configuration idea
Closed, ResolvedPublic

Description

I have an idea for small serverside options that we could maybe implement quickly for AR:

"mods": [
    {
        "modId": "5C50A6198B7CF7D2",
        "name": "ModConfiguration",
        "config": {
            "someString": "Hello from the Config!",
            "someFloat": 42.42
        }
    }
]

The backend API has functions around DSConfig - they look unfinished to me because GetAvailableConfigs and GetAvailableConfigPaths are empty on my dedicated server setup that does have a -config=conf.json
But it would probably not work with those too well even if they function, because one mod could make a modded version of DSMod, but then another mod that also wants to have some options would collide with the key name "config" and would have other properties on the config object.
So my idea is to ignore that API for now - not sure what it is even for - and add a new function based on the JSON Serialisation implementation that allows doing something like this:

class MyModConfiguration
{
    string someString;
    float someFloat;
}
...
MyModConfiguration myConfig();
GetGame().GetBackendApi().GetModConfiguration(guid: "5C50A6198B7CF7D2", configuration: myConfig);

And that code navigates to the server config -> mods -> mod with guid 5C50A6198B7CF7D2 and de-serializes it into the structure provided.

The advantage of using the -config JSON for options over a mod writing a new file just for it to the profile would be that hosters like Nitrado apparently lack direct access to the profile folder, only through managed log output windows. The server config JSON on the other hand is available to my knowledge.

Details

Severity
Minor
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
General

Event Timeline

Arkensor created this task.Jan 9 2023, 12:34 PM
Arkensor updated the task description. (Show Details)
Geez changed the task status from New to Assigned.Jan 11 2023, 11:40 AM
ookexoo added a subscriber: ookexoo.Nov 8 2023, 8:29 AM
Geez closed this task as Resolved.Jul 30 2024, 1:32 PM
Geez claimed this task.
Geez added a subscriber: Geez.

Unfortunately not planned for reforger :(