function read_line ($input) { global $owner; global $ownerip; global $public; #[1 IP=192.168.0.2:32861] New user: 1 $chatmsg=substr($input, strpos($input, ":", strpos($input, "]"))+2); switch(substr ($chatmsg, 0, 1)) { case "!": $public=true; break; case "/": $public=false; break; default: return 0; } $chatmsg = substr($chatmsg, 1); log_cmd($input); $command; $args; log_debug("in middle of read_cmd, before get_command_and_args"); get_command_and_args($chatmsg, $command, $args); $owner = substr ($input, strpos($input, "]") +2, (strpos($input, ":", strpos($input, "]"))) - (strpos($input, "]")+2)); $ownerip = substr ($input, strpos ($input, "ID=")+6, strpos($input, ":" ) - strpos ($input, "ID=") -6 ); $ownernum = substr ($input, 1, strpos($input, " ")-1); log_debug("In function read_cmd, $owner, $ownerip"); interpret_cmd ($command, $args); /* if ((substr($chatmsg, -15)==" left the game." && strpos($chatmsg, ": ")===false ) || (substr($chatmsg, 0, 10) == "Spectator " && substr($chatmsg, -6)==" left.")) { } */ }