コード例 #1
0
        public Server()
        {
            _Client           = new Client(new UdpSocket());
            this._LogRecorder = new Utility.LogFileRecorder("Play");

            this._StorageVerifyData = new CustomType.Verify();

            this._Machine = new Utility.StageMachine();
            this._Updater = new Utility.Updater();
        }
コード例 #2
0
        public Server()
        {
            _Provider         = new ConnectProvider(new UdpSocket());
            this._LogRecorder = new Utility.LogFileRecorder("Play");

            this._StorageVerifyData = new CustomType.Verify();

            this._Machine = new Utility.StatusMachine();
            this._Updater = new Utility.Updater();

            _Loop = new System.Threading.Tasks.Task(_Update);
        }
コード例 #3
0
        public Server()
        {
            this._LogRecorder = new Utility.LogFileRecorder("Play");

            this._StorageVerifyData = new CustomType.Verify();

            this._Machine = new Utility.StageMachine();
            this._Updater = new Utility.Updater();

            this._BuildParams();
            this._BuildUser();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: rforsbach/Treu-Structure
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Windows Vista Virtualization Problem FIX
            if (fixVistaVirtualizationError())
                return;
            // End of Windows Vista FIX

            Utility.Updater updater = new Utility.Updater();
            if (updater.Update())
                return;

            System.Threading.Thread.CurrentThread.CurrentUICulture = System.Threading.Thread.CurrentThread.CurrentCulture;

            Splash.Show(3000);
            Model.Model model = Model.Model.Instance;
            Controller.Controller controller = Controller.Controller.Instance;
            View.GraphicViewManager view = View.GraphicViewManager.Instance;
            model.Reset();
            //TestModel(model);

            using (MainFrm frm = new MainFrm())
            {
                frm.Show();

                try
                {
                    view.InitializeGraphics(frm.ScenePanel, frm);

                    controller.MainFrm = frm;

                    if (args.Length > 0)
                        controller.LoadModel(args[0]);

                    //////// TESTS /////////////
                    //TestView(view);
                    //model.AbstractCases.Add(new Canguro.Model.Load.AnalysisCase("aCase1"));
                    //Model.Load.AnalysisCase anc = model.AbstractCases[0] as Model.Load.AnalysisCase;
                    //if (anc != null)
                    //{
                    //    Model.Load.StaticCaseProps props = anc.Properties as Model.Load.StaticCaseProps;
                    //    if (props != null)
                    //    {
                    //        List<Model.Load.StaticCaseFactor> list = props.Loads;
                    //        list.Add(new Canguro.Model.Load.StaticCaseFactor(model.ActiveLoadCase));
                    //        props.Loads = list;
                    //    }
                    //}
                    ////////// END TESTS /////////////
                    Application.Run(frm);
                    //              Model.Model.Instance.Save();
                    controller.Execute("cancel");
                    updater.CancelDownload();
                    updater.InstallUpdate();
                }

            #if DEBUG
                catch (View.NoDirectXSupportException ex)
                {
                    MessageBox.Show(Culture.Get("strDirectXFatalError") + "\n" + ex.ToString(), Culture.Get("strFatalError"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (Microsoft.DirectX.DirectXException ex)
                {
                    MessageBox.Show(Culture.Get("strDirectXFatalError") + "\n" + ex.ToString(), Culture.Get("strFatalError"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (NotSupportedException ex)
                {
                    MessageBox.Show(ex.Message, Culture.Get("strFatalError"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            #else
                catch (View.NoDirectXSupportException ex)
                {
                    MessageBox.Show(Culture.Get("strDirectXFatalError"), Culture.Get("strFatalError"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (Microsoft.DirectX.DirectXException ex)
                {
                    MessageBox.Show(Culture.Get("strDirectXFatalError"), Culture.Get("strFatalError"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (NotSupportedException ex)
                {
                    MessageBox.Show(ex.Message, Culture.Get("strFatalError"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, Culture.Get("strFatalError"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            #endif

            }
        }
コード例 #5
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Windows Vista Virtualization Problem FIX
            if (fixVistaVirtualizationError())
            {
                return;
            }
            // End of Windows Vista FIX

            Utility.Updater updater = new Utility.Updater();
            if (updater.Update())
            {
                return;
            }

            System.Threading.Thread.CurrentThread.CurrentUICulture = System.Threading.Thread.CurrentThread.CurrentCulture;

            Splash.Show(3000);
            Model.Model             model      = Model.Model.Instance;
            Controller.Controller   controller = Controller.Controller.Instance;
            View.GraphicViewManager view       = View.GraphicViewManager.Instance;
            model.Reset();
            //TestModel(model);

            using (MainFrm frm = new MainFrm())
            {
                frm.Show();

                try
                {
                    view.InitializeGraphics(frm.ScenePanel, frm);

                    controller.MainFrm = frm;

                    if (args.Length > 0)
                    {
                        controller.LoadModel(args[0]);
                    }

                    //////// TESTS /////////////
                    //TestView(view);
                    //model.AbstractCases.Add(new Canguro.Model.Load.AnalysisCase("aCase1"));
                    //Model.Load.AnalysisCase anc = model.AbstractCases[0] as Model.Load.AnalysisCase;
                    //if (anc != null)
                    //{
                    //    Model.Load.StaticCaseProps props = anc.Properties as Model.Load.StaticCaseProps;
                    //    if (props != null)
                    //    {
                    //        List<Model.Load.StaticCaseFactor> list = props.Loads;
                    //        list.Add(new Canguro.Model.Load.StaticCaseFactor(model.ActiveLoadCase));
                    //        props.Loads = list;
                    //    }
                    //}
                    ////////// END TESTS /////////////
                    Application.Run(frm);
                    //              Model.Model.Instance.Save();
                    controller.Execute("cancel");
                    updater.CancelDownload();
                    updater.InstallUpdate();
                }

#if DEBUG
                catch (View.NoDirectXSupportException ex)
                {
                    MessageBox.Show(Culture.Get("strDirectXFatalError") + "\n" + ex.ToString(), Culture.Get("strFatalError"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (Microsoft.DirectX.DirectXException ex)
                {
                    MessageBox.Show(Culture.Get("strDirectXFatalError") + "\n" + ex.ToString(), Culture.Get("strFatalError"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (NotSupportedException ex)
                {
                    MessageBox.Show(ex.Message, Culture.Get("strFatalError"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
#else
                catch (View.NoDirectXSupportException ex)
                {
                    MessageBox.Show(Culture.Get("strDirectXFatalError"), Culture.Get("strFatalError"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (Microsoft.DirectX.DirectXException ex)
                {
                    MessageBox.Show(Culture.Get("strDirectXFatalError"), Culture.Get("strFatalError"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (NotSupportedException ex)
                {
                    MessageBox.Show(ex.Message, Culture.Get("strFatalError"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, Culture.Get("strFatalError"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
#endif
            }
        }