rSimulate / Cosmosium

:earth_americas: js game engine for space-based games
Other
23 stars 7 forks source link

empty OOI inserted into JSON breaks webGL scene #84

Closed 7yl4r closed 9 years ago

7yl4r commented 9 years ago

Not sure this happened (request to track undefined asteroid?), but the offending JSON looks like this:

[
  {
    ...asteroid details here...
  },
  {
    ...asteroid details here...
  },
  ,
  {
    ...asteroid details here...
  }
];
7yl4r commented 9 years ago

It looks like the problem is json.dumps(mpo).decode("string-escape")[2:-2] returning nothing in py/OOIs.__OOI2JSON(), which I think means that a "None" object somehow got into the instance of OOIs.MPOs. Pretty odd... oh well...

7yl4r commented 9 years ago

new insight: the MPO added to OOIs was indeed malformed. This is because asteroid track requests from the client contain only the name of the asteroid which is then used in an asterank api call (see py/websocketparser/asteroidTrackResponder). If the asterank call doesn't work, then who knows what we get back.

7yl4r commented 9 years ago

was able to reproduce: happens when player tries to claim a planet.