Beispiel #1
0
        public ServerStarter()
        {
            GV.InitServer();
            var session = GV.Session;

            session.On("disconnect", () => { OnClose(); });
            GV.MWindow.Hide();
            GV.MWindow.Width  = 0;
            GV.MWindow.Height = 0;
            if (session != null)
            {
                session.On("connectSucess", (d) => { connectionSucesss = true; });
                Thread checker = new Thread(() =>
                {
                    //Got 3 Secons to check if connection was a sucess or not
                    Thread.Sleep(3000);
                    if (!connectionSucesss)
                    {
                        //Server is not running
                        OnClose();
                    }
                    else
                    {
                        //Server Does Run
                        // - Init Login View
                        this.UiChange(() =>
                        {
                            this.ChangeScreen(new LoginControl(), "Login Screen");
                        });
                        this.UiChange(() => { GV.MWindow.Show(); });
                    }
                });
                checker.Start();
            }
        }