예제 #1
0
<?php

require "RtmpClient.class.php";
require "debug.php";
$client = new RtmpClient();
$client->connect("localhost", "myApp");
$result = $client->call("myMethod");
var_dump($result);
$data->fmsServerIP = $options["ip"];
$data->fmsAppName = $options["app"];
$data->fmsServerPort = $options["port"];
$data->collabClassName = $options["classname"];
$data->collabClassID = $options["classid"];
$data->userName = $options["user"];
$data->soName = $options["so"];
$data->lectureID = $options["lectureid"];
$data->classType = $options["classtype"];
//=========================================================
$peoplecount = $options["peoplecount"];
$attendance = new Attendance();
$attendance->peopleCount = $peoplecount;
$attendance->lastUpdated = time();
//Create RtmpClient Object
$client = new RtmpClient();
try {
    $fmsInstance = "";
    if ($data->classType == "Meeting") {
        $fmsInstance = $data->fmsAppName . "/" . $data->collabClassName . "_" . $data->lectureID;
    } else {
        $fmsInstance = $data->fmsAppName . "/" . $data->collabClassName . "_" . $data->collabClassID;
    }
    //Connect to server
    $client->connect($data->fmsServerIP, $fmsInstance, $data->fmsServerPort, array("peoplecount"));
    $client->setValue($data->soName, $data->userName, $attendance);
    //$client->call("disconnectConnection");
} catch (Exception $exp) {
    echo $exp->getMessage();
}
//Closing connection
예제 #3
0
//**DONT TOUCH**
ini_set('memory_limit', '-1');
ini_set('max_execution_time', '999999999999999999999999999999999999999999999999');
// change to the proper directory
chdir("./RtmpClient");
// the rtmp client library
require_once "RtmpClient.class.php";
// go back
chdir("../");
date_default_timezone_set("America/Chicago");
// For all time() uses, otherwise it goes mad.
//var_dump($argv); // get cmd line args, $argv[0] is always the script full file name.
$sends = array();
$recvs = array();
$running = true;
$client = new RtmpClient();
$client->connect($rtmp, "tinyconf", $port, array($roomname, $autoop, "show", "tinychat", $BotUsername));
runClient();
function runClient()
{
    global $running, $sends, $recvs, $client, $safeusers;
    while ($running) {
        // Critical events, check before bot receive/send! Better to avoid these.
        if (false) {
            $time = time();
            if ($time - $safeusers['time'] > 20) {
                $safeusers['time'] = 0;
                // not finished meh... supposed to ban anyone not in safelist,
                // but only one every while loop!
            }
        }