-
Notifications
You must be signed in to change notification settings - Fork 16
/
OtherPlayerLevelUpHandler.cs
36 lines (30 loc) · 1.05 KB
/
OtherPlayerLevelUpHandler.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using AutomaticTypeMapper;
using EOLib.Domain.Character;
using EOLib.Domain.Login;
using EOLib.Domain.Notifiers;
using EOLib.Net;
using EOLib.Net.Handlers;
using System.Collections.Generic;
namespace EOLib.PacketHandlers
{
[AutoMappedType]
public class OtherPlayerLevelUpHandler : InGameOnlyPacketHandler
{
private readonly IEnumerable<IEmoteNotifier> _emoteNotifiers;
public override PacketFamily Family => PacketFamily.Item;
public override PacketAction Action => PacketAction.Accept;
public OtherPlayerLevelUpHandler(IPlayerInfoProvider playerInfoProvider,
IEnumerable<IEmoteNotifier> emoteNotifiers)
: base(playerInfoProvider)
{
_emoteNotifiers = emoteNotifiers;
}
public override bool HandlePacket(IPacket packet)
{
var playerId = packet.ReadShort();
foreach (var notifier in _emoteNotifiers)
notifier.NotifyEmote(playerId, Emote.LevelUp);
return true;
}
}
}