Refactor EmojiHandler to implement IPacketHandler<TArgs>

This commit is contained in:
Chris 2020-06-02 19:18:43 +09:30
parent f80bf4abab
commit 9dff07e6c2

View file

@ -1,17 +1,18 @@
using System; using static TShockAPI.GetDataHandlers;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TShockAPI.Handlers namespace TShockAPI.Handlers
{ {
/// <summary> /// <summary>
/// Handles emoji packets and checks for validity and permissions /// Handles emoji packets and checks for validity and permissions
/// </summary> /// </summary>
public class EmojiHandler public class EmojiHandler : IPacketHandler<EmojiEventArgs>
{ {
public void OnReceiveEmoji(object sender, GetDataHandlers.EmojiEventArgs args) /// <summary>
/// Invoked when an emoji is sent in chat. Rejects the emoji packet if the player is spoofing IDs or does not have emoji permissions
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
public void OnReceive(object sender, EmojiEventArgs args)
{ {
if (args.PlayerIndex != args.Player.Index) if (args.PlayerIndex != args.Player.Index)
{ {