Class SteamFriends


  • public class SteamFriends
    extends ClientMsgHandler
    This handler handles all interaction with other users on the Steam3 network.
    • Constructor Detail

      • SteamFriends

        public SteamFriends()
    • Method Detail

      • setPersonaName

        public void setPersonaName​(java.lang.String name)
        Sets the local user's persona name and broadcasts it over the network. Results are returned in aPersonaChangeCallback callback.
        Parameters:
        name - The name.
      • setPersonaState

        public void setPersonaState​(EPersonaState state)
        Sets the local user's persona state and broadcasts it over the network. Results are returned in aPersonaChangeCallback callback.
        Parameters:
        state - The state.
      • resetPersonaStateFlag

        public void resetPersonaStateFlag()
        JavaSteam addition: Sets the local user's persona state flag back to normal desktop mode.
      • sendChatMessage

        public void sendChatMessage​(SteamID target,
                                    EChatEntryType type,
                                    java.lang.String message)
        Sends a chat message to a friend.
        Parameters:
        target - The target to send to.
        type - The type of message to send.
        message - The message to send.
      • addFriend

        public void addFriend​(java.lang.String accountNameOrEmail)
        Sends a friend request to a user.
        Parameters:
        accountNameOrEmail - The account name or email of the user.
      • addFriend

        public void addFriend​(SteamID steamID)
        Sends a friend request to a user.
        Parameters:
        steamID - The SteamID of the friend to add.
      • removeFriend

        public void removeFriend​(SteamID steamID)
        Removes a friend from your friends list.
        Parameters:
        steamID - The SteamID of the friend to remove.
      • joinChat

        public void joinChat​(SteamID steamID)
        Attempts to join a chat room.
        Parameters:
        steamID - The SteamID of the chat room.
      • leaveChat

        public void leaveChat​(SteamID steamID)
        Attempts to leave a chat room.
        Parameters:
        steamID - The SteamID of the chat room.
      • sendChatRoomMessage

        public void sendChatRoomMessage​(SteamID steamIdChat,
                                        EChatEntryType type,
                                        java.lang.String message)
        Sends a message to a chat room.
        Parameters:
        steamIdChat - The SteamID of the chat room.
        type - The message type.
        message - The message.
      • inviteUserToChat

        public void inviteUserToChat​(SteamID steamIdUser,
                                     SteamID steamIdChat)
        Invites a user to a chat room. The results of this action will be available through the ChatActionResultCallback callback.
        Parameters:
        steamIdUser - The SteamID of the user to invite.
        steamIdChat - The SteamID of the chat room to invite the user to.
      • kickChatMember

        public void kickChatMember​(SteamID steamIdChat,
                                   SteamID steamIdMember)
        Kicks the specified chat member from the given chat room.
        Parameters:
        steamIdChat - The SteamID of chat room to kick the member from.
        steamIdMember - The SteamID of the member to kick from the chat.
      • banChatMember

        public void banChatMember​(SteamID steamIdChat,
                                  SteamID steamIdMember)
        Bans the specified chat member from the given chat room.
        Parameters:
        steamIdChat - The SteamID of chat room to ban the member from.
        steamIdMember - The SteamID of the member to ban from the chat.
      • unbanChatMember

        public void unbanChatMember​(SteamID steamIdChat,
                                    SteamID steamIdMember)
        Unbans the specified chat member from the given chat room.
        Parameters:
        steamIdChat - The SteamID of chat room to unban the member from.
        steamIdMember - The SteamID of the member to unban from the chat.
      • requestFriendInfo

        public void requestFriendInfo​(java.util.List<SteamID> steamIdList,
                                      int requestedInfo)
        Requests persona state for a list of specified SteamID. Results are returned in PersonaState.
        Parameters:
        steamIdList - A list of SteamIDs to request the info of.
        requestedInfo - The requested info flags. If none specified, this uses SteamConfiguration.getDefaultPersonaStateFlags().
      • requestFriendInfo

        public void requestFriendInfo​(SteamID steamID,
                                      int requestedInfo)
        Requests persona state for a specified SteamID. Results are returned in PersonaState.
        Parameters:
        steamID - A SteamID to request the info of.
        requestedInfo - The requested info flags. If none specified, this uses SteamConfiguration.getDefaultPersonaStateFlags().
      • ignoreFriend

        public JobID ignoreFriend​(SteamID steamID)
        Ignores a friend on Steam. Results are returned in a IgnoreFriendCallback.
        Parameters:
        steamID - The SteamID of the friend to ignore or unignore.
        Returns:
        The Job ID of the request. This can be used to find the appropriate IgnoreFriendCallback.
      • ignoreFriend

        public JobID ignoreFriend​(SteamID steamID,
                                  boolean setIgnore)
        Ignores or unignores a friend on Steam. Results are returned in a IgnoreFriendCallback.
        Parameters:
        steamID - The SteamID of the friend to ignore or unignore.
        setIgnore - if set to true, the friend will be ignored; otherwise, they will be unignored.
        Returns:
        The Job ID of the request. This can be used to find the appropriate IgnoreFriendCallback.
      • requestProfileInfo

        public JobID requestProfileInfo​(SteamID steamID)
        Requests profile information for the given SteamID Results are returned in a ProfileInfoCallback
        Parameters:
        steamID - The SteamID of the friend to request the details of.
        Returns:
        The Job ID of the request. This can be used to find the appropriate ProfileInfoCallback.
      • requestMessageHistory

        public void requestMessageHistory​(SteamID steamID)
        Requests the last few chat messages with a friend. Results are returned in a FriendMsgHistoryCallback
        Parameters:
        steamID - SteamID of the friend
      • requestOfflineMessages

        public void requestOfflineMessages()
        Requests all offline messages. This also marks them as read server side. Results are returned in a FriendMsgHistoryCallback.
      • setFriendNickname

        public JobID setFriendNickname​(SteamID friendID,
                                       java.lang.String nickname)
        Set the nickname of a friend. The result is returned in a NicknameCallback.
        Parameters:
        friendID - the steam id of the friend
        nickname - the nickname to set to
        Returns:
        The Job ID of the request. This can be used to find the appropriate NicknameCallback.
      • requestAliasHistory

        public JobID requestAliasHistory​(SteamID steamID)
        Request the alias history of the account of the given steam id. The result is returned in a AliasHistoryCallback.
        Parameters:
        steamID - the steam id
        Returns:
        The Job ID of the request. This can be used to find the appropriate AliasHistoryCallback.
      • requestAliasHistory

        public JobID requestAliasHistory​(java.util.List<SteamID> steamIDs)
        Request the alias history of the accounts of the given steam ids. The result is returned in a AliasHistoryCallback.
        Parameters:
        steamIDs - the steam ids
        Returns:
        The Job ID of the request. This can be used to find the appropriate AliasHistoryCallback.
      • handleMsg

        public void handleMsg​(IPacketMsg packetMsg)
        Description copied from class: ClientMsgHandler
        Handles a client message. This should not be called directly.
        Specified by:
        handleMsg in class ClientMsgHandler
        Parameters:
        packetMsg - The packet message that contains the data.