Beispiel #1
0
        /// <summary>
        /// 更新成员数据
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="member"></param>
        public void UpdateMember(GameCmd.stClanMemberInfo member)
        {
            if (null != m_serverInfo &&
                null != m_serverInfo.memberlist &&
                null != m_serverInfo.memberlist.member)
            {
                GameCmd.stClanMemberInfo updateMember = null;
                foreach (GameCmd.stClanMemberInfo info in m_serverInfo.memberlist.member)
                {
                    if (null == info)
                    {
                        continue;
                    }
                    if (info.id == member.id)
                    {
                        updateMember = info;
                        break;
                    }
                }

                if (null != updateMember)
                {
                    m_serverInfo.memberlist.member.Remove(updateMember);
                }
                if (null != member)
                {
                    m_serverInfo.memberlist.member.Add(member);
                }
            }
        }
Beispiel #2
0
 /// <summary>
 /// 移除成员
 /// </summary>
 /// <param name="userId"></param>
 public void RemoveMember(uint userId)
 {
     if (null != m_serverInfo &&
         null != m_serverInfo.memberlist &&
         null != m_serverInfo.memberlist.member)
     {
         GameCmd.stClanMemberInfo removeMember = null;
         foreach (GameCmd.stClanMemberInfo info in m_serverInfo.memberlist.member)
         {
             if (null == info)
             {
                 continue;
             }
             if (info.id == userId)
             {
                 removeMember = info;
                 break;
             }
         }
         m_serverInfo.memberlist.member.Remove(removeMember);
     }
 }
Beispiel #3
0
 /// <summary>
 /// 获取氏族成员数据
 /// </summary>
 /// <param name="userId"></param>
 /// <returns></returns>
 public GameCmd.stClanMemberInfo GetMemberInfo(uint userId)
 {
     GameCmd.stClanMemberInfo member = null;
     if (null != m_serverInfo &&
         null != m_serverInfo.memberlist &&
         null != m_serverInfo.memberlist.member)
     {
         foreach (GameCmd.stClanMemberInfo info in m_serverInfo.memberlist.member)
         {
             if (null == info)
             {
                 continue;
             }
             if (info.id == userId)
             {
                 member = info;
                 break;
             }
         }
     }
     return(member);
 }