I'm using a function which implements GetPrivateProfileString to read values from an INI file. Now, this function requires a value for strApplicationname, which is basically the section of the INI File to read the value from. This is marked in the INI File by "[AppName]".
Now my problem is that the INI files I want to read from do not have such a marking, there are just values with no section header.
Does anyone have any idea how I can read values from an INI File without specifying the AppName, or at least how I can insert a null value into a string ("" is no good, this looks for a section called []).
I can't add any markers to the INI file, as they are used by the Serious Sam TSE Dedicated Server, and it doesn't work if any markers are added to the files...There are various ways I can work around this, but I'd be really grateful if there are any simple solutions.
This is the contents of init.ini, the initial config file for the dedicated server. I tried adding blank markers to the file, but the DedServ ignored the file contents, rendering that idea useless.
Code:
// this adjusts initial parameters that will be used for this server
net_iPort = 25600; // port to run on - change if you want to run more servers on one computer
gam_iStartMode = 2; // game mode (0=coop, 1=scorematch, 2=fragmatch)
gam_iStartDifficulty = -1; // difficulty (-1=tourist, 0=easy, 1=normal, 2=hard, 3=serious)
gam_ctMaxPlayers = 8; // max number of players accepted
gam_bWaitAllPlayers = 0; // set this to wait for all player to join
gam_iCredits = 0; // number of credits for respawning
gam_bWeaponsStay = 0; // weapons stay on/off
gam_iTimeLimit = 0; // timelimit(minutes) 0=no timelimit
gam_iFragLimit = 20; // fraglimit
gam_strSessionName = "MarMac SSTSE Fragmatch 1";
ded_tmTimeout = 20; // timeout after level is finished
ser_bWaitFirstPlayer = 1; // wait until first player is joined