Merge remote-tracking branch 'upstream/general-devel' into net9-upgrade

This commit is contained in:
Luke 2025-02-02 16:43:59 +10:00
commit 677426b746
7 changed files with 28 additions and 8 deletions

View file

@ -63,7 +63,7 @@ namespace TShockAPI
/// <summary>VersionNum - The version number the TerrariaAPI will return back to the API. We just use the Assembly info.</summary>
public static readonly Version VersionNum = Assembly.GetExecutingAssembly().GetName().Version;
/// <summary>VersionCodename - The version codename is displayed when the server starts. Inspired by software codenames conventions.</summary>
public static readonly string VersionCodename = "Intensity";
public static readonly string VersionCodename = "East";
/// <summary>SavePath - This is the path TShock saves its data in. This path is relative to the TerrariaServer.exe (not in ServerPlugins).</summary>
public static string SavePath = "tshock";
@ -1366,6 +1366,8 @@ namespace TShockAPI
}
}
}
Bans.CheckBan(player);
Players[args.Who] = player;
}
@ -1387,7 +1389,8 @@ namespace TShockAPI
return;
}
Bans.CheckBan(player);
if (Bans.CheckBan(player))
return;
}
/// <summary>OnLeave - Called when a player leaves the server.</summary>
@ -1427,7 +1430,7 @@ namespace TShockAPI
if (tsplr.ReceivedInfo)
{
if (!tsplr.SilentKickInProgress && tsplr.State >= 3)
if (!tsplr.SilentKickInProgress && tsplr.State >= 3 && tsplr.FinishedHandshake) //The player has left, do not broadcast any clients exploiting the behaviour of not spawning their player.
Utils.Broadcast(GetString("{0} has left.", tsplr.Name), Color.Yellow);
Log.Info(GetString("{0} disconnected.", tsplr.Name));
@ -1448,6 +1451,9 @@ namespace TShockAPI
}
}
tsplr.FinishedHandshake = false;
// Fire the OnPlayerLogout hook too, if the player was logged in and they have a TSPlayer object.
if (tsplr.IsLoggedIn)
{
@ -1477,6 +1483,12 @@ namespace TShockAPI
return;
}
if (!tsplr.FinishedHandshake)
{
args.Handled = true;
return;
}
if (args.Text.Length > 500)
{
tsplr.Kick(GetString("Crash attempt via long chat packet."), true);
@ -1693,14 +1705,14 @@ namespace TShockAPI
Log.Info(GetString("{0} ({1}) from '{2}' group from '{3}' joined. ({4}/{5})", player.Name, player.IP,
player.Group.Name, player.Country, TShock.Utils.GetActivePlayerCount(),
TShock.Config.Settings.MaxSlots));
if (!player.SilentJoinInProgress)
if (!player.SilentJoinInProgress && player.FinishedHandshake)
Utils.Broadcast(GetString("{0} ({1}) has joined.", player.Name, player.Country), Color.Yellow);
}
else
{
Log.Info(GetString("{0} ({1}) from '{2}' group joined. ({3}/{4})", player.Name, player.IP,
player.Group.Name, TShock.Utils.GetActivePlayerCount(), TShock.Config.Settings.MaxSlots));
if (!player.SilentJoinInProgress)
if (!player.SilentJoinInProgress && player.FinishedHandshake)
Utils.Broadcast(GetString("{0} has joined.", player.Name), Color.Yellow);
}