示例#1
0
        public Server(MainForm form)
        {
            this.form = form;

            try {
                database = new Database(this);

                gameServers = database.GetAllGameServers();
                LinkProcesses(gameServers);

                registrationAutomation = new RegistrationAutomation(this);

                form.InitializeGameServerPanel(gameServers);

                socketListener = new SocketListener(this, 33333); // 33333
                socketListener.SocketMessageReceived += OnMessageReceive;

                performanceMonitor = new PerformanceMonitor();
                performanceMonitor.OnPerformanceTick += OnPerformanceTick;

                string path = AppDomain.CurrentDomain.BaseDirectory + @"\exceptions.txt";
                if (!File.Exists(path))
                {
                    File.CreateText(path);
                }

                AppDomain.CurrentDomain.UnhandledException += UnhandledException;
            }
            catch (Exception ex) {
                form.Output("INIT ERROR: " + ex.Message);
            }
        }
示例#2
0
        public Server(MainForm form)
        {
            this.form = form;

            try {
                database = new Database(this);

                gameServers = database.GetAllGameServers();
                LinkProcesses(gameServers);

                registrationAutomation = new RegistrationAutomation(this);

                form.InitializeGameServerPanel(gameServers);

                socketListener = new SocketListener(this, 33333); // 33333
                socketListener.SocketMessageReceived += OnMessageReceive;

                performanceMonitor = new PerformanceMonitor();
                performanceMonitor.OnPerformanceTick += OnPerformanceTick;

                string path = AppDomain.CurrentDomain.BaseDirectory + @"\exceptions.txt";
                if(!File.Exists(path)) {
                    File.CreateText(path);
                }

                AppDomain.CurrentDomain.UnhandledException += UnhandledException;
            }
            catch (Exception ex) {
                form.Output("INIT ERROR: " + ex.Message);
            }
        }