共用方式為


NetworkSession.MaxGamers Property

Gets or sets the maximum number of players able to join this multiplayer session. The Zune platform supports up to eight players. All other platforms support up to 31 players.

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

Syntax

public int MaxGamers { get; set; }

Property Value

Maximum number of players supported by the multiplayer session. Only the host can modify this value.

Exceptions

Exception type Condition
ArgumentOutOfRangeException

MaxGamers must be between 2 and 31 players for Windows-based and Xbox 360–based games, and between 2 and 8 for Zune-based games.

ObjectDisposedException

This NetworkSession is disposed.

InvalidOperationException

This NetworkSession is not the host; therefore, it cannot set the property MaxGamers.

Remarks

Bb975778.note(en-US,XNAGameStudio.30).gifZune Specific Information

For Zune-based games, MaxGamers must be between 2 and 8, where 8 is the maximum number of players supported in the session.

Bb975778.note(en-US,XNAGameStudio.30).gifWindows Specific Information

For Windows-based games, MaxGamers must be between 2 and 31, where 31 is the maximum number of players supported in a session.

Bb975778.note(en-US,XNAGameStudio.30).gifXbox 360 Specific Information

For Xbox 360–based games, MaxGamers must be between 2 and 31, where 31 is the maximum number of players supported in a session.

See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Platforms

Xbox 360, Windows XP SP2, Windows Vista, Zune