Exemple #1
0
        //Database database;
        //Server
        public LillyPad()
        {
            InputOutput.InitLogTypes();
            /*
             * The LillyPad System simply takes each subsystem and starts it
             * in its own thread, doing this allows us to desync the entire
             * system and restart subsystems without restarting the whole
             * server.
             *
             */

            HistoryAppDomain = AppDomain.CreateDomain("History_AppDomain");
            Type t = typeof(MCFrog.History.HistoryController);
            historyController = (MCFrog.History.HistoryController)HistoryAppDomain.CreateInstanceAndUnwrap("MCFrog", t.FullName);

            DatabaseAppDomain = AppDomain.CreateDomain("Database_AppDomain");
            t = typeof(MCFrog.Database.DatabaseController);
            databaseController = (MCFrog.Database.DatabaseController)DatabaseAppDomain.CreateInstanceAndUnwrap("MCFrog", t.FullName);

            HeartBeatDomain = AppDomain.CreateDomain("HeartBeat_AppDomain");
            t = typeof(MCFrog.HeartBeat.HeartBeat);
            heartBeater = (MCFrog.HeartBeat.HeartBeat)HistoryAppDomain.CreateInstanceAndUnwrap("MCFrog", t.FullName);

            Server.Log("Starting Server SybSystems...", LogTypesEnum.system);

            ServerDomain = AppDomain.CreateDomain("Server_AppDomain");
            t = typeof(MCFrog.Server);
            server = (MCFrog.Server)ServerDomain.CreateInstanceAndUnwrap("MCFrog", t.FullName);

            server.historyControllerNS = historyController;
            server.databaseControllerNS = databaseController;
            server.Start();

            //new Thread(new ThreadStart(StartServer)).Start();
            //new Thread(new ThreadStart(StartConnectionHandler)).Start();
            //new Thread(new ThreadStart(StartPlayerHandler)).Start();
            //new Thread(new ThreadStart(StartLevelHandler)).Start();

            Server.StartInput();
        }
Exemple #2
0
        public void Start()
        {
            historyController = historyControllerNS;
            databaseController = databaseControllerNS;
            InputOutput.InitLogTypes();
            Block.Initialize();

            try
            {
                PhysicsHandler.LoadPhysicsTypes();

                new Thread(new ThreadStart(StartConnectionHandler)).Start();
                new Thread(new ThreadStart(StartPlayerHandler)).Start();
                new Thread(new ThreadStart(StartLevelHandler)).Start();
                new Thread(new ThreadStart(StartPerformanceMonitor)).Start();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
                new TestClass();
        }