Page 1 of 3

[Draft] Communication between server controllers

Posted: 06 Sep 2012, 14:26
by The_Big_Boo
Hi fellow developpers,

In ManiaLive 2.4, we introduced a first draft of a communication protocol between any system which is listening to dedicated callbacks. At the moment, we're using it only between the Dedicated Manager and ManiaLive for a simple purpose (checking if ManiaLive is running and stopping it) but we hope it will be extended in the future.

As it is a draft and it is not already widely used, the discussion about messages format is totally open. Anyone who wants to contribute is welcome, as long as there is a standard to keep compatibility between systems implementing it. The fact it is a draft also means it can be replaced by anything else for any reason.

First, we're using the Echo method so here are a few things to know before starting:
  • Messages are sent by calling Echo method on the dedicated
  • Message are received by the callback ManiaPlanet.Echo
  • Echo callback is always sent to everyone
  • Echo method and ManiaPlanet.Echo callback have 2 arguments but there are not in the same order (which most probably won't be fixed)

So now, here is how it works at the moment...

Format

Code: Select all

Echo(sender, message) to send a message
ManiaPlanet.Echo(message, sender) when receiving a message
As stated before, arguments are not in the same order in the method and in the callback. Each argument is a string.

Code: Select all

Message:
    (?|!)method[:recipient]
? is used for requests while ! is used for answers when receiving a request (an answer is not mandatory for every request)
method is a single word
:recipient is optional but used when you want a single system to take care of the message (meaning other systems must ignore it)


Identifiers

Senders and recipients have to be a string, preferably unique. As an example, we have at the moment "ManiaLive 2.4" and "DedicatedManager 1.5". It's not perfect as it doesn't ensure unicity (eg. if you have 2 instances of ManiaLive 2.4) but that's why it's only a draft.


Methods

census: ask systems to identify themselves.

Code: Select all

Sent request:
    Echo( DedicatedManager 1.5 , ?census )

Received answer:
    ManiaPlanet.Echo( !census:DedicatedManager 1.5 , ManiaLive 2.4 )
stop: ask a system (or all) to stop. No answer expected

Code: Select all

Sent request:
    Echo( DedicatedManager 1.5 , ?stop:ManiaLive 2.4 )


And that's all to know (I think). Feel free to comment, contribute or implement it in your controllers! :)

Re: [Draft] Communication between server controllers

Posted: 08 Sep 2012, 11:24
by vni
I'll implement that into the upcoming SMART-Version.

Re: [Draft] Communication between server controllers

Posted: 08 Sep 2012, 14:46
by The_Big_Boo
At the moment, the only use case is with the Dedicated Manager so it has nothing to do with something like FreeZone (and moreover, implementing it is absolutely not mandatory). As I want this to be a collaborative work, you can propose anything about it, as long as we all agree on the way it works.


About the Dedicated Manager, we're actually offering you to have the same possibilities than ManiaLive, ie. allowing users to configure, start and stop your controllers from the web interface. It's, in my opinion, a good thing for everybody:
- we can give a very complete tool to remotely administer servers
- people using this tool has more choices than just ManiaLive
- developpers can get their server controllers to be a bit promoted through it

But it requires much more work than just the Echo thing and is a bit trickier. At first we thought to let you do (almost) all the work to add these features in the Dedicated Manager with a quick documentation on how it's done for ManiaLive and then integrate it in future releases. However, it's a bit too soon as:
- it won't be very clean as the integration needs to modify too many files
- you're probably not used to the way we're coding
So it actually needs a small refactoring to make all of this easier.


Edit: By at least implementing the Echo thing, if people start your controller the "normal" way they will be able to see if it's running in the Dedicated Manager and stop it. Which is, I think, already a nice improvement.

Re: [Draft] Communication between server controllers

Posted: 09 Sep 2012, 12:50
by vni
It was added for the upcoming SMART version (available from version 0.4.6)

I also added ?reboot:SMART vX.XX

If you want me to add more hooks, tell me.

Re: [Draft] Communication between server controllers

Posted: 10 Sep 2012, 18:26
by Slig
I would suggest methods (you can decide the names, the goal is to have all use the same ones) that web managers and controllers would send to indicate that it has changed some value(s) in ServerOptions, GameInfos, Maps, and Guest/Ban/Black/Ignore lists, so that others web managers/controllers would know it, then eventually get those values again to have them up to date.

Re: [Draft] Communication between server controllers

Posted: 10 Sep 2012, 20:46
by fng_thatoneguy
Slig wrote:I would suggest methods (you can decide the names, the goal is to have all use the same ones) that web managers and controllers would send to indicate that it has changed some value(s) in ServerOptions, GameInfos, Maps, and Guest/Ban/Black/Ignore lists, so that others web managers/controllers would know it, then eventually get those values again to have them up to date.
+1

This would follow a model similar to that of CCOW (Clinical Context Object Workgroup) in the medical industry; which allows disparate apps to sync up in relation to a given patient. It provides a central context which keeps track of all changes and the context notifies everything subscribed to it when changes have been made; then leaves it up to the app to request for the changes when it is ready to.

I think this would be an awesome feature to implement. And having a standard messaging format specified to go with it might be nice too (CCOW sits on top of the HL7 messaging system used in the medical industry.)

Re: [Draft] Communication between server controllers

Posted: 13 Sep 2012, 17:35
by kapsubm
would it be possible to implement a method which can take control over the "#Setting " Vars in Various Serverside gamescripts ?

what protocoll does it use ? (UDP ? )

Re: [Draft] Communication between server controllers

Posted: 13 Sep 2012, 18:46
by Slig
kapsubm wrote:would it be possible to implement a method which can take control over the "#Setting " Vars in Various Serverside gamescripts ?
What for ? The discussion here is about communication between server managers/controllers, and each of them has already to possibility to control the #Setting vars.

Btw the #settings values can be added to the list of the changes that managers/controllers could announce to others.

Re: [Draft] Communication between server controllers

Posted: 13 Sep 2012, 19:19
by kapsubm
Slig wrote:
kapsubm wrote:would it be possible to implement a method which can take control over the "#Setting " Vars in Various Serverside gamescripts ?
What for ? The discussion here is about communication between server managers/controllers, and each of them has already to possibility to control the #Setting vars.

Btw the #settings values can be added to the list of the changes that managers/controllers could announce to others.
any system which is listening to dedicated callbacks.
to change script settings from remoteside but you are right, thats the thing of the controler of course.
that was a missunderstanding from my side.