X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=Bots%2FJavaGod.class.php;h=11b04e60277d4bcf079adcf3fa5065ee7d91df48;hb=9a22335174615d1aeda038cec4cf56c8952bc338;hp=19cdc187f295499bd175822c740777bfffdc9afc;hpb=1023ce8e8beb8eba00e8d7206fd71b4a589c24c9;p=PHP-P10.git diff --git a/Bots/JavaGod.class.php b/Bots/JavaGod.class.php index 19cdc18..11b04e6 100644 --- a/Bots/JavaGod.class.php +++ b/Bots/JavaGod.class.php @@ -40,6 +40,7 @@ class {$_NAME} extends Bot { if(is_a($this->bot, "P10_User")) { $this->uplink->join($this->bot, "#java", (P10_Channel::USERPRIV_OPED | P10_Channel::USERPRIV_VOICE)); $this->uplink->join($this->bot, "#dev", P10_Channel::USERPRIV_VOICE); + $this->uplink->join($this->bot, "#CoderCom", P10_Channel::USERPRIV_VOICE); } } else { $this->bot = $old; @@ -66,8 +67,8 @@ class {$_NAME} extends Bot { public function loop() { foreach($this->execcache as $id => $entry) { if(!$this->checkstate($entry)) { - unlink("tmp/debug_".$entry['id'].".java"); - unlink("tmp/debug_".$entry['id'].".class"); + unlink("tmp/Debug_".$entry['id'].".java"); + unlink("tmp/Debug_".$entry['id'].".class"); unset($this->execcache[$id]); } } @@ -100,23 +101,23 @@ class {$_NAME} extends Bot { return; } $javacode = "import java.*; - @SuppressWarnings("unused") + @SuppressWarnings(\"unused\") public class Debug_".$entry['id']." { ".$javacontent." } "; } else { $javacode = "import java.*; - @SuppressWarnings("unused") + @SuppressWarnings(\"unused\") public class Debug_".$entry['id']." { ".$exp[1]." } "; }; - $fp = fopen("tmp/debug_".$entry['id'].".c", "w"); + $fp = fopen("tmp/Debug_".$entry['id'].".java", "w"); fwrite($fp, $javacode); fclose($fp); - $err = shell_exec("javac tmp/debug_".$entry['id'].".java 2>&1"); + $err = shell_exec("javac tmp/Debug_".$entry['id'].".java 2>&1"); if($err) { $err=str_replace("\r","",$err); $lines=explode("\n",$err); @@ -131,12 +132,12 @@ class {$_NAME} extends Bot { $this->uplink->privmsg($this->bot, $entry['channel'], $line); } } - if(!file_exists("tmp/debug_".$entry['id'].".class")) { - unlink("tmp/debug_".$entry['id'].".java"); + if(!file_exists("tmp/Debug_".$entry['id'].".class")) { + unlink("tmp/Debug_".$entry['id'].".java"); break; } $descriptor = array(0 => array("pipe", "r"),1 => array("pipe", "w"),2 => array("pipe", "w")); - $entry['proc'] = proc_open('java tmp/debug_'.$entry['id'].'.class', $descriptor, $entry['pipes']); + $entry['proc'] = proc_open('java -classpath tmp Debug_'.$entry['id'], $descriptor, $entry['pipes']); if(!is_resource($entry['proc'])) { $this->uplink->notice($this->bot, $user, "error while loading c!"); return;