TrackManiaControl/core/Communication/usage_documentation.txt

33 lines
1.5 KiB
Plaintext
Raw Normal View History

The CommuncationListening of the Communcation Manager can be enabled in the ingame Settings.
2015-06-21 21:45:52 +02:00
There the following settings are existing:
-- Enable Socket Listening (Let the CommunicationManager listen for incoming calls)
2017-03-16 18:29:04 +01:00
-- Password (Password which get used to encrypt and decrypt the messages for the openssl connection)
-- Listening port for every server (this is the port the CommunicationManager listens at)
For the description of the available implemented communcation Methods check the CommunicationMethods interface.
2015-06-26 13:25:29 +02:00
If you need methods which are not implemented, or additional Parameters, feel free to contact us.
Sample ManiaControl Implementation (for ManiaControl to ManiaControl connections)
##php code begin
2017-03-26 21:21:19 +02:00
//This Sample shows just the Implementation of the Method GET_SERVER_CHAT
2017-05-08 15:02:03 +02:00
//Caller Side
$communication = $this->maniaControl->getCommunicationManager()->createCommunication(IP/Domain, PORT, 'YOUR_PASSWORD');
$communication->call(function($data){
2017-03-26 21:21:19 +02:00
//$data includes the data sent by the Website / other Controller
2017-05-08 15:02:03 +02:00
return new CommunicationAnswer($data); //send data back
}, CommunicationMethods::GET_SERVER_CHAT);
2017-05-08 15:02:03 +02:00
//Callee Side
$this->maniaControl->getCommunicationManager()->registerCommunicationListener(CommunicationMethods::GET_SERVER_CHAT, $this, function ($data) {
2017-05-08 15:06:38 +02:00
return new CommunicationAnswer($this->chatBuffer);
});
##php code end
2017-05-25 16:31:24 +02:00
If you want to use the Communication Manager from a PHP Website you can use the Control-It Communication WEB-SDK
https://github.com/ManiaControl/Control-It-Communication-WEB-SDK