Ejemplo n.º 1
0
    public void ResetInfo()
    {
        OnClear();
        //清理排行榜的数据 在排行榜打开的情况下
        tagFriendLoadEvent pEvent = new tagFriendLoadEvent();

        MsgEventHandle.HandleMsg(pEvent);

        tagBlackLoadEvent pEvent2 = new tagBlackLoadEvent();

        MsgEventHandle.HandleMsg(pEvent2);
    }
Ejemplo n.º 2
0
    bool HandGetRoleRelation(NetCmdBase obj)
    {
        LC_Cmd_GetUserRelation ncb = (LC_Cmd_GetUserRelation)obj;

        //向客户端添加关系集合
        if ((ncb.States & FishDataInfo.MsgBegin) != 0)
        {
            FriendMap.Clear();
            BlackListMap.Clear();
        }
        for (UInt16 i = 0; i < ncb.Sum; ++i)
        {
            RelationRole pBase = new RelationRole(ncb.Array[i]);
            if (ncb.Array[i].bRelationType == 1)
            {
                if (FriendMap.ContainsKey(pBase.GetUserID()))
                {
                    return(false);
                }
                FriendMap.Add(pBase.GetUserID(), pBase);
            }
            else if (ncb.Array[i].bRelationType == 2)
            {
                if (BlackListMap.ContainsKey(pBase.GetUserID()))
                {
                    return(false);
                }
                BlackListMap.Add(pBase.GetUserID(), pBase);
            }
        }
        if ((ncb.States & FishDataInfo.MsgEnd) != 0)
        {
            m_IsLoad = true;

            tagFriendLoadEvent pFirendEvent = new tagFriendLoadEvent();
            MsgEventHandle.HandleMsg(pFirendEvent);

            tagBlackLoadEvent pBlackEvent = new tagBlackLoadEvent();
            MsgEventHandle.HandleMsg(pBlackEvent);
        }
        return(true);
    }
Ejemplo n.º 3
0
    public void UpdateByDay()//每天12点进行更新
    {
        if (FriendMap.Count > 0)
        {
            bool IsChange = false;
            for (int i = 0; i < FriendMap.Count; ++i)
            {
                if (FriendMap.Values.ElementAt <RelationRole>(i).GetLeaveOnlineDay() != 0xff && FriendMap.Values.ElementAt <RelationRole>(i).GetLeaveOnlineDay() < 250)
                {
                    FriendMap.Values.ElementAt <RelationRole>(i).SetLeaveOnlineDay(Convert.ToByte(FriendMap.Values.ElementAt <RelationRole>(i).GetLeaveOnlineDay() + 1));//离线天数加1
                    IsChange = true;
                }
            }
            if (IsChange)
            {
                //tagFriendChangeEvent pFirendEvent = new tagFriendChangeEvent();
                //MsgEventHandle.HandleMsg(pFirendEvent);

                tagFriendLoadEvent pFirendEvent = new tagFriendLoadEvent();
                MsgEventHandle.HandleMsg(pFirendEvent);
            }
        }
        if (BlackListMap.Count > 0)
        {
            bool IsChange = false;
            for (int i = 0; i < BlackListMap.Count; ++i)
            {
                if (BlackListMap.Values.ElementAt <RelationRole>(i).GetLeaveOnlineDay() != 0xff && BlackListMap.Values.ElementAt <RelationRole>(i).GetLeaveOnlineDay() < 250)
                {
                    BlackListMap.Values.ElementAt <RelationRole>(i).SetLeaveOnlineDay(Convert.ToByte(BlackListMap.Values.ElementAt <RelationRole>(i).GetLeaveOnlineDay() + 1));//离线天数加1
                    IsChange = true;
                }
            }
            if (IsChange)
            {
                tagBlackLoadEvent pBlackEvent = new tagBlackLoadEvent();
                MsgEventHandle.HandleMsg(pBlackEvent);
            }
        }
    }