JSONRPC

A helper to handle dictionaries which look like JSONRPC documents.

url=https://www.jsonrpc.org/JSON-RPC/url is a standard which wraps a method call in a JSON object. The object has a particular structure and identifies which method is called, the parameters to that function, and carries an ID to keep track of responses. This class implements that standard on top of Dictionary; you will have to convert between a Dictionary and JSON with other functions.

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Enums

Constants
enum Constants
ErrorCode
enum ErrorCode

Functions

makeNotification
Dictionary makeNotification(String method, VariantArg1 params)

Returns a dictionary in the form of a JSON-RPC notification. Notifications are one-shot messages which do not expect a response. - method: Name of the method being called. - params: An array or dictionary of parameters being passed to the method.

makeRequest
Dictionary makeRequest(String method, VariantArg1 params, VariantArg2 id)

Returns a dictionary in the form of a JSON-RPC request. Requests are sent to a server with the expectation of a response. The ID field is used for the server to specify which exact request it is responding to. - method: Name of the method being called. - params: An array or dictionary of parameters being passed to the method. - id: Uniquely identifies this request. The server is expected to send a response with the same ID.

makeResponse
Dictionary makeResponse(VariantArg0 result, VariantArg1 id)

When a server has received and processed a request, it is expected to send a response. If you did not want a response then you need to have sent a Notification instead. - result: The return value of the function which was called. - id: The ID of the request this response is targeted to.

makeResponseError
Dictionary makeResponseError(long code, String message, VariantArg2 id)

Creates a response which indicates a previous reply has failed in some way. - code: The error code corresponding to what kind of error this is. See the errorcode constants. - message: A custom message about this error. - id: The request this error is a response to.

opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(JSONRPC other)
opEquals
bool opEquals(typeof(null) n)
processAction
Variant processAction(VariantArg0 action, bool recurse)

Given a Dictionary which takes the form of a JSON-RPC request: unpack the request and run it. Methods are resolved by looking at the field called "method" and looking for an equivalently named function in the JSONRPC object. If one is found that method is called. To add new supported methods extend the JSONRPC class and call processAction on your subclass. action: The action to be run, as a Dictionary in the form of a JSON-RPC request or notification.

processString
String processString(String action)
setScope
void setScope(String _scope, GodotObject target)
toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Static functions

_new
JSONRPC _new()

Construct a new instance of JSONRPC. Note: use memnew!JSONRPC instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta