<?php
function GetInformation($name, $output)
{
if ($name == "Players")
{
$output = explode('<div id="Users" class="DataCont"><div class="Field3">', $output);
$output = str_replace('</a>', '', $output[1]);
$output = preg_replace('/<a class="User" href="(.*?)" target="_blank">/i', '$2', $output);
}
else
{
$output = explode('<div id="'.$name.'" class="DataCont">', $output);
$output = explode('</div>', $output[1]);
$output = str_replace('<div class="Field2">', '', $output[1]);
}
return $output;
}
//Variables
$info = array("Track" => "", "Cars" => "", "Version" => "", "Conns" => "", "Players" => "");
$hostname = "[TC]%20CityDriving%20One"; //Change to your server hostname
$time_start = microtime(true);
// Get contents from website url
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.lfsworld.net/hoststatus/?h=".$hostname);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);
// Set contents into array
foreach ($info as $name => &$value)
{
$info[$name] = GetInformation($name, $output);
}
// Show information from array
echo "<pre>";
print_r($info);
echo "</pre>";
//Script execution time
$time_end = microtime(true);
$time = $time_end - $time_start;
echo "Script executed in ".$time." seconds";
?>
var delete = new List<IS_BFN>
{
new IS_BFN
{
UCID = C.UCID,
ClickID = 2,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 3,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 4,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 5,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 6,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 7,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 8,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 9,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 10,
SubT = ButtonFunction.BFN_DEL_BTN,
},
}
insim.Send(delete);
new IS_BTN { ReqI = 3, UCID = MSO.UCID, ClickID = 3, BStyle = ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK, T = 30, L = 45, W = 100, H = 120, Text = "", },
public static void DeleteButton(InSim insim, byte UCID, byte ClickID)
{
insim.Send(new IS_BFN
{
UCID = UCID,
ClickID = ClickID,
SubT = ButtonFunction.BFN_DEL_BTN,
});
}
DeleteButton(insim, C.UCID, 8);
var buttons = new List<IS_BTN> {
new IS_BTN { ReqI = 3, UCID = MSO.UCID, ClickID = 3, BStyle = ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK, T = 30, L = 45, W = 100, H = 120, Text = "", },
new IS_BTN { ReqI = 4, UCID = MSO.UCID, ClickID = 4, BStyle = ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK, T = 30, L = 45, W = 100, H = 120, Text = "", },
// Etc...
};
// Send list in one go.
insim.Send(buttons);
<?php
PHP NOTICE:
Undefined offset: 3 in D:\MATAS\testukas\modules\prism_statehandler.php on line 416
1 :: onTakeOverCar in D:\MATAS\testukas\modules\prism_statehandler.php:81
2 :: onClientPacket in D:\MATAS\testukas\modules\prism_statehandler.php:58
3 :: dispatchPacket in D:\MATAS\testukas\modules\prism_hosts.php:576
4 :: inspectPacket in D:\MATAS\testukas\modules\prism_hosts.php:487
5 :: handlePacket in D:\MATAS\testukas\modules\prism_hosts.php:353
6 :: checkTraffic in D:\MATAS\testukas\PHPInSimMod.php:228
PHP NOTICE:
Object of class PlayerHandler could not be converted to int in D:\MATAS\testukas\modules\prism_statehandler.php on line 416
1 :: onTakeOverCar in D:\MATAS\testukas\modules\prism_statehandler.php:81
2 :: onClientPacket in D:\MATAS\testukas\modules\prism_statehandler.php:58
3 :: dispatchPacket in D:\MATAS\testukas\modules\prism_hosts.php:576
4 :: inspectPacket in D:\MATAS\testukas\modules\prism_hosts.php:487
5 :: handlePacket in D:\MATAS\testukas\modules\prism_hosts.php:353
6 :: checkTraffic in D:\MATAS\testukas\PHPInSimMod.php:228
object(IS_TOC)#11 (8) {
["Size"[:p]rotected]=>
int(8)
["Type"[:p]rotected]=>
&int(31)
["ReqI"[:p]rotected]=>
int(0)
["PLID"]=>
int(3)
["OldUCID"]=>
int(2)
["NewUCID"]=>
int(1)
["Sp2"[:p]rotected]=>
int(0)
["Sp3"[:p]rotected]=>
int(0)
}
?>
<?php
< IS_TOC Packet from server.
PHP NOTICE:
Undefined offset: 21 in xxxx\modules\prism_statehandler.php on line 416
1 :: onTakeOverCar in xxxx\modules\prism_statehandler.php:81
2 :: onClientPacket in xxxx\modules\prism_statehandler.php:58
3 :: dispatchPacket in xxxx\modules\prism_hosts.php:576
4 :: inspectPacket in xxxx\modules\prism_hosts.php:487
5 :: handlePacket in xxxx\modules\prism_hosts.php:353
6 :: checkTraffic in xxxx\PHPInSimMod.php:228
PHP NOTICE:
Object of class PlayerHandler could not be converted to int in xxxx\modules\prism_statehandler.php on line 416
1 :: onTakeOverCar in xxxx\modules\prism_statehandler.php:81
2 :: onClientPacket in xxxx\modules\prism_statehandler.php:58
3 :: dispatchPacket in xxxx\modules\prism_hosts.php:576
4 :: inspectPacket in xxxx\modules\prism_hosts.php:487
5 :: handlePacket in xxxx\modules\prism_hosts.php:353
6 :: checkTraffic in xxxx\PHPInSimMod.php:228
UNKNOWN:
Argument 1 passed to welcome::onTest() must be an instance of ISP_TOC, instance of IS_TOC given, called in xxxx\modules\prism_plugins.php on line 156 and defined in xxxx\plugins\welcome.php on line 54
1 :: onTest in xxxx\modules\prism_plugins.php:156
2 :: dispatchPacket in xxxx\modules\prism_hosts.php:577
3 :: inspectPacket in xxxx\modules\prism_hosts.php:487
4 :: handlePacket in xxxx\modules\prism_hosts.php:353
5 :: checkTraffic in xxxx\PHPInSimMod.php:228
object(IS_TOC)#11 (8) {
["Size"[:p]rotected]=>
int(8)
["Type"[:p]rotected]=>
&int(31)
["ReqI"[:p]rotected]=>
int(0)
["PLID"]=>
int(21)
["OldUCID"]=>
int(20)
["NewUCID"]=>
int(19)
["Sp2"[:p]rotected]=>
int(0)
["Sp3"[:p]rotected]=>
int(0)
}
?>
<?php
public function onTakeOverCar(ISP_TOC $TOC)
{
var_dump($TOC);
}
?>
// Text : 65-66-67-0 would display button text "ABC" and no caption
// Text : 0-65-66-67-0-68-69-70-71-0-0-0 would display button text "DEFG" and caption "ABC"
foreach ($this->getHostState($hostID)->[B][U]players[/U][/B] as [B][U]$plid[/U][/B] => $player)
console($player->PName);
foreach ($this->getHostState()->[B][U]clients[/U][/B] as [B][U]$ucid[/U][/B] => $client)
console($client->UName);