public void InitializeClientWithServer() { try { MetaverseServer.GetInstance().Init(_commandlineConfig, ServerControllers.Instance); MetaverseClient.GetInstance().Tick += new MetaverseClient.TickHandler(EntryPoint_Tick); MetaverseClient.GetInstance().Init(_commandlineConfig, ClientControllers.Instance); } catch (Exception e) { Console.WriteLine(e); string errorlogpath = EnvironmentHelper.GetExeDirectory() + "/error.log"; StreamWriter sw = new StreamWriter(errorlogpath, false); sw.WriteLine(LogFile.GetInstance().logfilecontents); sw.WriteLine(e.ToString()); sw.Close(); if (System.Environment.OSVersion.Platform != PlatformID.Unix) { ProcessStartInfo psi = new ProcessStartInfo("notepad.exe", errorlogpath); psi.UseShellExecute = true; Process process = new Process(); process.StartInfo = psi; process.Start(); } else { throw new NotImplementedException("An exception has occurred and we are not sure yet how to show this to you. Please look over your log files for errors"); } } return; }
public void InitializeServer() { MetaverseServer.GetInstance().Init(_commandlineConfig, ServerControllers.Instance); while (true) { MetaverseServer.GetInstance().OnTick(); Thread.Sleep(50); } }
private void EntryPoint_Tick() { MetaverseServer.GetInstance().OnTick(); }