gdDocumentation0.8.0

API reference

GDOnlineMatch

Directory that records rooms and identity gateways per game and returns a destination. It does not relay game traffic.

Methods

handle

handle(req: GDWebRequest) -> GDWebResponse, Err

Answer one matchmaking request.

Answer a matchmaking request as a web application handler, returning a value and Err.

Parameters

NameTypeDefaultDescription
reqGDWebRequestRequiredCurrent HTTP request supplied to the middleware or handler.

Return value

GDWebResponse, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

listen

listen(port: int, host: String = "127.0.0.1") -> Variant, Err

Serve every path from a web application owned by this endpoint.

Start the matchmaking HTTP listener, returning a value and Err.

Parameters

NameTypeDefaultDescription
portintRequiredNetwork port number. A listening port of zero lets the OS select a port.
hostString"127.0.0.1"Hostname or IP address used for connecting or binding.

Return value

Variant, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

port

port() -> int

Return the port opened by listen(), or 0 before it.

Return the listening port, or zero before listen.

Parameters

No parameters.

Return value

int

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

stop

stop() -> void

Stop the server opened by listen().

Stop the listener.

Parameters

No parameters.

Return value

void

No value is returned.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.