Blocks Npc data and sendsection packets.

This commit is contained in:
high 2011-06-01 22:55:01 -04:00
parent d48426adfd
commit 1909e3b5d0

View file

@ -1,11 +1,11 @@
using System;
using System.IO;
using System.Net;
using System.Text.RegularExpressions;
using Microsoft.Xna.Framework;
using Terraria;
using TerrariaAPI;
using TerrariaAPI.Hooks;
using System.Text.RegularExpressions;
namespace TShockAPI
{
@ -91,15 +91,6 @@ namespace TShockAPI
}
}
void OnPreGetData(byte id, messageBuffer msg, int idx, int length, HandledEventArgs e)
{
if (Main.netMode != 2) { return; }
if (id == 0x1e && ConfigurationManager.permaPvp)
{
e.Handled = true;
}
}
void GetData(GetDataEventArgs e)
{
if (Main.netMode != 2) { return; }
@ -126,6 +117,16 @@ namespace TShockAPI
NetMessage.SendData(30, -1, -1, "", e.Msg.whoAmI);
e.Handled = true;
}
if (e.MsgID == 0x0A) //SendSection
{
Tools.Broadcast(string.Format("{0}({1}) attempted sending a section", Main.player[e.Msg.whoAmI].name, e.Msg.whoAmI));
e.Handled = true;
}
if (e.MsgID == 0x17) //Npc Data
{
Tools.Broadcast(string.Format("{0}({1}) attempted spawning an NPC", Main.player[e.Msg.whoAmI].name, e.Msg.whoAmI));
e.Handled = true;
}
}
void OnGreetPlayer(int who, HandledEventArgs e)