Dedicated Server API Client Communication

Discuss the Dedicated Server Tools developed by Nadeo Live such as ManiaLive, Trust Circles, Dedicated Manager, Competition Manager and Lobbies

Moderator: NADEO

Post Reply
User avatar
steeffeen
Translator
Translator
Posts: 2472
Joined: 14 Oct 2012, 16:22
Location: Germany

Re: Dedicated Server API Client Communication

Post by steeffeen »

hey there
we encountered an issue in the Request class
the following adjusted test code fails

Code: Select all

$v = array('test' => true);
if(array_keys($v) == range(0, count($v) - 1)) {
	echo 'fail';
} else {
	echo 'k';
}
it's used to distinguish between array and struct
now an associative array (struct) with only 1 member gets interpreted as an array for some reason
so for example SetScriptModeSettings fails if you only set 1 settings as the dedicated expects a struct but gets an array
any idea?
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    User avatar
    steeffeen
    Translator
    Translator
    Posts: 2472
    Joined: 14 Oct 2012, 16:22
    Location: Germany

    Re: Dedicated Server API Client Communication

    Post by steeffeen »

    well the problem is that the following code succeeds...

    Code: Select all

    if (array('test') == array(0)) echo 'hell no';
    even though the arrays are obviously different
      Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

      ManiaControl, FancyManiaLinks
      The_Big_Boo
      Posts: 1041
      Joined: 15 Jun 2010, 15:46

      Re: Dedicated Server API Client Communication

      Post by The_Big_Boo »

      Oops, should be a strict equality, so === instead of ==. Fixed!
      OS: Win 7 Pro x64
      RAM: 2x4GB Corsair @ 1600MHz
      CPU: Intel i5 760 @ 3.6GHz
      Mobo: Asus P7P55D-E
      GPU: NVidia GTX 760 2GB
      HDD: WD Black 1TB
      Sound: VIA VT1828S (onboard)
      Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310
      User avatar
      steeffeen
      Translator
      Translator
      Posts: 2472
      Joined: 14 Oct 2012, 16:22
      Location: Germany

      Re: Dedicated Server API Client Communication

      Post by steeffeen »

      thanks. still weird that == doesn't work as it's supposed to check for key-value pairs, not?

      //Edit: nevermind ('test' == 0) is true... i thought only empty string equals zero
        Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

        ManiaControl, FancyManiaLinks
        The_Big_Boo
        Posts: 1041
        Joined: 15 Jun 2010, 15:46

        Re: Dedicated Server API Client Communication

        Post by The_Big_Boo »

        steeffeen wrote:thanks. still weird that == doesn't work as it's supposed to check for key-value pairs, not?
        PHP documentation is sometimes incomplete thus misleading. In my case, I was actually thinking it would convert everything to strings as in some array functions...

        @kresmy: do you know when the broken pipe on fwrite happened? Because it clearly means the connection is closed, not that the dedicated is simply hanging... Anyway, the notice will be silenced, so the custom exception is sent instead.
        Also, can you also give some basic info about configurations (OSes and if the server controller is running on the same machine than the dedicated or not).
        OS: Win 7 Pro x64
        RAM: 2x4GB Corsair @ 1600MHz
        CPU: Intel i5 760 @ 3.6GHz
        Mobo: Asus P7P55D-E
        GPU: NVidia GTX 760 2GB
        HDD: WD Black 1TB
        Sound: VIA VT1828S (onboard)
        Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310
        The_Big_Boo
        Posts: 1041
        Joined: 15 Jun 2010, 15:46

        Re: Dedicated Server API Client Communication

        Post by The_Big_Boo »

        If the dedicated is somehow hanging while changing map, then I don't really know what can be done except increasing timeouts... Can you try to have a more informative context than the exception itself to see it indeed happens only during map change?

        There's still a really strange case, the one where it timed out while reading callbacks. It's quite unexpected as it means stream_select said there was something to read but then it can't even read the first 8 bytes header. :shock:


        Anyway, I can't do miracles on this kind of issues :( . The original goal was to have a cleaner code without adding bugs, and I think this has been achieved. There are also new methods to help using the library, and the encoding/decoding is faster. So if in the end it appears long timeouts are needed, then let's put them back to 5s as they were before, especially if it happens only during map change.
        OS: Win 7 Pro x64
        RAM: 2x4GB Corsair @ 1600MHz
        CPU: Intel i5 760 @ 3.6GHz
        Mobo: Asus P7P55D-E
        GPU: NVidia GTX 760 2GB
        HDD: WD Black 1TB
        Sound: VIA VT1828S (onboard)
        Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310
        Post Reply

        Return to “Dedicated Server Tools”

        Who is online

        Users browsing this forum: No registered users and 1 guest