🛈 Announcement
Greetings! Trackmania forums are now archived and accessible in read-only mode, please go to the new platform to discuss the game.
  1. #31

    Niiiiiiice

    I tried again with a new clean install of the server files 2020-07-07 and the github dependency for the dedicated server api (with composer), and this time it works.

  2. #32
    @dStraint

    Thx mate!

    What trouble did you get with the connection wrapper?

    This is a basic working snippet with the connection wrapper:
    Code:
    <?php
        require __DIR__ . '/vendor/autoload.php';
        
        $client = Maniaplanet\DedicatedServer\Connection::factory('127.0.0.1', 5000, 5, 'SuperAdmin', 'SuperAdmin');
        $client->execute("EnableCallbacks", array(true));
        $client->execute('TriggerModeScriptEventArray', array('XmlRpc.EnableCallbacks', array('true')));
        
        flush();
        while(true) {
            $cbs = $client->executeCallbacks();
            if (!empty($cbs)) {
               var_dump($cbs);
               flush();
            }
        }
    
        $client->Terminate();
    ?>

  3. #33

    2 little changes to better use the wrapper

    2 methods changed to better use the wrapper:

    Code:
    <?php
        require __DIR__ . '/vendor/autoload.php';
        
        $client = Maniaplanet\DedicatedServer\Connection::factory('127.0.0.1', 5000, 5, 'SuperAdmin', 'SuperAdmin');
        $client->enableCallbacks();
        $client->triggerModeScriptEvent('XmlRpc.EnableCallbacks', array('true'));
        
        flush();
        while(true) {
            $cbs = $client->executeCallbacks();
            if (!empty($cbs)) {
               var_dump($cbs);
               flush();
            }
        }
    
        $client->Terminate();
    ?>

  4. #34
    Originally Posted by sdkNarkos Go to original post
    @dStraint

    Thx mate!

    What trouble did you get with the connection wrapper?

    This is a basic working snippet with the connection wrapper:
    Code:
    <?php
        require __DIR__ . '/vendor/autoload.php';
        
        $client = Maniaplanet\DedicatedServer\Connection::factory('127.0.0.1', 5000, 5, 'SuperAdmin', 'SuperAdmin');
        $client->execute("EnableCallbacks", array(true));
        $client->execute('TriggerModeScriptEventArray', array('XmlRpc.EnableCallbacks', array('true')));
        
        flush();
        while(true) {
            $cbs = $client->executeCallbacks();
            if (!empty($cbs)) {
               var_dump($cbs);
               flush();
            }
        }
    
        $client->Terminate();
    ?>

    Yeah the Connection wrapprer is very good and ready-to-use. I had trouble with a chat command (dont remember right now), all loaded with composer as well. So I decided to code a little bit more, but at least I know there's nothing between me and xmlrpc.

Page 4 of 4 ◄◄  First ... 234