public static Server getInstance() { if(instance == null) instance = new Server(); return instance; }
public virtual bool LoadConfigFile(string filename) { string line = null; StreamReader sr = null; string[] seperators = { "\t", " ", ":" }; if (serverConstructor != null) server = serverConstructor(); Console.WriteLine("Configs start"); sr = new StreamReader(filename); for (line = sr.ReadLine(); line != null; line = sr.ReadLine()) { if (line=="" || line[0] == '#') continue; string[] v = line.Split(seperators, StringSplitOptions.RemoveEmptyEntries); ParseArgs(v); } Console.WriteLine("Configs end"); if (sr != null) sr.Close(); return true; }