示例#1
0
        public void Stop()
        {
            lock (Data._syncStop)
            {
                if (GameState != eGameState.LOAD && GameState != eGameState.PLAY)
                {
                    return;
                }

                GSPacketIn pkg = new GSPacketIn((byte)ePackageType.GAME_OVER);
                _processor.OnStopping(this, pkg);

                SendToAll(pkg);

                _gameState = eGameState.OVER;

                if (RoomType == eRoomType.PAIRUP && MatchGame != null)
                {
                    MatchGame.GameState = eGameState.OVER;
                }

                _data.CurrentMap = null;

                //_data._fallItemID.Clear();
                _data.FlagPlayer.Clear();

                foreach (GamePlayer player in _data.GetAllPlayers())
                {
                    //player.UpdateStyle();
                    player.OnGameStop();
                    //player.Out.SendCheckCode();
                }

                _processor.OnStopped(this);

                //if(!_data.killFlag)
                //{
                //    if (MatchGame != null)
                //    {
                //        ShowArk(MatchGame, null);
                //    }
                //    ShowArk(this, null);
                //}

                if (MatchGame != null && !MatchGame.IsTakeOut)
                {
                    ShowArk(MatchGame, null);
                }
                if (!IsTakeOut)
                {
                    ShowArk(this, null);
                }
            }
        }