Sign In Register

How can we help you today?

Start a new topic

Code Working in Test Harness but not in GS_MINUTE

 

var request = new SparkRequests.LogEventRequest();
request.eventKey = "UPDATE_ALL_CREDIT_SCORE";
var response = request.Execute();

var msg = getMessage(response);
Spark.getLog().debug("Response + " + msg );

function getMessage() {
    if (response.error != null) {
        return response.error.ERROR;
    } else {
        return response.scriptData;
    }
    
}

 When I run this code on test Harness inside a custom event, it works just fine.  But the exact same code does nothing when i put it in GS_Minute. How do i fix this?

1 Comment

That's because in GS_MINUTE, the session isn't binded to any player, so there isn't a default player id for GameSparks to execute the logEventRequest with.


Therefore, instead of using request.Execute use .ExecuteAs(playerId) to preform the custom event will work.

Login to post a comment