Ed Giardina's .NET Blog

Blogging about Hobbyist Adventures in C#, XNA, ASP.NET and other stuff

February 2008 - Posts

GamerServices Game Components don't respond!

So I've been re-tooling my demo-game in XNA to take advantage of XNA 2.0 enhancements. So one thing I noticed is that my very simple code that I lifted from NetRumble project wasn't working in my project. It was a simple sign-in invocation:

if (!Guide.IsVisible)

{

Guide.ShowSignIn(1, false);

}

It was displaying, but not responding to input. (although my underlying components were responding to input.)

I had included the addition of the proper component in the Game's constructor:

Components.Add(new GamerServicesComponent(this));

but still no luck. Finally, even though it wasn't in the NetRumble game, I found in the MSDN documentation that "However, in some cases a program might not use the XNA Framework application model or component infrastructure." Whatever. I thought I was doing everything right. But turns out I needed to manually 'prime the pump', so to speak.

http://msdn2.microsoft.com/en-us/library/bb975692.aspx

 Adding the following line in the Game's Update method:

GamerServicesDispatcher.Update();

 Solved my problem. Unsure what I did to hose this component though. Or automatically adding components. Probably somewhere deep in my code I have the Game Components object do a .Clear or something