Class SteamFriends
- java.lang.Object
-
- in.dragonbra.javasteam.handlers.ClientMsgHandler
-
- in.dragonbra.javasteam.steam.handlers.steamfriends.SteamFriends
-
public class SteamFriends extends ClientMsgHandler
This handler handles all interaction with other users on the Steam3 network.
-
-
Field Summary
-
Fields inherited from class in.dragonbra.javasteam.handlers.ClientMsgHandler
client
-
-
Constructor Summary
Constructors Constructor Description SteamFriends()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFriend(SteamID steamID)Sends a friend request to a user.voidaddFriend(java.lang.String accountNameOrEmail)Sends a friend request to a user.voidbanChatMember(SteamID steamIdChat, SteamID steamIdMember)Bans the specified chat member from the given chat room.voidhandleMsg(IPacketMsg packetMsg)Handles a client message.JobIDignoreFriend(SteamID steamID)Ignores a friend on Steam.JobIDignoreFriend(SteamID steamID, boolean setIgnore)Ignores or unignores a friend on Steam.voidinviteUserToChat(SteamID steamIdUser, SteamID steamIdChat)Invites a user to a chat room.voidjoinChat(SteamID steamID)Attempts to join a chat room.voidkickChatMember(SteamID steamIdChat, SteamID steamIdMember)Kicks the specified chat member from the given chat room.voidleaveChat(SteamID steamID)Attempts to leave a chat room.voidremoveFriend(SteamID steamID)Removes a friend from your friends list.JobIDrequestAliasHistory(SteamID steamID)Request the alias history of the account of the given steam id.JobIDrequestAliasHistory(java.util.List<SteamID> steamIDs)Request the alias history of the accounts of the given steam ids.voidrequestFriendInfo(SteamID steamID, int requestedInfo)Requests persona state for a specified SteamID.voidrequestFriendInfo(java.util.List<SteamID> steamIdList, int requestedInfo)Requests persona state for a list of specified SteamID.voidrequestMessageHistory(SteamID steamID)Requests the last few chat messages with a friend.voidrequestOfflineMessages()Requests all offline messages.JobIDrequestProfileInfo(SteamID steamID)Requests profile information for the givenSteamIDResults are returned in aProfileInfoCallbackvoidresetPersonaStateFlag()JavaSteam addition: Sets the local user's persona state flag back to normal desktop mode.voidsendChatMessage(SteamID target, EChatEntryType type, java.lang.String message)Sends a chat message to a friend.voidsendChatRoomMessage(SteamID steamIdChat, EChatEntryType type, java.lang.String message)Sends a message to a chat room.JobIDsetFriendNickname(SteamID friendID, java.lang.String nickname)Set the nickname of a friend.voidsetPersonaName(java.lang.String name)Sets the local user's persona name and broadcasts it over the network.voidsetPersonaState(EPersonaState state)Sets the local user's persona state and broadcasts it over the network.voidsetPersonaStateFlag(EPersonaStateFlag flag)JavaSteam addition: Sets the local user's persona state flag to a valid ClientTypevoidunbanChatMember(SteamID steamIdChat, SteamID steamIdMember)Unbans the specified chat member from the given chat room.-
Methods inherited from class in.dragonbra.javasteam.handlers.ClientMsgHandler
getClient, isExpectDisconnection, setExpectDisconnection, setup
-
-
-
-
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 aPersonaChangeCallbackcallback.- 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 aPersonaChangeCallbackcallback.- Parameters:
state- The state.
-
resetPersonaStateFlag
public void resetPersonaStateFlag()
JavaSteam addition: Sets the local user's persona state flag back to normal desktop mode.
-
setPersonaStateFlag
public void setPersonaStateFlag(EPersonaStateFlag flag)
JavaSteam addition: Sets the local user's persona state flag to a valid ClientType- Parameters:
flag- one of the followingEPersonaStateFlag.ClientTypeWeb,EPersonaStateFlag.ClientTypeMobile,EPersonaStateFlag.ClientTypeTenfoot, orEPersonaStateFlag.ClientTypeVR.
-
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 theChatActionResultCallbackcallback.- 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 inPersonaState.- Parameters:
steamIdList- A list of SteamIDs to request the info of.requestedInfo- The requested info flags. If none specified, this usesSteamConfiguration.getDefaultPersonaStateFlags().
-
requestFriendInfo
public void requestFriendInfo(SteamID steamID, int requestedInfo)
Requests persona state for a specified SteamID. Results are returned inPersonaState.- Parameters:
steamID- A SteamID to request the info of.requestedInfo- The requested info flags. If none specified, this usesSteamConfiguration.getDefaultPersonaStateFlags().
-
ignoreFriend
public JobID ignoreFriend(SteamID steamID)
Ignores a friend on Steam. Results are returned in aIgnoreFriendCallback.- 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 aIgnoreFriendCallback.- 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 givenSteamIDResults are returned in aProfileInfoCallback- 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 aFriendMsgHistoryCallback- 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 aFriendMsgHistoryCallback.
-
setFriendNickname
public JobID setFriendNickname(SteamID friendID, java.lang.String nickname)
Set the nickname of a friend. The result is returned in aNicknameCallback.- Parameters:
friendID- the steam id of the friendnickname- 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 aAliasHistoryCallback.- 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 aAliasHistoryCallback.- 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:ClientMsgHandlerHandles a client message. This should not be called directly.- Specified by:
handleMsgin classClientMsgHandler- Parameters:
packetMsg- The packet message that contains the data.
-
-