private void Start(Object[] args) { try { m_startupArgsField.SetValue(null, args as String[]); m_startupMethod.Call(null, null); mainLog.Info(string.Format(Program.Localization.Sentences["WaitingForServer"])); ServerInstance.Instance.SetIsStarting(); // just making sure object gameServer = assembly.GetType("Game.GameStates.GameState").GetProperty("ActiveState").GetValue(null); while (gameServer == null) { Thread.Sleep(1000); if (gameServer != null) { break; } } ServerInstance.Instance.Hook(); } catch (Exception ex) { mainLog.Fatal(ex, string.Format(Program.Localization.Sentences["GameBaseCode"])); } }
private void Start(Object[] args) { m_startupArgsField.SetValue(null, args as String[]); //Type type = assembly.GetType("Game.Program"); //var obj = Activator.CreateInstance(type); //type.InvokeMember("Init", BindingFlags.Default | BindingFlags.InvokeMethod,null,obj,null); m_startupMethod.Call(null, null); //Activator.CreateInstance(assembly.GetType("Game.Program")); object gameServer = assembly.GetType("Game.GameStates.GameState").GetProperty("ActiveState").GetValue(null); //while (gameServer == null) //{ //Thread.Sleep(1000); //if (gameServer != null) //{ // break; //} //} //Thread.Sleep(10000); isRunning = true; }
public void StopServer() { try { m_stopMethod.Call(null, null); } catch (Exception) { } }
private void Start(Object[] args) { m_startupArgsField.SetValue(null, args as String[]); m_startupMethod.Call(null, null); mainLog.Info("IRSE: Waiting for server...."); object gameServer = assembly.GetType("Game.GameStates.GameState").GetProperty("ActiveState").GetValue(null); while (gameServer == null) { Thread.Sleep(1000); if (gameServer != null) { break; } } ServerInstance.Instance.Hook(); }