mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 13:09:44 +00:00
Do not show plugins in query, if disabled
do not show plugins in query, if "query-plugins" is disabled.
This commit is contained in:
parent
2e6ea78680
commit
5eb27cb742
1 changed files with 11 additions and 9 deletions
|
|
@ -20,8 +20,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Implementation of the UT3 Query Protocol (GameSpot)
|
Implementation of the UT3 Query Protocol (GameSpot)
|
||||||
Source: http://wiki.unrealadmin.org/UT3_query_protocol
|
Source: http://wiki.unrealadmin.org/UT3_query_protocol
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class QueryHandler{
|
class QueryHandler{
|
||||||
|
|
@ -52,13 +52,15 @@ class QueryHandler{
|
||||||
public function regenerateInfo(){
|
public function regenerateInfo(){
|
||||||
$str = "";
|
$str = "";
|
||||||
$plist = "NostalgiaCore ".MAJOR_VERSION;
|
$plist = "NostalgiaCore ".MAJOR_VERSION;
|
||||||
$pl = $this->server->api->plugin->getList();
|
if($this->server->extraprops->get("query-plugins") == true){
|
||||||
if(count($pl) > 0){
|
$pl = $this->server->api->plugin->getList();
|
||||||
$plist .= ":";
|
if(count($pl) > 0){
|
||||||
foreach($pl as $p){
|
$plist .= ":";
|
||||||
$plist .= " ".str_replace(array(";", ":", " "), array("", "", "_"), $p["name"])." ".str_replace(array(";", ":", " "), array("", "", "_"), $p["version"]).";";
|
foreach($pl as $p){
|
||||||
|
$plist .= " ".str_replace(array(";", ":", " "), array("", "", "_"), $p["name"])." ".str_replace(array(";", ":", " "), array("", "", "_"), $p["version"]).";";
|
||||||
|
}
|
||||||
|
$plist = substr($plist, 0, -1);
|
||||||
}
|
}
|
||||||
$plist = substr($plist, 0, -1);
|
|
||||||
}
|
}
|
||||||
$KVdata = array(
|
$KVdata = array(
|
||||||
"splitnum" => chr(128),
|
"splitnum" => chr(128),
|
||||||
|
|
@ -67,7 +69,7 @@ class QueryHandler{
|
||||||
"game_id" => "MINECRAFTPE",
|
"game_id" => "MINECRAFTPE",
|
||||||
"version" => CURRENT_MINECRAFT_VERSION,
|
"version" => CURRENT_MINECRAFT_VERSION,
|
||||||
"server_engine" => "NostalgiaCore ".MAJOR_VERSION,
|
"server_engine" => "NostalgiaCore ".MAJOR_VERSION,
|
||||||
"plugins" => $plist, /* write "off" to turn off display of plugins in Query */
|
"plugins" => $plist,
|
||||||
"map" => $this->server->api->level->getDefault()->getName(),
|
"map" => $this->server->api->level->getDefault()->getName(),
|
||||||
"numplayers" => count($this->server->clients),
|
"numplayers" => count($this->server->clients),
|
||||||
"maxplayers" => $this->server->maxClients,
|
"maxplayers" => $this->server->maxClients,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue