Hello
I've recently started working with the Custom server, and I've ran into a strange error.
The tutorial, and some discussions I've found after searching around implies that the working directory of the Custom Server is the same directory as the executable file.
However, trying to load a file relatively did not work. So I tried writing some logs about the variables, and here what I found:
TCHAR szDir[ MAX_PATH ]; ZeroMemory( szDir, sizeof( TCHAR ) * MAX_PATH ); GetCurrentDirectory( MAX_PATH, szDir );
Output: d:\gameserver
TCHAR buffer[ MAX_PATH ]; GetModuleFileName( NULL, buffer, MAX_PATH );
Output: d:\gameserver\gamefiles\gameserver.exe
And listing out all the files from the current working directory returns these values:
gamefiles\Cfg\Artifact\enchantments.cfg gamefiles\Cfg\Artifact\equipment.cfg gamefiles\Cfg\Artifact\loottypes.cfg logs\\874908806496338062.log logs\\Maps.log
According to this, all my files from the zip I uploaded went into the gamefiles folder( which I didn't have in the zip ), but the working folder is one folder above that.
Is that intentional? Is there a normal way to get my content folder?
Of course I can process the executable file name, to cut to the last '\', but that's not really elegant( nor reliable ).