From dbad016a4e9c1e876f37f01fbef11e81073984dc Mon Sep 17 00:00:00 2001 From: kremsy Date: Thu, 25 May 2017 16:31:24 +0200 Subject: [PATCH] doc update for communcation manager --- core/Communication/CommunicationMethods.php | 12 ++++---- core/Communication/usage_documentation.txt | 34 ++------------------- 2 files changed, 8 insertions(+), 38 deletions(-) diff --git a/core/Communication/CommunicationMethods.php b/core/Communication/CommunicationMethods.php index 9810fa1f..a07e1021 100644 --- a/core/Communication/CommunicationMethods.php +++ b/core/Communication/CommunicationMethods.php @@ -39,7 +39,7 @@ interface CommunicationMethods { /** Set Server Options * Required Parameter - * - scriptSettings (array(optionName1 => value1, optionName2 => value2...)) + * - serverOptions (array(optionName1 => value1, optionName2 => value2...)) */ const SET_SERVER_OPTIONS = "ServerOptions.SetServerOptions"; @@ -96,15 +96,15 @@ interface CommunicationMethods { const UPDATE_MAP = "MapManager.UpdateMap"; /** Gets the current Map - * Required Parameters - * - mxId (integer) - * OR - * - mapUid (string) + * no Parameters */ const GET_CURRENT_MAP = "MapManager.GetCurrentMap"; /** Gets the specific Map - * no Parameters + * Required Parameters + * - mxId (integer) + * OR + * - mapUid (string) */ const GET_MAP = "MapManager.GetMap"; diff --git a/core/Communication/usage_documentation.txt b/core/Communication/usage_documentation.txt index 3b8785cd..c611bb18 100644 --- a/core/Communication/usage_documentation.txt +++ b/core/Communication/usage_documentation.txt @@ -28,35 +28,5 @@ Sample ManiaControl Implementation (for ManiaControl to ManiaControl connections }); ##php code end -Sample Web Implementation (to call ManiaControl from a website) -##php code begin - $errno = null; - $errstr = null; - $socket = fsockopen("xx.xxx.xx.xx", xxxxx, $errno, $errstr, 2); - echo "ok?" . $errno . " - " . $errstr . "\n"; - - $data = array("method" => "getServerChat", "data" => ""); - - // Encode and Encrypt the Data - $data = json_encode(array("method" => "getServerChat", "data" => "")); - $data = openssl_encrypt($data, 'aes-192-cbc', 'YOUR_PASSWORD', OPENSSL_RAW_DATA, 'kZ2Kt0CzKUjN2MJX'); - - // Write the Data on the Socket - fwrite($socket, strlen($data) . "\n" . $data); - - - // Read Answer Data - $len = (int)fgets($socket); - echo $len; - $buff = ''; - while (!feof($socket) && strlen($buff) < $len) { - $buff .= fgets($socket, $len - strlen($buff) + 1); - } - - // Decrypt and Decode the Response Data - $data = openssl_decrypt($buff, 'aes-192-cbc', 'YOUR_PASSWORD', OPENSSL_RAW_DATA, 'kZ2Kt0CzKUjN2MJX'); - echo json_decode($data); - - //Close the Socket - fclose($socket); -##php code end +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