Refactor EmojiHandler to implement IPacketHandler<TArgs>
This commit is contained in:
parent
f80bf4abab
commit
9dff07e6c2
1 changed files with 8 additions and 7 deletions
|
|
@ -1,17 +1,18 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static TShockAPI.GetDataHandlers;
|
||||
|
||||
namespace TShockAPI.Handlers
|
||||
{
|
||||
/// <summary>
|
||||
/// Handles emoji packets and checks for validity and permissions
|
||||
/// </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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue