The best way to exchange commands between a ServerManagerApp and bombsquad_headless #423
-
Starting the server using It is necessary to create a command exchange point between the manager and his subprocess. I need to make it so that at any moment the subprocess can inform the manager about some command (for example, shutdown, log, or response to some manager request) An open asynchronous server is running on my modified manager. Ways that came to my mind:
What the best way? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Ahh, why not just send a command from bombsquad_server to the manager's asynchronous server 🤦♂️ |
Beta Was this translation helpful? Give feedback.
-
Yes this functionality would be great. In fact this sort of thing is largely what I've been building in recent months for the V2 account system. The game now keeps up a live socket connection to a nearby 'basn' server node, which in turn talks to the central v2 master server. It supports full asynchronous 2 way messaging which will be used for things like push notifications to any running game client and chats/parties that are not dependent on any particular running game/client. This stuff is all built on top of efro.message, efro.rpc, and efro.dataclassio functionality which I've been working on for a while. I know I haven't really documented that stuff much yet, but basically it lets you define a protocol of various dataclass message types and their associated response types and it gives you a fully type safe synchronous or asynchronous messaging api with encoding/decoding handled for you. I've been quite happy with it so far. So my thought is that the server-manager could be rejiggered to use that same system instead of the ugly stuff it does right now passing Python command strings in through the binary's stdin. Its just that the game would use it to communicate with the server-manager instead of a basn node. I haven't planned on working on this for 1.7, but perhaps we could get a simple foundation in there if you'd like to start playing around with it (and just leave it disabled by default until it matures a bit). Thoughts? |
Beta Was this translation helpful? Give feedback.
-
That would be great, but I need time to figure out how it works. |
Beta Was this translation helpful? Give feedback.
-
The system is a bit complicated at first glance, but once its set up its really simple to add new message/response types. I'm using it extensively in all the new v2 back-end stuff. I'll try to at least take a pass at getting the server-manager and binary talking via such a system soon (after I'm done finishing 1.7). Then we can play around with functionality while still leaving the janky old existing system as default for now. |
Beta Was this translation helpful? Give feedback.
Ahh, why not just send a command from bombsquad_server to the manager's asynchronous server 🤦♂️