[games-server/ghost++] initial import, still not finished (and only compile tested) uses cmake as we have a dep on it anyway.
This commit is contained in:
43
games-server/ghost++/files/ghost++-configpath.patch
Normal file
43
games-server/ghost++/files/ghost++-configpath.patch
Normal file
@@ -0,0 +1,43 @@
|
||||
Index: ghost/ghost.cpp
|
||||
===================================================================
|
||||
--- ghost/ghost.cpp (revision 573)
|
||||
+++ ghost/ghost.cpp (working copy)
|
||||
@@ -233,15 +233,23 @@
|
||||
{
|
||||
srand( time( NULL ) );
|
||||
|
||||
+// we need a full path for the config file since we could install system-wide so the executable is not in the same place as the config --Dessa
|
||||
+#ifdef CONFIGPATH
|
||||
+ gCFGFile = CONFIGPATH "ghost.cfg";
|
||||
+#else
|
||||
gCFGFile = "ghost.cfg";
|
||||
-
|
||||
+#endif
|
||||
if( argc > 1 && argv[1] )
|
||||
gCFGFile = argv[1];
|
||||
|
||||
// read config file
|
||||
|
||||
CConfig CFG;
|
||||
+#ifdef CONFIGPATH
|
||||
+ CFG.Read( CONFIGPATH "default.cfg" );
|
||||
+#else
|
||||
CFG.Read( "default.cfg" );
|
||||
+#endif
|
||||
CFG.Read( gCFGFile );
|
||||
gLogFile = CFG.GetString( "bot_log", string( ) );
|
||||
gLogMethod = CFG.GetInt( "bot_logmethod", 1 );
|
||||
@@ -1459,8 +1467,12 @@
|
||||
void CGHost :: LoadIPToCountryData( )
|
||||
{
|
||||
ifstream in;
|
||||
+// bah, why isn't that configurable? hardcode for now --Dessa
|
||||
+#ifdef CONFIGPATH
|
||||
+ in.open( CONFIGPATH "/ip-to-country.csv" );
|
||||
+#else
|
||||
in.open( "ip-to-country.csv" );
|
||||
-
|
||||
+#endif
|
||||
if( in.fail( ) )
|
||||
CONSOLE_Print( "[GHOST] warning - unable to read file [ip-to-country.csv], iptocountry data not loaded" );
|
||||
else
|
||||
Reference in New Issue
Block a user