Use code in example to generate a folder in profiles with a .JSON and a example format for a license code to be inputted into which will be read from on the next server load/boot
```
class Tier1Module : CF_ModuleGame
{
private string obfv_webhook;
private string licenseFilePath;
private ref map<string, string> playerLicenseData; // Add 'ref' to playerLicenseData
void Tier1Module()
{
// Constructor: This is where you can initialize variables or perform setup tasks.
// Check and create the CZAutoz folder if it doesn't exist
string profilePath = "$profile:CZAutoz";
if (!FileExist(profilePath))
{
Print("CZAutoz folder not found. Creating it.");
MakeDirectory(profilePath);
}
// Initialize licenseFilePath
licenseFilePath = profilePath + "\\Tier1license.json";
// Initialize playerLicenseData as a new map
playerLicenseData = new map<string, string>();
if (!FileExist(licenseFilePath))
{
// Create a new license code if it doesn't exist
string exampleLicenseCode = "EXAMPLE_LICENSE_CODE_CHANGE_ME"; // Replace with your example license code
playerLicenseData.Insert("licenseCode", exampleLicenseCode);
// Save the example license code to Tier1license.json
JsonFileLoader<map<string, string>>.JsonSaveFile(licenseFilePath, playerLicenseData);
if (FileExist(licenseFilePath))
{
Print("Created new Tier1license.json with example license code. Please change this to your valid license: " + exampleLicenseCode);
}
else
{
Print("Failed to create Tier1license.json. Check file permissions or path.");
}
}
else
{
// Tier1license.json exists, read the existing license code
JsonFileLoader<map<string, string>>.JsonLoadFile(licenseFilePath, playerLicenseData);
if (playerLicenseData.Count() > 0 && playerLicenseData.Contains("licenseCode"))
{
string existingLicenseCode = playerLicenseData["licenseCode"];
Print("Loaded existing license code: " + existingLicenseCode);
}
else
{
Print("Failed to load Tier1license.json or file format is incorrect. Check file format or path.");
}
}
}
}
```
Now I have directly had Vykix the host blaming my code and mod that this is the issue but when tested in other hosting enviroments, there has been no issue at all and the JSON files all read well without a JSON load data error? I am really adamant that the host Vykix has a really wierd hosting enviroment set up causing pathing issues etc.
Are we happy to rule this out as it would be a host related issue and not modding related issue if the related code works fine with OVH, GTX and many other hosts? But with any hosts like Vykix, the error appears and servers crash
SCRIPT : Checking IP: 5.252.101.152 Port: 2502
SCRIPT (E): JSON ERROR DNA_Keycards_Scripts/Scripts/5_Mission/dna_keycards\missionserver.c:23
SCRIPT (E): [::JsonLoadData] :: [ERROR] :: Cannot load data JSON ERROR:
Invalid value.
Function: 'JsonLoadData'
Stack trace:
scripts/3_Game/tools\jsonfileloader.c:160
callatic_vehicles_tier_2_scripts/Ftl4Ouun/ pr7w KnV/ygIzhvai//S8lGxtGn/mHCHWso9/mnpe uME.ARjOjVN :138
callatic_vehicles_tier_2_scripts/Ftl4Ouun/ pr7w KnV/ygIzhvai//S8lGxtGn/mHCHWso9/mnpe uME.ARjOjVN :68
JM/CF/Scripts/1_Core/communityframework\module\cf_modulecoreevent.c:41
JM/CF/Scripts/1_Core/communityframework\module\cf_modulecoremanager.c:157
JM/CF/Scripts/5_Mission/communityframework\mission\missionserver.c:37
VPPAdminTools/5_Mission/vppadmintools\missionserver.c:12
DNA_Keycards_Scripts/Scripts/5_Mission/dna_keycards\missionserver.c:23
Are we aware of any JSON related issues within DayZ itself?