From 697d85f0f24b9336bcb5f46a7f5f2edb1ceff899 Mon Sep 17 00:00:00 2001 From: kremsy Date: Mon, 8 May 2017 15:02:03 +0200 Subject: [PATCH] updated doc --- core/Communication/usage_documentation.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/Communication/usage_documentation.txt b/core/Communication/usage_documentation.txt index 454df701..590b8d5a 100644 --- a/core/Communication/usage_documentation.txt +++ b/core/Communication/usage_documentation.txt @@ -14,11 +14,18 @@ Sample ManiaControl Implementation (for ManiaControl to ManiaControl connections ##php code begin //This Sample shows just the Implementation of the Method GET_SERVER_CHAT + + //Caller Side $communication = $this->maniaControl->getCommunicationManager()->createCommunication(IP/Domain, PORT, 'YOUR_PASSWORD'); $communication->call(function($data){ //$data includes the data sent by the Website / other Controller - return new CommunicationAnswer($this->chatBuffer); + return new CommunicationAnswer($data); //send data back }, CommunicationMethods::GET_SERVER_CHAT); + + //Callee Side + $this->maniaControl->getCommunicationManager()->registerCommunicationListener(CommunicationMethods::GET_SERVER_CHAT, $this, function ($data) { + return new CommunicationAnswer($this->chatBuffer); + }); ##php code end Sample Web Implementation (to call ManiaControl from a website)