[SM] Integer running out of bounds

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

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

[SM] Integer running out of bounds

Post by steeffeen »

hey there,

some people might have noticed that integer variables can run out of bounds leading to weird results.
within calculation it isn't such a big deal because you know during the editing of the script that your values can't be handled

the real problem about this is the handling of time inside game modes.
as soon as the server ran for quite some time the "Now" variable runs out of bounds and gets a negative value, since then it's not possible to spawn players anymore because the "SpawnPlayer()" method fails because it needs a positive spawn date

for now i don't have evidences but the issue has been reported when it happened to a TimeTrial server http://forum.maniaplanet.com/viewtopic. ... 1&p=155394
it happened to our server quite a few times already, i can post screens/logs when it happened again

i don't really have a nice solution for this problem but i wanted to address it anyways.. maybe someone else got an idea.
probably the server should reset ALL of its values as soon as the script crashes because currently the "Now" integer keeps being out of bounds and negative because it seems to display the time since the server has started.
that's why you have to restart all your server every now and then...

i don't know if it matters for trackmania too because there isn't the need of actually spawning players but i think it leads to problems with other method..

any feedback would be appreciated

regards,
steff
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    Akbalder
    Posts: 1059
    Joined: 15 Jun 2010, 11:00
    Contact:

    Re: [SM] Integer running out of bounds

    Post by Akbalder »

    I had the same problem on the Jailbreak server (Spawn method not working anymore).
    Since there's nothing custom in this method for the jailbreak gamemode, I guess that it's a problem which can happen on every servers.
    User avatar
    steeffeen
    Translator
    Translator
    Posts: 2463
    Joined: 14 Oct 2012, 16:22
    Location: Germany

    Re: [SM] Integer running out of bounds

    Post by steeffeen »

    i guess it's not actually running "out of bounds" but rather restarting to count up from the lowest possible (and therefore negative) value which obviously doesn't work for many functions like spawning a player

    one more appearance: http://forum.maniaplanet.com/viewtopic. ... 69&t=24071
      Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

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

      Re: [SM] Integer running out of bounds

      Post by The_Big_Boo »

      I think the word you seek is "overflow" ^_^
      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 “ManiaScript”

      Who is online

      Users browsing this forum: No registered users and 1 guest