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.

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

Syntax

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 for Xbox 360 and Windows, or 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).

See Also

Tasks

Initializing and Updating Gamer Services

Concepts

Introduction to Gamer Services

Reference

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

Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP