Sign In Register

How can we help you today?

Start a new topic
Answered

[Cloud Code] Add Extra info on Account Details Response

I am new user of GameSpark,

I am trying to add custom data for the response of Account Details Request.


But it always return error :

 _line: 1

 _stack: []

 _statements: 0

 requireOnce: "function requireOnce() { [native code, arity=1] } "


Why would it happen and how to fix it?

Thanks

js
(67 Bytes)

Best Answer

Hey Steve,

This isnt an error. When you step through the code in the test-harness any variables defined in the script will show in the debugger.
What is showing there is just the script-context JS has already when you run make the request.

It isnt stopping you get the scriptData in the response though, right?

Sean


 Hey Steve,

Thats very strange, i just tried it with your code and i get a response back fine....


{
  "@class": ".AccountDetailsResponse",
  "currency1": 100,
  "currency2": 10,
  "currency3": 1,
  "currency4": 1,
  "currency5": 1,
  "currency6": 1,
  "externalIds": {},
  "location": {
    "country": "IE",
    "latitide": 53.338897705078125,
    "city": "Dublin",
    "longditute": -6.2595062255859375
  },
  "reservedCurrency1": {},
  "reservedCurrency2": {},
  "reservedCurrency3": {},
  "reservedCurrency4": {},
  "reservedCurrency5": {},
  "reservedCurrency6": {},
  "scriptData": {
    "segments": {}
  },
  "userId": "588b4631d23ed204bba4193c",
  "virtualGoods": {}
}



Is this happening in the old portal or the new portal?
Could you try clearing all the code you have in the script and then starting again?
If it is still happening we'll look into it for you.

Thanks,
Sean






Hi Sean,

Thanks your support,

I have tried remove it and set it again, but the error is still happen.

Is there any missing on the setting of my application?
Attached screen shot for your reference.


Thanks.

Answer

Hey Steve,

This isnt an error. When you step through the code in the test-harness any variables defined in the script will show in the debugger.
What is showing there is just the script-context JS has already when you run make the request.

It isnt stopping you get the scriptData in the response though, right?

Sean

Btw, if there was an error in the debugger, you wouldnt get a response back at all. You'd just get an error in the test-harness instead.

image


O i see, I get the data correctly after I step through.

Thank you very much!


Login to post a comment