示例#1
0
    bool HandleDelRelation(NetCmdBase obj)
    {
        LC_Cmd_DelUserRelation ncb = (LC_Cmd_DelUserRelation)obj;

        tagUserOperationEvent pUOM = new tagUserOperationEvent((ncb.Result ? UserOperateMessage.UOM_Relation_DelRelation_Sucess : UserOperateMessage.UOM_Relation_DelRelation_Failed_2));

        MsgEventHandle.HandleMsg(pUOM);

        if (ncb.Result)
        {
            if (FriendMap.ContainsKey(ncb.dwDestRoleID) == true)
            {
                FriendMap.Remove(ncb.dwDestRoleID);
                // FriendSysManager.Instance.OnDeleteListMsg(ncb.dwDestRoleID, WndType.Friend_Wnd);

                //tagFriendChangeEvent pFirendEvent = new tagFriendChangeEvent();
                //MsgEventHandle.HandleMsg(pFirendEvent);

                tagFriendDelEvent pFirendEvent = new tagFriendDelEvent(ncb.dwDestRoleID);
                MsgEventHandle.HandleMsg(pFirendEvent);
            }
            else if (BlackListMap.ContainsKey(ncb.dwDestRoleID) == true)
            {
                BlackListMap.Remove(ncb.dwDestRoleID);

                //tagBlackChangeEvent pBlackEvent = new tagBlackChangeEvent();
                //MsgEventHandle.HandleMsg(pBlackEvent);
                tagBlackDelEvent pBlackEvent = new tagBlackDelEvent(ncb.dwDestRoleID);
                MsgEventHandle.HandleMsg(pBlackEvent);
            }
        }
        return(true);
    }
示例#2
0
    bool HandleChangeRelation(NetCmdBase obj)
    {
        LC_Cmd_ChangeUserRelation ncb = (LC_Cmd_ChangeUserRelation)obj;

        tagUserOperationEvent pUOM = new tagUserOperationEvent((ncb.Result ? UserOperateMessage.UOM_Relation_ChangeRelation_Sucess : UserOperateMessage.UOM_Relation_ChangeRelation_Failed_1));

        MsgEventHandle.HandleMsg(pUOM);

        if (ncb.Result && FriendMap.ContainsKey(ncb.dwDestRoleID) && ncb.bRelationType == 2)    //加入黑名单
        {
            RelationRole pRole = FriendMap[ncb.dwDestRoleID];
            pRole.SetRelationType(ncb.bRelationType);
            BlackListMap.Add(ncb.dwDestRoleID, pRole);
            FriendMap.Remove(ncb.dwDestRoleID);

            //tagFriendChangeEvent pFirendEvent = new tagFriendChangeEvent();
            //MsgEventHandle.HandleMsg(pFirendEvent);

            //tagBlackChangeEvent pBlackEvent = new tagBlackChangeEvent();
            //MsgEventHandle.HandleMsg(pBlackEvent);

            tagFriendDelEvent pFriendEvent = new tagFriendDelEvent(ncb.dwDestRoleID);
            MsgEventHandle.HandleMsg(pFriendEvent);

            tagBlackAddEvent pBlackEvent = new tagBlackAddEvent(ncb.dwDestRoleID);
            MsgEventHandle.HandleMsg(pBlackEvent);
        }
        else if (ncb.Result && BlackListMap.ContainsKey(ncb.dwDestRoleID) && ncb.bRelationType == 1)   //黑名单
        {
            RelationRole pRole = BlackListMap[ncb.dwDestRoleID];
            pRole.SetRelationType(ncb.bRelationType);
            FriendMap.Add(ncb.dwDestRoleID, pRole);
            BlackListMap.Remove(ncb.dwDestRoleID);

            //tagFriendChangeEvent pFirendEvent = new tagFriendChangeEvent();
            //MsgEventHandle.HandleMsg(pFirendEvent);

            //tagBlackChangeEvent pBlackEvent = new tagBlackChangeEvent();
            //MsgEventHandle.HandleMsg(pBlackEvent);

            tagFriendAddEvent pFriendEvent = new tagFriendAddEvent(ncb.dwDestRoleID);
            MsgEventHandle.HandleMsg(pFriendEvent);

            tagBlackDelEvent pBlackEvent = new tagBlackDelEvent(ncb.dwDestRoleID);
            MsgEventHandle.HandleMsg(pBlackEvent);
        }
        return(true);
    }