예제 #1
0
        protected override void DoUpdate(SAMTime gameTime, InputState istate)
        {
            _server.Update(gameTime, istate);

            if (_server.Mode == SAMNetworkConnection.ServerMode.InLobby)
            {
                byte[] binData = _server.GetLobbySyncData();
                _server.StartLobbySync(binData);
            }

            if (_server.Mode == SAMNetworkConnection.ServerMode.InGame)
            {
                _doNotStop = true;
                MainGame.Inst.SetMultiplayerServerLevelScreen(Levels.LEVELS[_server.LevelID], _server.Speed, _server.MusicIndex, _server);
            }

            if (_server.Mode == SAMNetworkConnection.ServerMode.Error)
            {
                Owner.HUD.ShowToast(null, L10NImpl.FormatNetworkErrorMessage(_server.Error, _server.ErrorData), 32, FlatColors.Flamingo, FlatColors.Foreground, 7f);
                MainGame.Inst.SetOverworldScreen();
            }

            if (_server.Mode == SAMNetworkConnection.ServerMode.Stopped)
            {
                Remove();
                MainGame.Inst.SetOverworldScreen();
            }

            UpdateHostData();
        }
예제 #2
0
        protected override void DoUpdate(SAMTime gameTime, InputState istate)
        {
            if (!Alive)
            {
                return;
            }

            _server.Update(gameTime, istate);

            if (_server.Mode == SAMNetworkConnection.ServerMode.InLobby)
            {
                _doNotStop = true;
                Remove();
                Owner.HUD.AddModal(new MultiplayerServerLobbyPanel(_server), true, 0.5f);
            }

            if (_server.Mode == SAMNetworkConnection.ServerMode.Error)
            {
                Remove();

                Owner.HUD.ShowToast(null, L10NImplHelper.FormatNetworkErrorMessage(_server.Error, _server.ErrorData), 32, FlatColors.Flamingo, FlatColors.Foreground, 7f);
            }

            if (_server.Mode == SAMNetworkConnection.ServerMode.Stopped)
            {
                Remove();
            }
        }
        protected override void DoUpdate(SAMTime gameTime, InputState istate)
        {
            _server.Update(gameTime, istate);

            _btnStart.BackgroundNormal = _btnStart.BackgroundNormal.WithColor(ColorMath.Blend(FlatColors.Emerald, FlatColors.GreenSea, FloatMath.PercSin(gameTime.TotalElapsedSeconds * 5)));


            if (_server.Mode == SAMNetworkConnection.ServerMode.Error)
            {
                Remove();

                Owner.HUD.ShowToast(null, L10NImplHelper.FormatNetworkErrorMessage(_server.Error, _server.ErrorData), 32, FlatColors.Flamingo, FlatColors.Foreground, 7f);
            }

            if (_server.Mode == SAMNetworkConnection.ServerMode.Stopped)
            {
                Remove();
            }

            if (_server.Mode == SAMNetworkConnection.ServerMode.InLobby && _server.SessionCount == _server.SessionCapacity)
            {
                _btnStart.IsVisible = true;
            }

            if (_server.Mode == SAMNetworkConnection.ServerMode.InGame)
            {
                MainGame.Inst.SetMultiplayerServerLevelScreen(Levels.LEVELS[_server.LevelID], _server.Speed, _server.MusicIndex, _server);
            }
        }
예제 #4
0
        protected override void OnUpdate(SAMTime gameTime, InputState istate)
        {
            base.OnUpdate(gameTime, istate);

#if DEBUG
            DebugUtils.TIMING_NETWORK.Start();
            _server.Update(gameTime, istate);
            DebugUtils.TIMING_NETWORK.Stop();
#else
            _server.Update(gameTime, istate);
#endif

            if (_server.Mode == SAMNetworkConnection.ServerMode.Error)
            {
                HUD.ShowToast("SCRNSS::ERR", L10NImpl.FormatNetworkErrorMessage(_server.Error, _server.ErrorData), 32, FlatColors.Flamingo, FlatColors.Foreground, 7f);

                MainGame.Inst.SetOverworldScreen();
            }
        }