Merge pull request #1544 from Patrikkk/general-devel

Add missing "if handled - return" code to OnNameCollision.
This commit is contained in:
Lucas Nicodemus 2017-12-10 12:41:52 -07:00 committed by GitHub
commit 135826f15d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -3,6 +3,7 @@
This is the rolling changelog for TShock for Terraria. Use past tense when adding new entries; sign your name off when you add or change something. This should primarily be things like user changes, not necessarily codebase changes unless it's really relevant or large.
## Upcoming Changes
* API: Added return in OnNameCollision if hook has been handled. (@Patrikkk)
* API: Added hooks for item, projectile and tile bans (@deadsurgeon42)
* API: Changed `PlayerHooks` permission hook mechanisms to allow negation from hooks (@deadsurgeon42)
* API: New WorldGrassSpread hook which shold allow corruption/crimson/hallow creep config options to work (@DeathCradle)

View file

@ -522,6 +522,11 @@ namespace TShockAPI
/// <param name="args">args - The NameCollisionEventArgs object.</param>
private void NetHooks_NameCollision(NameCollisionEventArgs args)
{
if (args.Handled)
{
return;
}
string ip = Utils.GetRealIP(Netplay.Clients[args.Who].Socket.GetRemoteAddress().ToString());
var player = Players.First(p => p != null && p.Name == args.Name && p.Index != args.Who);