2016-08-22 10:43:04 -04:00
|
|
|
|
using FFXIVClassic.Common;
|
|
|
|
|
using System;
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
|
|
namespace FFXIVClassic_World_Server
|
|
|
|
|
{
|
|
|
|
|
class ConfigConstants
|
|
|
|
|
{
|
|
|
|
|
public static String OPTIONS_BINDIP;
|
|
|
|
|
public static String OPTIONS_PORT;
|
|
|
|
|
public static bool OPTIONS_TIMESTAMP = false;
|
|
|
|
|
|
2016-12-21 09:27:51 -05:00
|
|
|
|
public static uint DATABASE_WORLDID;
|
2016-08-22 10:43:04 -04:00
|
|
|
|
public static String DATABASE_HOST;
|
|
|
|
|
public static String DATABASE_PORT;
|
|
|
|
|
public static String DATABASE_NAME;
|
|
|
|
|
public static String DATABASE_USERNAME;
|
|
|
|
|
public static String DATABASE_PASSWORD;
|
|
|
|
|
|
2016-12-21 09:27:51 -05:00
|
|
|
|
public static String PREF_SERVERNAME;
|
|
|
|
|
|
2016-08-22 10:43:04 -04:00
|
|
|
|
public static bool Load()
|
|
|
|
|
{
|
2016-08-29 08:17:14 -04:00
|
|
|
|
Program.Log.Info("Loading world_config.ini");
|
2016-08-22 10:43:04 -04:00
|
|
|
|
|
2016-08-29 08:17:14 -04:00
|
|
|
|
if (!File.Exists("./world_config.ini"))
|
2016-08-22 10:43:04 -04:00
|
|
|
|
{
|
|
|
|
|
Program.Log.Error("FILE NOT FOUND!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-29 08:17:14 -04:00
|
|
|
|
INIFile configIni = new INIFile("./world_config.ini");
|
2016-08-22 10:43:04 -04:00
|
|
|
|
|
|
|
|
|
ConfigConstants.OPTIONS_BINDIP = configIni.GetValue("General", "server_ip", "127.0.0.1");
|
2016-08-28 14:25:37 -04:00
|
|
|
|
ConfigConstants.OPTIONS_PORT = configIni.GetValue("General", "server_port", "54992");
|
2016-08-22 10:43:04 -04:00
|
|
|
|
ConfigConstants.OPTIONS_TIMESTAMP = configIni.GetValue("General", "showtimestamp", "true").ToLower().Equals("true");
|
|
|
|
|
|
2016-12-21 09:27:51 -05:00
|
|
|
|
ConfigConstants.DATABASE_WORLDID = UInt32.Parse(configIni.GetValue("Database", "worldid", "0"));
|
2016-08-22 10:43:04 -04:00
|
|
|
|
ConfigConstants.DATABASE_HOST = configIni.GetValue("Database", "host", "");
|
|
|
|
|
ConfigConstants.DATABASE_PORT = configIni.GetValue("Database", "port", "");
|
|
|
|
|
ConfigConstants.DATABASE_NAME = configIni.GetValue("Database", "database", "");
|
|
|
|
|
ConfigConstants.DATABASE_USERNAME = configIni.GetValue("Database", "username", "");
|
|
|
|
|
ConfigConstants.DATABASE_PASSWORD = configIni.GetValue("Database", "password", "");
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|