Message manager must allow communication with other processes through the tcp/ip connection via messages, encoded in JSON format.
JSON format
JSON messages will consist of (service, type, parameters). For example:
service = "db" database message
type = increment value
contents = any parameters as JSON value
As JSON would look like this: {"s":"db","t":"inc","p":{"var":"/player_id/headshots","inc":10}}.
Service is simply a name for a message target. For early versions this simply means either "echo" or the name of the database.
echo service
For testing purposes, it would be nice to have a simple built-in service that simply sends back every message (with its source set to "echo") as-is. The only exception are messages of type "end", to which Avarice should not respond.
General workflow is as such
* Wait for client connection.
* Upon detecting a connection, delegate it to a worker thread with high-level interface for communication.
* All valid messages from all workers should be collected in a single main thread that will handle all of them
* Break connection on invalid messages. Note that any message of form `{"s":"...","t":"...","p":<any_json_value>}` is considered valid for this purpose.
# Message manager
Message manager must allow communication with other processes through the tcp/ip connection via messages, encoded in JSON format.
## JSON format
JSON messages will consist of (service, type, parameters). For example:
* service = "db" database message
* type = increment value
* contents = any parameters as JSON value
As JSON would look like this: `{"s":"db","t":"inc","p":{"var":"/player_id/headshots","inc":10}}`.
Service is simply a name for a message target. For early versions this simply means either "echo" or the name of the database.
## `echo` service
For testing purposes, it would be nice to have a simple built-in service that simply sends back every message (with its source set to "echo") as-is. The only exception are messages of type "end", to which Avarice should not respond.
## General workflow is as such
* Wait for client connection.
* Upon detecting a connection, delegate it to a worker thread with high-level interface for communication.
* All valid messages from all workers should be collected in a single main thread that will handle all of them
* Break connection on invalid messages. Note that any message of form `{"s":"...","t":"...","p":<any_json_value>}` is considered valid for this purpose.
After finishing code on the UE server's side, I have made some slight modifications to the issue. In particular, I've decided to add "echo" service that would simply repeat received messages back. This was useful for testing and I think it might also be useful for that later in the future, when changes to ue-side mods are made.
After finishing code on the UE server's side, I have made some slight modifications to the issue. In particular, I've decided to add "echo" service that would simply repeat received messages back. This was useful for testing and I think it might also be useful for that later in the future, when changes to ue-side mods are made.
Message manager
Message manager must allow communication with other processes through the tcp/ip connection via messages, encoded in JSON format.
JSON format
JSON messages will consist of (service, type, parameters). For example:
As JSON would look like this:
{"s":"db","t":"inc","p":{"var":"/player_id/headshots","inc":10}}
.Service is simply a name for a message target. For early versions this simply means either "echo" or the name of the database.
echo
serviceFor testing purposes, it would be nice to have a simple built-in service that simply sends back every message (with its source set to "echo") as-is. The only exception are messages of type "end", to which Avarice should not respond.
General workflow is as such
Edited issue, more info + clarifications.
After finishing code on the UE server's side, I have made some slight modifications to the issue. In particular, I've decided to add "echo" service that would simply repeat received messages back. This was useful for testing and I think it might also be useful for that later in the future, when changes to ue-side mods are made.