Implement network message manager #2

Open
opened 4 years ago by Ggg_123 · 2 comments
Ggg_123 commented 4 years ago
Collaborator

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.
# 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.
dkanus added the
enhancement
label 4 years ago
dkanus added this to the alpha1 milestone 4 years ago
Ggg_123 was assigned by dkanus 4 years ago
Owner

Edited issue, more info + clarifications.

Edited issue, more info + clarifications.
dkanus referenced this issue from a commit 3 years ago
dkanus self-assigned this 3 years ago
Ggg_123 was unassigned by dkanus 3 years ago
Owner

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.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.