Skip to main content

Sharing on Windows

Callbacks

Add the following callbacks for the sharing feature.

Sharing by channels

Follow the instructions for each channel to implement the sharing feature.

Steam

The sharing feature for Steam supports invite friends to the current game using a special invite string. When the target friend accepts the invite, pchConnectString is added to the connand line when starting the gamel.

To invite a friend, get the friend's OpenID for the Steam channel by calling 'QueryFriends', and then pass the OpenID to the user property of the FriendRequestInfo data structure while calling SendMessage.

To invite a friend using the special invite string, add the special invite string pchConnectString to the description property of the FriendRequestInfo data structure when calling SendMessage.

var friendInfo = new INTLFriendReqInfo();
friendInfo.Type = INTLFriendReqType.Friend_REQ_INVITE;
friendInfo.User = "123214"; //The OpenID of the friend to invite;
friendInfo.Description = "abc"; //Special invitation string, invite friends or group members to join the current game, if the target user accepts the invitation, pchConnectString will be added to the command line when starting the game
INTLAPI.SendMessage(friendInfo, INTLChannel.Steam);

Error codes

The following table shows some common error codes in the Steam channel.

ErrorCodeDescription
1031Steam DLL failed to load
1032Need to pull the game from the Steam platform
1033Steam initialization failed
Usually because steam_appid.txt is not placed in the same directory as the executable .exe file, or the Steam software did not start.