示例#1
0
        /// <summary>
        /// 开始匹配
        /// </summary>
        private void OnStartMatch(MobaClient client, int playerId)
        {
            if (playerCache.GetId(client) != playerId)
            {
                return;
            }
            MatchRoom room = matchCache.StartMatch(client, playerId);

            Send(client, OpCode.PlayerCode, OpPlayer.StartMatch, 0, "开始匹配");
            //如果房间满了就开始选人
            if (room.IsFull == true)
            {
                //开始选人
                StartSelectEvent(room.Team1IdList, room.Team2IdList);
                //发起是否进入选人请求
                room.Brocast(OpCode.PlayerCode, OpPlayer.MatchComplete, 0, "是否进入选人界面(10s内)");
                matchCache.DestroyRoom(room);
            }
        }
示例#2
0
 /// <summary>
 /// 开始匹配
 /// </summary>
 /// <param name="client"></param>
 /// <param name="playerId"></param>
 private void onStartMatch(MobaClient client, int playerId)
 {
     //非法操作
     if (playerCache.GetId(client) != playerId)
     {
         return;
     }
     //获取匹配结果
     Room.MatchRoom room = matchCache.StartMatch(client, playerId);
     Send(client, OpCode.PlayerCode, OpPlayer.StartMatch, 0, "开始匹配");
     //如果房间满了 那就开始选人
     if (room.IsFull)
     {
         //通知房间内所有人进入选人界面
         //room.Brocast(OpCode.PlayerCode, OpPlayer.MatchComplete, 1, "开始选人");
         //开始选人
         StartSelectEvent(room.Team1IdList, room.Team2IdList);
         //发起是否进入选人请求
         room.Brocast(OpCode.PlayerCode, OpPlayer.MatchComplete, 0, "是否进入选人房间(10s内)");
         //撕毁房间
         matchCache.DestroyRoom(room);
     }
 }