Bagikan melalui


GamerServicesDispatcher.Initialize Method

Initializes gamer services functionality for the game, automatically choosing the most appropriate gamer service type for the platform.

Call this method during startup of your game.

Syntax

'Declaration
Public Shared Sub Initialize ( _
         serviceProvider As IServiceProvider _
)
public static void Initialize (
         IServiceProvider serviceProvider
)
public:
static void Initialize(
         IServiceProvider serviceProvider
)

Parameters

Exceptions

Exception type Condition
GamerServicesNotAvailableException
  • If the current game uses the XNA Framework Redistributable. This file does not include Games for Windows – LIVE functionality.
  • If another Games for Windows – LIVE title is running already.
ArgumentNullException serviceProvider is null.
InvalidOperationException Gamer services has already been initialized.

Remarks

Important

Games for Windows - LIVE is unavailable to finished games. This functionality is not included in the redistributable version of the XNA Framework. A game that attempts to use these components without XNA Game Studio installed will result in a GamerServicesNotAvailableException.

This method automatically chooses the default gamer service type for your platform (Xbox LIVE on Windows Phone for Windows Phone). If you need to explicitly choose the gamer service type, use GamerServicesDispatcher.Initialize(System.IServiceProvider, Microsoft.Xna.Framework.GamerServices.GamerServiceType).

Requirements

Namespace: Microsoft.Xna.Framework.GamerServices

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

See Also

Tasks

Initializing and Updating Gamer Services

Concepts

Introduction to Gamer Services

Reference

GamerServicesDispatcher Class
GamerServicesDispatcher Members
Microsoft.Xna.Framework.GamerServices Namespace

Platforms

Windows Phone