Index: src/config/config.cs =================================================================== --- src/config/config.cs (revision 33) +++ src/config/config.cs (working copy) @@ -25,25 +25,59 @@ { public struct ServerConfigStruct { - public ServerConfigStruct(string _serverName, string _serverIP, ushort _portNumber, string _adminPass, char _commandPrefix, byte _insimOptionMask, ushort _netUpdateInterval, ushort _serverUpdateInterval) + public ServerConfigStruct(string _serverIP, ushort _portNumber, string _adminPass, char _commandPrefix, byte _InSimOptionMask, ushort _netUpdateInterval, ushort _serverUpdateInterval) { - serverName = _serverName; serverIP = _serverIP; portNumber = _portNumber; adminPass = _adminPass; commandPrefix = _commandPrefix; - insimOptionMask = _insimOptionMask; + InSimOptionMask = _InSimOptionMask; netUpdateInterval = _netUpdateInterval; - serverUpdateInterval = _netUpdateInterval; + serverUpdateInterval = _serverUpdateInterval; } - private string serverName; private string serverIP; private ushort portNumber; private string adminPass; private char commandPrefix; - private byte insimOptionMask; + private byte InSimOptionMask; private ushort netUpdateInterval; private ushort serverUpdateInterval; + + public string prServerIP + { + get { return serverIP; } + //set { serverIP = value; } + } + public ushort prPortNumber + { + get { return portNumber; } + //set { portNumber = value; } + } + public ushort prAdminPass + { + //get { return adminPass; } + //set { adminPass = value; } + } + public char prCommandPrefix + { + get { return commandPrefix; } + //set { commandPrefix = value; } + } + public byte prInSimOptionMask + { + get { return InSimOptionMask; } + //set { InSimOptionMask = value; } + } + public ushort prNetUpdateInterval + { + get { return netUpdateInterval; } + //set { netUpdateInterval = value; } + } + public ushort prServerUpdateInterval + { + get { return serverUpdateInterval; } + //set { serverUpdateInterval = value; } + } } private const string CONFIG_FILE = "dlfss.cfg"; @@ -54,7 +88,7 @@ private static uint DLFSSSUpdateRate = 0; private static int logDisable = 0; //mask variable - private static Dictionary serverList = new Dictionary(); + private static Dictionary serverList = new Dictionary(); public static bool Initialize() { @@ -83,7 +117,6 @@ } } } - return true; } private static bool ValidLineSetting(string _line, ushort _lineNumber) @@ -148,7 +181,6 @@ } } } - return true; } @@ -170,11 +202,10 @@ } break; default: { - Program.log.error("Error in config file at line: " + _lineNumber + ", unknow config option: " + args[2] + ", For Server: "+args[1]+".\r\n"); + Program.log.error("Error in config file at line: " + _lineNumber + ", unknow config option: " + args[2] + ", For Server: " + args[1] + ".\r\n"); return false; } } - return true; } private static bool CreateServer(string _line, ushort _lineNumber, string _serverName) @@ -190,15 +221,15 @@ try { - serverList.Add(serverList.Count + 1, new ServerConfigStruct(_serverName, args[0], Convert.ToUInt16(args[1]), args[2], Convert.ToChar(args[3]), Convert.ToByte(args[4]), Convert.ToUInt16(args[5]), Convert.ToUInt16(args[6]))); - //Program.log.normal("CreateServer name : " + _serverName + ", value : " + tempoConf + "\r\n"); - return true; + serverList.Add(_serverName, new ServerConfigStruct(args[0], Convert.ToUInt16(args[1]), args[2], Convert.ToChar(args[3]), Convert.ToByte(args[4]), Convert.ToUInt16(args[5]), Convert.ToUInt16(args[6]))); + //Program.log.normal("CreateServer name : " + _serverName + ", value : " + tempoConf + "\r\n"); //FOR DEBUG IF U NEED } catch (Exception _exception) { Program.log.error("Error in config file at line: " + _lineNumber + ", incorrect parameter: " + tempoConf + "\r\n"); return false; } + return true; } private static bool ValidConfVersion(string _line) { @@ -217,7 +248,6 @@ Program.log.error("Error in config file at line : " + _lineNumber + ", incorrect parameter : " + valueToConvert + "\r\n"); return false; } - return true; } private static bool SetPlayerSaveInterval(string _line, ushort _lineNumber) @@ -230,7 +260,6 @@ Program.log.error("Error in config file at line : " + _lineNumber + ", incorrect parameter : " + valueToConvert + "ms \r\n"); return false; } - return true; } private static bool SetDLFSSSUpdateRate(string _line, ushort _lineNumber)