Search found 67 matches

by moccha
22 Jul 2015, 15:57
Forum: SFS2X Questions
Topic: Restart server within SFS error
Replies: 12
Views: 4528

Restart server within SFS error

I'm running SFS version 2.10.0. As another topic said, I've made sure that all of the file permissions are 755 on the extension folder and everything in it. I've tried calling the function SmartFoxServer.getInstance().restart() and it works fine locally but in a live enviornment I get the error: 15:...
by moccha
08 Jul 2015, 18:40
Forum: SFS2X Questions
Topic: trace statement providing proper delay?
Replies: 2
Views: 2047

trace statement providing proper delay?

I have a very simple if-else statement in one of my Java extensions that looks like this: if(id == 1)//Check id type { if(strength >= 2) damage = 2; else damage = 1; //trace("ouch"); atkEffect = 1;//Player receives no knockback } It responds to the client with a damage total at the end and...
by moccha
26 Apr 2015, 21:59
Forum: SFS2X Questions
Topic: User not joined in Room
Replies: 1
Views: 1567

User not joined in Room

I occasionally will receive an error with a timed function where the user is removed from a Room and joined to a Lobby room, but for whatever reason they aren't properly joined in the Lobby and I get a constant "User is not joined in room "Lobby" every update, since the client seems t...
by moccha
26 Apr 2015, 21:57
Forum: SFS2X Questions
Topic: Connection encryption
Replies: 57
Views: 58089

Re: Connection encryption

I agree with all of your points Lapo, I don't see a huge importance in encrypting the connection as it currently stands. You might make it hard to hijack data, but the user might then target the game source itself and perform a type of cheating with it instead. As long as you check data carefully se...
by moccha
23 Apr 2015, 17:57
Forum: SFS2X Questions
Topic: Get password from roomJoin?
Replies: 4
Views: 2445

Re: Get password from roomJoin?

Thanks, I didn't realize that SFSApi.changeRoomPassword() would fire an event to clients to change the roomvars, so now "isPasswordProtected" is updated on the fly correctly. The regular "room.setPassword()" wasn't updating clients like I wanted. You've been a big help once again...
by moccha
23 Apr 2015, 16:25
Forum: SFS2X Questions
Topic: Get password from roomJoin?
Replies: 4
Views: 2445

Re: Get password from roomJoin?

I was using one method but now I have to try something else. I want to let special users request to password protect a public game room if they want to do so. when they leave the room and the room is empty, it will remove the password. do you have suggestions as to the best method for this? sorry fo...
by moccha
23 Apr 2015, 03:26
Forum: SFS2X Questions
Topic: Get password from roomJoin?
Replies: 4
Views: 2445

Get password from roomJoin?

Is it possible to see room join credentials server-side SFS? I have a "(SFSEventType.USER_JOIN_ROOM, OnJoinRoom.class)" call in my main server code and it goes to this: User user = (User) event.getParameter(SFSEventParam.USER); Room room = (SFSRoom) event.getParameter(SFSEventParam.ROOM); ...
by moccha
15 Feb 2015, 03:26
Forum: SFS2X Questions
Topic: Hosting server locally; examples can't connect.
Replies: 9
Views: 4591

Re: Hosting server locally; examples can't connect.

Are you doing this from your home or do you live in an apartment or dorm room? Do you have complete control over your router and modem?
by moccha
13 Feb 2015, 21:35
Forum: SFS2X Questions
Topic: Kick oldest users
Replies: 8
Views: 3639

Re: Kick oldest users

Iterating on the list means using an iterator literally. Collection<User> userList = getParentZone().getUserList(); long lowestLoginTime = Long.MAX_VALUE; User userToRemove = null; for (User user : userList) { if (user.getLoginTime() < lowestLoginTime) { lowestLoginTime = user.getLoginTime(); userT...
by moccha
13 Feb 2015, 14:36
Forum: SFS2X Questions
Topic: Kick oldest users
Replies: 8
Views: 3639

Re: Kick oldest users

I am not sure why don't you base your search on the getLoginTime() instead of the ID. You simply get User1 time, store it, then compare it with the next one and if it's less-than replace the stored value ... and so on. This will also avoid the search for non-existent IDs that return a null and wast...
by moccha
12 Feb 2015, 18:30
Forum: SFS2X Questions
Topic: Kick oldest users
Replies: 8
Views: 3639

Re: Kick oldest users

I've revised my method to find the oldest user. Here's some new code: SFSZone zone = (SFSZone) event.getParameter(SFSEventParam.ZONE); int oldestPlayer = 0; if(zone.getUserCount() >= zone.getMaxAllowedUsers()) { for(int i=0; i < zone.getMaxAllowedUsers(); i++) { //Increment until you find a value th...
by moccha
11 Feb 2015, 20:27
Forum: SFS2X Questions
Topic: Kick oldest users
Replies: 8
Views: 3639

Re: Kick oldest users

I do have a way of tracking if the user is a paid member or not. I have a loginHandler as well, and I wondered what the most elegant way to disconnect the oldest player in the zone. I've been digging around the api but at this point it feels like I'm just throwing things around to see if they stick....
by moccha
11 Feb 2015, 06:07
Forum: SFS2X Questions
Topic: Kick oldest users
Replies: 8
Views: 3639

Kick oldest users

I'm trying to cater to users who have purchased an account with my game I want to ask if there is a way to force allow a paying user to join the server and kick out the longest logged in non-paying user. Say my server limit is 100 users, and 100 users are playing. I have a paid account and also a fr...
by moccha
05 Feb 2015, 22:07
Forum: SFS2X Questions
Topic: More than one TaskRunner?
Replies: 4
Views: 2364

Re: More than one TaskRunner?

After tracing through the entire timer in each tiny step, I finally found that somewhere I was calling for a user variable that didn't exist (for loop based on getUserById), yet it didn't throw a flag for null variable. Even when I wrap it in a try block it still won't complain. It was something eas...
by moccha
05 Feb 2015, 19:58
Forum: SFS2X Questions
Topic: More than one TaskRunner?
Replies: 4
Views: 2364

Re: More than one TaskRunner?

It's particularly vexing because the problem seems to be variable. I'll give a basic breakdown. The recurring scheduled timer I set up when I start a match in a "StartGame" class. It runs every 4 seconds. The timer with a 5 second start time is called any time the player does a specific ac...

Go to advanced search