fixing linked YSFReflector when not running YSFGateway

This commit is contained in:
dg9vh 2016-10-13 19:58:20 +00:00
parent 39b8852f15
commit 0aa06e46ec
2 changed files with 27 additions and 19 deletions

View file

@ -488,26 +488,32 @@ function getActualLink($logLines, $mode) {
// M: 2016-09-25 16:08:05.811 Connect to 62829 has been requested by DG9VH // M: 2016-09-25 16:08:05.811 Connect to 62829 has been requested by DG9VH
// M: 2016-10-01 17:52:36.586 Automatic connection to 62829 // M: 2016-10-01 17:52:36.586 Automatic connection to 62829
foreach($logLines as $logLine) { if (isProcessRunning(IRCDDBGATEWAY)) {
$to = ""; foreach($logLines as $logLine) {
if (strpos($logLine,"Starting YSFGateway")) { $to = "";
$to = -1; if (strpos($logLine,"Starting YSFGateway")) {
} $to = -1;
if (strpos($logLine,"DISCONNECT Reply")) { }
$to = -1; if (strpos($logLine,"DISCONNECT Reply")) {
} $to = -1;
if (strpos($logLine,"Connect to")) { }
$to = substr($logLine, 38, 5); if (strpos($logLine,"Connect to")) {
} $to = substr($logLine, 38, 5);
if (strpos($logLine,"Automatic connection to")) { }
$to = substr($logLine, 51, 5); if (strpos($logLine,"Automatic connection to")) {
} $to = substr($logLine, 51, 5);
if ($to !== "") { }
return $to; if ($to !== "") {
return $to;
}
} }
return -1;
break;
} else {
return -2;
break;
} }
return -1;
break;
} }
return "something went wrong!"; return "something went wrong!";
} }
@ -559,6 +565,8 @@ function getActiveYSFReflectors() {
function getYSFReflectorById($id, $reflectors) { function getYSFReflectorById($id, $reflectors) {
if ($id ==-1) { if ($id ==-1) {
return "not linked"; return "not linked";
} else if ($id == -2 ) {
return "YSFGateway not running";
} else { } else {
foreach($reflectors as $reflector) { foreach($reflectors as $reflector) {
if ($reflector[2] === $id) { if ($reflector[2] === $id) {

View file

@ -1,3 +1,3 @@
<?php <?php
define("VERSION", "20161013-3"); define("VERSION", "20161013-4");
?> ?>