Add handling for liquid net module
This commit is contained in:
parent
48d610d33f
commit
1c0a649a0c
3 changed files with 36 additions and 2 deletions
29
TShockAPI/Handlers/NetModules/LiquidHandler.cs
Normal file
29
TShockAPI/Handlers/NetModules/LiquidHandler.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
using System.IO;
|
||||
|
||||
namespace TShockAPI.Handlers.NetModules
|
||||
{
|
||||
/// <summary>
|
||||
/// Handles the NetLiquidModule. Rejects all incoming net liquid requests, as clients should never send them
|
||||
/// </summary>
|
||||
public class LiquidHandler : INetModuleHandler
|
||||
{
|
||||
/// <summary>
|
||||
/// Does nothing. We should not deserialize this data
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
public void Deserialize(MemoryStream data)
|
||||
{
|
||||
// No need to deserialize
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rejects the packet. Clients should not send this to us
|
||||
/// </summary>
|
||||
/// <param name="player"></param>
|
||||
/// <param name="rejectPacket"></param>
|
||||
public void HandlePacket(TSPlayer player, out bool rejectPacket)
|
||||
{
|
||||
rejectPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using Terraria;
|
||||
using Terraria;
|
||||
using static TShockAPI.GetDataHandlers;
|
||||
|
||||
namespace TShockAPI.Handlers.NetModules
|
||||
|
|
@ -48,6 +47,11 @@ namespace TShockAPI.Handlers.NetModules
|
|||
handler = new PylonHandler();
|
||||
break;
|
||||
}
|
||||
case NetModulesTypes.Liquid:
|
||||
{
|
||||
handler = new LiquidHandler();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
// As of 1.4.x.x, this is now used for more things:
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@
|
|||
<Compile Include="Handlers\NetModules\CreativePowerHandler.cs" />
|
||||
<Compile Include="Handlers\NetModules\CreativeUnlocksHandler.cs" />
|
||||
<Compile Include="Handlers\NetModules\INetModuleHandler.cs" />
|
||||
<Compile Include="Handlers\NetModules\LiquidHandler.cs" />
|
||||
<Compile Include="Handlers\NetModules\NetModulePacketHandler.cs" />
|
||||
<Compile Include="Handlers\NetModules\PylonHandler.cs" />
|
||||
<Compile Include="Handlers\SendTileSquareHandler.cs" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue