Exemple #1
0
        /// <summary>
        /// The start engine.
        /// </summary>
        /// <param name="page">
        /// The game page.
        /// </param>
        /// <param name="settings">
        /// The settings.
        /// </param>
        private void StartEngine(GameTabPage page, Settings settings)
        {
            var engine = new Game(page, settings, Environment.UserName + ++this.gameCounter);
            var peer   = new PhotonPeer(engine, settings.UseTcp);

            ////{
            ////    DebugOut = log.IsDebugEnabled ? DE.Exitgames.Neutron.Client.NPeer.DebugLevel.ALL : DE.Exitgames.Neutron.Client.NPeer.DebugLevel.INFO
            ////};
            if (!this.tabPageRadar.Initialized)
            {
                page.WorldEntered += this.HandleGameWorldEntered;
            }

            engine.Initialize(peer);
            page.Initialize(engine);

            // set focus on game tab
            this.tabControlTabs.SelectedTab = page;
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WorldForm"/> class.
        /// </summary>
        public WorldForm()
        {
            this.gameCounter = 0;

            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_OnUnhandledException;
            Application.ThreadException += Application_OnThreadException;

            this.InitializeComponent();

            this.MouseWheel += this.OnMouseWheel;

            // diagnostics
            this.fiber = new FormFiber(this, new DefaultExecutor());
            this.fiber.Start();
            Settings settings = Program.GetDefaultSettings();

            this.diagnosticsPeer = new PhotonPeer(this, settings.UseTcp);
            this.counterGraph.GraphPane.Title.Text            = "Server Performance";
            this.counterGraph.GraphPane.YAxis.Title.Text      = "Value";
            this.counterGraph.GraphPane.YAxis.Scale.Min       = 0;
            this.counterGraph.GraphPane.XAxis.Title.Text      = "Time";
            this.counterGraph.GraphPane.XAxis.Scale.MajorUnit = DateUnit.Second;
        }
        /// <summary>
        /// The start engine.
        /// </summary>
        /// <param name="page">
        /// The game page.
        /// </param>
        /// <param name="settings">
        /// The settings.
        /// </param>
        private void StartEngine(GameTabPage page, Settings settings)
        {
            var engine = new Game(page, settings, Environment.UserName + ++this.gameCounter);
            var peer = new PhotonPeer(engine, settings.UseTcp);

            ////{
            ////    DebugOut = log.IsDebugEnabled ? DE.Exitgames.Neutron.Client.NPeer.DebugLevel.ALL : DE.Exitgames.Neutron.Client.NPeer.DebugLevel.INFO 
            ////};
            if (!this.tabPageRadar.Initialized)
            {
                page.WorldEntered += this.HandleGameWorldEntered;
            }

            engine.Initialize(peer);
            page.Initialize(engine);

            // set focus on game tab
            this.tabControlTabs.SelectedTab = page;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="WorldForm"/> class.
        /// </summary>
        public WorldForm()
        {
            this.gameCounter = 0;

            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_OnUnhandledException;
            Application.ThreadException += Application_OnThreadException;

            this.InitializeComponent();

            this.MouseWheel += this.OnMouseWheel;

            // diagnostics
            this.fiber = new FormFiber(this, new DefaultExecutor());
            this.fiber.Start();
            Settings settings = Program.GetDefaultSettings();
            this.diagnosticsPeer = new PhotonPeer(this, settings.UseTcp);
            this.counterGraph.GraphPane.Title.Text = "Server Performance";
            this.counterGraph.GraphPane.YAxis.Title.Text = "Value";
            this.counterGraph.GraphPane.YAxis.Scale.Min = 0;
            this.counterGraph.GraphPane.XAxis.Title.Text = "Time";
            this.counterGraph.GraphPane.XAxis.Scale.MajorUnit = DateUnit.Second;
        }