doc update for communcation manager
This commit is contained in:
parent
a9b01f139f
commit
dbad016a4e
@ -39,7 +39,7 @@ interface CommunicationMethods {
|
|||||||
|
|
||||||
/** Set Server Options
|
/** Set Server Options
|
||||||
* Required Parameter
|
* Required Parameter
|
||||||
* - scriptSettings (array(optionName1 => value1, optionName2 => value2...))
|
* - serverOptions (array(optionName1 => value1, optionName2 => value2...))
|
||||||
*/
|
*/
|
||||||
const SET_SERVER_OPTIONS = "ServerOptions.SetServerOptions";
|
const SET_SERVER_OPTIONS = "ServerOptions.SetServerOptions";
|
||||||
|
|
||||||
@ -96,15 +96,15 @@ interface CommunicationMethods {
|
|||||||
const UPDATE_MAP = "MapManager.UpdateMap";
|
const UPDATE_MAP = "MapManager.UpdateMap";
|
||||||
|
|
||||||
/** Gets the current Map
|
/** Gets the current Map
|
||||||
* Required Parameters
|
* no Parameters
|
||||||
* - mxId (integer)
|
|
||||||
* OR
|
|
||||||
* - mapUid (string)
|
|
||||||
*/
|
*/
|
||||||
const GET_CURRENT_MAP = "MapManager.GetCurrentMap";
|
const GET_CURRENT_MAP = "MapManager.GetCurrentMap";
|
||||||
|
|
||||||
/** Gets the specific Map
|
/** Gets the specific Map
|
||||||
* no Parameters
|
* Required Parameters
|
||||||
|
* - mxId (integer)
|
||||||
|
* OR
|
||||||
|
* - mapUid (string)
|
||||||
*/
|
*/
|
||||||
const GET_MAP = "MapManager.GetMap";
|
const GET_MAP = "MapManager.GetMap";
|
||||||
|
|
||||||
|
@ -28,35 +28,5 @@ Sample ManiaControl Implementation (for ManiaControl to ManiaControl connections
|
|||||||
});
|
});
|
||||||
##php code end
|
##php code end
|
||||||
|
|
||||||
Sample Web Implementation (to call ManiaControl from a website)
|
If you want to use the Communication Manager from a PHP Website you can use the Control-It Communication WEB-SDK
|
||||||
##php code begin
|
https://github.com/ManiaControl/Control-It-Communication-WEB-SDK
|
||||||
$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
|
|
||||||
|
Loading…
Reference in New Issue
Block a user