示例#1
0
        private void UpdateBuddyLists(object sender, MemberLogonEventArgs args)
        {
            var message = _netServer.CreateMessage();
            message.Write(DataMessageType.MemberJoined.ToString());
            message.Write(args.LoggedOnMember.Name);
            // TODO: have yourself in the list or not?
            //var recipients = _members.Where(m => m != args.LoggedOnMember).Select(m => m.Connection).ToList();
            var recipients = _members.Select(m => m.Connection).ToList();

            if (recipients.Count > 0)
                _netServer.SendMessage(message, recipients, NetDeliveryMethod.ReliableUnordered, 0);
        }
示例#2
0
 private void OnMemberLogon(MemberLogonEventArgs args)
 {
     MemberLogonHandler handler = MemberLogon;
     if (handler != null) handler(this, args);
 }