Some i18nifiying
This commit is contained in:
parent
39576e3180
commit
f63b26ac76
31 changed files with 538 additions and 455 deletions
|
|
@ -18,7 +18,7 @@ namespace TShockAPI.Handlers
|
|||
/// Thus, they would not be able to modify its content. This means that a hacker attempted to send this packet directly, or through raw bytes to tamper with the DisplayDoll. This is why I do not bother with making sure the player gets their item back.
|
||||
if (!args.Player.HasBuildPermission(args.DisplayDollEntity.Position.X, args.DisplayDollEntity.Position.Y, false))
|
||||
{
|
||||
args.Player.SendErrorMessage("You do not have permission to modify a Mannequin in a protected area!");
|
||||
args.Player.SendErrorMessage(GetString("You do not have permission to modify a Mannequin in a protected area!"));
|
||||
args.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace TShockAPI.Handlers
|
|||
{
|
||||
if (!args.Player.HasPermission(Permissions.sendemoji))
|
||||
{
|
||||
args.Player.SendErrorMessage("You do not have permission to send emotes!");
|
||||
args.Player.SendErrorMessage(GetString("You do not have permission to send emotes!"));
|
||||
args.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace TShockAPI.Handlers.IllegalPerSe
|
|||
{
|
||||
if (args.PlayerIndex != args.Player.Index)
|
||||
{
|
||||
TShock.Log.ConsoleError($"IllegalPerSe: Emoji packet rejected for ID spoofing. Expected {args.Player.Index}, received {args.PlayerIndex} from {args.Player.Name}.");
|
||||
TShock.Log.ConsoleError(GetString($"IllegalPerSe: Emoji packet rejected for ID spoofing. Expected {args.Player.Index}, received {args.PlayerIndex} from {args.Player.Name}."));
|
||||
args.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ namespace TShockAPI.Handlers
|
|||
{
|
||||
if (args.PlayerIndex != args.Player.Index)
|
||||
{
|
||||
TShock.Log.ConsoleDebug($"LandGolfBallInCupHandler: Packet rejected for ID spoofing. Expected {args.Player.Index}, received {args.PlayerIndex} from {args.Player.Name}.");
|
||||
TShock.Log.ConsoleDebug(GetString($"LandGolfBallInCupHandler: Packet rejected for ID spoofing. Expected {args.Player.Index}, received {args.PlayerIndex} from {args.Player.Name}."));
|
||||
args.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
|
@ -97,21 +97,21 @@ namespace TShockAPI.Handlers
|
|||
if (args.TileX > Main.maxTilesX || args.TileX < 0
|
||||
|| args.TileY > Main.maxTilesY || args.TileY < 0)
|
||||
{
|
||||
TShock.Log.ConsoleDebug($"LandGolfBallInCupHandler: X and Y position is out of world bounds! - From {args.Player.Name}");
|
||||
TShock.Log.ConsoleDebug(GetString($"LandGolfBallInCupHandler: X and Y position is out of world bounds! - From {args.Player.Name}"));
|
||||
args.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Main.tile[args.TileX, args.TileY].active() && Main.tile[args.TileX, args.TileY].type != TileID.GolfHole)
|
||||
{
|
||||
TShock.Log.ConsoleDebug($"LandGolfBallInCupHandler: Tile at packet position X:{args.TileX} Y:{args.TileY} is not a golf hole! - From {args.Player.Name}");
|
||||
TShock.Log.ConsoleDebug(GetString($"LandGolfBallInCupHandler: Tile at packet position X:{args.TileX} Y:{args.TileY} is not a golf hole! - From {args.Player.Name}"));
|
||||
args.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GolfBallProjectileIDs.Contains(args.ProjectileType))
|
||||
{
|
||||
TShock.Log.ConsoleDebug($"LandGolfBallInCupHandler: Invalid golf ball projectile ID {args.ProjectileType}! - From {args.Player.Name}");
|
||||
TShock.Log.ConsoleDebug(GetString($"LandGolfBallInCupHandler: Invalid golf ball projectile ID {args.ProjectileType}! - From {args.Player.Name}"));
|
||||
args.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
|
@ -120,14 +120,14 @@ namespace TShockAPI.Handlers
|
|||
var usedGolfClub = args.Player.RecentlyCreatedProjectiles.Any(e => e.Type == ProjectileID.GolfClubHelper);
|
||||
if (!usedGolfClub && !usedGolfBall)
|
||||
{
|
||||
TShock.Log.ConsoleDebug($"GolfPacketHandler: Player did not have create a golf club projectile the last 5 seconds! - From {args.Player.Name}");
|
||||
TShock.Log.ConsoleDebug(GetString($"GolfPacketHandler: Player did not have create a golf club projectile the last 5 seconds! - From {args.Player.Name}"));
|
||||
args.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GolfClubItemIDs.Contains(args.Player.SelectedItem.type))
|
||||
{
|
||||
TShock.Log.ConsoleDebug($"LandGolfBallInCupHandler: Item selected is not a golf club! - From {args.Player.Name}");
|
||||
TShock.Log.ConsoleDebug(GetString($"LandGolfBallInCupHandler: Item selected is not a golf club! - From {args.Player.Name}"));
|
||||
args.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ namespace TShockAPI.Handlers.NetModules
|
|||
{
|
||||
if (!PowerToPermissionMap.ContainsKey(powerType))
|
||||
{
|
||||
TShock.Log.ConsoleDebug("CreativePowerHandler received permission check request for unknown creative power");
|
||||
TShock.Log.ConsoleDebug(GetString("CreativePowerHandler received permission check request for unknown creative power"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ namespace TShockAPI.Handlers.NetModules
|
|||
|
||||
if (!player.HasPermission(permission))
|
||||
{
|
||||
player.SendErrorMessage("You do not have permission to {0}.", PermissionToDescriptionMap[permission]);
|
||||
player.SendErrorMessage(PermissionToDescriptionMap[permission]);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -100,18 +100,18 @@ namespace TShockAPI.Handlers.NetModules
|
|||
/// </summary>
|
||||
public static Dictionary<string, string> PermissionToDescriptionMap = new Dictionary<string, string>
|
||||
{
|
||||
{ Permissions.journey_timefreeze, "freeze the time of the server" },
|
||||
{ Permissions.journey_timeset, "modify the time of the server" },
|
||||
{ Permissions.journey_godmode, "toggle godmode" },
|
||||
{ Permissions.journey_windstrength, "modify the wind strength of the server" },
|
||||
{ Permissions.journey_rainstrength, "modify the rain strength of the server" },
|
||||
{ Permissions.journey_timespeed, "modify the time speed of the server" },
|
||||
{ Permissions.journey_rainfreeze, "freeze the rain strength of the server" },
|
||||
{ Permissions.journey_windfreeze, "freeze the wind strength of the server" },
|
||||
{ Permissions.journey_placementrange, "modify the tile placement range of your character" },
|
||||
{ Permissions.journey_setdifficulty, "modify the world difficulty of the server" },
|
||||
{ Permissions.journey_biomespreadfreeze, "freeze the biome spread of the server" },
|
||||
{ Permissions.journey_setspawnrate, "modify the NPC spawn rate of the server" },
|
||||
{ Permissions.journey_timefreeze, GetString("You do not have permission to freeze the time of the server.") },
|
||||
{ Permissions.journey_timeset, GetString("You do not have permission to modify the time of the server.") },
|
||||
{ Permissions.journey_godmode, GetString("You do not have permission to toggle godmode.") },
|
||||
{ Permissions.journey_windstrength, GetString("You do not have permission to modify the wind strength of the server.") },
|
||||
{ Permissions.journey_rainstrength, GetString("You do not have permission to modify the rain strength of the server.") },
|
||||
{ Permissions.journey_timespeed, GetString("You do not have permission to modify the time speed of the server.") },
|
||||
{ Permissions.journey_rainfreeze, GetString("You do not have permission to freeze the rain strength of the server.") },
|
||||
{ Permissions.journey_windfreeze, GetString("You do not have permission to freeze the wind strength of the server.") },
|
||||
{ Permissions.journey_placementrange, GetString("You do not have permission to modify the tile placement range of your character.") },
|
||||
{ Permissions.journey_setdifficulty, GetString("You do not have permission to modify the world difficulty of the server.") },
|
||||
{ Permissions.journey_biomespreadfreeze, GetString("You do not have permission to freeze the biome spread of the server.") },
|
||||
{ Permissions.journey_setspawnrate, GetString("You do not have permission to modify the NPC spawn rate of the server.") },
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,8 +52,7 @@ namespace TShockAPI.Handlers.NetModules
|
|||
if (!Main.GameModeInfo.IsJourneyMode)
|
||||
{
|
||||
TShock.Log.ConsoleDebug(
|
||||
"NetModuleHandler received attempt to unlock sacrifice while not in journey mode from",
|
||||
player.Name
|
||||
GetString($"NetModuleHandler received attempt to unlock sacrifice while not in journey mode from {player.Name}")
|
||||
);
|
||||
|
||||
rejectPacket = true;
|
||||
|
|
@ -63,9 +62,7 @@ namespace TShockAPI.Handlers.NetModules
|
|||
if (UnknownField != 0)
|
||||
{
|
||||
TShock.Log.ConsoleDebug(
|
||||
"CreativeUnlocksHandler received non-vanilla unlock request. Random field value: {0} but should be 0 from {1}",
|
||||
UnknownField,
|
||||
player.Name
|
||||
GetString($"CreativeUnlocksHandler received non-vanilla unlock request. Random field value: {UnknownField} but should be 0 from {player.Name}")
|
||||
);
|
||||
|
||||
rejectPacket = true;
|
||||
|
|
@ -74,7 +71,7 @@ namespace TShockAPI.Handlers.NetModules
|
|||
|
||||
if (!player.HasPermission(Permissions.journey_contributeresearch))
|
||||
{
|
||||
player.SendErrorMessage("You do not have permission to contribute research.");
|
||||
player.SendErrorMessage(GetString("You do not have permission to contribute research."));
|
||||
rejectPacket = true;
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ namespace TShockAPI.Handlers.NetModules
|
|||
if (!player.HasPermission(Permissions.pylon))
|
||||
{
|
||||
rejectPacket = true;
|
||||
player.SendErrorMessage("You do not have permission to teleport using pylons.");
|
||||
player.SendErrorMessage(GetString("You do not have permission to teleport using pylons."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ using static TShockAPI.GetDataHandlers;
|
|||
namespace TShockAPI.Handlers
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
public class RequestTileEntityInteractionHandler : IPacketHandler<RequestTileEntityInteractionEventArgs>
|
||||
{
|
||||
|
|
@ -19,20 +19,20 @@ namespace TShockAPI.Handlers
|
|||
{
|
||||
if (args.TileEntity is TEHatRack && !args.Player.HasBuildPermissionForTileObject(args.TileEntity.Position.X, args.TileEntity.Position.Y, TEHatRack.entityTileWidth, TEHatRack.entityTileHeight, false))
|
||||
{
|
||||
args.Player.SendErrorMessage("You do not have permission to modify a Hat Rack in a protected area!");
|
||||
args.Player.SendErrorMessage(GetString("You do not have permission to modify a Hat Rack in a protected area!"));
|
||||
args.Handled = true;
|
||||
return;
|
||||
}
|
||||
else if (args.TileEntity is TEDisplayDoll && !args.Player.HasBuildPermissionForTileObject(args.TileEntity.Position.X, args.TileEntity.Position.Y, TEDisplayDoll.entityTileWidth, TEDisplayDoll.entityTileHeight, false))
|
||||
{
|
||||
args.Player.SendErrorMessage("You do not have permission to modify a Mannequin in a protected area!");
|
||||
args.Player.SendErrorMessage(GetString("You do not have permission to modify a Mannequin in a protected area!"));
|
||||
args.Handled = true;
|
||||
return;
|
||||
}
|
||||
else if (!args.Player.HasBuildPermission(args.TileEntity.Position.X, args.TileEntity.Position.Y, false))
|
||||
{
|
||||
args.Player.SendErrorMessage("You do not have permission to modify a TileEntity in a protected area!");
|
||||
TShock.Log.ConsoleDebug($"RequestTileEntityInteractionHandler: Rejected packet due to lack of building permissions! - From {args.Player.Name} | Position X:{args.TileEntity.Position.X} Y:{args.TileEntity.Position.Y}, TileEntity type: {args.TileEntity.type}, Tile type: {Main.tile[args.TileEntity.Position.X, args.TileEntity.Position.Y].type}");
|
||||
args.Player.SendErrorMessage(GetString("You do not have permission to modify a TileEntity in a protected area!"));
|
||||
TShock.Log.ConsoleDebug(GetString($"RequestTileEntityInteractionHandler: Rejected packet due to lack of building permissions! - From {args.Player.Name} | Position X:{args.TileEntity.Position.X} Y:{args.TileEntity.Position.Y}, TileEntity type: {args.TileEntity.type}, Tile type: {Main.tile[args.TileEntity.Position.X, args.TileEntity.Position.Y].type}"));
|
||||
args.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ namespace TShockAPI.Handlers
|
|||
if (args.Handled == true)
|
||||
{
|
||||
TSPlayer.All.SendTileRect(args.TileX, args.TileY, args.Width, args.Length);
|
||||
TShock.Log.ConsoleDebug("Bouncer / SendTileRect reimplemented from carbonara from {0}", args.Player.Name);
|
||||
TShock.Log.ConsoleDebug(GetString($"Bouncer / SendTileRect reimplemented from carbonara from {args.Player.Name}"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -289,13 +289,13 @@ namespace TShockAPI.Handlers
|
|||
// More in depth checks should take place in handlers for the Place Object (79), Update Tile Entity (86), and Place Tile Entity (87) packets
|
||||
if (!args.Player.HasBuildPermissionForTileObject(realX, realY, width, height))
|
||||
{
|
||||
TShock.Log.ConsoleDebug("Bouncer / SendTileRect rejected from no permission for tile object from {0}", args.Player.Name);
|
||||
TShock.Log.ConsoleDebug(GetString($"Bouncer / SendTileRect rejected from no permission for tile object from {args.Player.Name}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (TShock.TileBans.TileIsBanned((short)tileType))
|
||||
{
|
||||
TShock.Log.ConsoleDebug("Bouncer / SendTileRect rejected for banned tile");
|
||||
TShock.Log.ConsoleDebug(GetString("Bouncer / SendTileRect rejected for banned tile"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -410,7 +410,7 @@ namespace TShockAPI.Handlers
|
|||
TileID.Sets.Conversion.MossBrick[tile.type] && TileID.Sets.Conversion.MossBrick[newTile.Type]
|
||||
)
|
||||
{
|
||||
TShock.Log.ConsoleDebug("Bouncer / SendTileRect processing a tile conversion update - [{0}] -> [{1}]", tile.type, newTile.Type);
|
||||
TShock.Log.ConsoleDebug(GetString($"Bouncer / SendTileRect processing a tile conversion update - [{tile.type}] -> [{newTile.Type}]"));
|
||||
UpdateServerTileState(tile, newTile, TileDataType.Tile);
|
||||
}
|
||||
|
||||
|
|
@ -425,7 +425,7 @@ namespace TShockAPI.Handlers
|
|||
WallID.Sets.Conversion.NewWall4[tile.wall] && WallID.Sets.Conversion.NewWall4[newTile.Wall]
|
||||
)
|
||||
{
|
||||
TShock.Log.ConsoleDebug("Bouncer / SendTileRect processing a wall conversion update - [{0}] -> [{1}]", tile.wall, newTile.Wall);
|
||||
TShock.Log.ConsoleDebug($"Bouncer / SendTileRect processing a wall conversion update - [{tile.wall}] -> [{newTile.Wall}]");
|
||||
UpdateServerTileState(tile, newTile, TileDataType.Wall);
|
||||
}
|
||||
}
|
||||
|
|
@ -554,27 +554,27 @@ namespace TShockAPI.Handlers
|
|||
{
|
||||
if (args.Player.HasPermission(Permissions.allowclientsideworldedit))
|
||||
{
|
||||
TShock.Log.ConsoleDebug("Bouncer / SendTileRect accepted clientside world edit from {0}", args.Player.Name);
|
||||
TShock.Log.ConsoleDebug(GetString($"Bouncer / SendTileRect accepted clientside world edit from {args.Player.Name}"));
|
||||
args.Handled = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args.Width > 4 || args.Length > 4) // as of 1.4.3.6 this is the biggest size the client will send in any case
|
||||
{
|
||||
TShock.Log.ConsoleDebug("Bouncer / SendTileRect rejected from non-vanilla tilemod from {0}", args.Player.Name);
|
||||
TShock.Log.ConsoleDebug(GetString($"Bouncer / SendTileRect rejected from non-vanilla tilemod from {args.Player.Name}"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args.Player.IsBouncerThrottled())
|
||||
{
|
||||
TShock.Log.ConsoleDebug("Bouncer / SendTileRect rejected from throttle from {0}", args.Player.Name);
|
||||
TShock.Log.ConsoleDebug(GetString($"Bouncer / SendTileRect rejected from throttle from {args.Player.Name}"));
|
||||
args.Player.SendTileRect(args.TileX, args.TileY, args.Length, args.Width);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args.Player.IsBeingDisabled())
|
||||
{
|
||||
TShock.Log.ConsoleDebug("Bouncer / SendTileRect rejected from being disabled from {0}", args.Player.Name);
|
||||
TShock.Log.ConsoleDebug(GetString($"Bouncer / SendTileRect rejected from being disabled from {args.Player.Name}"));
|
||||
args.Player.SendTileRect(args.TileX, args.TileY, args.Length, args.Width);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -606,7 +606,7 @@ namespace TShockAPI.Handlers
|
|||
}
|
||||
}
|
||||
|
||||
TShock.Log.ConsoleDebug("Bouncer / SendTileRectHandler - rejected tile object because object dimensions fall outside the tile rect (excessive size)");
|
||||
TShock.Log.ConsoleDebug(GetString("Bouncer / SendTileRectHandler - rejected tile object because object dimensions fall outside the tile rect (excessive size)"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace TShockAPI.Handlers
|
|||
if (args.TileX > Main.maxTilesX || args.TileX < 0
|
||||
|| args.TileY > Main.maxTilesY || args.TileY < 0)
|
||||
{
|
||||
TShock.Log.ConsoleDebug($"SyncTilePickingHandler: X and Y position is out of world bounds! - From {args.Player.Name}");
|
||||
TShock.Log.ConsoleDebug(GetString($"SyncTilePickingHandler: X and Y position is out of world bounds! - From {args.Player.Name}"));
|
||||
args.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue