mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-23 20:43:04 +00:00
28 lines
870 B
C#
28 lines
870 B
C#
|
#if STEAM
|
|||
|
|
|||
|
using Steamworks;
|
|||
|
|
|||
|
namespace Facepunch.Steam
|
|||
|
{
|
|||
|
public static class SteamEx
|
|||
|
{
|
|||
|
public static string Format(this CSteamID steamID)
|
|||
|
{
|
|||
|
if (steamID.GetEAccountType() == EAccountType.k_EAccountTypeInvalid ||
|
|||
|
steamID.GetEAccountType() == EAccountType.k_EAccountTypeIndividual) {
|
|||
|
uint accountID = steamID.GetAccountID().m_AccountID;
|
|||
|
|
|||
|
if (steamID.GetEUniverse() <= EUniverse.k_EUniversePublic) {
|
|||
|
return string.Format("STEAM_0:{0}:{1}", accountID & 1, accountID >> 1);
|
|||
|
} else {
|
|||
|
return string.Format("STEAM_{2}:{0}:{1}", accountID & 1, accountID >> 1,
|
|||
|
(int) steamID.GetEUniverse());
|
|||
|
}
|
|||
|
} else {
|
|||
|
return steamID.ToString();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endif
|