Пример #1
0
    void _Packet(ScFriendApplyDetail p)
    {
        ScFriendApplyDetail pp = p.Clone();

        if (pp.applyInfo == null || pp.applyInfo?.playerInfo == null)
        {
            return;
        }
        var black = BlackList.Exists(a => a.roleId == pp.applyInfo.playerInfo.roleId);

        if (black)
        {
            return;
        }

        PPlayerInfo apply = Apply_playerList.Find(a => a.roleId == pp.applyInfo.playerInfo.roleId);

        if (apply != null)
        {
            RemoveApply(apply);
        }
        AddApply(pp.applyInfo);
        Apply_playerList.Reverse();//按接收顺序翻转所以就会是最早的在第一个
        DispatchModuleEvent(EventFriendApplyList);

        if (moduleFriend.FriendList.Count < FriendNumTop)
        {
            moduleHome.UpdateIconState(HomeIcons.Friend, true);
        }
    }