Search found 5 matches

by verlout1
09 Feb 2017, 11:15
Forum: SFS2X Questions
Topic: How to pause a task?
Replies: 8
Views: 8966

Re: How to pause a task?

Lapo wrote:Yes, that's pretty much the way to do it.
You can use a "pause" flag and if it's set to true you just return immediately.

Cheers

:D Thanks
by verlout1
09 Feb 2017, 06:31
Forum: SFS2X Questions
Topic: How to pause a task?
Replies: 8
Views: 8966

Re: How to pause a task?

That's how I do it. boolean IfPauseCountdown = false; private class Tasker implements Runnable { private int runningCycles = 0; public void run() { if (IfPauseCountdown) return; ++runningCycles; if (runningCycles >= 30) { runningCycles = 0; taskHandle.cancel(true); } } } Is there a better way?
by verlout1
09 Feb 2017, 06:24
Forum: SFS2X Questions
Topic: How to pause a task?
Replies: 8
Views: 8966

How to pause a task?

Code: Select all

ScheduledFuture<?> taskHandle = sfs.getTaskScheduler().scheduleAtFixedRate(new Tasker(), 0, 1,TimeUnit.SECONDS);

How to pause "taskHandle" when Client request pause game?
Until the client requests to continue the "taskHandle" again.
:D
Thanks,
by verlout1
21 Jan 2017, 11:06
Forum: SFS2X Questions
Topic: The server for a specified user to create a room?
Replies: 3
Views: 4958

Re: The server for a specified user to create a room?

Hi, yes you need to create an Extension. If you're not familiar with this take a look at this quick Youtube tutorial: https://www.youtube.com/watch?v=nKGxhwJ0Ccc To create a room you just call getApi.createRoom(...) All the server side API are documented here: http://docs2x.smartfoxserver.com/api-d...
by verlout1
18 Jan 2017, 03:38
Forum: SFS2X Questions
Topic: The server for a specified user to create a room?
Replies: 3
Views: 4958

The server for a specified user to create a room?

How can I on the server for a specified user to create a room?
The user as the owner.
The server-side to create the room needed to create another extension?
:shock:
I can't find related to the demo.
Thanks,

Go to advanced search