Friend Manager
Last updated
Last updated
Support us as a and get instant access to all our assets, exclusive tools and assets, escalated support and issue tracking and our gratitude. These articles are made possible by our ... become a sponsor today!
The handler for this event would look like the following.
Received a notfication of rich presence change
The handler for this event would look like the following
Received a notification of persona state change
The handler for this event would look like the following
This indicates rather or not the system is listening for freind chat messages. Note that friend chat messages will only be raised in game if you set this to true.
This is the same as calling API.Friends.Client.GetFriends(flags);
Gets the list of friends the user has recently played with
You should use this in responce to evtGameConnectedChatMsg to fetch the body of the message and the type of the message.
Sends the target friend a string message. If this returns false it means the local user is rate or chat limited by Valve and cannot send a message.
The UI work is left up to you ... the following code will demonstrate fetching friends and how you might read the data contained within.
Note that the "Immediate" flag is your "normal" friends such as what you see in your Steam Client's friend list.
Now that we have an array of our friends we can simply iterate over that and populate our UI
The UI work is left up to you ... the following code will demonstrate enabling friend chat, listening for chat messages and sending messages to that friend.
First we should set up our event handler to listen for friend chat messages. You can do this in the Unity inspector or in code.
The handler for that would look like this
Before the system will raise the evtGameConnectedChatMsg event we need to tell it to listen for messages.
Finally in order to send a friend a chat message we use the UserData of that friend. Lets assume we have a UserData named friend and that is who we want to send the message to.
We could also send the message via the friendManager such as
This is simply an example you would of course want to give the user a means to input text to send to your friend so you would likely drive this from a InputField's on submit or similar.
Received a message from a friend, this willy be raised if you first set the to true.
You can see the various options for in Valve's documentation as linked.
The structure is defined in Steamworks namespace space and discribes the friend ID and AppId related to the event.
The structure is defined in the Steamworks namespace and discribes the user the change is related to as well as the changes.
Get lists of user friends, The flags argument is of type and can be used to modify what subset is returned.
You shouldn't need to call this as we will call it for you and raise the with the results.
Be sure to read and understand all the features of the object. You can also use tools like and to simplify fetching and keeping up to date the friend's avatar image and display name.
In the above example we are only paying attention to chat message types of ChatEntry. You can see all the different types .