Пример #1
0
    /// <summary>
    /// 发送验证码请求登陆
    /// nState = 1登陆 2绑定 3解绑
    /// </summary>
    public void SendCodeApplyLogin(uint ncode, byte nState)
    {
        if (!NetWorkClient.GetInstance().IsSocketConnected)
        {
            HallMain.ConnectLoginServer();
        }

        UMessage           LoginMsg  = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_CHECKINDENTIFYING);
        CheckCodeLogin_Msg msg_Check = new CheckCodeLogin_Msg();

        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            msg_Check.nPlatform = 1;
        }
        else if (Application.platform == RuntimePlatform.Android)
        {
            msg_Check.nPlatform = 2;
        }
        else
        {
            msg_Check.nPlatform = 0;
        }

        msg_Check.nBindOrLogin = nState;
        msg_Check.nCode        = ncode;
        msg_Check.smachinecode = SystemInfo.deviceUniqueIdentifier;

        msg_Check.SetSendData(LoginMsg);

        NetWorkClient.GetInstance().SendMsg(LoginMsg);
    }
Пример #2
0
    /// <summary>
    /// 显示兑换物品历史记录界面
    /// </summary>
    public void ShowExchangeItemRecordPanel()
    {
        if (ExchangeItemPanelGameObject == null)
        {
            LoadExchangeItemPanelResource();
        }
        CurItemData = null;
        UnityEngine.Transform ItemPopTransform    = ExchangeItemPanelGameObject.transform.Find("pop_up");
        UnityEngine.Transform ItemRecordTransform = ItemPopTransform.Find("Exchange_Record");

        ItemRecordTransform.gameObject.SetActive(true);
        ItemPopTransform.gameObject.SetActive(true);
        ExchangeItemPanelGameObject.SetActive(true);

        if (!ExChangeRecordDataFlag)
        {
            ExChangeRecordDataFlag = true;
            //请求兑换记录数据
            UMessage recordMsg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_PLAYERGETTRADEINFO);
            recordMsg.Add(GameMain.hall_.GetPlayerId());
            NetWorkClient.GetInstance().SendMsg(recordMsg);

            CCustomDialog.OpenCustomWaitUI("正在进行兑换记录查询...");
        }
    }
Пример #3
0
    private void GuestLogin()
    {
        UMessage LoginMsg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_PLAYERLOGIN);

        MessageLogin ml_ = new MessageLogin();

        Luancher.IsVChatLogin = false;

        ml_.nUseID = VisitorAccountId;


        ml_.smachinecode = SystemInfo.deviceUniqueIdentifier;
        ml_.sVersion     = GameMain.Instance.GetAppVersion();

        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            ml_.nPlatform = 1;
        }
        else if (Application.platform == RuntimePlatform.Android)
        {
            ml_.nPlatform = 2;
        }
        else
        {
            ml_.nPlatform = 0;
        }
        ml_.bLoadType = 0;
        ml_.SetSendData(LoginMsg);

        NetWorkClient.GetInstance().SendMsg(LoginMsg);
    }
Пример #4
0
    /// <summary>
    /// 请求大师分排行榜数据消息
    /// </summary>
    /// <param name="beginindex">排行榜等级</param>
    public void Ask4RankInfo(short beginindex = 0)
    {
        rankDataPromptUpdateState = true;
        GameKind_Enum currentGameID = (GameKind_Enum)currentgameid;

        if (0 == beginindex)
        {
            if (currentGameID == GameKind_Enum.GameKind_LandLords)
            {
                if (llrMasterList.Count > 0)
                {
                    RankDataPrompt(false);
                    return;
                }
            }
            else if (currentGameID == GameKind_Enum.GameKind_GuanDan)
            {
                if (terMasterList.Count > 0)
                {
                    RankDataPrompt(false);
                    return;
                }
            }
        }

        UMessage ask4RankDataMsg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_APPLYMASTERRANKTOLOGIN);

        ask4RankDataMsg.Add(currentgameid);
        ask4RankDataMsg.Add(beginindex);
        NetWorkClient.GetInstance().SendMsg(ask4RankDataMsg);
    }
Пример #5
0
    /// <summary>
    /// 发送消息到login 获取金钱排行榜
    /// </summary>
    public void SendGetCoinRankData(short nBeginSign = 0)
    {
        UMessage LoginMsg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_PLAYERGETCOINRANK);

        LoginMsg.Add(nBeginSign);
        NetWorkClient.GetInstance().SendMsg(LoginMsg);
    }
Пример #6
0
    //发送加入比赛消息
    public void SendJoinMsg(uint contestid)
    {
        NumberPanel.GetInstance().SetNumberPanelActive(false);

        bool CheckSendState = CheckSendJoinMsg(contestid);

        if (!CheckSendState)
        {
            return;
        }

        if (ContestDataManager.Instance().selfcontestdatas_[contestid].enContestType == ContestType.ContestType_AnyTime)
        {
            UMessage admissionMsg = new UMessage((uint)GameCity.EMSG_ENUM.ContestMsg_PlayerRequestAdmission);

            admissionMsg.Add(GameMain.hall_.GetPlayerId());
            admissionMsg.Add(contestid);

            NetWorkClient.GetInstance().SendMsg(admissionMsg);
        }
        else
        {
            UMessage joinmsg = new UMessage((uint)GameCity.EMSG_ENUM.ContestMsg_PlayerEnroll);
            joinmsg.Add(GameMain.hall_.GetPlayerId());
            joinmsg.Add(contestid);
            NetWorkClient.GetInstance().SendMsg(joinmsg);
        }
    }
Пример #7
0
    public void Ask4MailData()
    {
        UMessage mailmsg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_REQUESTPLAYERMAILINFO);

        mailmsg.Add(GameMain.hall_.GetPlayerId());
        NetWorkClient.GetInstance().SendMsg(mailmsg);
    }
Пример #8
0
    //�������������Ϣ��ť
    private void OnTrumpetSendBtn(EventTriggerType eventtype, object param, PointerEventData eventData)
    {
        if (eventtype == EventTriggerType.PointerClick)
        {
            CustomAudio.GetInstance().PlayCustomAudio(1002);
            PlayerData playerdata = GameMain.hall_.GetPlayerData();
            if (playerdata.GetDiamond() < 5)
            {
                CRollTextUI.Instance.AddVerticalRollText(1501);
                return;
            }

            InputField content  = TrumpetMessageSendUIObj.transform.Find("ImageInputBG/Inputcontent").gameObject.GetComponent <InputField>();
            string     sendtext = content.text;
            if (sendtext.Length == 0)
            {
                CRollTextUI.Instance.AddVerticalRollText(1506);
                return;
            }

            if (sendtext.Length > 30)
            {
                CRollTextUI.Instance.AddVerticalRollText(1503);
                return;
            }

            UMessage trumpetMsg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_CM_SENDHORNTOALL);
            trumpetMsg.Add(GameMain.hall_.GetPlayerId());
            GameCommon.CheckForbiddenWord(ref sendtext, true);
            trumpetMsg.Add(sendtext);
            NetWorkClient.GetInstance().SendMsg(trumpetMsg);

            OpenOrCloseTrumpetUI(false);
        }
    }
Пример #9
0
    /// <summary>
    /// 请求微信登录
    /// </summary>
    private void WeChatAuthLogin()
    {
        UMessage vchatmsg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_PLAYERLOGIN);

        MessageLogin ml_ = new MessageLogin();

        Luancher.IsVChatLogin = true;
        ml_.nUseID            = VisitorAccountId;
        ml_.smachinecode      = SystemInfo.deviceUniqueIdentifier;
        ml_.sVersion          = GameMain.Instance.GetAppVersion();

        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            ml_.nPlatform = 1;
        }
        else if (Application.platform == RuntimePlatform.Android)
        {
            ml_.nPlatform = 2;
        }
        else
        {
            ml_.nPlatform = 0;
        }
        vchatmsg.Add(ml_.nUseID);
        vchatmsg.Add(ml_.smachinecode);
        vchatmsg.Add(ml_.sVersion);
        vchatmsg.Add(ml_.nPlatform);
        vchatmsg.Add((byte)2);  //登陆方式标记 1 运营渠道 2 微信
        vchatmsg.Add(CWechatUserAuth.GetInstance().GetUserUnionId());
        vchatmsg.Add(CWechatUserAuth.GetInstance().GetUserHeadImgUrl());
        vchatmsg.Add(CWechatUserAuth.GetInstance().GetUserNickname());
        vchatmsg.Add(CWechatUserAuth.GetInstance().GetUserSex());
        NetWorkClient.GetInstance().SendMsg(vchatmsg);
    }
Пример #10
0
    void OnClickGift()
    {
        UMessage msg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_GETWEEKOROLDREWORD);

        msg.Add((byte)2);
        msg.Add(GameMain.hall_.GetPlayerId());
        NetWorkClient.GetInstance().SendMsg(msg);
    }
Пример #11
0
    //发送购买请求
    private void SendBuyReq(uint itemid, PayPlatform payPlatform = PayPlatform.none)
    {
        UMessage buyMsg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_PLAYER_REQESTBUY);

        buyMsg.Add(GetPlayerId());
        buyMsg.Add(itemid);
        buyMsg.Add((byte)payPlatform);
        NetWorkClient.GetInstance().SendMsg(buyMsg);
    }
Пример #12
0
    //创建比赛
    private void OnCreateContest()
    {
        CustomAudio.GetInstance().PlayCustomAudio(1002);

        if (selfcreateNumber_ >= 10)
        {
            CCustomDialog.OpenCustomConfirmUI(1651);
            return;
        }

        byte gameid = SelfContestDataManager.instance().gameid;
        int  power  = SelfContestDataManager.instance().selfcontestcsvs[gameid].datas[0];
        int  level  = SelfContestDataManager.instance().selfcontestcsvs[gameid].datas[playtimesindex_];

        int pay4appointment = power * level;

        if (GameMain.hall_.GetPlayerData().GetDiamond() + GameMain.hall_.GetPlayerData().GetCoin() < pay4appointment)
        {
            CCustomDialog.OpenCustomConfirmUI(1501);
            return;
        }

        UMessage createContestDataMsg = new UMessage((uint)GameCity.EMSG_ENUM.Contestmsg_PlayerCreateContestRequest);

        createContestDataMsg.Add(GameMain.hall_.GetPlayerId());
        createContestDataMsg.Add(SelfContestDataManager.instance().gamedataid);
        createContestDataMsg.Add(scr_.playernumber);
        createContestDataMsg.Add(scr_.cost);
        createContestDataMsg.Add(scr_.precontest);
        createContestDataMsg.Add(scr_.finalcontest);

        Debug.Log(" 比赛游戏:" + SelfContestDataManager.instance().gamedataid + " 比赛人数:" + scr_.playernumber + " 报名费:" + scr_.cost + "预赛场数:" + scr_.precontest + " 决赛场数" + scr_.finalcontest);

        if (rulepanel2_ == null)
        {
            createContestDataMsg.Add((uint)0);
        }
        else
        {
            if (!rulepanel2_.activeSelf)
            {
                createContestDataMsg.Add((uint)0);
            }
            else
            {
                createContestDataMsg.Add(scr_.timeseconds);
            }
        }

        NetWorkClient.GetInstance().SendMsg(createContestDataMsg);

        UnityEngine.Transform groupTransform = rulepanel1_ ? rulepanel1_.transform : rulepanel2_.transform;
        groupTransform.Find("Right/ImageBG/Button_chuangjian").GetComponent <Button>().interactable   = false;
        groupTransform.Find("Right/ImageBG/Button_chuangjian_0").GetComponent <Button>().interactable = false;
    }
Пример #13
0
    void RequestAnnouncement()
    {
        if (!NeedUpdate)
        {
            return;
        }

        UMessage msg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_APPLYANNOUNCEMENTDATA);

        NetWorkClient.GetInstance().SendMsg(msg);
    }
Пример #14
0
    void OnClickSign()
    {
        CustomAudio.GetInstance().PlayCustomAudio(1002);

        m_SignBtn.interactable = false;

        UMessage msg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_GETWEEKOROLDREWORD);

        msg.Add((byte)1);
        msg.Add(GameMain.hall_.GetPlayerId());
        NetWorkClient.GetInstance().SendMsg(msg);
    }
Пример #15
0
    /// <summary>
    /// 获取验证码
    /// </summary>
    void OnBtn_GetCode(EventTriggerType eventtype, object button, PointerEventData eventData)
    {
        if (eventtype == EventTriggerType.PointerClick)
        {
            CustomAudio.GetInstance().PlayCustomAudio(1002);

            if (CanvasObj == null)
            {
                CanvasObj = GameObject.Find("Canvas/Root");
            }

            InputField PhonePanel = CanvasObj.transform.Find("Login").Find("Panel_PhoneLogin")
                                    .Find("InputField_PhoneNum").gameObject.GetComponent <InputField>();

            long phonenum = 0;
            if (!long.TryParse(PhonePanel.text, out phonenum))
            {
                CCustomDialog.OpenCustomConfirmUI(1003);
                return;
            }

            if (!GameCommon.CheckPhoneIsAble(PhonePanel.text))
            {
                CCustomDialog.OpenCustomConfirmUI(1003);
                return;
            }

            if (phonenum > 0)
            {
                if (!NetWorkClient.GetInstance().IsSocketConnected)
                {
                    HallMain.ConnectLoginServer();
                }
                SendApplyGetCode(phonenum, 1);

                //if(MobileCodeTimer == null)
                MobileCodeTimer = new CTimerPersecondCall(60f, UpdataGetCodeBtnText);
                xTimeManger.Instance.RegisterTimer(MobileCodeTimer);

                GameObject PhoneLogin = CanvasObj.transform.Find("Login").Find("Panel_PhoneLogin").gameObject;
                if (null != PhoneLogin)
                {
                    Button btn    = PhoneLogin.transform.Find("Button_GetCode").gameObject.GetComponent <Button>();
                    Image  btnimg = PhoneLogin.transform.Find("Button_GetCode").gameObject.GetComponent <Image>();
                    btn.interactable     = false;
                    btnimg.raycastTarget = false;

                    Text strCode = PhoneLogin.transform.Find("Button_GetCode").Find("Text_GetCode").gameObject.GetComponent <Text>();
                    strCode.text = "60S可重新获取";
                }
            }
        }
    }
Пример #16
0
    public void Ask4SelfContestList()
    {
        UMessage ask4ContestDataMsg = new UMessage((uint)GameCity.EMSG_ENUM.ContestMsg_RequestContestInfo);

        ask4ContestDataMsg.Add((byte)2);

        NetWorkClient.GetInstance().SendMsg(ask4ContestDataMsg);
        if (GameMain.hall_.contest != null)
        {
            GameMain.hall_.contest.UpdateContestButtonState(2);
            GameMain.hall_.contest.ResetRefreshContestTime();
        }
    }
Пример #17
0
 //购买完成后发送凭据给服务器验证数据
 public static bool SendBuyReceiptToServer(PayPlatform payplatform, string receipt)
 {
     //if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         UMessage buyMsg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_PLAYER_BUYVERIFY);
         buyMsg.Add(GameMain.hall_.GetPlayerId());
         buyMsg.Add(GameMain.hall_.GetPlayer().GetPlayerBuyingItemId());
         buyMsg.Add((byte)payplatform);
         buyMsg.Add(receipt);
         NetWorkClient.GetInstance().SendMsg(buyMsg);
     }
     return(true);
 }
Пример #18
0
    void OnClickCDKey()
    {
        Transform  tfm   = OldPlayerTfm.Find("ImageBG/cdkey/InputField");
        InputField field = tfm.GetComponent <InputField>();

        if (field.text.Length != 6)
        {
            CCustomDialog.OpenCustomConfirmUI(1402);
            return;
        }
        UMessage msg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_CM_PLAYERAPPLYBINDINVITE);

        msg.Add(GameMain.hall_.GetPlayerId());
        msg.Add(field.text);
        NetWorkClient.GetInstance().SendMsg(msg);
    }
Пример #19
0
    /// <summary>
    /// 请求发送验证码
    /// </summary>
    public void SendApplyGetCode(long nPhoneNum, byte nState)
    {
        if (!NetWorkClient.GetInstance().IsSocketConnected)
        {
            HallMain.ConnectLoginServer();
        }

        UMessage        LoginMsg  = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_MOBILELOGIN);
        MobileLogin_Msg msg_login = new MobileLogin_Msg();

        msg_login.nState     = nState;
        msg_login.nMobileNum = nPhoneNum;
        msg_login.SetSendData(LoginMsg);

        NetWorkClient.GetInstance().SendMsg(LoginMsg);
    }
Пример #20
0
    /// <summary>
    /// 请求冠军排行榜数据
    /// </summary>
    void Ask4ChampionData()
    {
        rankDataPromptUpdateState = true;
        if (championList.Count > 0 && !isask4championdata)
        {
            RankDataPrompt(false);
            return;
        }

        isask4championdata = false;
        UMessage ask4ChampionDataMsg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_APPLYCONTESTCHAMPIONINFO);

        ask4ChampionDataMsg.Add(currentChampionBeginIndex);

        NetWorkClient.GetInstance().SendMsg(ask4ChampionDataMsg);
    }
Пример #21
0
    //最大红包事件
    private void OnDiamondOKClickEvent()
    {
        if (DiamondOkButton == null)
        {
            return;
        }
        DiamondOkButton.interactable = false;
        CustomAudio.GetInstance().PlayCustomAudio(1002);

        UMessage DiamondMsg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_CashToDiamond);

        DiamondMsg.Add(GameMain.hall_.GetPlayerId());
        uint valueNum = 0;

        uint.TryParse(RedBagInputField.text, out valueNum);
        DiamondMsg.Add(valueNum);
        NetWorkClient.GetInstance().SendMsg(DiamondMsg);
    }
Пример #22
0
    //发送购买请求(奖券兑换京东卡,手机充值卡)
    private void SendBuyReq(uint itemid, string consigneePhone, string consigneeName, string consigneeAddr)
    {
        UMessage buyMsg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_PLAYER_REQESTBUY);

        buyMsg.Add(GetPlayerId());
        buyMsg.Add(itemid);
        buyMsg.Add((byte)0);
        buyMsg.Add(consigneePhone);
        if (!string.IsNullOrEmpty(consigneeName))
        {
            buyMsg.Add(consigneeName);
        }
        if (!string.IsNullOrEmpty(consigneeAddr))
        {
            buyMsg.Add(consigneeAddr);
        }
        NetWorkClient.GetInstance().SendMsg(buyMsg);
    }
Пример #23
0
    bool BackGateSerIpPort(uint _msgType, UMessage _ms)
    {
        byte nState = _ms.ReadByte();

        if (nState > 0)
        {
            string sip   = _ms.ReadString();
            int    nPort = _ms.ReadInt();

            Debug.Log("Get gateSer Ip:" + sip + ",Port:" + nPort);

            NetWorkClient.GetInstance().CloseNetwork();

            if (NetWorkClient.GetInstance().InitNetWork(sip, nPort))
            {
                bHavedGetGateServr = true;
                if (enLoginType == LoginType.LoginType_Guest)
                {
                    GuestLogin();
                }
                else if (enLoginType == LoginType.LoginType_Wechat)
                {
                    WeChatAuthLogin();
                }
                else if (enLoginType == LoginType.LoginTyee_WechatQRCode)
                {
                    UMessage ReqConnIdMsg = new UMessage((uint)GameCity.EMSG_ENUM.CCGateMsg_PlayerReqConnIdForWxQR);
                    NetWorkClient.GetInstance().SendMsg(ReqConnIdMsg);
                }
            }
            else
            {
                Debug.Log("Can not connect gateser!");
            }
        }
        else
        {
            Debug.Log("Can not get gateser ip and port!");
        }

        return(true);
    }
Пример #24
0
    private void OnGetGoods(EventTriggerType eventtype, object button, PointerEventData eventData)
    {
        if (eventtype == EventTriggerType.PointerClick && m_MailinfoTransform != null)
        {
            Button getbtn = m_MailinfoTransform.Find("ImageBG/Button_lingqu").GetComponent <Button>();

            if (!getbtn.interactable)
            {
                return;
            }

            CustomAudio.GetInstance().PlayCustomAudio(1002);

            uint     key        = (uint)button;
            UMessage getitemmsg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_APPLAYGETMAILREWORDDATA);
            getitemmsg.Add(GameMain.hall_.GetPlayerId());
            getitemmsg.Add(key);
            NetWorkClient.GetInstance().SendMsg(getitemmsg);

            getbtn.interactable = false;
        }
    }
Пример #25
0
    /// <summary>
    /// unionid码登陆
    /// </summary>
    /// <param name="unionid"></param>
    private void UnionIdLogin(string unionid)
    {
        if (!NetWorkClient.GetInstance().IsSocketConnected)
        {
            HallMain.ConnectLoginServer();
        }
        CCustomDialog.OpenCustomWaitUI(1008);

        UMessage unionLoginMsg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_PLAYERLOGIN);

        MessageLogin ml_ = new MessageLogin();

        ml_.smachinecode = SystemInfo.deviceUniqueIdentifier;
        ml_.sVersion     = GameMain.Instance.GetAppVersion();

        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            ml_.nPlatform = 1;
        }
        else if (Application.platform == RuntimePlatform.Android)
        {
            ml_.nPlatform = 2;
        }
        else
        {
            ml_.nPlatform = 0;
        }
        unionLoginMsg.Add((int)0);
        unionLoginMsg.Add(ml_.smachinecode);
        unionLoginMsg.Add(ml_.sVersion);
        unionLoginMsg.Add(ml_.nPlatform);
        unionLoginMsg.Add((byte)1);
        unionLoginMsg.Add(unionid);
        //unionLoginMsg.Add();
        //unionLoginMsg.Add(CWechatUserAuth.GetInstance().GetUserNickname());

        NetWorkClient.GetInstance().SendMsg(unionLoginMsg);
    }
Пример #26
0
    /// <summary>
    /// 请求比赛排行数据
    /// </summary>
    /// <param name="StartIndex"></param>
    /// <param name="EndIndex"></param>
    void RequestContestRankData(ushort StartIndex, ushort EndIndex)
    {
        ushort _StartIndex = StartIndex, _EndIndex = EndIndex;

        if (ContestRankingDataDictionary.ContainsKey(m_ContestID))
        {
            bool State = true;
            while (State && _StartIndex <= _EndIndex)
            {
                State = false;
                if (ContestRankingDataDictionary[m_ContestID].ContainsKey(_StartIndex))
                {
                    ++_StartIndex;
                    State = true;
                }
                if (ContestRankingDataDictionary[m_ContestID].ContainsKey(_EndIndex))
                {
                    --_EndIndex;
                    State = true;
                }
            }
        }
        if (_StartIndex <= _EndIndex)
        {
            RightChessScrolllRect.vertical = false;
            CCustomDialog.OpenCustomWaitUI("正在加载数据...");
            UMessage msg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_ReqContestRankData);
            msg.Add(GameMain.hall_.GetPlayerId());
            msg.Add(m_ContestID);
            msg.Add(_StartIndex);
            msg.Add(_EndIndex);
            NetWorkClient.GetInstance().SendMsg(msg);
        }
        else
        {
            RefreshGameContestRankingPlayerPanel(StartIndex, EndIndex);
        }
    }
Пример #27
0
    /// <summary>
    /// 请求登陆
    /// </summary>
    public void RequestLogin(LoginType logintype = LoginType.LoginType_Guest)
    {
        if (logintype != LoginType.LoginType_LastOne)
        {
            enLoginType = logintype;
        }

        CCustomDialog.OpenCustomWaitUI(1008);
        if (!NetWorkClient.GetInstance().IsSocketConnected)
        {
            if (!HallMain.ConnectLoginServer())
            {
                if (LoginNetReconnectTimer == null)
                {
                    LoginNetReconnectTimer = new CTimerCirculateCall(3.0f, LoginNetReconnectCallBack);
                }
                xTimeManger.Instance.RegisterTimer(LoginNetReconnectTimer);
                return;
            }
        }

        if (bHavedGetGateServr)
        {
            if (enLoginType == LoginType.LoginType_Guest)
            {
                GuestLogin();
            }
            else if (enLoginType == LoginType.LoginType_Wechat)
            {
                WeChatAuthLogin();
            }
            else if (enLoginType == LoginType.LoginTyee_WechatQRCode)
            {
                WeChatAuthLogin();
            }
        }
    }
Пример #28
0
    /// <summary>
    /// 登陆成功处理
    /// </summary>
    /// <param name="_msgType"></param>
    /// <param name="_ms"></param>
    /// <returns></returns>
    bool LoginSuccess(uint _msgType, UMessage _ms)
    {
        PlayerData playerdata        = GameMain.hall_.GetPlayerData();
        uint       lastLoginPlayerId = playerdata.GetPlayerID();

        playerdata.ReadPlayerData(_ms, ref CRankUI.Instance.m_fLeftCoinRankTime);
        //检测是否切换角色了
        if (lastLoginPlayerId != 0 && lastLoginPlayerId != playerdata.GetPlayerID())
        {
        }

        GameMain.hall_.IntelentType = Application.internetReachability;
        WriteAccountConfig();

        //GameMain.hall_.SendGetCoinRankData();

        //m_bIsSendMobileNum = false;
        CCustomDialog.CloseCustomWaitUI();
        GameMain.hall_.AfterLogin();


#if ScFish
        GameMain.hall_.OnClickRoomIconBtn((byte)GameKind_Enum.GameKind_Fishing, 1);
        return(true);
#endif


        //GameMain.hall_.LoadHallResource();
        if (playerdata.nGameMode_Before >= 0)
        {
            Debug.Log("断线重连GameId:" + playerdata.nGameKind_Before + ",GameMode:" + playerdata.nGameMode_Before);
            string        strSign           = string.Empty;
            GameKind_Enum CurbeforeGameKind = (GameKind_Enum)playerdata.nGameKind_Before;
            if (playerdata.nGameMode_Before == 0)
            {
                CurbeforeGameKind = (GameKind_Enum)(Mathf.Log(playerdata.nGameKind_Before, 2));
                for (GameKind_Enum gameKind = GameKind_Enum.GameKind_CarPort; gameKind < GameKind_Enum.GameKind_Max; ++gameKind)
                {
                    if (gameKind != GameKind_Enum.GameKind_LandLords && gameKind != GameKind_Enum.GameKind_Mahjong &&
                        gameKind != GameKind_Enum.GameKind_GuanDan && gameKind != GameKind_Enum.GameKind_YcMahjong &&
                        gameKind != GameKind_Enum.GameKind_CzMahjong && gameKind != GameKind_Enum.GameKind_GouJi &&
                        gameKind != GameKind_Enum.GameKind_HongZhong && gameKind != GameKind_Enum.GameKind_Answer &&
                        gameKind != GameKind_Enum.GameKind_Chess)
                    {
                        if (GameKind.HasFlag((int)gameKind, (int)playerdata.nGameKind_Before))
                        {
                            GameData gamedata = CCsvDataManager.Instance.GameDataMgr.GetGameData((byte)CurbeforeGameKind);
                            if (gamedata != null)
                            {
                                strSign += gamedata.GameName;
                            }
                            else
                            {
                                strSign += "未知游戏";
                            }
                        }
                    }
                }
            }

            if (!string.IsNullOrEmpty(strSign))
            {
                CCustomDialog.OpenCustomWaitUI(2014, strSign);
            }
            else
            {
                if (GameMain.hall_.contestui_)
                {
                    GameMain.hall_.contestui_.SetActive(false);
                }
                GameMain.hall_.ReconnectLoadGame(CurbeforeGameKind, (GameTye_Enum)playerdata.nGameMode_Before);
            }
        }
        else
        {
            if (Application.platform == RuntimePlatform.Android)
            {
#if UNITY_ANDROID && !UNITY_EDITOR
                AlipayWeChatPay.GetAndroidActivity().Call("GetGameRoomID");
#endif
            }
        }

        GameMain.hall_.ReconnectGameServer();

        UMessage activemsg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_GETTODAYREDBAGINFO);
        activemsg.Add(GameMain.hall_.GetPlayerId());
        NetWorkClient.GetInstance().SendMsg(activemsg);

        BagDataManager.GetBagDataInstance();
        if (GameMain.hall_.GetPlayerData().itemNumber > 0)
        {
            UMessage bagmsg = new UMessage((uint)GameCity.EMSG_ENUM.CrazyCityMsg_REQUESTPLAYERPACKETINFO);
            bagmsg.Add(GameMain.hall_.GetPlayerId());
            NetWorkClient.GetInstance().SendMsg(bagmsg);
        }

        PlayerInfoUI.Instance.Ask4PlayerTotalData();

        return(true);
    }