-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring, fixes, remove DisposeHelper
- Loading branch information
1 parent
4bc2997
commit d4523f0
Showing
4 changed files
with
34 additions
and
72 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters