Render() public method

Renders this instance into it's "STEAM_" represenation.
public Render ( ) : string
return string
Esempio n. 1
0
 /// <summary>
 /// Adds a chat room that is automatically joined on start-up.
 /// </summary>
 /// <param name="steamID">The SteamID of the chat room.</param>
 public void AddChatRoomToAutoJoin(SteamID steamID)
 {
     using (var file = new StreamWriter(File.OpenWrite(_autoJoinPath)))
     {
         file.WriteLine(steamID.Render());
         file.Flush();
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Saves a new admin.
 /// </summary>
 private void SaveAdmin(SteamID steamID)
 {
     using (var file = new StreamWriter(_adminListPath))
     {
         file.WriteLine(steamID.Render());
         file.Flush();
     }
 }
Esempio n. 3
0
        /*
         * From VoiDeD's bot: https://github.com/VoiDeD/steam-irc-bot/blob/cedb7636e529fa226188ce102f5ee1337f8bed63/SteamIrcBot/Utils/Utils.cs#L191
         */
        private static string ExpandSteamID(SteamID input)
        {
            string displayInstance = input.AccountInstance.ToString();

            switch (input.AccountInstance)
            {
                case SteamID.AllInstances:
                    displayInstance = "All";
                    break;

                case SteamID.DesktopInstance:
                    displayInstance = "Desktop";
                    break;

                case SteamID.ConsoleInstance:
                    displayInstance = "Console";
                    break;

                case SteamID.WebInstance:
                    displayInstance = "Web";
                    break;

                case (uint)SteamID.ChatInstanceFlags.Clan:
                    displayInstance = "Clan";
                    break;

                case (uint)SteamID.ChatInstanceFlags.Lobby:
                    displayInstance = "Lobby";
                    break;

                case (uint)SteamID.ChatInstanceFlags.MMSLobby:
                    displayInstance = "MMS Lobby";
                    break;
            }

            return string.Format("{0} / {1} (UInt64: {2}, AccountID: {3}, IsValid: {4}, Universe: {5}, Instance: {6}, Type: {7})",
                input.Render(), input.Render(true), input.ConvertToUInt64(), input.AccountID, input.IsValid, input.AccountUniverse, displayInstance, input.AccountType);
        }
Esempio n. 4
0
 public String SteamIdToName(SteamID id)
 {
     return steamFriends.GetFriendPersonaName(id) + " [" + id.Render() + "]";
 }
Esempio n. 5
0
        public void MemberLeftChat(SteamID chatterID)
        {
            mChattingUsers [chatRoomID] = mChattingUsers [chatRoomID].Where (x => x.id != chatterID).ToList ();

            if (chatterID == this.steamUser.SteamID)
            {
                log.Info (String.Format ("I [[{0}]] left the chat (or was kicked)", chatterID.Render ()));

                AllChatrooms.Remove (chatRoomID);
            }

            log.Info (String.Format ("{0}[[{1}]] left the chat", steamFriends.GetFriendPersonaName (chatterID), chatterID.Render ()));

            //Show this event to subscribing users
            List<SteamID> subscribingUsers;
            UserRelays.TryGetValue (chatRoomID, out subscribingUsers);
            if (subscribingUsers != null)
            {
                foreach (SteamID user in subscribingUsers)
                {
                    FriendMessage (user, String.Format ("{0} left the chat.", steamFriends.GetFriendPersonaName (chatterID)));
                }
            }
        }
Esempio n. 6
0
        public void Steam3StringSymmetric()
        {
            var steamIds = new[]
            {
                "[U:1:123]",
                "[U:1:123:2]",
                "[G:1:626]",
                "[A:2:165:1234]",
            };

            foreach ( var steamId in steamIds )
            {
                SteamID sid = new SteamID();
                bool parsed = sid.SetFromSteam3String( steamId );
                Assert.True( parsed );
                Assert.Equal( steamId, sid.Render( steam3: true ) );
            }
        }
Esempio n. 7
0
 public void RendersOutOfRangeAccountTypeAsLowercaseI()
 {
     SteamID sid = new SteamID( 123, EUniverse.Beta, (EAccountType)(-1) );
     Assert.Equal( "[i:2:123]", sid.Render(steam3: true) );
 }