doc update for communcation manager

This commit is contained in:
kremsy 2017-05-25 16:31:24 +02:00
parent a9b01f139f
commit dbad016a4e
2 changed files with 8 additions and 38 deletions

View File

@ -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";

View File

@ -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