Add last startup command display feature
Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
parent
5e41da1247
commit
662582823d
5 changed files with 47 additions and 3 deletions
|
|
@ -3170,6 +3170,36 @@ class OGPDatabaseMySQL extends OGPDatabase
|
|||
return $result['last_param'];
|
||||
}
|
||||
|
||||
public function changeLastStartupCmd($home_id, $command) {
|
||||
$query = sprintf("UPDATE `%sserver_homes` SET `last_startup_cmd` = '%s' WHERE `home_id` = %d",
|
||||
$this->table_prefix,
|
||||
$this->realEscapeSingle($command),
|
||||
$this->realEscapeSingle($home_id));
|
||||
++$this->queries_;
|
||||
if ( mysqli_query($this->link,$query) === FALSE )
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
public function getLastStartupCmd($home_id) {
|
||||
if ( !$this->link ) return FALSE;
|
||||
|
||||
$query = sprintf("SELECT `last_startup_cmd` FROM `%sserver_homes` WHERE `home_id` = %d",
|
||||
$this->table_prefix,
|
||||
$this->realEscapeSingle($home_id));
|
||||
|
||||
++$this->queries_;
|
||||
$result = mysqli_query($this->link,$query);
|
||||
|
||||
if ( mysqli_num_rows($result) != 1 )
|
||||
return FALSE;
|
||||
|
||||
$result = mysqli_fetch_assoc( $result );
|
||||
|
||||
return $result['last_startup_cmd'];
|
||||
}
|
||||
|
||||
public function saveServerStatusCache($ip_id,$port,$status) {
|
||||
$query = sprintf("SELECT * FROM `%sstatus_cache` WHERE `ip_id` = %s AND `port` = %s;",
|
||||
$this->table_prefix,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue