Compare commits
No commits in common. "acf0c5b84650fc6c1c862e250f0f71991185e231" and "0dcf7abb8700937d7e878249e3606d5ad4765ac7" have entirely different histories.
acf0c5b846
...
0dcf7abb87
|
@ -15,5 +15,5 @@
|
|||
],
|
||||
"start_url": "index.php",
|
||||
"display": "standalone",
|
||||
"scope": "/l/"
|
||||
"scope": "/"
|
||||
}
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
#!/usr/bin/php
|
||||
<?php
|
||||
|
||||
require 'header.php';
|
||||
|
||||
if ( php_sapi_name() != "cli" ) {
|
||||
echo "This is a command line only utility.\n";
|
||||
exit();
|
||||
}
|
||||
|
||||
if ( $argc != 3 ) {
|
||||
echo "Usage: setcolor_cli.php <6 digit hex color> <target ids separated by commas>\n\n";
|
||||
exit();
|
||||
}
|
||||
$hex = $argv[1];
|
||||
if ( !ctype_xdigit($hex) || (strlen($hex) != 6) ) {
|
||||
echo "Invalid six character hex color patter in ARG[1]\n";
|
||||
exit();
|
||||
}
|
||||
$targets = explode(",", $argv[2]);
|
||||
foreach ( $targets as $target ) {
|
||||
if ( !is_numeric($target) ) {
|
||||
echo "Invalid targetd id: {$target}\n";
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
$command = 0x01;
|
||||
$unique = mt_rand(1, 2000000000);
|
||||
$red = hexdec(substr($hex, 0, 2));
|
||||
$green = hexdec(substr($hex, 2, 2));
|
||||
$blue = hexdec(substr($hex, 4, 2));
|
||||
|
||||
var_dump($targets);
|
||||
foreach ( $targets as $target ) {
|
||||
$target = intval($target);
|
||||
$unique = mt_rand(1, 2000000000);
|
||||
$data = pack("LLLCLLCCC", PACKETFILTER[0], PACKETFILTER[1], $unique, $command, $target, 1, $red, $green, $blue);
|
||||
transmitMessage($data);
|
||||
}
|
||||
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user