Skip to content
This site is under heavy WIP, so contributions on GitHub are much appreciated! You've most likely been pointed to this site to point towards a concept, or something. Either way, take at least some of the info on this page with a grain of salt, and also don't expect much info since it's very incomplete on content.

Asynchronous action results

Because action results packets are meant to be sent as soon as possible after validating incoming packets, we should use both action result packets and context packets to send validation and results separately.

Asynchronous actions (such as querying a database) should first send a successful action/result packet back to tell Neuro that her packet data was correct:

{
"command": "action/result",
"game": "game",
"data": {
"id": "action_id",
"success": true
}
}

Then, when the asynchronous action is completed, send Neuro the results as a context:

{
"command": "context",
"game": "game",
"data": {
"message": "Query results: (data)",
"silent": true
}
}

This allows Neuro to perform any other action between validation and receiving results.