コード例 #1
0
ファイル: SteamID.cs プロジェクト: millworm/SteamToolkit
 public SteamId(string steamIdText, bool id3 = false)
 {
     if (id3)
     {
         string[] exploded = steamIdText.Split(':');
         if (exploded[0].ToUpper() != "U")
         {
             throw new ArgumentException("Group ids not supported.");
         }
         AccountId    = Convert.ToUInt32(exploded[2].Remove(exploded[2].Length - 1));
         SteamIdUlong = IdConversions.AccountIdToUlong(AccountId);
         SteamIdText  = IdConversions.AccountIdToSteamIdText(AccountId);
         SteamId3Text = SteamIdText;
     }
     else
     {
         AccountId    = IdConversions.SteamIdTextToAccountId(steamIdText);
         SteamIdUlong = IdConversions.SteamIdTextToUlong(steamIdText);
         if (SteamIdUlong < 76561197960265728)
         {
             throw new ArgumentException("SteamIdUlong cannot be less than '76561197960265728'");
         }
         SteamIdText = steamIdText;
     }
 }
コード例 #2
0
ファイル: SteamID.cs プロジェクト: millworm/SteamToolkit
 public SteamId(ulong steamIdUlong)
 {
     if (steamIdUlong < 76561197960265728)
     {
         throw new ArgumentException("SteamIdUlong cannot be less than '76561197960265728'");
     }
     AccountId    = IdConversions.UlongToAccountId(steamIdUlong);
     SteamIdUlong = steamIdUlong;
     SteamIdText  = IdConversions.UlongToSteamIdText(steamIdUlong);
 }
コード例 #3
0
ファイル: SteamID.cs プロジェクト: millworm/SteamToolkit
 /// <summary>
 /// Initializes a new SteamId as well as automatically performing the conversions to 'AccountId' 'SteamIdUlong' 'SteamIdText'
 /// </summary>
 /// <param name="accountId"></param>
 public SteamId(uint accountId)
 {
     AccountId    = accountId;
     SteamIdUlong = IdConversions.AccountIdToUlong(accountId);
     if (SteamIdUlong < 76561197960265728)
     {
         throw new ArgumentException("SteamIdUlong cannot be less than '76561197960265728'");
     }
     SteamIdText = IdConversions.AccountIdToSteamIdText(accountId);
 }