Exemplo n.º 1
0
        protected override void Run(Gamer gamer, Actor_GamerReady_Landlords message)
        {
            LandlordsComponent landordsMatchComponent = Game.Scene.GetComponent <LandlordsComponent>();
            LandlordsRoom      room = landordsMatchComponent.GetWaitingRoom(gamer);

            if (room != null)
            {
                //找到玩家的座位顺序 设置其准备状态为真
                int seatIndex = room.GetGamerSeat(gamer.UserID);
                if (seatIndex >= 0)
                {
                    room.isReadys[seatIndex] = true;
                    //广播通知全房间玩家
                    room.Broadcast(new Actor_GamerReady_Landlords()
                    {
                        UserID = gamer.UserID
                    });
                    //检测开始游戏
                    room.CheckGameStart();
                }
                else
                {
                    Log.Error("玩家不在正确的座位上");
                }
            }
        }