For some reason, Inferno potions do PvP damage without specifying the
source player in the `PlayerDeathReason` -- so special-case the only
identifying information being the other index value of `16`.
The `AchievementTagHandler` expects `Main.Achievements` to be non-null,
which is not normally the case on dedicated servers. When trying to
parse an achievement chat tag, it will instead throw.
The tag is parsed when calling `ChatManager.ParseMessage`, which is used
in TShock when writing chat messages to the console. Our `OnChat`
handler uses `Utils.Broadcast`, which will send the message to all
connected clients, write the message to the console and the log. Due to
the order of execution, the message ends up being sent to all connected
clients, but throws whilst trying to write to the console, and never
gets written to the log.
To solve the issue, we make achievements available on the server,
allowing the tag handler to work as expected, and even allowing the
localization of achievements names to appear in the console.
There is now a local function `Reject` that will handle logging,
rejecting, and (optionally) re-syncing upon a rejected packet.
Alongside this, the debug message has been improved to include the
sender index, buff type, receiver index, and the time in ticks (and the
existing reason for rejection.)
This allows the tshock tile providers to be switched via the config instead of cli args via tsapi, for environments where the command line args cannot be changed.
This was previously using the constant `22` directly, instead of
`Player.maxBuffs`, which is now `44`. This theoretically allowed players
to smuggle buffs on to servers with SSC enabled, by using buff indexes
past `22`.
The player being CC'd does not cause any issues for us if SSC isn't
enabled, so we can relax it's restriction.
This also allows the `RequireLogin` config option to function usefully
again, as it would disable the player, causing them to be CC'd until
they logged in, creating a vicious cycle.