1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Error Plugin

Discussion in 'Development' started by yBriisMC, Mar 18, 2022.

  1. yBriisMC

    yBriisMC Silverfish

    Messages:
    19
    Infoslapper plugin has some errors and I don't know how to fix it can someone help me

    Erros:
    1- [19:56:33] [Asynchronous Worker #0 thread/CRITICAL]: ErrorException: "Trying to access array offset on value of type null" (EXCEPTION) in "plugins/InfoSlapper_v3.0 [ServerBridge]/src/SlapperInfo/AsyncUpdate" at line 42 (When will the entity be)

    2- Deprecated: Required parameter $dbinfo follows optional parameter $svs in /home/container/plugins/InfoSlapper_v3.0 [ServerBridge]/src/SlapperInfo/AsyncUpdate.php on line 21 (when you turn on the plugin)


    Code LINE 42 and 21 :
    PHP:
     21 public function onRun() {
            
    $results = [];
            
    $dbinfo unserialize($this->dbinfo);
            
    $db mysqli_connect($dbinfo["host"], $dbinfo["username"], $dbinfo["password"], $dbinfo["db"]);
            if(!
    $db){
            
    $this->setResult(serialize([]));
            echo 
    "MySql Nao Conectada" PHP_EOL;
            return 
    true;
            }
            
    $svs unserialize($this->svs);
            foreach(
    $svs as $n => $a){
            
    $q $db->query("SELECT * FROM servidores WHERE name = '$n';");   
            if(!
    is_bool($q)){
                
    $r mysqli_fetch_array($q);
                    
    $ip $a[0];
                    
    $port $a[1];
             
    42       $on $r["players"];
                    
    $max $r["maxplayers"];
                    
    $status $r["status"] == "&aServidor Online" "§e{$on}§7/§e{$max} Jogando" $r["status"];
                    if(
    $status == "&cServidor em manuten?ao"){
                        
    $on 0;
                        
    $max 0;
                    }
                    
    $results[$ip.":".$port] = [$on$max$port$status];
              }
             }
            
    $this->setResult(serialize($results));
            }
    If you want the plugin let me know.
     
  2. yBriisMC

    yBriisMC Silverfish

    Messages:
    19
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.