KSP-Telemachus / Telemachus

KSP telemetry in the web browser
188 stars 50 forks source link

Incorrect key values in web socket API #35

Open jberkman opened 9 years ago

jberkman commented 9 years ago

Running 1.4.26.0 on a Mac with KSP 0.25, rate set to 0.1 (10/s). Will check with 1.4.27.0, but nothing similar was mentioned in the release notes.

Sometimes I see the wrong keys coming over when using the web socket API. I have one web socket connection, and a map page open.

v.brakeValue and v.rcsValue are duplicated, lightValue and sasValue not included: {"v.name":"Mark1-2Pod (Kerbal X)","v.body":"Kerbin","v.brakeValue":"False","v.brakeValue":"False","v.gearValue":"False","v.rcsValue":"False","v.rcsValue":"True","f.throttle":0,"o.eccentricity":0.0371861293848403,"o.argumentOfPeriapsis":157.642582519858,"o.lan":203.220440825844,"o.sma":765957.299788505,"o.ApA":194440.287041703,"o.PeA":137474.312535307,"o.timeToAp":143.617105164745,"o.trueAnomaly":158.532966325254,"v.altitude":192317.747185674}

lightValue passed instead of name: {"v.lightValue":"Mark1-2Pod (Kerbal X)","v.body":"Kerbin","v.brakeValue":"False","v.gearValue":"False","v.lightValue":"False","v.rcsValue":"False","v.sasValue":"True","f.throttle":0,"o.eccentricity":0.037186124860307,"o.argumentOfPeriapsis":157.642586849932,"o.lan":203.220458137865,"o.sma":765957.323259571,"o.ApA":194440.307919968,"o.PeA":137474.338599174,"o.timeToAp":143.717254788501,"o.trueAnomaly":158.517943920984,"v.altitude":192314.838118228}

rcsValue passed instead of name: {"v.rcsValue":"Mark1-2Pod (Kerbal X)","v.body":"Kerbin","v.brakeValue":"False","v.gearValue":"False","v.lightValue":"False","v.rcsValue":"False","v.sasValue":"True","f.throttle":0,"o.eccentricity":0.0371861847959258,"o.argumentOfPeriapsis":157.642558804954,"o.lan":203.220451241405,"o.sma":765957.311735688,"o.ApA":194440.341875682,"v.altitude":137474.281595694,"o.timeToAp":143.937035123914,"o.trueAnomaly":158.484976795349,"v.altitude":192308.431334066}

values captured using tcpdump.

jberkman commented 9 years ago

Correction: I think i only see this when I have multiple web socket connections running.

richardbunt commented 9 years ago

Thanks the report! I will hunt this one down :).

richardbunt commented 9 years ago

Hopefully I have fixed this issue now.

JimmySticks2001 commented 9 years ago

I believe I have a related issue. The keys are now in misplaced in the output string. For example:

If I send this

{"+":["v.altitude", "v.name", "v.long"]}

I will get this is return

{:88772.8079838537,"v.altitude":"probeCoreOcto2 (Untitled Space Craft)","v.name":-113.486750457981}

The first key is null, and the second key is the first key and so on. I am using the latest release (1.4.28.0), I am playing KSP 1.0.2.842.

richardbunt commented 9 years ago

Well, it looks like I've just changed the problem rather than solving it.

Thanks for reporting this!