</PropertyGroup>
<ItemGroup>
- <PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.0"/>
- <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0-rc.1.20451.14"/>
- <PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="5.0.0-rc.1.20451.14"/>
+ <PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.0" />
+ <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0-rc.1.20451.14" />
+ <PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="5.0.0-rc.1.20451.14" />
<PackageReference Include="Nullable" Version="1.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
--- /dev/null
+namespace Impostor.Api.Innersloth
+{
+ public static class TextBox
+ {
+ public static bool IsCharAllowed(char i)
+ {
+ return i == ' ' || (i >= 'A' && i <= 'Z') || (i >= 'a' && i <= 'z') || (i >= '0' && i <= '9') || (i >= 'À' && i <= 'ÿ') || (i >= 'Ѐ' && i <= 'џ') || (i >= 'ㄱ' && i <= 'ㆎ') || (i >= '가' && i <= '힣');
+ }
+ }
+}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
- <PropertyGroup>
- <TargetFramework>netstandard2.1</TargetFramework>
- </PropertyGroup>
+ <PropertyGroup>
+ <TargetFramework>netstandard2.1</TargetFramework>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\Impostor.Api\Impostor.Api.csproj"/>
+ </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Impostor.Api\Impostor.Api.csproj" />
- </ItemGroup>
</Project>
--- /dev/null
+using System.Collections.Generic;
+using Impostor.Api.Net;
+using Impostor.Api.Net.Manager;
+
+namespace Impostor.Server.Net.Manager
+{
+ internal partial class ClientManager : IClientManager
+ {
+ IEnumerable<IClient> IClientManager.Clients => _clients.Values;
+ }
+}
\ No newline at end of file
namespace Impostor.Server.Net.Manager
{
- internal class ClientManager : IClientManager
+ internal partial class ClientManager
{
- public static HashSet<int> SupportedVersions { get; } = new HashSet<int>
+ private static HashSet<int> SupportedVersions { get; } = new HashSet<int>
{
GameVersion.GetVersion(2020, 09, 07), // 2020.09.07 - 2020.09.22
GameVersion.GetVersion(2020, 10, 08), // 2020.10.08
public IEnumerable<ClientBase> Clients => _clients.Values;
- IEnumerable<IClient> IClientManager.Clients => _clients.Values;
-
public int NextId()
{
var clientId = Interlocked.Increment(ref _idLast);
return clientId;
}
- private static bool IsCharAllowed(char i)
- {
- return i == ' ' || (i >= 'A' && i <= 'Z') || (i >= 'a' && i <= 'z') || (i >= '0' && i <= '9') || (i >= 'À' && i <= 'ÿ') || (i >= 'Ѐ' && i <= 'џ') || (i >= 'ㄱ' && i <= 'ㆎ') || (i >= '가' && i <= '힣');
- }
-
public async ValueTask RegisterConnectionAsync(IHazelConnection connection, string name, int clientVersion)
{
if (!SupportedVersions.Contains(clientVersion))
return;
}
- if (string.IsNullOrWhiteSpace(name) || !name.All(IsCharAllowed))
+ if (string.IsNullOrWhiteSpace(name) || !name.All(TextBox.IsCharAllowed))
{
using var packet = MessageWriter.Get(MessageType.Reliable);
Message01JoinGameS2C.SerializeError(packet, false, DisconnectReason.Custom, DisconnectMessages.UsernameIllegalCharacters);