How do i stop a certain timer schedule ?

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

genar
Posts: 84
Joined: 13 Jul 2017, 11:49

How do i stop a certain timer schedule ?

Postby genar » 25 Feb 2018, 13:18

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 ?
User avatar
Lapo
Site Admin
Posts: 20392
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How do i stop a certain timer schedule ?

Postby Lapo » 26 Feb 2018, 08:56

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
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 20 guests