Changeset 444 for TFP-WebServer/WebServer/src/WebAPI
- Timestamp:
- Jun 10, 2023, 6:33:56 PM (17 months ago)
- Location:
- TFP-WebServer/WebServer/src/WebAPI
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TFP-WebServer/WebServer/src/WebAPI/APIs/WorldState/Animal.cs
r434 r444 35 35 36 36 writer.WriteRaw (jsonKeyPosition); 37 JsonCommons.Write PositionObject(ref writer, position);37 JsonCommons.WriteVector3I (ref writer, position); 38 38 39 39 writer.WriteEndObject (); -
TFP-WebServer/WebServer/src/WebAPI/APIs/WorldState/Hostile.cs
r434 r444 35 35 36 36 writer.WriteRaw (jsonKeyPosition); 37 JsonCommons.Write PositionObject(ref writer, position);37 JsonCommons.WriteVector3I (ref writer, position); 38 38 39 39 writer.WriteEndObject (); -
TFP-WebServer/WebServer/src/WebAPI/APIs/WorldState/Player.cs
r434 r444 152 152 _writer.WriteRaw (jsonPositionKey); 153 153 if (online) { 154 JsonCommons.Write PositionObject(ref _writer, entity.GetPosition ());154 JsonCommons.WriteVector3 (ref _writer, entity.GetPosition ()); 155 155 // TODO: Possibly show last position? 156 156 } else { -
TFP-WebServer/WebServer/src/WebAPI/JsonCommons.cs
r436 r444 11 11 private static readonly byte[] jsonKeyPositionZ = JsonWriter.GetEncodedPropertyNameWithPrefixValueSeparator ("z"); 12 12 13 public static void Write PositionObject(ref JsonWriter _writer, Vector3i _position) {13 public static void WriteVector3I (ref JsonWriter _writer, Vector3i _position) { 14 14 _writer.WriteRaw (jsonKeyPositionX); 15 15 _writer.WriteInt32 (_position.x); … … 24 24 } 25 25 26 public static void Write PositionObject(ref JsonWriter _writer, Vector3 _position) {26 public static void WriteVector3 (ref JsonWriter _writer, Vector3 _position) { 27 27 _writer.WriteRaw (jsonKeyPositionX); 28 28 _writer.WriteSingle (_position.x); … … 33 33 _writer.WriteRaw (jsonKeyPositionZ); 34 34 _writer.WriteSingle (_position.z); 35 36 _writer.WriteEndObject (); 37 } 38 39 public static void WriteVector2I (ref JsonWriter _writer, Vector2i _position) { 40 _writer.WriteRaw (jsonKeyPositionX); 41 _writer.WriteInt32 (_position.x); 42 43 _writer.WriteRaw (jsonKeyPositionY); 44 _writer.WriteInt32 (_position.y); 45 46 _writer.WriteEndObject (); 47 } 48 49 public static void WriteVector2 (ref JsonWriter _writer, Vector2 _position) { 50 _writer.WriteRaw (jsonKeyPositionX); 51 _writer.WriteSingle (_position.x); 52 53 _writer.WriteRaw (jsonKeyPositionY); 54 _writer.WriteSingle (_position.y); 35 55 36 56 _writer.WriteEndObject ();
Note:
See TracChangeset
for help on using the changeset viewer.