Example #1
0
        public Form1()
        {
            InitializeComponent();

            bool init = false;

            try
            {
                int result = DB.InitDB();
                AddLoginMessage(string.Format("{0} Users' Status Inited", result));            //初始化用户状态
                init = true;
            }
            catch (Exception e)
            {
                AddLoginMessage("数据库初始化失败");
                AddDebugMessage(string.Format("{0} : {1} {2}", e.Message, e.TargetSite, e.Source));
            }

            if (init)
            {
                hall = new GameHall(this);

                serverThread = new Thread(new ThreadStart(StartListen));
                serverThread.Start();

                AddLoginMessage("Socket Server Started");
            }
        }