public bool SendPackage(CSPkg msg)
        {
            if (!this.connected || this.connector == null)
            {
                return(false);
            }
            int len = 0;

            if (msg.pack(ref this.szSendBuffer, this.nBuffSize, ref len, 0u) != TdrError.ErrorType.TDR_NO_ERROR)
            {
                return(false);
            }
            if (this.initParam.bIsUDP && (msg.stPkgHead.dwMsgID == 1004u || msg.stPkgHead.dwMsgID == 1260u || msg.stPkgHead.dwMsgID == 1036u || msg.stPkgHead.dwMsgID == 1037u))
            {
                return(this.connector.WriteUdpData(this.szSendBuffer, len) == ApolloResult.Success);
            }
            return(this.connector.WriteData(this.szSendBuffer, len) == ApolloResult.Success);
        }
Exemplo n.º 2
0
        public static void Send_Private_Chat(ulong ullUid, uint logicWorldId, string text)
        {
            CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x514);

            msg.stPkgData.stChatReq.stChatMsg.bType = 2;
            msg.stPkgData.stChatReq.stChatMsg.stContent.select(2L);
            msg.stPkgData.stChatReq.stChatMsg.stContent.stPrivate.stTo.ullUid        = ullUid;
            msg.stPkgData.stChatReq.stChatMsg.stContent.stPrivate.stTo.iLogicWorldID = (int)logicWorldId;
            COMDT_FRIEND_INFO gameOrSnsFriend = Singleton <CFriendContoller> .instance.model.GetGameOrSnsFriend(ullUid, logicWorldId);

            if (gameOrSnsFriend != null)
            {
                msg.stPkgData.stChatReq.stChatMsg.stContent.stPrivate.stTo.szName  = gameOrSnsFriend.szUserName;
                msg.stPkgData.stChatReq.stChatMsg.stContent.stPrivate.stTo.dwLevel = gameOrSnsFriend.dwLevel;
            }
            msg.stPkgData.stChatReq.stChatMsg.stContent.stPrivate.szContent = UT.String2Bytes(text);
            Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref msg, false);
        }
Exemplo n.º 3
0
        public static void ReceiveTransDataRenameRsp(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_TRANSDATA_RENAME_RES stTransDataRenameRes = msg.stPkgData.get_stTransDataRenameRes();
            CS_ERRORCODE_DEF           dwResult             = stTransDataRenameRes.dwResult;

            if (dwResult == null)
            {
                Singleton <CUIManager> .GetInstance().CloseForm("UGUI/Form/Common/Form_NameChange.prefab");

                Singleton <CUIManager> .GetInstance().OpenTips("NameChange_Success", true, 1.5f, null, new object[0]);
            }
            else
            {
                Singleton <CNameChangeSystem> .GetInstance().ShowErrorCode(dwResult);
            }
        }
Exemplo n.º 4
0
        public static void OnReviveHeroRsp(CSPkg msg)
        {
            Singleton <BattleLogic> .instance.m_bIsPayStat = false;
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            if ((msg.stPkgData.stPveReviveRsp.iErrCode == 0) && (((msg.stPkgData.stPveReviveRsp.bDifficultType == Singleton <PVEReviveHeros> .instance.CurDifficulType) || (msg.stPkgData.stPveReviveRsp.iLevelID == Singleton <PVEReviveHeros> .instance.CurLevelId)) || (msg.stPkgData.stPveReviveRsp.bReviveNo == Singleton <PVEReviveHeros> .instance.CurReviveNum)))
            {
                ReviveAllHeros();
            }
            else
            {
                string text = Singleton <CTextManager> .instance.GetText("PVE_Revive_Data_Error");

                Singleton <CUIManager> .GetInstance().OpenTips(text, false, 1.5f, null, new object[0]);

                Singleton <PVEReviveHeros> .instance.ReviveHerosFailed();
            }
        }
        public static void On_SCID_SNS_FRIEND_RECALLPOINT(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_CMD_RECALL_FRIEND stFriendRecallRsp = msg.stPkgData.stFriendRecallRsp;

            if (stFriendRecallRsp.dwResult == 0u)
            {
                UT.Check_AddReCallCD(stFriendRecallRsp.stUin, (COM_FRIEND_TYPE)stFriendRecallRsp.bFriendType);
                Singleton <EventRouter> .GetInstance().BroadCastEvent("Friend_FriendList_Refresh");

                Singleton <CUIManager> .GetInstance().OpenTips(UT.GetText("Common_Sns_Tips_10"), false, 1.5f, null, new object[0]);
            }
            else
            {
                Singleton <CUIManager> .GetInstance().OpenTips(UT.ErrorCode_String(stFriendRecallRsp.dwResult), false, 1.5f, null, new object[0]);
            }
        }
Exemplo n.º 6
0
        public static void ON_OBSERVE_FRIEND_RSP(CSPkg msg)
        {
            Singleton <CUIManager> .get_instance().CloseSendMsgAlert();

            if (msg.stPkgData.get_stObserveFriendRsp().iResult == 0)
            {
                if (Singleton <WatchController> .GetInstance().StartObserve(msg.stPkgData.get_stObserveFriendRsp().stTgwinfo))
                {
                    Singleton <CUIManager> .GetInstance().OpenSendMsgAlert(5, enUIEventID.None);
                }
            }
            else
            {
                Singleton <COBSystem> .get_instance().UpdateView();

                Singleton <CUIManager> .get_instance().OpenTips(string.Format("OB_Error_{0}", msg.stPkgData.get_stObserveFriendRsp().iResult), true, 1.5f, null, new object[0]);
            }
        }
Exemplo n.º 7
0
 public void RequestPause(bool isPause)
 {
     if (isPause)
     {
         if (this.CanPause)
         {
             CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(5243u);
             cSPkg.stPkgData.stPauseReq.bType = 1;
             Singleton <NetworkModule> .GetInstance().SendGameMsg(ref cSPkg, 0u);
         }
     }
     else
     {
         CSPkg cSPkg2 = NetworkModule.CreateDefaultCSPKG(5243u);
         cSPkg2.stPkgData.stPauseReq.bType = 2;
         Singleton <NetworkModule> .GetInstance().SendGameMsg(ref cSPkg2, 0u);
     }
 }
Exemplo n.º 8
0
 public void Buy()
 {
     if (this.bCanBuy)
     {
         CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(1113u);
         cSPkg.stPkgData.get_stShopBuyReq().iBuyType    = 5;
         cSPkg.stPkgData.get_stShopBuyReq().iBuySubType = this.CurBuyTime + 1;
         Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref cSPkg, false);
     }
     else if (!base.IsHaveEnoughDianQuan(1))
     {
         Singleton <CUIManager> .GetInstance().OpenTips("没有足够的钻石!", false, 1.5f, null, new object[0]);
     }
     else if (!this.bSkillPointZero)
     {
         Singleton <CUIManager> .GetInstance().OpenTips("当前技能点不为零,不能继续购买!", false, 1.5f, null, new object[0]);
     }
 }
Exemplo n.º 9
0
        public bool SendPackage(CSPkg msg)
        {
            if (!this.connected || this.connector == null)
            {
                return(false);
            }
            int num = 0;

            if (msg.pack(ref this.szSendBuffer, this.nBuffSize, ref num, 0u) != null)
            {
                return(false);
            }
            if (this.initParam.bIsUDP && (msg.stPkgHead.dwMsgID == 1004u || msg.stPkgHead.dwMsgID == 1260u))
            {
                return(this.connector.WriteUdpData(this.szSendBuffer, num) == 0);
            }
            return(this.connector.WriteData(this.szSendBuffer, num) == 0);
        }
Exemplo n.º 10
0
        public static void SendOBServeFriend(COMDT_ACNT_UNIQ uin, int friendType = -1)
        {
            if (Singleton <CMatchingSystem> .GetInstance().IsInMatching)
            {
                Singleton <CUIManager> .GetInstance().OpenTips("PVP_Matching", true, 1.5f, null, new object[0]);

                return;
            }
            CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(5218u);

            if (friendType == -1)
            {
                friendType = (Singleton <CFriendContoller> .GetInstance().model.IsGameFriend(uin.ullUid, uin.dwLogicWorldId) ? 1 : 2);
            }
            cSPkg.stPkgData.stObserveFriendReq.bType        = (byte)friendType;
            cSPkg.stPkgData.stObserveFriendReq.stFriendUniq = uin;
            Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref cSPkg, true);
        }
Exemplo n.º 11
0
        private void RequestRepairFraqBootInfo()
        {
            if (this._maxFrqNo <= this._begFrqNo)
            {
                return;
            }
            CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(1036u);
            CSPKG_REQUESTFRAPBOOTSINGLE stReqFrapBootSingle = cSPkg.stPkgData.stReqFrapBootSingle;

            stReqFrapBootSingle.bNum = 0;
            byte b  = 0;
            byte b2 = 0;

            for (uint num = this._begFrqNo; num < this._maxFrqNo; num += 1u)
            {
                if (this._receiveWindow[(int)((uint)((UIntPtr)this._FrqNoToWinIdx_(num)))] == null)
                {
                    b += 1;
                    if ((int)stReqFrapBootSingle.bNum >= stReqFrapBootSingle.KFrapsNo.Length)
                    {
                        break;
                    }
                    uint[] kFrapsNo = stReqFrapBootSingle.KFrapsNo;
                    CSPKG_REQUESTFRAPBOOTSINGLE cSPKG_REQUESTFRAPBOOTSINGLE = stReqFrapBootSingle;
                    byte bNum;
                    cSPKG_REQUESTFRAPBOOTSINGLE.bNum = (bNum = cSPKG_REQUESTFRAPBOOTSINGLE.bNum) + 1;
                    kFrapsNo[(int)bNum] = num;
                }
                else
                {
                    if (b > b2)
                    {
                        b2 = b;
                    }
                    b = 0;
                }
            }
            if (stReqFrapBootSingle.bNum > 0)
            {
                stReqFrapBootSingle.bFrapDiff = b2;
                stReqFrapBootSingle.bSession  = this._svrSession;
                Singleton <NetworkModule> .GetInstance().SendGameMsg(ref cSPkg, 0u);
            }
        }
        public static void ReceiveRollingMsgNtf(CSPkg msg)
        {
            SCPKG_ROLLINGMSG_NTF stRollingMsgNtf = msg.stPkgData.stRollingMsgNtf;
            int num = Mathf.Min(stRollingMsgNtf.astRollingMsg.Length, (int)stRollingMsgNtf.bMsgCnt);

            for (int i = 0; i < num; i++)
            {
                RollingInfo      rollingInfo      = new RollingInfo();
                CSDT_ROLLING_MSG cSDT_ROLLING_MSG = stRollingMsgNtf.astRollingMsg[i];
                rollingInfo.resetPriorityTime = CRoleInfo.GetCurrentUTCTime();
                rollingInfo.priority          = CRollingSystem.CalculatePriority((COM_ROLLINGMSG_TYPE)cSDT_ROLLING_MSG.bType, cSDT_ROLLING_MSG.bPriority);
                rollingInfo.repeatCount       = CRollingSystem.CalculateRepeatCount(cSDT_ROLLING_MSG.dwStartTime, cSDT_ROLLING_MSG.dwEndTime, cSDT_ROLLING_MSG.wPeriod);
                rollingInfo.content           = Utility.UTF8Convert(cSDT_ROLLING_MSG.szContent, (int)cSDT_ROLLING_MSG.wContentLen);
                bool flag = false;
                ListView <UrlAction> listView = UrlAction.ParseFromText(rollingInfo.content, null);
                if (listView.Count > 0)
                {
                    UrlAction urlAction = listView[0];
                    if (!string.IsNullOrEmpty(urlAction.target) && urlAction.action == UrlAction.Action.openUrl && !string.IsNullOrEmpty(urlAction.url))
                    {
                        rollingInfo.content = urlAction.target;
                        rollingInfo.url     = urlAction.url;
                        flag = true;
                    }
                }
                if (cSDT_ROLLING_MSG.bType == 0)
                {
                    if (flag)
                    {
                        rollingInfo.content = "<color=#fdb900>" + rollingInfo.content + "</color>";
                    }
                    else
                    {
                        rollingInfo.content = "<color=#b5e9ff>" + rollingInfo.content + "</color>";
                    }
                }
                if (cSDT_ROLLING_MSG.bIsChat == 1)
                {
                    Singleton <EventRouter> .GetInstance().BroadCastEvent <string>(EventID.ROLLING_SYSTEM_CHAT_INFO_RECEIVED, rollingInfo.content);
                }
                Singleton <CRollingSystem> .GetInstance().m_rollingInfos.Add(rollingInfo);
            }
            Singleton <CRollingSystem> .GetInstance().StartRolling();
        }
        public static void On_Send_INTIMACY_RELATION_REQUEST(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_RECRUITMENT_REWARD_RSP stRecruitmentRewardRsp = msg.stPkgData.stRecruitmentRewardRsp;
            CFriendRecruit       friendRecruit = Singleton <CFriendContoller> .instance.model.friendRecruit;
            ResRecruitmentReward cfgReward     = friendRecruit.GetCfgReward(stRecruitmentRewardRsp.wRecruitRewardId);

            if (cfgReward.bRewardType == 2)
            {
                friendRecruit.SetBITS((RES_RECRUIMENT_BITS)cfgReward.bRewardBit, true);
            }
            CFriendRecruit.RecruitData recruitData = friendRecruit.GetRecruitData(stRecruitmentRewardRsp.stUin.ullUid, stRecruitmentRewardRsp.stUin.dwLogicWorldId);
            recruitData.SetReward(stRecruitmentRewardRsp.wRecruitRewardId, CFriendRecruit.RewardState.Getted);
            if (friendRecruit.SuperReward.rewardID == stRecruitmentRewardRsp.wRecruitRewardId)
            {
                friendRecruit.SuperReward.state = CFriendRecruit.RewardState.Getted;
            }
        }
Exemplo n.º 14
0
        private void CacheFramesData(CSPkg inFrapMsg)
        {
            int dwBufLen = (int)inFrapMsg.stPkgData.stRecoverFrapRsp.dwBufLen;

            byte[] dst = new byte[dwBufLen];
            Buffer.BlockCopy(inFrapMsg.stPkgData.stRecoverFrapRsp.szBuf, 0, dst, 0, dwBufLen);
            if ((this.nRecvByteSize + dst.Length) > this.nRecvBuffSize)
            {
                Array.Resize <byte>(ref this.szRecvBuffer, this.nRecvByteSize + dst.Length);
                Buffer.BlockCopy(dst, 0, this.szRecvBuffer, this.nRecvByteSize, dst.Length);
                this.nRecvBuffSize = this.nRecvByteSize + dst.Length;
                this.nRecvByteSize = this.nRecvBuffSize;
            }
            else
            {
                Buffer.BlockCopy(dst, 0, this.szRecvBuffer, this.nRecvByteSize, dst.Length);
                this.nRecvByteSize += dst.Length;
            }
        }
Exemplo n.º 15
0
        public static void OnRecieveLimitSkinAdd(CSPkg msg)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            COMDT_HERO_LIMIT_SKIN_LIST stLimitSkinList = msg.stPkgData.get_stLimitSkinAdd().stLimitSkinList;
            int num = 0;

            while ((long)num < (long)((ulong)stLimitSkinList.dwNum))
            {
                COMDT_HERO_LIMIT_SKIN cOMDT_HERO_LIMIT_SKIN = stLimitSkinList.astSkinList[num];
                if (masterRoleInfo.heroExperienceSkinDic.ContainsKey(cOMDT_HERO_LIMIT_SKIN.dwSkinID))
                {
                    uint num2 = masterRoleInfo.heroExperienceSkinDic.get_Item(cOMDT_HERO_LIMIT_SKIN.dwSkinID);
                    masterRoleInfo.heroExperienceSkinDic.set_Item(cOMDT_HERO_LIMIT_SKIN.dwSkinID, cOMDT_HERO_LIMIT_SKIN.dwDeadLine);
                    if (0u < num2 && num2 < masterRoleInfo.heroExperienceSkinDic.get_Item(cOMDT_HERO_LIMIT_SKIN.dwSkinID))
                    {
                        int    experienceHeroOrSkinExtendDays = CHeroInfo.GetExperienceHeroOrSkinExtendDays(masterRoleInfo.heroExperienceSkinDic.get_Item(cOMDT_HERO_LIMIT_SKIN.dwSkinID) - num2);
                        string skinName = CSkinInfo.GetSkinName(cOMDT_HERO_LIMIT_SKIN.dwSkinID);
                        Singleton <CUIManager> .GetInstance().OpenTips("ExpCard_ExtendDays", true, 1f, null, new object[]
                        {
                            skinName,
                            experienceHeroOrSkinExtendDays
                        });
                    }
                }
                else
                {
                    masterRoleInfo.heroExperienceSkinDic.Add(cOMDT_HERO_LIMIT_SKIN.dwSkinID, cOMDT_HERO_LIMIT_SKIN.dwDeadLine);
                    uint heroId;
                    uint skinId;
                    CSkinInfo.ResolveHeroSkin(cOMDT_HERO_LIMIT_SKIN.dwSkinID, out heroId, out skinId);
                    if (!Singleton <CHeroSelectBaseSystem> .get_instance().m_isInHeroSelectState)
                    {
                        CUICommonSystem.ShowNewHeroOrSkin(heroId, skinId, enUIEventID.None, true, 10, false, null, enFormPriority.Priority1, 0u, CHeroInfo.GetExperienceHeroOrSkinValidDays(cOMDT_HERO_LIMIT_SKIN.dwDeadLine));
                    }
                    else if (!Singleton <CHeroSelectBaseSystem> .get_instance().IsMultilMode())
                    {
                        CHeroInfoSystem2.ReqWearHeroSkin(heroId, skinId, true);
                    }
                }
                num++;
            }
        }
Exemplo n.º 16
0
        public static void On_SC_Search_LBS_Rsp(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_CMD_LBS_SEARCH stLbsSearchRsq = msg.stPkgData.stLbsSearchRsq;

            if (stLbsSearchRsq.dwResult == 0)
            {
                Singleton <CFriendContoller> .instance.model.ClearLBSData();

                for (int i = 0; i < stLbsSearchRsq.dwLbsListNum; i++)
                {
                    CSDT_LBS_USER_INFO info = stLbsSearchRsq.astLbsList[i];
                    if ((info != null) && (info.stLbsUserInfo.stUin.ullUid != Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID))
                    {
                        Singleton <CFriendContoller> .instance.model.RemoveLBSUser(info.stLbsUserInfo.stUin.ullUid, info.stLbsUserInfo.stUin.dwLogicWorldId);

                        Singleton <CFriendContoller> .instance.model.AddLBSUser(info);
                    }
                }
                if (stLbsSearchRsq.dwLbsListNum == 0)
                {
                    string text = Singleton <CTextManager> .instance.GetText("LBS_Location_Error");

                    Singleton <CFriendContoller> .instance.model.searchLBSZero = text;
                    if ((Singleton <CFriendContoller> .instance.view != null) && (Singleton <CFriendContoller> .instance.view.ifnoText != null))
                    {
                        Singleton <CFriendContoller> .instance.view.ifnoText.text = text;
                    }
                }
                else
                {
                    Singleton <CFriendContoller> .instance.model.searchLBSZero = string.Empty;
                }
                Singleton <CFriendContoller> .instance.model.SortLBSFriend();

                Singleton <EventRouter> .GetInstance().BroadCastEvent("Friend_LBS_User_Refresh");
            }
            else
            {
                Singleton <CUIManager> .GetInstance().OpenTips(UT.ErrorCode_String(stLbsSearchRsq.dwResult), false, 1.5f, null, new object[0]);
            }
        }
Exemplo n.º 17
0
        public static void On_Send_FriendPower(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_CMD_DONATE_FRIEND_POINT stFriendDonatePointRsp = msg.stPkgData.stFriendDonatePointRsp;

            if (stFriendDonatePointRsp.dwResult == 0)
            {
                UT.Check_AddHeartCD(stFriendDonatePointRsp.stUin, (COM_FRIEND_TYPE)stFriendDonatePointRsp.bFriendType);
                Singleton <EventRouter> .GetInstance().BroadCastEvent("Friend_FriendList_Refresh");

                Singleton <EventRouter> .GetInstance().BroadCastEvent <SCPKG_CMD_DONATE_FRIEND_POINT>("Friend_Send_Coin_Done", stFriendDonatePointRsp);

                if (Singleton <CFriendContoller> .instance.model.IsSnsFriend(stFriendDonatePointRsp.stUin.ullUid, stFriendDonatePointRsp.stUin.dwLogicWorldId))
                {
                    COMDT_FRIEND_INFO info = Singleton <CFriendContoller> .instance.model.GetInfo(CFriendModel.FriendType.SNS, stFriendDonatePointRsp.stUin);

                    if (info != null)
                    {
                        string str = Utility.UTF8Convert(info.szOpenId);
                        if (!string.IsNullOrEmpty(str) && !CFriendModel.IsOnSnsSwitch(info.dwRefuseFriendBits, COM_REFUSE_TYPE.COM_REFUSE_TYPE_DONOTE_AND_REC))
                        {
                            string text = Singleton <CTextManager> .instance.GetText("Common_Sns_Tips_3");

                            string confirmStr = Singleton <CTextManager> .instance.GetText("Common_Sns_Tips_5");

                            string cancelStr = Singleton <CTextManager> .instance.GetText("Common_Sns_Tips_4");

                            stUIEventParams param = new stUIEventParams();
                            param.snsFriendEventParams.openId = str;
                            Singleton <CUIManager> .instance.OpenMessageBoxWithCancel(text, enUIEventID.Friend_Share_SendCoin, enUIEventID.None, param, confirmStr, cancelStr, false);

                            return;
                        }
                    }
                }
                Singleton <CUIManager> .GetInstance().OpenTips(UT.GetText("Friend_Tips_SendHeartOK"), false, 1.5f, null, new object[0]);
            }
            else
            {
                Singleton <CUIManager> .GetInstance().OpenTips(UT.ErrorCode_String(stFriendDonatePointRsp.dwResult), false, 1.5f, null, new object[0]);
            }
        }
 public void PostRecvPackage(CSPkg msg)
 {
     if (msg != null && msg.stPkgHead.dwReserve <= this.curCltPkgSeq)
     {
         int i = 0;
         while (i < this.confirmSendQueue.get_Count())
         {
             CSPkg cSPkg = this.confirmSendQueue.get_Item(i);
             if (cSPkg.stPkgHead.dwReserve > 0u && cSPkg.stPkgHead.dwReserve <= msg.stPkgHead.dwReserve)
             {
                 this.confirmSendQueue.RemoveAt(i);
             }
             else
             {
                 i++;
             }
         }
     }
 }
Exemplo n.º 19
0
        public static void SendInBattleMsg_PreConfig(uint id, COM_INBATTLE_CHAT_TYPE msgType, uint heroID)
        {
            CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x514);

            msg.stPkgData.stChatReq.stChatMsg.bType = 7;
            msg.stPkgData.stChatReq.stChatMsg.stContent.select(7L);
            msg.stPkgData.stChatReq.stChatMsg.stContent.stInBattle.bChatType = (byte)msgType;
            msg.stPkgData.stChatReq.stChatMsg.stContent.stInBattle.stChatInfo.select((long)msgType);
            msg.stPkgData.stChatReq.stChatMsg.stContent.stInBattle.stFrom.dwAcntHeroID = heroID;
            if (msgType == COM_INBATTLE_CHAT_TYPE.COM_INBATTLE_CHATTYPE_SIGNAL)
            {
                msg.stPkgData.stChatReq.stChatMsg.stContent.stInBattle.stChatInfo.stSignalID.dwTextID = id;
            }
            else if (msgType == COM_INBATTLE_CHAT_TYPE.COM_INBATTLE_CHATTYPE_BUBBLE)
            {
                msg.stPkgData.stChatReq.stChatMsg.stContent.stInBattle.stChatInfo.stBubbleID.dwTextID = id;
            }
            Singleton <NetworkModule> .GetInstance().SendGameMsg(ref msg, 0);
        }
Exemplo n.º 20
0
        public static void ReceiveChgTrophyRsp(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            if (msg.stPkgData.stRspAchieveShow.iResult < 0)
            {
                Singleton <CUIManager> .GetInstance().CloseForm("UGUI/Form/System/Achieve/Form_Trophy_Select.prefab");

                Singleton <CUIManager> .GetInstance().OpenTips(Singleton <CTextManager> .GetInstance().GetText("Achievement_Trophy_Select_Err_3"), false, 1.5f, null, new object[0]);
            }
            else
            {
                CTrophySelector instance = Singleton <CTrophySelector> .GetInstance();

                Singleton <CUIManager> .GetInstance().CloseForm("UGUI/Form/System/Achieve/Form_Trophy_Select.prefab");

                Singleton <EventRouter> .GetInstance().BroadCastEvent <byte, CAchieveItem2>(EventID.ACHIEVE_SERY_SELECT_DONE, msg.stPkgData.stRspAchieveShow.bIndex, instance.NewTrophy);
            }
        }
Exemplo n.º 21
0
        public static void ReceiveGetGuildMemberGameStateRsp(CSPkg msg)
        {
            SCPKG_GET_GUILD_MEMBER_GAME_STATE_RSP stGetGuildMemberGameStateRsp = msg.stPkgData.stGetGuildMemberGameStateRsp;
            ListView <GuildMemInfo> allGuildMemberList = Singleton <CInviteSystem> .GetInstance().m_allGuildMemberList;

            for (int i = 0; i < stGetGuildMemberGameStateRsp.iMemberCnt; i++)
            {
                for (int j = 0; j < allGuildMemberList.Count; j++)
                {
                    if (CGuildHelper.IsMemberOnline(allGuildMemberList[j]) && (stGetGuildMemberGameStateRsp.astMemberInfo[i].ullUid == allGuildMemberList[j].stBriefInfo.uulUid))
                    {
                        allGuildMemberList[j].GameState = (COM_ACNT_GAME_STATE)stGetGuildMemberGameStateRsp.astMemberInfo[i].bGameState;
                    }
                }
            }
            Singleton <CInviteSystem> .GetInstance().RefreshGuildMemberPanel();

            Singleton <CInviteSystem> .GetInstance().m_isNeedRefreshGuildMemberPanel = false;
        }
Exemplo n.º 22
0
        public static void onFrapBootInfoMultipleNtf(CSPkg msg)
        {
            SCPKG_FRAPBOOTINFO stFrapBootInfo = msg.stPkgData.stFrapBootInfo;

            Singleton <FrameWindow> .GetInstance()._svrSession = stFrapBootInfo.bSession;

            for (int i = 0; i < (int)stFrapBootInfo.bSpareNum; i++)
            {
                if (FrameWindow.HandleFraqBootSingle(stFrapBootInfo.astSpareFrap[i]))
                {
                    MonoSingleton <Reconnection> .GetInstance().UpdateCachedLen(msg);

                    break;
                }
            }
            Singleton <FrameWindow> .GetInstance().SampleFrameSpare((int)stFrapBootInfo.bSpareNum);

            msg.Release();
        }
Exemplo n.º 23
0
        public void OnTASKSUBMIT_RES(ref CSPkg pkg)
        {
            if (pkg.stPkgData.stSubmitTaskRes.bSubmitResult == 0)
            {
                uint dwTaskID = pkg.stPkgData.stSubmitTaskRes.dwTaskID;
                this._show_task_award(dwTaskID);
                CTask task = this.model.GetTask(dwTaskID);
                if (task != null)
                {
                    task.SetState((CTask.State)pkg.stPkgData.stSubmitTaskRes.bTaskState);
                }
            }
            Singleton <EventRouter> .instance.BroadCastEvent("TaskUpdated");

            if (this.m_taskView != null)
            {
                this.m_taskView.Refresh();
            }
        }
Exemplo n.º 24
0
        public static void onRelaySvrPingMsg(CSPkg msg)
        {
            if (Singleton <FrameSynchr> .instance.bActive && Singleton <FrameSynchr> .instance.bRunning)
            {
                uint num = ((uint)(Time.realtimeSinceStartup * 1000f)) - msg.stPkgData.stRelaySvrPing.dwTime;
                Singleton <FrameSynchr> .instance.m_pingRecords.Add((uint)Mathf.Clamp((float)num, 0f, 1000f));

                FrameSynchr instance = Singleton <FrameSynchr> .instance;
                instance.m_PingIdx++;
                Singleton <FrameSynchr> .instance.m_AvePing = ((Singleton <FrameSynchr> .instance.m_AvePing * (Singleton <FrameSynchr> .instance.m_PingIdx - 1)) + num) / Singleton <FrameSynchr> .instance.m_PingIdx;
                Singleton <FrameSynchr> .instance.m_pingWobble.Add((uint)Mathf.Abs((float)(num - Singleton <FrameSynchr> .instance.m_AvePing)));

                if (num > Singleton <FrameSynchr> .instance.m_MaxPing)
                {
                    Singleton <FrameSynchr> .instance.m_MaxPing = num;
                }
                if (num < Singleton <FrameSynchr> .instance.m_MinPing)
                {
                    Singleton <FrameSynchr> .instance.m_MinPing = num;
                }
                Singleton <FrameSynchr> .instance.GameSvrPing = (((int)num) + Singleton <FrameSynchr> .instance.GameSvrPing) / 2;
                if ((Time.time - Singleton <FrameSynchr> .instance.m_PingTimeBegin) > 5f)
                {
                    Singleton <FrameSynchr> .instance.m_PingTimeBegin = Time.time;
                    if (Singleton <FrameSynchr> .instance.m_LastPing == 0)
                    {
                        Singleton <FrameSynchr> .instance.m_LastPing = num;
                    }
                    if (Math.Abs((long)(Singleton <FrameSynchr> .instance.m_LastPing - num)) > 100L)
                    {
                        FrameSynchr local2 = Singleton <FrameSynchr> .instance;
                        local2.m_Abnormal_PingCount++;
                        Singleton <FrameSynchr> .instance.m_LastPing = num;
                    }
                }
                if ((Singleton <FrameSynchr> .instance.m_pingRecords.Count > 100) && (Singleton <FrameSynchr> .instance.GameSvrPing > 300))
                {
                    RealPing();
                }
                Singleton <FrameSynchr> .instance.PrepareReportPingToBeacon(Singleton <FrameSynchr> .instance.GameSvrPing);
            }
            msg.Release();
        }
Exemplo n.º 25
0
 private void OnGetGreatMatch(CSPkg msg)
 {
     this.OBExpertList.Clear();
     for (int i = 0; i < msg.stPkgData.stGetGreatMatchRsp.dwCount; i++)
     {
         for (int j = 0; j < msg.stPkgData.stGetGreatMatchRsp.astList[i].dwLabelNum; j++)
         {
             stOBExpert item = new stOBExpert {
                 desk       = msg.stPkgData.stGetGreatMatchRsp.astList[i].stDesk,
                 startTime  = msg.stPkgData.stGetGreatMatchRsp.astList[i].dwStartTime,
                 observeNum = msg.stPkgData.stGetGreatMatchRsp.astList[i].dwObserveNum,
                 heroLabel  = msg.stPkgData.stGetGreatMatchRsp.astList[i].astLabel[j]
             };
             this.OBExpertList.Add(item);
         }
     }
     this.OBExpertList.Sort(new Comparison <stOBExpert>(this.SortByObserveNum));
     this.UpdateView();
 }
Exemplo n.º 26
0
 public void Buy()
 {
     if (this.bCanBuy)
     {
         CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x459);
         msg.stPkgData.stShopBuyReq             = new CSPKG_CMD_SHOPBUY();
         msg.stPkgData.stShopBuyReq.iBuyType    = 4;
         msg.stPkgData.stShopBuyReq.iBuySubType = this.CurBuyTime + 1;
         Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref msg, false);
     }
     else if (!base.IsHaveEnoughDianQuan(1))
     {
         CUICommonSystem.OpenDianQuanNotEnoughTip();
     }
     else if (this.willOverMaxAP(1))
     {
         Singleton <CUIManager> .GetInstance().OpenTips("将超过体力最大上限值!", false, 1f, null, new object[0]);
     }
 }
Exemplo n.º 27
0
        public static void SendInBattleMsg_PreConfig(uint id, COM_INBATTLE_CHAT_TYPE msgType, uint heroID)
        {
            CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(1300u);

            cSPkg.stPkgData.get_stChatReq().stChatMsg.bType = 7;
            cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.select(7L);
            cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.get_stInBattle().bChatType = msgType;
            cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.get_stInBattle().stChatInfo.select(msgType);
            cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.get_stInBattle().stFrom.dwAcntHeroID = heroID;
            if (msgType == 1)
            {
                cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.get_stInBattle().stChatInfo.get_stSignalID().dwTextID = id;
            }
            else if (msgType == 2)
            {
                cSPkg.stPkgData.get_stChatReq().stChatMsg.stContent.get_stInBattle().stChatInfo.get_stBubbleID().dwTextID = id;
            }
            Singleton <NetworkModule> .GetInstance().SendGameMsg(ref cSPkg, 0u);
        }
Exemplo n.º 28
0
        public static void OnObserveTipsCome(CSPkg msg)
        {
            InBattleInputChat inputChat = Singleton <InBattleMsgMgr> .get_instance().m_InputChat;

            if (inputChat != null)
            {
                SCPKG_OBTIPS_NTF    stOBTipsNtf = msg.stPkgData.get_stOBTipsNtf();
                COM_OBNUM_TIPS_TYPE bTipsType   = stOBTipsNtf.bTipsType;
                string text        = string.Empty;
                Player playerByUid = Singleton <GamePlayerCenter> .GetInstance().GetPlayerByUid(stOBTipsNtf.ullRecomUid);

                if (playerByUid != null)
                {
                    text = playerByUid.Name;
                }
                InBattleInputChat.InBatChatEntity ent = inputChat.ConstructColorFlagEnt(string.Format(Singleton <CTextManager> .GetInstance().GetText(bTipsType.ToString()), stOBTipsNtf.dwOBNum, text));
                inputChat.Add(ent);
            }
        }
Exemplo n.º 29
0
 public void PostRecvPackage(CSPkg msg)
 {
     if ((msg != null) && (msg.stPkgHead.dwReserve <= this.curCltPkgSeq))
     {
         int index = 0;
         while (index < this.confirmSendQueue.Count)
         {
             CSPkg pkg = this.confirmSendQueue[index];
             if ((pkg.stPkgHead.dwReserve > 0) && (pkg.stPkgHead.dwReserve <= msg.stPkgHead.dwReserve))
             {
                 this.confirmSendQueue.RemoveAt(index);
             }
             else
             {
                 index++;
             }
         }
     }
 }
Exemplo n.º 30
0
        public static void OnRelayStatePick(ref CSPkg msg)
        {
            Singleton <GameStateCtrl> .GetInstance().GotoState("LobbyState");

            CSDT_RECONN_PICKINFO stPickInfo = msg.stPkgData.stReconnGameNtf.stStateData.stPickInfo;

            if (msg.stPkgData.stReconnGameNtf.stStateData.stPickInfo.stDeskInfo.bMapType != 3)
            {
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                masterRoleInfo.SetFreeHeroInfo(stPickInfo.stFreeHero);
                masterRoleInfo.SetFreeHeroSymbol(stPickInfo.stFreeHeroSymbol);
            }
            Singleton <LobbyLogic> .GetInstance().inMultiRoom = true;

            Singleton <CRoomSystem> .GetInstance().UpdateRoomInfoReconnectPick(stPickInfo.stDeskInfo, stPickInfo.astCampInfo);

            Singleton <CHeroSelectSystem> .GetInstance().SetPvpDataByRoomInfo(Singleton <CRoomSystem> .GetInstance().roomInfo, 1);
        }