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

FriendOnline() public static method

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

			packet.PutInt(friend.Id);
			packet.PutString(friend.Nickname);
			packet.PutByte((byte)friend.Status);
			packet.PutString(friend.ChannelName);

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

Same methods

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

Usage Example

示例#1
0
        public void FriendUnblock(MsgrClient client, Packet packet)
        {
            var contactId = packet.GetInt();

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

            if (friend == null)
            {
                Log.Warning("FriendUnblock: User '{0}' tried to block invalid friend.", client.User.AccountId);
                return;
            }

            // Check status
            if (friend.FriendshipStatus != FriendshipStatus.Blocked)
            {
                Send.FriendUnblockR(client.User, false, contactId);
                return;
            }

            // Change status
            friend.FriendshipStatus = FriendshipStatus.Normal;
            MsgrServer.Instance.Database.SetFriendshipStatusOneSided(client.User.Id, contactId, friend.FriendshipStatus);

            Send.FriendUnblockR(client.User, true, contactId);

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

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