Search found 67 matches

by moccha
05 Feb 2015, 15:00
Forum: SFS2X Questions
Topic: More than one TaskRunner?
Replies: 4
Views: 2364

More than one TaskRunner?

Hello again, I have a TaskRunner object that schedules a future task that runs every 4 seconds. It looks like this: TaskRunner tr = new TaskRunner(); ScheduledFuture<?> 4sec = SmartFoxServer.getInstance().getTaskScheduler().scheduleAtFixedRate(tr, 0, 4, TimeUnit.SECONDS); I tried creating another ta...
by moccha
31 Dec 2014, 17:47
Forum: SFS2X Questions
Topic: Get user variables with MMORoom
Replies: 3
Views: 2340

Re: Get user variables with MMORoom

Sorry for any confusion and thanks for the reply, Lapo. In this case, it was an error on my part. My server grabs some variables and then sets them as user variables. The data I was pulling, however, was a String and I never cast it as an Int. It was checking an int against String data and obviously...
by moccha
31 Dec 2014, 00:49
Forum: SFS2X Questions
Topic: Get user variables with MMORoom
Replies: 3
Views: 2340

Get user variables with MMORoom

Hello again, I have an MMORoom setup and it's working well. However, I am having trouble finding a way to send more variables than just X and Y coordinates. The player can select multiple characters, and the user variable that stores the player ID doesn't seem to retrieve when the player leaves the ...
by moccha
15 Feb 2014, 05:04
Forum: SFS2X Questions
Topic: Update multiple RoomVariable values?
Replies: 9
Views: 4263

Re: Update multiple RoomVariable values?

Bax wrote:IMHO, storing player-related data in a Room Variable is logically wrong. That said, it is up to you.

Bax (and Lapo) I love you guys so much, thank you. If you were here in person I'd give you a smooch.
by moccha
14 Feb 2014, 17:27
Forum: SFS2X Questions
Topic: Update multiple RoomVariable values?
Replies: 9
Views: 4263

Re: Update multiple RoomVariable values?

One last thing: Is there a real advantage to using UserVariables over RoomVariables for this sort of storage? I have implemented everything already as RoomVariables but if there is a glaring advantage other than for organizational purposes I'll change it. Thank you both for your helpful responses. I...
by moccha
13 Feb 2014, 17:05
Forum: SFS2X Questions
Topic: Update multiple RoomVariable values?
Replies: 9
Views: 4263

Re: Update multiple RoomVariable values?

Aren't user variables able to be changed by the user? I only wish to let the server have control over the values of the energy level. Even if I do use UserVariables, it brings me back to my original question: What is the best way for the timer task to increment through and update all of the variable...
by moccha
13 Feb 2014, 16:48
Forum: SFS2X Questions
Topic: Update multiple RoomVariable values?
Replies: 9
Views: 4263

Update multiple RoomVariable values?

I have a TaskScheduler that runs every few seconds when a game starts in a room. I want to replenish a small amount of energy to all of the players energy meters within the same room. public void run() { ISFSObject playerData = roomRef.getVariable("player"+playerRef.getPlayerId()).getSFSOb...

Go to advanced search