Unity Photon Steam Friend Invite

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Unity Photon Steam Friend Invite

NerfeR
2018-04-04 23:15:45

Hello,

I am the founder of Partical Studios. Currently we're working on a new game. We're using Photon Networking for our new game. But i have a problem about Steam Invite.

I am creating a room in game then i want to invite my steam friends to the room. For this;

CSteamID invitedUserId = (CSteamID)0;
SteamFriends.ActivateGameOverlayInviteDialog(invitedUserId);

When he acceptes the invite, how can i bring him to my room? I want him to join my room directly.
Please help me, thanks!

Comments

NerfeR
2018-04-05 22:02:10

Wow, can't any body help me?

NerfeR
2018-04-08 14:10:21

Well okay. Some one helped me and finally i have made it.
First you need to create a callback from GameRichPresenceJoinRequested_t (it's in unity steamworks api)
Then you need to bring him to your room with the room's name.

Example Code:
//The Callback
protected Callback<GameRichPresenceJoinRequested_t> m_GameRichPresenceJoinRequested;

//Creating the callback write it on void start
m_GameRichPresenceJoinRequested = Callback<GameRichPresenceJoinRequested_t>.Create(OnGameRichPresenceJoinRequested);

//When the player accepts the invite
//Create a void to join the game. Then start the void with the connection string.

private void OnGameRichPresenceJoinRequested(GameRichPresenceJoinRequested_t pCallback) {
JoinGame(pCallback.m_rgchConnect);
}

CaperCube
2020-08-20 20:40:07

Unironically, thanks a ton for replying to your own post about this, it's frustratingly difficult to find any reasonable information on this.

goeki_04
2022-10-22 17:26:04

Thanks a lot for replying on your own comment :D

It helped me alot

Back to top