Author Topic: AppOnIdleTimer ?  (Read 912 times)

0 Members and 1 Guest are viewing this topic.

Offline squiddy

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 333
  • Flagger assassin
    • SoldatX
AppOnIdleTimer ?
« on: September 02, 2012, 11:25:29 pm »
How does this new global variable, implemented in 2.7.3 work? (Btw, Shoozza, thanks A WHOLE LOT for this :D) I was very excited at first, but then I faced some problems.

It seems it can only be set different than usual in ActivateServer, IF safe mode is off. Otherwise it will grant you with the following error: (ActivateServer): Null Pointer Exception
And, if you try to change it AFTER the start of the server, it will give you nearly the same, but in AppOnIdle: (AppOnIdle): Null Pointer Exception
Although, when I set it to 1 in ActivateServer, it runs smoothly, almost like a thread function.

So, I come here with the following question: how does this work? In what ways can we use it?; is there any bugs we should be aware of?; is it REALLY working?

Thanks a lot! :D
www.soldatx.com.br - The brazilian Soldat community.

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: AppOnIdleTimer ?
« Reply #1 on: September 03, 2012, 01:56:18 am »
I really have no idea how you managed to get null pointer exception. If safemode is off you should be able to set it in any place including apponidle itself. If safemode is on, then you should be still able to set it, just with no effect.
The set value is number of ticks between calls (defaults to 60). 0 disables AppOnIdle calls at all.
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline squiddy

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 333
  • Flagger assassin
    • SoldatX
Re: AppOnIdleTimer ?
« Reply #2 on: September 03, 2012, 10:05:49 am »
Actually, if you do writeln(inttostr(apponidletimer));, if safe mode is OFF, it will return "0". I thought it would return 60 as default too, but apparently it is not how it works.
www.soldatx.com.br - The brazilian Soldat community.

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: AppOnIdleTimer ?
« Reply #3 on: September 03, 2012, 12:18:47 pm »
You're right, i forgot to set it when safemode is off. Doesn't matter anyway, it doesn't work without safemode. With safemode off you should get 60 in result of the command you wrote.
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.