[BUG] RoomVariable is reported as not persistent

Post here your questions about the Java client / Android API for SFS2X

Moderators: Lapo, Bax

Post Reply
mente
Posts: 73
Joined: 14 Apr 2011, 14:27

[BUG] RoomVariable is reported as not persistent

Post by mente »

Hello,

Encountered bug. Using SFS2x RC3 server and SFS2x RC3 client. Trying to set room variable on server:

Code: Select all

        RoomVariable state = new SFSRoomVariable(RoomVariableName.SCRIPT_STATE.toString(), new SFSObject(), true, true, false);
        state.setOwner(room.getOwner());
        
        logger.debug("State is " + state);
        List<RoomVariable> vars = new ArrayList(1);
        vars.add(state);
        getAPI().setRoomVariables(room.getOwner(), room, vars);
Log shows following:

Code: Select all

11:45:29,304 DEBUG [pool-1-thread-2] event.RoomAddedHandler     - State is { N: state, T: OBJECT, V: [SFSObject, size: 0], Pr: true, Ps: true, G: false, H: false, Owner: ( User Name: account-1, Id: 0, Priv: 0, Sess: 95.69.176.224:56536 )  }
11:45:29,305 DEBUG [pool-1-thread-2] event.RoomAddedHandler     - State is { N: state, T: OBJECT, V: [SFSObject, size: 0], Pr: true, Ps: true, G: false, H: false, Owner: ( User Name: account-1, Id: 0, Priv: 0, Sess: 95.69.176.224:56536 )  }
Looks like variable is reported persistent on server.
But following assert on client fails:

Code: Select all

        assertTrue("State is persistent", state.isPersistent());
I trust server-side, so it looks like error on client.

Thanks
Last edited by mente on 05 Aug 2011, 08:17, edited 1 time in total.
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Post by ThomasLund »

Added to bugtracker - thanks for reporting
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
mente
Posts: 73
Joined: 14 Apr 2011, 14:27

Post by mente »

One more bug: admin panel reports, that this variable is not private, not persistent. But it's persistent and private.
mente
Posts: 73
Joined: 14 Apr 2011, 14:27

Post by mente »

Looks like bug is in server, not client.
Update on this bug: when roomvariable owner leaves the room, variable is removed. Server-side generation of variable:

Code: Select all

RoomVariable stateVariable = new SFSRoomVariable(RoomVariableName.SCRIPT_STATE.toString(), state, true, true, false);
stateVariable.setOwner(room.getOwner());
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Thanks for reporting.
I confirm that there is a client side bug on the PERSISTENT flag which has been fixed and we'll release a quick patch soon.
One more bug: admin panel reports, that this variable is not private, not persistent. But it's persistent and private.
This is confusing.
If the variable is set as PERSISTENT and PRIVATE then you'd expect exactly to see those two flags active in the AdminTool which is what happens.
We didn't find any anomalies.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
mente
Posts: 73
Joined: 14 Apr 2011, 14:27

Post by mente »

That's the problem. Two flags should be true, but both of them are false.
Let's see what will be after a quick fix release. Maybe I've missed something
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

We are not able to reproduce that.
Suggestion: make sure you are not using an older AdminTool cached by the browser. Clear your cache and reload the tool, it should work just fine.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
mente
Posts: 73
Joined: 14 Apr 2011, 14:27

Post by mente »

Ok, will do it on next patch release :)
Post Reply