Beispiel #1
0
 void OnDisable()
 {
     NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.ENull, TestReceveMsg);
     // Remove callback when object goes out of scope
     //当对象超出范围,删除回调。
     Application.RegisterLogCallback(null);
 }
Beispiel #2
0
    private void OnDestroy()
    {
        NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EGUANDAG_ROOM_LEAVE, UpdateLevelRoom);
        NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.ERoomJoin_other_join, UpdateOtherJoin);
        NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.ERoom_other_leave, UpdateOtherLeaveJoin);
        NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.ESendCanReadyGame, UpdateReadyGame);
        NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.ESameIpPlayer, UpdateSameIpPlayer);
        NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EApplyChangeSeat, UpdateApplyChangeSeat);
        NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EAgreeChangeSeat, UpdateAgreeChangeSeat);
        //道具
        NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EGoldNotEnough, UpdateGoldNotEnough);
        NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EUseProp, UseProps);
        //使用表情
        NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EUseEmoticon, UseEmoticon);
        NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.ETalkNotify, UseTalk);
        NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EReconnectRefresh, ReconnectToPlaying);
        NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EDissmisRoomResultSuc, DisRoomResultSuc);
        NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EResetWaitGameView, ResetConnectView);
        NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.ERoomJoin_Suc, ResetRefreshView);     //用于断线重连,刷新等候玩家的数据
        NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EGoldReadySuc, GoldReadySuc);         //金币场准备成功
        NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EGoldOutSuc, GoldOutSuc);             //金币场退出成功

        NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EOnLinePlayer, UpdateOnLinePlayer);   //玩家上线
        NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EOfflinePlayer, UpdateOffLinePlayer); //玩家下线
        StopAllCoroutines();
    }
Beispiel #3
0
    IEnumerator SendGet(string _url)
    {
        WWW getData = new WWW(_url);

        yield return(getData);

#if UNITY_IPHONE || UNITY_STANDALONE_WIN
        if (getData.error != "")
        {
            Debug.LogError(getData.error);
        }
#elif UNITY_ANDROID
        if (getData.error != null)
        {
            Debug.LogError(getData.error);
        }
#endif
        else
        {
            Debug.Log(getData.text);

            var        t    = JsonManager.GetWeChatLoginSucData(getData.text);
            ArgsWeChat args = new ArgsWeChat();
            args.access_token = t.access_token;
            args.openid       = t.openid;
            args.refreshToken = t.refresh_token;
            //Debug.Log(t);
            NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ELoginByWeChatSuc, args);
        }
    }
Beispiel #4
0
    void RoomJoinFAIL(MsgGlobal msg)
    {
        ArgsJoinRoomReason args = new ArgsJoinRoomReason();

        args.reason = EJoinRoomFailReason.ERSYM;
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EJoinRoomFail, args);
    }
Beispiel #5
0
    public void SendReceiveEmail()
    {
        WWWForm form = new WWWForm();

        form.AddField("appId", GlobalData.mAppId);
        form.AddField("pid", PlayerInfo.Instance.mPlayerPid.ToString());
        //   form.AddField("pid", "1430");
        form.AddField("id", emailData.emailId);
        form.AddField("time", TimeUtils.ConvertToTime(DateTime.Now).ToString()); //当前时间戳
        form.AddField("sig", "tobeadded");
        string url = GlobalData.mConstBaseServerUrl + MsgContainer.ServerUrlTitle.Url_ReceiveEmail;

        StartCoroutine(GlobalData.SendPost(url, form, delegate(WWW www)
        {
            Debug.Log("邮件领取结果:" + www.text);
            if (www.text == "success")
            {
                PlayerInfo.Instance.AddRoomCard(int.Parse(mEmailData.rcNum  = mEmailData.rcNum ?? "0"));
                PlayerInfo.Instance.UpdateGold(int.Parse(mEmailData.goldNum = mEmailData.goldNum ?? "0"));

                ArgsReceiveEmail args = new ArgsReceiveEmail();
                args.emailId          = mEmailData.emailId;
                EmailManager.Instance.PlayTween(ref emailData, this.transform.parent.parent.parent);
                HadGet();//整体item的显示的变化
                //领取成功
                NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EGetEmailSuccess, args);
            }
            else
            {
                UIManagers.Instance.EnqueueTip("领取失败");
            }
        }));
    }
Beispiel #6
0
 private void RoomKFBZ(MsgGlobal msg)
 {
     Debug.Log("房卡不足");
     //MemoryStream ms = new MemoryStream(msg.ReadBytes());
     //MsgRoomInfo msg_data_head = Game.Serial.Deserialize(ms, null, typeof(MsgRoomInfo)) as MsgRoomInfo;
     NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EGUANDAN_ROOM_GD_FKBZ);
 }
Beispiel #7
0
    void SendInputInfoToService()
    {   //将手机号和密码发送到服务器
        WWWForm form = new WWWForm();

        form.AddField("appId", "HY_NJ_GD");
        form.AddField("phone", phoneNumInput.text);
        form.AddField("pid", PlayerInfo.Instance.mPlayerPid.ToString());
        form.AddField("code", checkNumInput.text);
        form.AddField("password", passwordInput.text);
        form.AddField("time", TimeUtils.ConvertToTime(System.DateTime.Now).ToString());
        //form.AddField("sig", "tobeadded");//手机标识
        string url = GlobalData.mConstBaseServerUrl + MsgContainer.ServerUrlTitle.Url_BindSubmit;

        StartCoroutine(GlobalData.SendPost(url, form, delegate(WWW www)
        {
            string text = www.text;
            if (text == "OK")
            {
                UIManagers.Instance.EnqueueTip("绑定成功!奖励将通过邮箱发送");
                PlayerInfo.Instance.mPlayerData.phone = phoneNumInput.text;
                NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EUpdatePlayerInfo);
            }
            else
            {
                UIManagers.Instance.EnqueueTip(www.text);
            }
            OnCloseClick(null);
        }));
    }
Beispiel #8
0
    //void RecevEnterGoldNotEnough(MsgGlobal msg)
    //{
    //    Debug.Log("金币不够使用道具");
    //    UIManagers.Instance.EnqueueTip("金币不足");
    //    NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EGoldNotEnough);
    //}

    void RecevGoldEnterSuc(MsgGlobal msg)
    {
        Debug.Log("RecevEnterSuc");


        //思想:Module层控制数据,View层纯显示
        GameManager.Instance.ClearCurGame();

        MsgGuandanRoom data = msg.guandan_room;

        if (data.gold_ready_player != null)
        {
            var playerReadyList = data.gold_ready_player.pid;
            if (playerReadyList != null)
            {
                GoldFiledManager.Instance.UpdateReadyPlayer(playerReadyList);
            }
        }

        if (data.gold_playground.type == (uint)EJoinRoomType.EEnter)
        {
            UIManagers.Instance.EnqueueTip("加入房间成功");
        }
        else
        {
            UIManagers.Instance.EnqueueTip("加入房间成功");
        }

        GoldFiledManager.Instance.UpdateGoldPlayerGroundData(msg.guandan_room.gold_playground);
        RoomInfo.Instance.GetRoomInfo(data.room_info);
        PlayerInfo.Instance.mPlayerData.roomCode = data.room_info.roomCode;
        RoomInfo.Instance.UpdatePlayersDic(data.player_info);
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ERoomJoin_Suc);
    }
Beispiel #9
0
 /// <summary>
 /// 进入房间
 /// </summary>
 public void ExistWaitRoom()
 {
     GameObject.Find("WaitGameView").transform.SetAsLastSibling();
     mIsExistWaitGameView = false;
     //TweenManager.Instance.HomeViewAnimationShow(false);
     NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EUpdateCreateRoomSpr);
 }
Beispiel #10
0
        void TestDebugInLog(string str)
        {
            ArgsMsgTest args = new ArgsMsgTest();

            args.testStr = str;
            NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ENull, args);
        }
Beispiel #11
0
 private void Awake()
 {
     NotificationCenter.Instance().AddEventListener((uint)ENotificationMsgType.ESingleDissRoomApplyResult, UpdatePlayerResult);
     NotificationCenter.Instance().AddEventListener((uint)ENotificationMsgType.EDissmisRoomResultFail, UpdateResultFail);
     //    NotificationCenter.Instance().AddEventListener((uint)ENotificationMsgType.EDissmisRoomResultSuc, UpdateResultSuc);
     NotificationCenter.Instance().AddEventListener((uint)ENotificationMsgType.EReconnectRefresh, UpdateResultFail);
 }
Beispiel #12
0
 private void RemoveNotification()
 {
     NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EReconnectRefresh, RefreshData);
     NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EGoldRefreshStartGame, RefreshData);
     NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EGoldOverBureau, RefreshData);      //单局结算结束
     NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EReconnectRefresh, RefreshAllData); //断线重连
 }
Beispiel #13
0
 void OnDestroy()
 {
     NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EChangeCardSelectStatus, UpdateCardStatus);
     NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.ETouchCardShake, ShakeCard);
     NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EDragDroping, DragDropMoving);
     NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EReleaseDragDrop, ReleaseDragDrop);
 }
Beispiel #14
0
 void OnDestroy()
 {
     // NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.ELoginSucc, UpdateLoginSucc);
     NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.ELoginFail, UpdateLoginfail);
     NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.ELoginByWeChatSuc, UpdateLoginByWeChatSuc);
     NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EResetLogin, ResetLogin);
     NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EHideLogining, HideLogining);
 }
Beispiel #15
0
    void RoomJoinFull(MsgGlobal msg)
    {
        Debug.Log("房间不存在");
        ArgsJoinRoomReason args = new ArgsJoinRoomReason();

        args.reason = EJoinRoomFailReason.EROOM_NULL;
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EJoinRoomFail, args);
    }
Beispiel #16
0
 void OnDestroy()
 {
     Debug.Log("游戏已被强制关闭");
     SDKManager.Instance.yayaLogout();// 呀呀语音退出
     NotificationCenter.Instance().RemoveEventListener((uint)ENotificationMsgType.EBackToLoginScene, BackToLoginScene);
     Resources.UnloadUnusedAssets();
     XLuaInstance.DestroyInstance();
 }
Beispiel #17
0
    void SendDownLoadProgressArgs(int idx, string url, float progress)
    {
        ArgsDownLoadProgress msg = new ArgsDownLoadProgress();

        msg.total    = totalDownKB;
        msg.progress = GetCurKb(idx, progress) / totalDownKB;
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EDownLoadProgress, msg);
    }
Beispiel #18
0
 void OnExitLoginClick(GameObject g)
 {
     AudioManager.Instance.PlayClickBtnAudio();
     ContextManager.Instance.Pop(curContext);//需要先释放掉当前的view
     RoomInfo.Instance.SendExitRoomServer();
     XPlayerPrefs.Instance.mPlayerToken = "";
     NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EBackToLoginScene);
 }
Beispiel #19
0
    void RecevCardTypeChoose(MsgGlobal msg)
    {
        MsgAction         data = msg.action;
        ArgsCanputOutCard args = new ArgsCanputOutCard();

        args.msgCardGroup = data.cardGroup;
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EChooseCardType, args);
    }
Beispiel #20
0
    void ButtonClick(GameObject gm)
    {
        AudioManager.Instance.PlayClickBtnAudio();
        ArgsChangeRoomNumber msg = new ArgsChangeRoomNumber();

        msg.Id = this.Id;
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EInputNumber, msg);
    }
Beispiel #21
0
    /// <summary>
    /// 重置所有牌为非震动
    /// </summary>
    public void SendShakeNormalCards()
    {
        var           list = SelfCardsManager.Instance.GetOwnCardIdList();
        ArgsShakeCard msg  = new ArgsShakeCard();

        msg.mList.AddRange(list);
        msg.isShake = false;
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ETouchCardShake, msg);
    }
Beispiel #22
0
    void SendDownOverArgs()
    {
        Debug.Log("isOver++++" + downLoadTime);
        ArgsDownLoadProgress msg = new ArgsDownLoadProgress();

        msg.total    = totalDownKB;
        msg.progress = 1;
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EDownLoadProgress, msg);
    }
Beispiel #23
0
    void RecevSQDHZWSuc(MsgGlobal msg)
    {
        MsgChangeSeatInfo  data = msg.change_seat_info;
        ArgsChangeSeatInfo args = new ArgsChangeSeatInfo();

        args.applyId = data.apply_player_id;
        args.toId    = data.to_player_id;
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EApplyChangeSeat, args);
    }
Beispiel #24
0
    void NotificaPlayerPut(ulong playerId, ulong lastOperationId, MsgActionType type, bool isYbq)
    {
        ArgsPlayerPut args = new ArgsPlayerPut();

        args.playerId        = playerId;
        args.lastOperationId = lastOperationId;
        args.type            = type;
        args.isYbq           = isYbq;
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EPlayerPlayingStatus, args);
    }
Beispiel #25
0
    void RecevIpConfirm(MsgGlobal msg)
    {
        MsgIpConfirm        data = msg.ip_confirm;
        ArgsIpConfirmPlayer args = new ArgsIpConfirmPlayer();

        Debug.Log("IpConFirm" + args.playerId);
        args.playerId   = (uint)data.player_id;
        args.mPlayerIds = data.pids;
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EIpConfirmNotify, args);
    }
Beispiel #26
0
 void OnDrag(GameObject g, Vector2 delta)
 {
     Debug.Log("OnDrag Id" + singleCard.mId);
     if (_isPressed && SelfCardsManager.Instance.mIsDragDroping)
     {
         ArgsDragDroping args = new ArgsDragDroping();
         args.deltaPosX = delta.x * GlobalData.mDragDrogTouchRate;
         NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EDragDroping, args);
     }
 }
Beispiel #27
0
    //测试用
    public void Test()
    {
        ArgsReceiveEmail args = new ArgsReceiveEmail();

        args.emailId = mEmailData.emailId;
        EmailManager.Instance.PlayTween(ref emailData, transform.parent.parent.parent.parent);
        HadGet();//整体item的显示的变化
        //领取成功
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EGetEmailSuccess, args);
    }
Beispiel #28
0
    private void RoomCreateSuccess(MsgGlobal msg)
    {
        RoomInfo.Instance.mRoomId         = msg.room_id;
        SDKManager.Instance.shareRoomCode = PlayerInfo.Instance.mPlayerData.roomCode;
        Debug.Log("开房成功");
        MsgRoomInfo data = msg.room_info;

        Debug.Log("RoomCode: " + RoomInfo.Instance.mRoomCode.ToString());
        RoomInfo.Instance.GetRoomInfo(data);
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EGUANDAN_ROOM_GD_KF_SUC);
    }
Beispiel #29
0
    void ExecuteTalk(ArgsTalk info)
    {
        ArgsTalk args = new ArgsTalk();

        args.voiceName = info.voiceName;
        args.talkPid   = (uint)info.talkPid;
        SDKManager.Instance.yayaPlay(info.voiceName);

        // 表现谁在说话
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ETalkNotify, args);
    }
Beispiel #30
0
    void RecevRoomRefuse(MsgGlobal msg)
    {
        uint pid = (uint)msg.actionId;

        Debug.Log("RecevRoomApply :" + ">>>pid:" + pid);
        ArgsDismissRoomApplyResult args = new ArgsDismissRoomApplyResult();

        args.playerId = pid;
        args.isAgree  = false;
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ESingleDissRoomApplyResult, args);
    }