NyxStudios/TShock — pull request #714 by ComputerDruid (2013-11-04 21:24:12+00:00)
Title: fix MemoryStream passed to HandlerGetData containing an extra byte

When OnGetData is called, it gets passed the position of the first
byte following the packet ID, but the length it is passed is the
length of the entire packet *including* the packet ID byte. So when
the MemoryStream is constructed with that length, it actually
contains an extra byte not in the packet, whatever is next in the
buffer.

Fix this so that the MemoryStream only contains the packet itself,
without the extra byte.

---

I'm not entirely sure that this should be done here, exactly; it's possible that OnGetData's caller (in TerrariaServer) should be fixed instead, but it seems easier to fix it here.

While I do think that this fix is an improvement, this will break existing plugins which use the Length of the MemoryStream in calculations. I know for a fact that it will break InfiniteSigns, for example, but the fix is trivial, as it will likely be in most cases.