Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kouwasi committed Mar 16, 2017
1 parent d148c33 commit d41a5e7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
16 changes: 9 additions & 7 deletions VACKicker.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Rocket.API.Collections;
using Rocket.Core.Logging;
using Rocket.Core.Plugins;
using Rocket.Unturned;
using Rocket.Core.Steam;
using Rocket.Unturned.Permissions;
using Rocket.Unturned.Player;
using SDG.Unturned;
Expand Down Expand Up @@ -52,25 +52,27 @@ public override TranslationList DefaultTranslations
};
}
}

private void Events_OnJoinRequested(CSteamID player, ref ESteamRejection? rejection)
{
UnturnedPlayer user = UnturnedPlayer.FromCSteamID(player);
bool? vacStatus = user.SteamProfile.IsVacBanned;
Profile SteamProfile = new Profile(ulong.Parse(player.ToString()));
bool? vacStatus = SteamProfile.IsVacBanned;

string name = SteamProfile.SteamID;

if (Instance.Configuration.Instance.Errorkick && (!(vacStatus.HasValue)))
{
rejection = ESteamRejection.PLUGIN;
Logger.LogError(Translate("vacStatus_null", user.DisplayName, player));
Logger.LogError(Translate("vacStatus_null", name, player));
}
else if (!(vacStatus.HasValue))
{
Logger.LogError(Translate("vacStatus_null", user.DisplayName, player));
Logger.LogError(Translate("vacStatus_null", name, player));
}
else
{
if ((bool)vacStatus) { rejection = ESteamRejection.AUTH_VAC_BAN; }
Logger.Log(Translate((bool)vacStatus ? "vacStatus_true" : "vacStatus_false", user.DisplayName, player));
Logger.Log(Translate((bool)vacStatus ? "vacStatus_true" : "vacStatus_false", name, player));
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions VACKicker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>lib\Assembly-CSharp.dll</HintPath>
<HintPath>D:\SteamLibrary\steamapps\common\Unturned\Unturned_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>lib\Assembly-CSharp-firstpass.dll</HintPath>
<HintPath>D:\SteamLibrary\steamapps\common\Unturned\Unturned_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Rocket.API">
<HintPath>lib\Rocket.API.dll</HintPath>
<HintPath>E:\kouwa\Desktop\Unturned\Unturned_1162\Unturned\Modules\Rocket.Unturned\Rocket.API.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Rocket.Core">
<HintPath>lib\Rocket.Core.dll</HintPath>
<HintPath>E:\kouwa\Desktop\Unturned\Unturned_1162\Unturned\Modules\Rocket.Unturned\Rocket.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Rocket.Unturned">
<HintPath>lib\Rocket.Unturned.dll</HintPath>
<HintPath>E:\kouwa\Desktop\Unturned\Unturned_1162\Unturned\Modules\Rocket.Unturned\Rocket.Unturned.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
Expand All @@ -57,7 +57,7 @@
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine">
<HintPath>lib\UnityEngine.dll</HintPath>
<HintPath>D:\SteamLibrary\steamapps\common\Unturned\Unturned_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
Expand Down

0 comments on commit d41a5e7

Please sign in to comment.