Aura.Msgr.Network.Send.FriendOffline C# (CSharp) Method

FriendOffline() public static method

Notifies users about friend being offline.
public static FriendOffline ( List users, Aura.Msgr.Database.User friend ) : void
users List
friend Aura.Msgr.Database.User
return void
		public static void FriendOffline(List<User> users, User friend)
		{
			var packet = new Packet(Op.Msgr.FriendOffline, 0);
			packet.PutInt(friend.Id);

			foreach (var user in users)
				user.Client.Send(packet);
		}

Same methods

Send::FriendOffline ( Aura.Msgr.Database.User user, Aura.Msgr.Database.User friend ) : void

Usage Example

Exemplo n.º 1
0
        public void DeleteFriend(MsgrClient client, Packet packet)
        {
            var contactId = packet.GetInt();

            // Check friend
            var friend = client.User.GetFriend(contactId);

            if (friend == null)
            {
                Log.Warning("DeleteFriend: User '{0}' tried to delete non-existent friend.", client.User.AccountId);
                client.Kill();                 // Out of sync, close connection.
                return;
            }

            client.User.Friends.Remove(friend);
            MsgrServer.Instance.Database.DeleteFriend(client.User.Id, contactId);

            // Live update
            var friendUser = MsgrServer.Instance.UserManager.Get(contactId);

            if (friendUser != null)
            {
                Send.FriendOffline(friendUser, client.User);
            }
        }
All Usage Examples Of Aura.Msgr.Network.Send::FriendOffline