Files
VRCX/WorldDataRequestResponse.cs
Teacup ada39a05a7 Add /settings endpoint, clean up README, make WorldDB U# impl easier/faster (#556)
* docs: Change readme

* feat: New /settings endpoint; Make U# implementation easier

To further avoid the 5 second string loading delay, developers are no longer required to use /init before getting data; Every data request endpoint will now initialize the world automatically and include a connection key in the response.

Changed the way debug init works; It should now work for all endpoints without extra checks by just returning the current world as wrld_12345.

New /settings endpoint allows the change of the allow_external_reads column in the database, but getting data is currently unimplemented.

Fix store request logging being... completely wrong.

* Update README.md

Co-authored-by: Tayou <31988415+TayouVR@users.noreply.github.com>

---------

Co-authored-by: Tayou <31988415+TayouVR@users.noreply.github.com>
2023-06-03 07:23:32 +12:00

56 lines
1.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace VRCX
{
public class WorldDataRequestResponse
{
/// <summary>
/// Gets or sets a value indicating whether the request was successful.
/// </summary>
[JsonProperty("ok")]
public bool OK { get; set; }
/// <summary>
/// Gets or sets the error message if the request was not successful.
/// </summary>
[JsonProperty("error")]
public string Error { get; set; }
/// <summary>
/// Gets or sets the data returned by the request.
/// </summary>
[JsonProperty("data")]
public string Data { get; set; }
/// <summary>
/// Gets or sets the response code.
/// </summary>
/// <value></value>
[JsonProperty("statusCode")]
public int StatusCode { get; set; }
[JsonProperty("connectionKey")]
public string ConnectionKey { get; set; }
public WorldDataRequestResponse(bool ok, string error, string data)
{
OK = ok;
Error = error;
Data = data;
}
}
public class WorldDataRequest
{
[JsonProperty("requestType")]
public string RequestType;
[JsonProperty("connectionKey")]
public string ConnectionKey;
[JsonProperty("key")]
public string Key;
[JsonProperty("value")]
public string Value;
}
}