Commit EmojiHandler.cs and register OnEmoji hook.
This commit is contained in:
parent
f538ceb793
commit
c94d15e634
3 changed files with 6 additions and 1 deletions
|
|
@ -37,6 +37,7 @@ namespace TShockAPI
|
||||||
internal sealed class Bouncer
|
internal sealed class Bouncer
|
||||||
{
|
{
|
||||||
internal Handlers.SendTileSquareHandler STSHandler { get; set; }
|
internal Handlers.SendTileSquareHandler STSHandler { get; set; }
|
||||||
|
internal Handlers.EmojiHandler EmojiHandler { get; set; }
|
||||||
|
|
||||||
/// <summary>Constructor call initializes Bouncer and related functionality.</summary>
|
/// <summary>Constructor call initializes Bouncer and related functionality.</summary>
|
||||||
/// <returns>A new Bouncer.</returns>
|
/// <returns>A new Bouncer.</returns>
|
||||||
|
|
@ -45,6 +46,9 @@ namespace TShockAPI
|
||||||
STSHandler = new Handlers.SendTileSquareHandler();
|
STSHandler = new Handlers.SendTileSquareHandler();
|
||||||
GetDataHandlers.SendTileSquare += STSHandler.OnReceiveSendTileSquare;
|
GetDataHandlers.SendTileSquare += STSHandler.OnReceiveSendTileSquare;
|
||||||
|
|
||||||
|
EmojiHandler = new Handlers.EmojiHandler();
|
||||||
|
GetDataHandlers.Emoji += EmojiHandler.OnEmoji;
|
||||||
|
|
||||||
// Setup hooks
|
// Setup hooks
|
||||||
GetDataHandlers.GetSection += OnGetSection;
|
GetDataHandlers.GetSection += OnGetSection;
|
||||||
GetDataHandlers.PlayerUpdate += OnPlayerUpdate;
|
GetDataHandlers.PlayerUpdate += OnPlayerUpdate;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ namespace TShockAPI.Handlers
|
||||||
{
|
{
|
||||||
if (args.PlayerIndex != args.Player.Index)
|
if (args.PlayerIndex != args.Player.Index)
|
||||||
{
|
{
|
||||||
TShock.Log.ConsoleError($"EmojiHandler: Packet is spoofing to be player ID {args.PlayerIndex}! - From [{args.Player.Index}]{args.Player.Name}");
|
TShock.Log.ConsoleError($"EmojiHandler: Packet is spoofing to be player ID {args.PlayerIndex}! - From [{args.Player.Index}] {args.Player.Name}");
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@
|
||||||
<Compile Include="DB\ResearchDatastore.cs" />
|
<Compile Include="DB\ResearchDatastore.cs" />
|
||||||
<Compile Include="DB\TileManager.cs" />
|
<Compile Include="DB\TileManager.cs" />
|
||||||
<Compile Include="Extensions\ExceptionExt.cs" />
|
<Compile Include="Extensions\ExceptionExt.cs" />
|
||||||
|
<Compile Include="Handlers\EmojiHandler.cs" />
|
||||||
<Compile Include="Handlers\SendTileSquareHandler.cs" />
|
<Compile Include="Handlers\SendTileSquareHandler.cs" />
|
||||||
<Compile Include="Hooks\AccountHooks.cs" />
|
<Compile Include="Hooks\AccountHooks.cs" />
|
||||||
<Compile Include="Hooks\GeneralHooks.cs" />
|
<Compile Include="Hooks\GeneralHooks.cs" />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue