GameSparks Debugger

The GameSparks Debugger allows you to test your Cloud Code. If you have an Event, Request, Response, or Message that has custom Cloud Code written to it, by enabling the GameSparks Debugger you can step through your code to examine what's happening, as it's happening.

The GameSparks Debugger can be enabled separately for Requests, Responses, or Messages. Alternatively, you can enable debugging for any of these in combination.

Please Note! The Debugger panel will only display if there is some Cloud Code written against the Event, Request, Response, or Message and you haven't enabled for Cloud Code profiling.

Enabling the Debugger

To enable the GameSparks Debugger, in the Debug section of the Test Harness select any or all of the check boxes that you wish to debug Cloud Code for:

For example, if you only select the Debug checkbox for Responses, the GameSparks Debugger will activate only when the Response is triggered, provided the Response has some Cloud Code written for it.

Working with the Debugger

With the Debugger enabled, when you send a request that has some Cloud Code written to it, the GameSparks Debugger will appear as an overlay on the left side of the Test Harness page:

The Debugger is laid out as follows:

Understanding the Context Menu

The Context Menu sets things out to make your debugging tasks easier:

Responses to SendRequests within Cloud Code viewed within the Debugger are displayed similar to the way the Test Harness Inspector displays them.

Here, the Cloud Code calls an AuthenticationRequest and an AuthenticationResponse. The values attributed to the Request are shown as child properties of that object:

Breakpoints

As in standard developer IDE's, the Breakpoint feature allows you to navigate to and wait at desired steps within the Cloud Code.

To set a Breakpoint, click to the left of the line number of the Cloud Code where you want to set the breakpoint. The line number is highlighted in dark blue:

Breakpoints:

Multiple Debug Panels

If you have multiple Debug checkboxes enabled and your Cloud Code invokes other Cloud Code items which, in turn, also have Cloud Code attributed to them, then multiple debugging panels may be opened simultaneously in the form of tabbed panels.

Debugger Time-out

If the Debugger has been inactive or idle for 2 minutes, the GameSparks Debugger panel will automatically close.

Imposing this time-out is in everyone's interest:

Break on Error

Another important feature you can use when debugging your Cloud Code is Break on Error. There may be instances when your Cloud Code throws an error exception that is not seen within the Test Harness or won’t necessarily halt the rest of the event but invalidates the test.

The Break on Error will display any exceptions encountered within the Context menu.

Did this page help you? Please enter your feedback below. For questions about using this part of the platform, please contact support here