Fixed ModSDK players from joining and getting sandbox file. (#399)

This commit is contained in:
Bob Da Ross
2020-08-10 16:21:13 -05:00
committed by GitHub
parent e9e446f8ab
commit 80a820ae3d

View File

@@ -112,6 +112,10 @@ namespace Torch.Server.Managers
public bool IsBanned(ulong steamId) => _isClientBanned.Invoke(MyMultiplayer.Static, steamId) || public bool IsBanned(ulong steamId) => _isClientBanned.Invoke(MyMultiplayer.Static, steamId) ||
MySandboxGame.ConfigDedicated.Banned.Contains(steamId); MySandboxGame.ConfigDedicated.Banned.Contains(steamId);
public bool IsProfiling(ulong steamId) => _Profiling.Invoke((MyDedicatedServerBase)MyMultiplayer.Static, steamId);
/// <inheritdoc /> /// <inheritdoc />
public event Action<ulong> PlayerKicked; public event Action<ulong> PlayerKicked;
@@ -173,6 +177,9 @@ namespace Torch.Server.Managers
[ReflectedStaticMethod(Type = typeof(MyGameService), Name = "GetServerAccountType")] [ReflectedStaticMethod(Type = typeof(MyGameService), Name = "GetServerAccountType")]
private static Func<ulong, MyGameServiceAccountType> _getServerAccountType; private static Func<ulong, MyGameServiceAccountType> _getServerAccountType;
[ReflectedMethod(Name = "ClientIsProfiling")]
private static Func<MyDedicatedServerBase, ulong, bool> _Profiling;
[ReflectedMethod(Name = "UserAccepted")] [ReflectedMethod(Name = "UserAccepted")]
private static Action<MyDedicatedServerBase, ulong> _userAcceptedImpl; private static Action<MyDedicatedServerBase, ulong> _userAcceptedImpl;
@@ -218,6 +225,11 @@ namespace Torch.Server.Managers
_log.Debug($"ValidateAuthTicketResponse(user={steamId}, response={response}, owner={steamOwner}, permissions={promoteLevel})"); _log.Debug($"ValidateAuthTicketResponse(user={steamId}, response={response}, owner={steamOwner}, permissions={promoteLevel})");
_log.Info($"Connection attempt by {steamId} from {ip}"); _log.Info($"Connection attempt by {steamId} from {ip}");
if (IsProfiling(steamId))
{
UserRejected(arg1, JoinResult.ProfilingNotAllowed);
}
if (Players.ContainsKey(steamId)) if (Players.ContainsKey(steamId))
{ {