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
- serviceProvider
Type: IServiceProvider
The service provider to be used when locating additional services services. For example, IGraphicsDeviceService.
Exceptions
Exception type | Condition |
---|---|
GamerServicesNotAvailableException |
|
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