Added support for legacy Spectator Keyframes in LegacyKeyframeSetAdapter
This commit is contained in:
@@ -40,7 +40,7 @@ public class LegacyKeyframeSetAdapter extends TypeAdapter<KeyframeSet[]> {
|
|||||||
in.beginArray();
|
in.beginArray();
|
||||||
while(in.hasNext()) {
|
while(in.hasNext()) {
|
||||||
Keyframe<AdvancedPosition> newKeyframe = new Keyframe<AdvancedPosition>();
|
Keyframe<AdvancedPosition> newKeyframe = new Keyframe<AdvancedPosition>();
|
||||||
|
Integer spectatedEntityID = null;
|
||||||
in.beginObject();
|
in.beginObject();
|
||||||
while(in.hasNext()) {
|
while(in.hasNext()) {
|
||||||
String jsonKeyframeTag = in.nextName();
|
String jsonKeyframeTag = in.nextName();
|
||||||
@@ -49,8 +49,11 @@ public class LegacyKeyframeSetAdapter extends TypeAdapter<KeyframeSet[]> {
|
|||||||
newKeyframe.setValue(position);
|
newKeyframe.setValue(position);
|
||||||
} else if("realTimestamp".equals(jsonKeyframeTag)) {
|
} else if("realTimestamp".equals(jsonKeyframeTag)) {
|
||||||
newKeyframe.setRealTimestamp(in.nextInt());
|
newKeyframe.setRealTimestamp(in.nextInt());
|
||||||
|
} else if("spectatedEntityID".equals(jsonKeyframeTag)) {
|
||||||
|
spectatedEntityID = in.nextInt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
newKeyframe.getValue().setSpectatedEntityID(spectatedEntityID);
|
||||||
in.endObject();
|
in.endObject();
|
||||||
|
|
||||||
keyframes.add(newKeyframe);
|
keyframes.add(newKeyframe);
|
||||||
|
|||||||
Reference in New Issue
Block a user