[add] First
This commit is contained in:
42
index.php
Normal file
42
index.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
include_once('vendor/autoload.php');
|
||||
|
||||
header("Content-type:text/html;charset=utf-8");
|
||||
|
||||
use phpseclib3\Crypt\RSA;
|
||||
use phpseclib3\Net\SSH2;
|
||||
use phpseclib3\Crypt\PublicKeyLoader;
|
||||
|
||||
echo("<title>打包機遊戲列表</title>");
|
||||
echo "打包機遊戲列表<br>";
|
||||
|
||||
$ssh = new SSH2('192.168.5.108', 22);
|
||||
$public_key = file_get_contents(__DIR__."\authorized_keys");
|
||||
$private_key = file_get_contents(__DIR__."\Publisher");
|
||||
$key = PublicKeyLoader::load($private_key);
|
||||
|
||||
if ($ssh->login('Publisher', $key)) {
|
||||
// echo('Connected');
|
||||
} else {
|
||||
die('Login Failed');
|
||||
}
|
||||
|
||||
$dir = $ssh->exec('dir /b/on D:\Casino-Core-Type2\assets\Game');
|
||||
$dirs = explode("\n",$dir);
|
||||
|
||||
function lensort($a,$b){
|
||||
return strlen($a)-strlen($b);
|
||||
}
|
||||
usort($dirs,'lensort');
|
||||
|
||||
for ( $i=0 ; $i<count($dirs); $i++ ) {
|
||||
$dirname = $dirs[$i];
|
||||
if (strpos($dirname, "Game_") !== false && strpos($dirname, ".meta") === false) {
|
||||
$gamedir = $ssh->exec('dir /b/on D:\Casino-Core-Type2\assets\Game\\'.$dirname);
|
||||
$gamedirs = explode("\n",$gamedir);
|
||||
if ( count($gamedirs) > 2 ) {
|
||||
echo $dirname . "<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user