コード例 #1
0
 /// <summary>
 /// 取消准备
 /// </summary>
 /// <param name="client"></param>
 /// <param name="roomType"></param>
 private void UnReady(ClientPeer client, int roomType)
 {
     SingleExecute.Instance.Execute(() =>
     {
         if (matchCacheList[roomType].IsMatching(client.Id) == false)
         {
             return;
         }
         MatchRoom room = matchCacheList[roomType].GetRoom(client.Id);
         room.UnReady(client.Id);
         room.Broadcase(OpCode.Match, MatchCode.UnReady_BRO, client.Id);
     });
 }
コード例 #2
0
        private void HandleReady(ClientPeer client, bool ready)
        {
            if (!Sessions.matchSession.IsMatching(client))
            {
                return;
            }

            MatchRoom   room        = Sessions.matchSession.GetRoom(client);
            UserInfoDto userInfoDto = DatabaseManager.CreateUserInfoDto(client.userId);

            if (ready)
            {
                room.Ready(client);
                room.Broadcast(OpCode.match, MatchCode.ReadyBrd, userInfoDto, client);
            }
            else
            {
                room.UnReady(client);
                room.Broadcast(OpCode.match, MatchCode.UnReadyBrd, userInfoDto, client);
            }
        }