Example #1
0
        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 == 0)
            {
                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]);

                COMDT_FRIEND_INFO comdt_friend_info = Singleton <CFriendContoller> .instance.model.getFriendByUid(stFriendRecallRsp.stUin.ullUid, CFriendModel.FriendType.SNS);

                if (comdt_friend_info != null)
                {
                    Singleton <CFriendContoller> .instance.ShareTo_SNSFriend_ReCall(Utility.UTF8Convert(comdt_friend_info.szOpenId));
                }
            }
            else
            {
                Singleton <CUIManager> .GetInstance().OpenTips(UT.ErrorCode_String(stFriendRecallRsp.dwResult), false, 1.5f, null, new object[0]);
            }
        }
Example #2
0
        public static void On_Send_CHG_INTIMACY_CONFIRM(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_CMD_CHG_INTIMACY_CONFIRM stChgIntimacyConfirmRsp = msg.stPkgData.stChgIntimacyConfirmRsp;

            if (stChgIntimacyConfirmRsp.dwResult == 0u)
            {
                if (stChgIntimacyConfirmRsp.bRelationChgType == 1 && IntimacyRelationViewUT.IsRelaState(stChgIntimacyConfirmRsp.bIntimacyState))
                {
                    CFriendRelationship.FRData.Add(stChgIntimacyConfirmRsp.stUin.ullUid, stChgIntimacyConfirmRsp.stUin.dwLogicWorldId, (COM_INTIMACY_STATE)stChgIntimacyConfirmRsp.bIntimacyState, (COM_INTIMACY_RELATION_CHG_TYPE)stChgIntimacyConfirmRsp.bRelationChgType, 0u, false);
                }
                if (stChgIntimacyConfirmRsp.bRelationChgType == 2 && IntimacyRelationViewUT.IsRelaState(stChgIntimacyConfirmRsp.bIntimacyState))
                {
                    CFriendRelationship.FRData.Add(stChgIntimacyConfirmRsp.stUin.ullUid, stChgIntimacyConfirmRsp.stUin.dwLogicWorldId, COM_INTIMACY_STATE.COM_INTIMACY_STATE_VALUE_FULL, (COM_INTIMACY_RELATION_CHG_TYPE)stChgIntimacyConfirmRsp.bRelationChgType, stChgIntimacyConfirmRsp.dwTerminateTime, false);
                }
            }
            else
            {
                Singleton <CUIManager> .GetInstance().OpenTips(UT.ErrorCode_String(stChgIntimacyConfirmRsp.dwResult), false, 1.5f, null, new object[0]);

                COMDT_ACNT_UNIQ stUin = stChgIntimacyConfirmRsp.stUin;
                if (stUin != null)
                {
                    FriendRelationNetCore.ProcessByErrorCode(stChgIntimacyConfirmRsp.dwResult, stUin.ullUid, stUin.dwLogicWorldId);
                }
            }
        }
Example #3
0
        private void On_FriendSys_Friend_Confrim(CSPkg msg)
        {
            SCPKG_CMD_ADD_FRIEND_CONFIRM stFriendAddConfirmRsp = msg.stPkgData.stFriendAddConfirmRsp;
            COMDT_FRIEND_INFO            stUserInfo            = stFriendAddConfirmRsp.stUserInfo;

            if (stFriendAddConfirmRsp.dwResult == 0)
            {
                Singleton <CUIManager> .GetInstance().OpenTips(UT.GetText("Friend_Tips_BeFriend_Ok"), false, 1f, null, new object[0]);

                Singleton <CFriendContoller> .GetInstance().model.Remove(CFriendModel.FriendType.RequestFriend, stUserInfo.stUin);

                Singleton <CFriendContoller> .GetInstance().model.Add(CFriendModel.FriendType.GameFriend, stUserInfo, false);

                Singleton <CFriendContoller> .GetInstance().model.SortGameFriend();

                CFriendView view = Singleton <CFriendContoller> .GetInstance().view;

                if ((view != null) && view.IsActive())
                {
                    view.Refresh();
                }
            }
            else
            {
                Singleton <CUIManager> .GetInstance().OpenTips(UT.ErrorCode_String(stFriendAddConfirmRsp.dwResult), false, 1f, null, new object[0]);

                this.Remove_And_Refresh(CFriendModel.FriendType.RequestFriend, stUserInfo.stUin);
            }
        }
        public static void On_RECRUITMENT_ERR_NTF(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_RECRUITMENT_ERR_NTF stRecruitmentErrNtf = msg.stPkgData.stRecruitmentErrNtf;

            if (stRecruitmentErrNtf.dwErrorCode != 0u)
            {
                Singleton <CUIManager> .GetInstance().OpenTips(UT.ErrorCode_String(stRecruitmentErrNtf.dwErrorCode), false, 1.5f, null, new object[0]);
            }
        }
        public static void On_Send_CHG_INTIMACY_DENY(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_CMD_CHG_INTIMACY_DENY stChgIntimacyDenyRsp = msg.stPkgData.get_stChgIntimacyDenyRsp();

            if (stChgIntimacyDenyRsp.dwResult != 0u)
            {
                Singleton <CUIManager> .GetInstance().OpenTips(UT.ErrorCode_String(stChgIntimacyDenyRsp.dwResult), false, 1.5f, null, new object[0]);
            }
        }
Example #6
0
        public static void ShowFriendNetResult(uint dwResult, UT.FriendResultType type)
        {
            string strContent = string.Empty;

            if (dwResult == 0u)
            {
                strContent = UT.GetFriendResultTypeString(type);
            }
            else
            {
                strContent = UT.ErrorCode_String(dwResult);
            }
            Singleton <CUIManager> .GetInstance().OpenTips(strContent, false, 1.5f, null, new object[0]);
        }
Example #7
0
        public static void On_SC_Search_LBS_Rsp(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_CMD_LBS_SEARCH stLbsSearchRsq = msg.stPkgData.get_stLbsSearchRsq();

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

                int num = 0;
                while ((long)num < (long)((ulong)stLbsSearchRsq.dwLbsListNum))
                {
                    CSDT_LBS_USER_INFO cSDT_LBS_USER_INFO = stLbsSearchRsq.astLbsList[num];
                    if (cSDT_LBS_USER_INFO != null)
                    {
                        if (cSDT_LBS_USER_INFO.stLbsUserInfo.stUin.ullUid != Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID)
                        {
                            Singleton <CFriendContoller> .get_instance().model.RemoveLBSUser(cSDT_LBS_USER_INFO.stLbsUserInfo.stUin.ullUid, cSDT_LBS_USER_INFO.stLbsUserInfo.stUin.dwLogicWorldId);

                            Singleton <CFriendContoller> .get_instance().model.AddLBSUser(cSDT_LBS_USER_INFO);
                        }
                    }
                    num++;
                }
                if (stLbsSearchRsq.dwLbsListNum == 0u)
                {
                    string text = Singleton <CTextManager> .get_instance().GetText("LBS_Location_Error");

                    Singleton <CFriendContoller> .get_instance().model.searchLBSZero = text;

                    if (Singleton <CFriendContoller> .get_instance().view != null && Singleton <CFriendContoller> .get_instance().view.ifnoText != null)
                    {
                        Singleton <CFriendContoller> .get_instance().view.ifnoText.text = text;
                    }
                }
                else
                {
                    Singleton <CFriendContoller> .get_instance().model.searchLBSZero = string.Empty;
                }
                Singleton <CFriendContoller> .get_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]);
            }
        }
Example #8
0
        private void On_FriendSys_Friend_Deny(CSPkg msg)
        {
            SCPKG_CMD_ADD_FRIEND_DENY stFriendAddDenyRsp = msg.stPkgData.stFriendAddDenyRsp;

            if (stFriendAddDenyRsp.dwResult == 0)
            {
                this.Remove_And_Refresh(CFriendModel.FriendType.RequestFriend, stFriendAddDenyRsp.stUin);
            }
            else
            {
                Singleton <CUIManager> .GetInstance().OpenTips(UT.ErrorCode_String(stFriendAddDenyRsp.dwResult), false, 1f, null, new object[0]);

                this.Remove_And_Refresh(CFriendModel.FriendType.RequestFriend, stFriendAddDenyRsp.stUin);
            }
        }
Example #9
0
        private void On_FriendSys_Friend_Search(CSPkg msg)
        {
            SCPKG_CMD_SEARCH_PLAYER stFriendSearchPlayerRsp = msg.stPkgData.stFriendSearchPlayerRsp;

            if (stFriendSearchPlayerRsp.dwResult == 0)
            {
                if (this.view != null)
                {
                    this.view.Show_Search_Result(stFriendSearchPlayerRsp.stUserInfo);
                }
            }
            else
            {
                Singleton <CUIManager> .GetInstance().OpenTips(UT.ErrorCode_String(stFriendSearchPlayerRsp.dwResult), false, 1f, null, new object[0]);
            }
            this.view.addFriendView.Refresh_Friend_Recommand_List_Pos();
        }
        public static void On_Send_INTIMACY_RELATION_REQUEST(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_CMD_INTIMACY_RELATION_REQUEST stIntimacyRelationRequestRsp = msg.stPkgData.get_stIntimacyRelationRequestRsp();

            if (stIntimacyRelationRequestRsp.dwResult == 0u)
            {
                string             strContent = string.Empty;
                COM_INTIMACY_STATE state      = 0;
                if (stIntimacyRelationRequestRsp.bRelationChgType == 1)
                {
                    if (stIntimacyRelationRequestRsp.bIntimacyState == 1)
                    {
                        state      = 20;
                        strContent = UT.FRData().IntimRela_Tips_SendRequestGaySuccess;
                    }
                    else if (stIntimacyRelationRequestRsp.bIntimacyState == 2)
                    {
                        state      = 22;
                        strContent = UT.FRData().IntimRela_Tips_SendRequestLoverSuccess;
                    }
                }
                else if (stIntimacyRelationRequestRsp.bRelationChgType == 2)
                {
                    if (stIntimacyRelationRequestRsp.bIntimacyState == 1)
                    {
                        state      = 21;
                        strContent = UT.FRData().IntimRela_Tips_SendDelGaySuccess;
                    }
                    else if (stIntimacyRelationRequestRsp.bIntimacyState == 2)
                    {
                        state      = 23;
                        strContent = UT.FRData().IntimRela_Tips_SendDelLoverSuccess;
                    }
                }
                Singleton <CUIManager> .GetInstance().OpenTips(strContent, false, 1.5f, null, new object[0]);

                CFriendRelationship.FRData.Add(stIntimacyRelationRequestRsp.stUin.ullUid, stIntimacyRelationRequestRsp.stUin.dwLogicWorldId, state, stIntimacyRelationRequestRsp.bRelationChgType, 0u, false);
            }
            else
            {
                Singleton <CUIManager> .GetInstance().OpenTips(UT.ErrorCode_String(stIntimacyRelationRequestRsp.dwResult), false, 1.5f, null, new object[0]);
            }
        }
        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]);
            }
        }
Example #12
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]);
            }
        }
Example #13
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]);
            }
        }
Example #14
0
        private void On_FriendSys_Friend_Recommand_List(CSPkg msg)
        {
            SCPKG_CMD_LIST_FREC stFRecRsp = msg.stPkgData.stFRecRsp;

            this.model.Clear(CFriendModel.FriendType.Recommend);
            if (stFRecRsp.dwResult == 0)
            {
                for (int i = 0; i < stFRecRsp.dwAcntNum; i++)
                {
                    COMDT_FRIEND_INFO data = stFRecRsp.astAcnts[i];
                    if (this.model.getFriendByUid(data.stUin.ullUid, CFriendModel.FriendType.GameFriend) == null)
                    {
                        this.model.Add(CFriendModel.FriendType.Recommend, data, false);
                    }
                }
            }
            else
            {
                Singleton <CUIManager> .GetInstance().OpenTips(UT.ErrorCode_String(stFRecRsp.dwResult), false, 1f, null, new object[0]);
            }
        }
        public static void On_Send_CHG_INTIMACY_CONFIRM(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_CMD_CHG_INTIMACY_CONFIRM stChgIntimacyConfirmRsp = msg.stPkgData.get_stChgIntimacyConfirmRsp();

            if (stChgIntimacyConfirmRsp.dwResult == 0u)
            {
                if (stChgIntimacyConfirmRsp.bRelationChgType == 1)
                {
                    if (stChgIntimacyConfirmRsp.bIntimacyState == 1)
                    {
                        CFriendRelationship.FRData.Add(stChgIntimacyConfirmRsp.stUin.ullUid, stChgIntimacyConfirmRsp.stUin.dwLogicWorldId, 1, stChgIntimacyConfirmRsp.bRelationChgType, 0u, false);
                    }
                    if (stChgIntimacyConfirmRsp.bIntimacyState == 2)
                    {
                        CFriendRelationship.FRData.Add(stChgIntimacyConfirmRsp.stUin.ullUid, stChgIntimacyConfirmRsp.stUin.dwLogicWorldId, 2, stChgIntimacyConfirmRsp.bRelationChgType, 0u, false);
                    }
                }
                if (stChgIntimacyConfirmRsp.bRelationChgType == 2)
                {
                    if (stChgIntimacyConfirmRsp.bIntimacyState == 1)
                    {
                        CFriendRelationship.FRData.Add(stChgIntimacyConfirmRsp.stUin.ullUid, stChgIntimacyConfirmRsp.stUin.dwLogicWorldId, 24, stChgIntimacyConfirmRsp.bRelationChgType, stChgIntimacyConfirmRsp.dwTerminateTime, false);
                    }
                    if (stChgIntimacyConfirmRsp.bIntimacyState == 2)
                    {
                        CFriendRelationship.FRData.Add(stChgIntimacyConfirmRsp.stUin.ullUid, stChgIntimacyConfirmRsp.stUin.dwLogicWorldId, 24, stChgIntimacyConfirmRsp.bRelationChgType, stChgIntimacyConfirmRsp.dwTerminateTime, false);
                    }
                }
            }
            else
            {
                Singleton <CUIManager> .GetInstance().OpenTips(UT.ErrorCode_String(stChgIntimacyConfirmRsp.dwResult), false, 1.5f, null, new object[0]);
            }
        }
Example #16
0
        public static void On_Send_INTIMACY_RELATION_REQUEST(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_CMD_INTIMACY_RELATION_REQUEST stIntimacyRelationRequestRsp = msg.stPkgData.stIntimacyRelationRequestRsp;

            if (stIntimacyRelationRequestRsp.dwResult == 0u)
            {
                string             strContent = string.Empty;
                COM_INTIMACY_STATE state      = COM_INTIMACY_STATE.COM_INTIMACY_STATE_NULL;
                if (stIntimacyRelationRequestRsp.bRelationChgType == 1)
                {
                    if (IntimacyRelationViewUT.IsRelaState(stIntimacyRelationRequestRsp.bIntimacyState))
                    {
                        state = IntimacyRelationViewUT.GetConfirmState(stIntimacyRelationRequestRsp.bIntimacyState);
                        RelationConfig relaTextCfg = Singleton <CFriendContoller> .instance.model.FRData.GetRelaTextCfg(stIntimacyRelationRequestRsp.bIntimacyState);

                        strContent = relaTextCfg.IntimRela_Tips_SendRequestSuccess;
                    }
                }
                else if (stIntimacyRelationRequestRsp.bRelationChgType == 2 && IntimacyRelationViewUT.IsRelaState(stIntimacyRelationRequestRsp.bIntimacyState))
                {
                    state = IntimacyRelationViewUT.GetDenyState(stIntimacyRelationRequestRsp.bIntimacyState);
                    RelationConfig relaTextCfg2 = Singleton <CFriendContoller> .instance.model.FRData.GetRelaTextCfg(stIntimacyRelationRequestRsp.bIntimacyState);

                    strContent = relaTextCfg2.IntimRela_Tips_SendDelSuccess;
                }
                Singleton <CUIManager> .GetInstance().OpenTips(strContent, false, 1.5f, null, new object[0]);

                CFriendRelationship.FRData.Add(stIntimacyRelationRequestRsp.stUin.ullUid, stIntimacyRelationRequestRsp.stUin.dwLogicWorldId, state, (COM_INTIMACY_RELATION_CHG_TYPE)stIntimacyRelationRequestRsp.bRelationChgType, 0u, false);
            }
            else
            {
                Singleton <CUIManager> .GetInstance().OpenTips(UT.ErrorCode_String(stIntimacyRelationRequestRsp.dwResult), false, 1.5f, null, new object[0]);
            }
        }