Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Wolfje.Plugins.EnglishPlox/bin/
Wolfje.Plugins.EnglishPlox/obj/
.vs/Wolfje.Plugins.EnglishPlox/v15/Server/sqlite3/db.lock
.vs/Wolfje.Plugins.EnglishPlox/v15/Server/sqlite3/storage.ide
Binary file added .vs/Wolfje.Plugins.EnglishPlox/v15/.suo
Binary file not shown.
11 changes: 5 additions & 6 deletions Wolfje.Plugins.EnglishPlox/EnglishPloxPlugin.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Terraria;
using TerrariaApi;
using Terraria.Localization;

namespace Wolfje.Plugins.EnglishPlox {
[TerrariaApi.Server.ApiVersion(1, 20)]
namespace Wolfje.Plugins.EnglishPlox
{
[TerrariaApi.Server.ApiVersion(2, 1)]
public class EnglishPloxPlugin : TerrariaApi.Server.TerrariaPlugin {
public static readonly Regex invalidCharactersRegex = new Regex(@"[^\da-z!@#\$%\^\&\*\(\)\-\+~ ;{}|\[\]:\.,_`]", RegexOptions.IgnoreCase);

Expand Down Expand Up @@ -57,7 +56,7 @@ private void Server_Join(TerrariaApi.Server.JoinEventArgs args) {
foreach (Match m in invalidCharactersRegex.Matches(player.name)) {
sb.Append(m.Value);
}
Terraria.NetMessage.SendData((int)PacketTypes.Disconnect, player.whoAmI, text: "Your name cannot contain these characters: " + sb.ToString());
NetMessage.SendData((int)PacketTypes.Disconnect, player.whoAmI, text: NetworkText.FromLiteral("Your name cannot contain these characters: " + sb.ToString()));
}
}

Expand Down
5 changes: 4 additions & 1 deletion Wolfje.Plugins.EnglishPlox/Wolfje.Plugins.EnglishPlox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="OTAPI">
<HintPath>..\..\Tshock-refs\OTAPI.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand All @@ -39,7 +42,7 @@
<Reference Include="System.Xml" />
<Reference Include="TerrariaServer, Version=1.15.0.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\ServerInstance4.3\TerrariaServer.exe</HintPath>
<HintPath>..\..\Tshock-refs\TerrariaServer.exe</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down