示例#1
0
文件: SteamEx.cs 项目: CyberSys/UTA
        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());
            }
        }
示例#2
0
        public static string GetSteamID3()
        {
            // fill out the CSteamID structure with our own SteamID
            // via the SteamUser interface
            CSteamID steamID = SteamUser.GetSteamID();

            // returning the required information from the CSteamID struct
            // to form the SteamID3
            // U = EUniverse, I exclude this, because it will always be 1.
            // {0} = EAccountType, this *should* always be 1, however, it depends on the account, so I get it just incase.
            // {1} = the AccountID, this is 32bits long, and is completely unique per account.
            // the output should be something like [U:1:XXXXXXXX]
            return(string.Format("SteamID3: [U:{0}:{1}]\n", (int)steamID.GetEAccountType(), steamID.GetAccountID()));
        }