Sdílet prostřednictvím


NetworkSession.JoinInvited Method (Generic IEnumerable)

Joins an existing network session in response to an InviteAccepted notification event.

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

Syntax

public static NetworkSession JoinInvited (
         IEnumerable<SignedInGamer> localGamers
)

Parameters

  • localGamers
    Collection of local gamers to participate in the network session. The first gamer in the collection becomes the host, and the others are added to the session.

Return Value

The network session.

Exceptions

Exception type Condition
NetworkSessionJoinException The session either is full, is not joinable, or cannot be found.
  • If the session is full, the specified session does not have enough open slots for all the local gamers signed in to this machine.
  • If it is not joinable, you must wait for the host to return to the lobby before joining.
  • If it cannot be found, the session may have ended, or there may be no network connectivity between the local machine and session host.

Remarks

This method blocks until the operation has completed. For an asynchronous version of this method, see BeginJoinInvited.

Note

When someone accepts an invitation for Xbox LIVE Community Games, but the game is not installed already on his or her computer, the invited player will be taken to the game offer. The offer enables the invited player to download the game and accept the invitation to start the game.

For creator games still waiting to pass peer review, the game invitation will be sent over the Xbox LIVE service to the other player. If the game is not installed the invited player will be prompted with a message indicating that he or she can get the game from the game creator.

See Also

Reference

Guide.ShowGameInvite Method
NetworkSession.InviteAccepted Event
NetworkSession.BeginJoinInvited Method
NetworkSession.EndJoinInvited Method
NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Platforms

Xbox 360, Windows XP SP2, Windows Vista, Zune