Ejemplo n.º 1
0
        void client_ClanMemberListReceived(object sender, ClanMemberListEventArgs e)
        {
            m_members = e.Members;

            ThreadStart update = delegate
            {
                this.lbClanMembers.BeginUpdate();

                foreach (ClanMember member in m_members)
                {
                    this.lbClanMembers.Items.Add(member);
                }

                this.lbClanMembers.EndUpdate();
            };

            if (InvokeRequired)
                BeginInvoke(update);
            else
                update();
        }
Ejemplo n.º 2
0
        private void HandleClanMemberList(ParseData pd)
        {
            DataReader dr = new DataReader(pd.Data);
            dr.Seek(4);
            byte memCount = dr.ReadByte();
            for (int i = 0; i < memCount; i++)
            {
                string userName = dr.ReadCString();
                ClanRank rank = (ClanRank)dr.ReadByte();
                ClanMemberStatus status = (ClanMemberStatus)dr.ReadByte();
                string location = dr.ReadCString();
                m_clanList.Add(userName, new ClanMember(userName, rank, status, location));

            }

            ClanMember[] members = new ClanMember[m_clanList.Count];
            m_clanList.Values.CopyTo(members, 0);

            ClanMemberListEventArgs args = new ClanMemberListEventArgs(members);
            args.EventData = pd;
            OnClanMemberListReceived(args);
        }
 public void OnClanMemberListReceived(ClanMemberListEventArgs e)
 {
     m_host.OnClanMemberListReceived(e);
 }