Sorry for the massive wall of text, here is my thoughts after thinking about the problem:
Basic idea is that, each server manager keeps track of its own id (and others too)
Id can be randon generated for every time the server controller starts up, preferably use the pid of the runnable,
is is passed in server controllers name separated with pipe character "|"
Xaseco|
12345 -->
!0|
hello
-----------------------------------------------
Manialive|
67890 -->
#0|
hello
ServerManager|
36497-->
#0|
hello
All server managers are now introduced to each other with own id.
----------------------------------------------
The message protocol is separeted to 2 parts, splitted with pipe character.
First part is composed of action followed by identifier, who the message was ment to and 0 for global.
example:
!0|
resync
[
action] [
identifier] | [
command]
possible actions are:
! -> execute
# -> answer
? -> list
the second part is same for execute and answer:
example from the bus:
!12345|
kick:
reaby,
get out!
#36497|
kick:
success!
[
action] [
identifier] | [
command] : [
param], [
param2], [
param3]...
the second part for the list command:
example:
!12345|
list
?45678|
kick:
kick a player|
team:
change team|
addAdmin:
addAdmin to servercontroller
[
action] [
identifier] | [
command] : [
description] | [
command] : [
description]
----------------------------------------------------
Every server controller should react on these global keywords:
hello, register server controller and associate an id with it, send back id
bye, unregister server controller from the current list
resync, resync = fetch again all server parameters
Every server controller should react on these keywords, when they are called via id:
stop, stop service
list, send list of methods available
[
all local commands], execute the command and give possible answer
----------------------------------------------------
dunno if this would be good enough
