Add bestiary handler

This commit is contained in:
Chris 2020-06-02 14:06:18 +09:30
parent 1c0a649a0c
commit 3b6a9ffcc2
3 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,28 @@
using System.IO;
namespace TShockAPI.Handlers.NetModules
{
/// <summary>
/// Rejects client->server bestiary net modules as the client should never send this to the server
/// </summary>
internal class BestiaryHandler : INetModuleHandler
{
/// <summary>
/// No deserialization needed. This should never be received by the server
/// </summary>
/// <param name="data"></param>
public void Deserialize(MemoryStream data)
{
}
/// <summary>
/// This should never be received by the server
/// </summary>
/// <param name="player"></param>
/// <param name="rejectPacket"></param>
public void HandlePacket(TSPlayer player, out bool rejectPacket)
{
rejectPacket = true;
}
}
}

View file

@ -52,6 +52,11 @@ namespace TShockAPI.Handlers.NetModules
handler = new LiquidHandler();
break;
}
case NetModulesTypes.Bestiary:
{
handler = new BestiaryHandler();
break;
}
default:
{
// As of 1.4.x.x, this is now used for more things:

View file

@ -89,6 +89,7 @@
<Compile Include="DB\TileManager.cs" />
<Compile Include="Extensions\ExceptionExt.cs" />
<Compile Include="Handlers\IPacketHandler.cs" />
<Compile Include="Handlers\NetModules\BestiaryHandler.cs" />
<Compile Include="Handlers\NetModules\CreativePowerHandler.cs" />
<Compile Include="Handlers\NetModules\CreativeUnlocksHandler.cs" />
<Compile Include="Handlers\NetModules\INetModuleHandler.cs" />