public final class SteamFriends extends ClientMsgHandler
Modifier and Type | Field and Description |
---|---|
(package private) AccountCache |
cache |
private List<SteamID> |
clanList |
(package private) int |
defaultInfoRequest |
private List<SteamID> |
friendList |
private Object |
listLock |
Constructor and Description |
---|
SteamFriends() |
Modifier and Type | Method and Description |
---|---|
void |
addFriend(SteamID steamId)
Sends a friend request to a user.
|
void |
addFriend(String accountNameOrEmail)
Sends a friend request to a user.
|
void |
banChatMember(SteamID steamIdChat,
SteamID steamIdMember)
Bans the specified chat member from the given chat room.
|
byte[] |
getClanAvatar(SteamID steamId)
Gets a SHA-1 hash representing the clan's avatar.
|
SteamID |
getClanByIndex(int index)
Gets a clan SteamID by index.
|
int |
getClanCount()
Gets the count of clans the local user is a member of.
|
String |
getClanName(SteamID steamId)
Gets the name of a clan.
|
EClanRelationship |
getClanRelationship(SteamID steamId)
Gets the relationship of a clan.
|
byte[] |
getFriendAvatar(SteamID steamId)
Gets a SHA-1 hash representing the friend's avatar.
|
SteamID |
getFriendByIndex(int index)
Gets a friend by index.
|
int |
getFriendCount()
Gets the friend count of the local user.
|
GameID |
getFriendGamePlayed(SteamID steamId)
Gets the GameID of a friend playing a game.
|
String |
getFriendGamePlayedName(SteamID steamId)
Gets the game name of a friend playing a game.
|
String |
getFriendPersonaName(SteamID steamId)
Gets the persona name of a friend.
|
EPersonaState |
getFriendPersonaState(SteamID steamId)
Gets the persona state of a friend.
|
EFriendRelationship |
getFriendRelationship(SteamID steamId)
Gets the relationship of a friend.
|
String |
getPersonaName()
Gets the local user's persona name.
|
EPersonaState |
getPersonaState()
Gets the local user's persona state.
|
(package private) void |
handleAccountInfo(IPacketMsg packetMsg) |
(package private) void |
handleChatActionResult(IPacketMsg packetMsg) |
(package private) void |
handleChatEnter(IPacketMsg packetMsg) |
(package private) void |
handleChatInvite(IPacketMsg packetMsg) |
(package private) void |
handleChatMemberInfo(IPacketMsg packetMsg) |
(package private) void |
handleChatMsg(IPacketMsg packetMsg) |
(package private) void |
handleFriendMsg(IPacketMsg packetMsg) |
(package private) void |
handleFriendResponse(IPacketMsg packetMsg) |
(package private) void |
handleFriendsList(IPacketMsg packetMsg) |
(package private) void |
handleIgnoreFriendResponse(IPacketMsg packetMsg) |
void |
handleMsg(IPacketMsg packetMsg)
Handles a client message.
|
(package private) void |
handlePersonaState(IPacketMsg packetMsg) |
JobID |
ignoreFriend(SteamID steamId) |
JobID |
ignoreFriend(SteamID steamId,
boolean setIgnore)
Ignores or unignores a friend on Steam.
|
void |
joinChat(SteamID steamId)
Attempts to join a chat room.
|
void |
kickChatMember(SteamID steamIdChat,
SteamID steamIdMember)
Kicks the specified chat member from the given chat room.
|
void |
leaveChat(SteamID steamId)
Attempts to leave a chat room.
|
void |
removeFriend(SteamID steamId)
Removes a friend from your friends list.
|
void |
requestFriendInfo(Collection<SteamID> steamIdList) |
void |
requestFriendInfo(Collection<SteamID> steamIdList,
EClientPersonaStateFlag requestedInfo) |
void |
requestFriendInfo(Collection<SteamID> steamIdList,
int requestedInfo)
Requests persona state for a list of specified SteamID.
|
void |
requestFriendInfo(SteamID steamId) |
void |
requestFriendInfo(SteamID steamId,
EClientPersonaStateFlag requestedInfo) |
void |
requestFriendInfo(SteamID steamId,
int requestedInfo)
Requests persona state for a specified SteamID.
|
void |
sendChatMessage(SteamID target,
EChatEntryType type,
String message)
Sends a chat message to a friend.
|
void |
sendChatRoomMessage(SteamID steamIdChat,
EChatEntryType type,
String message)
Sends a message to a chat room.
|
void |
setPersonaName(String name)
Sets the local user's persona name and broadcasts it over the network.
|
void |
setPersonaState(EPersonaState state)
Sets the local user's persona state and broadcasts it over the network.
|
setup
private final Object listLock
AccountCache cache
final int defaultInfoRequest
public String getPersonaName()
public void setPersonaName(String name)
name
- The name.public EPersonaState getPersonaState()
public void setPersonaState(EPersonaState state)
state
- The state.public int getFriendCount()
public SteamID getFriendByIndex(int index)
index
- The index.public String getFriendPersonaName(SteamID steamId)
steamId
- The steam id.public EPersonaState getFriendPersonaState(SteamID steamId)
steamId
- The steam id.public EFriendRelationship getFriendRelationship(SteamID steamId)
steamId
- The steam id.public String getFriendGamePlayedName(SteamID steamId)
steamId
- The steam id.public GameID getFriendGamePlayed(SteamID steamId)
steamId
- The steam id.public byte[] getFriendAvatar(SteamID steamId)
steamId
- The SteamID of the friend to get the avatar of.public int getClanCount()
public SteamID getClanByIndex(int index)
index
- The index.public String getClanName(SteamID steamId)
steamId
- The clan SteamID.public EClanRelationship getClanRelationship(SteamID steamId)
steamId
- The clan steamid.public byte[] getClanAvatar(SteamID steamId)
steamId
- The SteamID of the clan to get the avatar of.public void sendChatMessage(SteamID target, EChatEntryType type, String message)
target
- The target to send to.type
- The type of message to send.message
- The message to send.public void addFriend(String accountNameOrEmail)
accountNameOrEmail
- The account name or email of the user.public void addFriend(SteamID steamId)
steamId
- The SteamID of the friend to add.public void removeFriend(SteamID steamId)
steamId
- The SteamID of the friend to remove.public void joinChat(SteamID steamId)
steamId
- The SteamID of the chat room.public void leaveChat(SteamID steamId)
steamId
- The SteamID of the chat room.public void sendChatRoomMessage(SteamID steamIdChat, EChatEntryType type, String message)
steamIdChat
- The SteamID of the chat room.type
- The message type.message
- The message.public void kickChatMember(SteamID steamIdChat, SteamID steamIdMember)
steamIdChat
- The SteamID of chat room to kick the member from.steamIdMember
- The SteamID of the member to kick from the chat.public void banChatMember(SteamID steamIdChat, SteamID steamIdMember)
steamIdChat
- The SteamID of chat room to ban the member from.steamIdMember
- The SteamID of the member to ban from the chat.public void requestFriendInfo(Collection<SteamID> steamIdList, int requestedInfo)
PersonaStateCallback
.steamIdList
- A list of SteamIDs to request the info of.requestedInfo
- The requested info flags.public void requestFriendInfo(Collection<SteamID> steamIdList, EClientPersonaStateFlag requestedInfo)
public void requestFriendInfo(Collection<SteamID> steamIdList)
public void requestFriendInfo(SteamID steamId, int requestedInfo)
PersonaStateCallback
.steamId
- A SteamID to request the info of.requestedInfo
- The requested info flags.public void requestFriendInfo(SteamID steamId, EClientPersonaStateFlag requestedInfo)
public void requestFriendInfo(SteamID steamId)
public JobID ignoreFriend(SteamID steamId, boolean setIgnore)
IgnoreFriendCallback
.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.JobCallback
.public void handleMsg(IPacketMsg packetMsg)
handleMsg
in class ClientMsgHandler
packetMsg
- The packet message that contains the data.void handleAccountInfo(IPacketMsg packetMsg)
void handleFriendMsg(IPacketMsg packetMsg)
void handleFriendsList(IPacketMsg packetMsg)
void handlePersonaState(IPacketMsg packetMsg)
void handleFriendResponse(IPacketMsg packetMsg)
void handleChatEnter(IPacketMsg packetMsg)
void handleChatMsg(IPacketMsg packetMsg)
void handleChatMemberInfo(IPacketMsg packetMsg)
void handleChatActionResult(IPacketMsg packetMsg)
void handleChatInvite(IPacketMsg packetMsg)
void handleIgnoreFriendResponse(IPacketMsg packetMsg)
Copyright © 2012. All Rights Reserved.