共用方式為


Guide.ShowGameInvite Method (String)

Displays the game invitation user interface, taking a session ID.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework.GamerServices (in microsoft.xna.framework.gamerservices.dll)

Syntax

public static void ShowGameInvite (
         string sessionId
)

Parameters

  • sessionId
    The session ID to use for the game invitation.

Remarks

See Inviting Players to Join Your Game for more information about adding game invitation support to your title.

You can check GamerPrivileges.AllowCommunication to determine if a player is allowed to send and receive communications before displaying a menu option that would call this method.

Ff604990.note(en-us,XNAGameStudio.40).gifWindows Phone Specific Information

On Windows Phone, this method causes the game to close so that the system user interface can be shown. For information about how to prepare for such an interruption, see Handling Interruptions on Windows Phone.

No response to this method is returned. The player can choose invitation recipients from his or her own contact list on the phone. For each recipient chosen, an email is sent to the contact's email address.

If the recipient has an Xbox LIVE Gamertag associated with this email address and a Windows Phone, an invitation also is sent directly to the recipient's phone. If the recipient does not have an Xbox LIVE Gamertag associated with the email address or does not have a Windows Phone, the recipient only receives the email.

The email will contain a link to play the game. This link leads to a redirect service so that when the link is clicked an appropriate action is taken based on the platform the recipient is using.

  • On a PC, the link opens a web-based version of the game, if one exists.
  • On the phone, the link either opens the game if it is already installed on the recipient's phone, or it goes to the Marketplace if the game is not installed.

See Also

Reference

NetworkSession.InviteAccepted Event
NetworkSession.JoinInvited Method
NetworkSession.BeginJoinInvited Method
NetworkSession.EndJoinInvited Method
GamerPrivileges.AllowCommunication Property
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7