Skip to content

Commit

Permalink
Refactoring, fixes, remove DisposeHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnamed434 committed Jul 10, 2023
1 parent 4bc2997 commit d4523f0
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 72 deletions.
14 changes: 0 additions & 14 deletions src/RocketPluginHelper/Helpers/CSteamIdHelper.cs

This file was deleted.

57 changes: 0 additions & 57 deletions src/RocketPluginHelper/Helpers/DisposeHelper.cs

This file was deleted.

34 changes: 34 additions & 0 deletions src/RocketPluginHelper/Helpers/SteamIdHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
namespace RocketPluginHelper.Helpers;

[UsedImplicitly(ImplicitUseTargetFlags.WithMembers)]
public static class SteamIdHelper
{
public static CSteamID GetSteamId(this IRocketPlayer source)
{
if (source is UnturnedPlayer unturnedPlayer)
{
return unturnedPlayer.CSteamID;
}
return Provider.server;
}
public static CSteamID GetSteamId(this Player source)
{
return source.channel.owner.GetSteamId();
}
public static CSteamID GetSteamId(this SteamPlayer source)
{
return source.playerID.steamID;
}
public static string GetStringSteamId(this Player source)
{
return source.channel.owner.GetStringSteamId();
}
public static string GetStringSteamId(this SteamPlayer source)
{
return source.playerID.steamID.GetStringSteamId();
}
public static string GetStringSteamId(this CSteamID source)
{
return source.m_SteamID.ToString();
}
}
1 change: 0 additions & 1 deletion src/RocketPluginHelper/RocketPluginHelper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

<ItemGroup>
<PackageReference Include="Nito.AsyncEx.Context" Version="5.1.2"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.24"/>
<PackageReference Include="RocketMod.Modern.Dependencies" Version="1.1.2.5" PrivateAssets="true"/>
<PackageReference Include="OpenMod.UniTask" Version="*">
<IncludeAssets>compile</IncludeAssets>
Expand Down

0 comments on commit d4523f0

Please sign in to comment.