Jump to content

TonQ

Member
  • Posts

    30
  • Joined

  • Last visited

Posts posted by TonQ

  1. <?php
    header('Access-Control-Allow-Origin: *');
    ini_set('memory_limit', '-1');
    
    error_reporting(-1);
    ini_set('display_errors', 'On');
    
    $postdata = file_get_contents("php://input");
    $request = json_decode($postdata);
    
    $db = $request -> db;
    
    require 'Predis/Autoloader.php';
    
    require 'config.php';
    
    Predis\Autoloader::register();
    
    $client = new Predis\Client([
        'host'   => $myRedisHost,
        'password' => $myRedisPass,
    	'port' => $myRedisPort,
    	'database' => $db
    ]);
    
    $deathlogs  = $client-> llen('deathlog-LOG');
    $deathlogs2 = $client-> lrange('deathlog-LOG', 0, $deathlogs);
    
    $dl = [];
    
    foreach($deathlogs2  as  $log){
    
        $result = [];
    
        $exploded = explode(" ",$log,3);
    
        $result['time'] = $exploded[0] . " " . $exploded[1];
    
        $exploded2 = explode("(",$exploded[2],2);
    
        $result['killername'] = trim($exploded2[0]);
    
        $exploded3 = explode(")",$exploded2[1],2);
    
        $result['killerpuid'] = trim($exploded3[0]);
    
        $exploded3[1] = str_replace(" killed ","",$exploded3[1]);
    
        $exploded4 = explode("(",$exploded3[1],2);
    
        $result['killedname'] = trim($exploded4[0]);
    
        $exploded5 = explode(")",$exploded4[1],2);
    
        $result['killedpuid'] = trim($exploded5[0]);
    
        $exploded5[1] = str_replace(" with weapon","",$exploded5[1]);
    
        $result['weapon'] = trim($exploded5[1]);
    
        array_push($dl,$result);
    }
    
    
    echo json_encode($dl);
    
    

    getNoLogDeathLogs.php

     

    Thx :)

  2.  

    <?php

    header('Access-Control-Allow-Origin: *');
    ini_set('memory_limit', '-1');
     
    error_reporting(-1);
    ini_set('display_errors', 'On');
     
    $postdata = file_get_contents("php://input");
    $request = json_decode($postdata);
     
    $db = $request -> db; <- Line 11
     
    require 'Predis/Autoloader.php';
     
    require 'config.php';
     

     

    the db request :( 

     

    $db = $request -> db;

  3. u edited the config correctly?

     

    i think so my conf.php : 

     

    <?php
     
    $myRedisPass = "mypassword";
    $myRedisPort = 6379;
    $myRedisHost = '127.0.0.1';
     
    $serverlist = '[
    {"community":"Ozi-Lan","name": "Ozi-Lan Epoch Server", "dbi": "0", "map":"altis","descr": "EpochMod |Altis |Mission & Ai City |Extra loot | Safe Base| JSRS3"}
     
     
     
     
     
     
    ]';
     
    /*
     * Fill in the config correctly. If redis is on another ip change this aswell and see that redis accepts externall connections than.
     *
     * To add servers look at the example. DBI = database nummer
     * NO COMMA behind the last server
     */
     
     
    ?>
     
    my redis conf in EPOCH : 
     
    [Redis]
    IP = 127.0.0.1
    Port = 6379
    DB = 0
    Password = mypassword
  4.  

    Or change it to this, to get more error logs

    <?php
    header('Access-Control-Allow-Origin: *');
    ini_set('memory_limit', '-1');
    
    error_reporting(-1);
    ini_set('display_errors', 'On');
    

     

    Hello, i try to install you're awesome work :D but i have no data on my website and when i change getNoLogDeathLogs.php with this code i obtain :

     

    Notice: Trying to get property of non-object in C:\xampp\htdocs\ozi-epoch\server\getNoLogDeathLogs.php on line 11 

     

    Any idea ? 

    My database is on the same server as my arma server on a xampp tools.

     

    Thx ! 

×
×
  • Create New...