Page 1 of 1

How do i stop a certain timer schedule ?

Posted: 25 Feb 2018, 13:18
by genar
Hey there !

Im sending an extension request to my server once my player presses on "Building House". The server takes the build duration out of my database, creates a timer schedule and sends an packet to the clients. When my clients receive this package, they spawn a Progressbar with the received duration at the certain position.
When the server side timer is finished, the extension sends another packet to the clients, thats working fine so far.

The problem is that i wanna stop or destroy the server side timer, once my player moves. But i cant find an way to destroy the timer for now, is there a way to do this ?

Re: How do i stop a certain timer schedule ?

Posted: 26 Feb 2018, 08:56
by Lapo
Hi,
each Task you run in the Scheduler is referenced by an object of type Future<?>
You can use that reference to stop the task from running when it's necessary.

Take a look here:
http://smartfoxserver.com/blog/how-to-s ... extension/

Hope it helps