예제 #1
0
    private void InitReconnectionData(ReconnectionData data)
    {
        touziInfo        = data.dice;
        bankerID         = data.bankerID;
        surplusCardCount = data.cardCount;
        laizi            = data.laizi;
        gangPaiState     = data.gangPaiInfo;
        if (laizi != 0)
        {
            gameIsBegin = true;
        }
        SetLaizipi();
        reconnectionData = data;
        currentPlayerID  = data.cardRighter;

        playerCardPlayerSeat = data.playCardPlayerSeat;
        currentCardID        = data.processer_card;

        creatRoomInfo.baseScore = (int)data.score;
        creatRoomInfo.jushu     = (int)data.times;

        ReconnectionProcesserID = data.processer;
        _playersInfo.laizi      = data.laizi;
        if (data.cardRighter == selfOrderIndex)
        {
            selfGameState = SelfState.Can_playCard;
        }
        if (data.laizi != 0)
        {
            _playersInfo.Reconnection(data);
        }
    }
예제 #2
0
        //o
        public void mj_huanghuang_room_info(ArrayList data)
        {
            Hashtable        room_mj_info = (Hashtable)data[0];
            ReconnectionData info         = new ReconnectionData(room_mj_info);

            EventDispatcher.GetInstance().MainEventManager.TriggerEvent <ReconnectionData>(EventId.Sever_Reconnection, info);
        }
예제 #3
0
    /// <summary>
    /// 重连
    /// </summary>
    /// <param name="data"></param>
    public void Reconnection(ReconnectionData data)
    {
        List <PlayerCardInfo> playerCardinfoList = data.PlayerCardinfoList;
        int            index;
        PlayerCardInfo info;

        foreach (PlayerData item in _infoList)
        {
            index = (int)item.dir;
            info  = playerCardinfoList[index - 1];
            if (data.bankerID == index)//如果是庄家则 把第一次翻的癞子皮放到他打过的牌里
            {
                info.playOutArr.Insert(0, GetLaizipi(data.laizi));
            }
            item.SetRevealList(info.pengArr, true, GetLaizipi(data.laizi));
            item.SetRevealList(info.GangArr, false, GetLaizipi(data.laizi));
            item.SetPlayOutList(info.playOutArr, data.laizi);
            if (item.IsSelfData)
            {
                selfPutOutLaiziNum = item.playOutlaiziList.Count;
            }
            item.SetHandList((int)info.handCardNum);//还要后台给吧,前端算有问题
        }
        EventDispatcher.GetInstance().UIFrameWorkEventManager.TriggerEvent <bool>(EventId.UIFrameWork_Reconnection_Updata, data.isHu);
    }
예제 #4
0
    public void RemoveEventListener()
    {
        if (voteState != null)
        {
            voteState.Clear();
        }
        if (selfRoomList != null)
        {
            selfRoomList.Clear();
        }
        gangPaiState = null;
        DisPoseData();
        _reconnectionData             = null;
        reconnectionData              = null;
        _reconnectionSelfHandcardCard = null;
        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <Hashtable>(EventId.OtherJoinRoom, OnOtherJoinRoom);
        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <ArrayList, CreatRoomData>(EventId.SelfJoinRoom, onSelfJoinRoom);
        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <KeyValuePair <string, Int64> >(EventId.PlaySitDown, OnPlayerSitDown);
        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <Int64, Int64, ArrayList>(EventId.Server_HandCard, OnBeginGame);
        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <Int64, Int64>(EventId.ShowLaizi, OnShowLaizi);
        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <Int64>(EventId.Order, OnOrderHandle);
        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <Int64>(EventId.AddOneCard, OnAddOneHandle);
        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <ArrayList>(EventId.Server_HuPai_other_player_card, OnOtherPlayerCards);

        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <Int64>(EventId.Server_draw, OnPlayerDrawCard);
        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <Int64>(EventId.PlayCard, OnPlayPutOutCard);
        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <Int64, Int64>(EventId.Server_PengCard, OnPengCard);
        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <Int64, Int64, Int64>(EventId.Server_GangCard, OnGangCardHandle);
        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <Hashtable>(EventId.Server_GangScore, OnGangScore);
        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <ArrayList, Int64, Int64>(EventId.Server_HuPai, OnHupai);
        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <Hashtable>(EventId.Server_HuScore, OnHuScore);
        EventDispatcher.GetInstance().UIFrameWorkEventManager.RemoveEventListener(EventId.UIFrameWork_Game_liuju, GameLiuJu);
        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <string>(EventId.PlayerExitRoom, OnPlayerExitRoom);
        EventDispatcher.GetInstance().UIFrameWorkEventManager.RemoveEventListener <int, int>(EventId.UIFrameWork_Game_Animation_Playover, OnAnimationPlayover);
        EventDispatcher.GetInstance().UIFrameWorkEventManager.RemoveEventListener(EventId.Server_End_Game, OnEndGame);
        EventDispatcher.GetInstance().UIFrameWorkEventManager.RemoveEventListener(EventId.Server_Disband_Eng_Game, OnDisbandEndGame);
        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <ReconnectionData>(EventId.Sever_Reconnection, OnReconnection);
        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <ArrayList>(EventId.Sever_Reconnection_SelfHandcard, OnReconnectionSelfHandcard);
        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <Int64>(EventId.Sever_Reconnection_selfMopai_Num, OnReconnectionSelfMopaiNum);
        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <Hashtable>(EventId.Server_Room_list, OnChangRoomList);

        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <string, Int64>(EventId.Server_Disband_Game_Vote, OnDisbandgame);
        EventDispatcher.GetInstance().MainEventManager.RemoveEventListener <Hashtable>(EventId.Server_Disband_Room_Vote_list, OnReconnectionDisbandList);
    }
예제 #5
0
 /// <summary>
 /// 断线重连
 /// </summary>
 /// <param name="data"></param>
 private void OnReconnection(ReconnectionData data)
 {
     _reconnectionData = data;
     //  selfGetCardID = _reconnectionData.curr
 }