Пример #1
0
        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;
        }
Пример #2
0
        public void InitializeServer()
        {
            MetaverseServer.GetInstance().Init(_commandlineConfig, ServerControllers.Instance);

            while (true)
            {
                MetaverseServer.GetInstance().OnTick();
                Thread.Sleep(50);
            }
        }
Пример #3
0
 private void EntryPoint_Tick()
 {
     MetaverseServer.GetInstance().OnTick();
 }