Hi this is one of the programs i made long ago and has been used in two of my recent projects-filterscripts and rcon. It works perfectly.
Using this, you can read values from server.cfg. Using indexes, you can read the second, third , fourth and so on.
The two files (ReadCFG.cpp and ReadCFG.h) are attached.
Examples(https://i.imgur.com/YambfOt.png)
Usage: main.cpp#include "ReadCFG.h"
//Look for the term 'configuration' in server.cfg
char* szValue;
cfg mycfg;
mycfg.read("server.cfg", "configuration");
//Looping through all values (first, second, third, fourth, etc. )
for (int i = 0; i < mycfg.argc; i++)
{
szValue = mycfg.ptr[i];
printf(szValue);
printf("\n");
//Do something
}
mycfg.freememory();
Expected Output
Quotealpha
beta
gamma
delta
hi habi, may i know what kind of file is it ? and the benefits ?
It is just nothing. When making plugins for server, you can tell user to type some value (names, file locations, etc) in server.cfg and this one helps to get that value.