loadRoom(roomname) fails

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

Moderators: Lapo, Bax

mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

loadRoom(roomname) fails

Postby mmilen » 20 Mar 2023, 00:41

Hi,

Server version 2.18.3.

I am playing around with the FilePersistant storage. My test Room saves, and I can see the file. When I use getParentZone().getRoomPersistenceApi().loadRoom(roomname) I get this error.

tablename = "1864743674_-1480107014"
e = "com.smartfoxserver.v2.persistence.room.SFSStorageException: Cannot find stored Room file for Room named: 1864743674_-1480107014, Zone: OnlineBridgeClub"


At the same time
Screen Shot 2023-03-19 at 8.51.30 PM.png
Screenshot of getParentZone().getRoomPersistenceApi().loadAllRooms()
(232.09 KiB) Not downloaded yet
getParentZone().getRoomPersistenceApi().loadAllRooms(); happily load all saved rooms. See attached image of the result.

I did play with the room names, removing the _, and the - , same result.

Workaround is iterating over a group of tables, which is not too bad unless the underlying logic of loadRoom( name) is much more efficient.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: loadRoom(roomname) fails

Postby Lapo » 20 Mar 2023, 09:01

Very strange.
In order for us to investigate the issue we'd need to obtain the list of all file names stored in the storage folders.

If you can store that to a text file and send it to our support@... email box with a reference to this post, we'll take a look.
The data is stored under SFS2X/data/roomData/<encoded-zone-name>/

The <encoded-zone-name> is the name of your zone in hex. Should be easy to find if you only use Room persistence in one Zone

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Re: loadRoom(roomname) fails

Postby mmilen » 13 Apr 2023, 13:47

Lapo,

I think removeRoom by name also fails.
this.getParentZone().getRoomPersistenceApi().removeRoom(getParentRoom().getName()) this code fails to remove a saved room.

The room name is sim_lobby_constant , and the file name I get is 696e64765f7473696d5f6c6f6262795f636f6e7374616e74.room

This one if kind of urgent, since there is no good work around. I have to load the room on resurrect, check for a variable to see if it should really be resurrected and take appropriate action. Also some of my rooms are quite bid like 300MB, no need for this kind of file to hang around when not needed.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: loadRoom(roomname) fails

Postby Lapo » 14 Apr 2023, 14:07

We'll look into it and let you know.
There is a patch coming early next week but it addresses a different issues with Unity/WebGL and will not contain other fixes, for the time beng.

I am not sure how a Room data file can possibly be 300MB, considering it's binary and it only saves a handful of properties. The typical room file size is between 1 and 5 KBytes.
Lapo

--

gotoAndPlay()

...addicted to flash games
mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Re: loadRoom(roomname) fails

Postby mmilen » 16 Apr 2023, 04:52

I have some long running games that over time do grow to about this size. We can certainly find ways to cut size by re-rolling data, but is some much easier to just reload it :).
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: loadRoom(roomname) fails

Postby Lapo » 17 Apr 2023, 08:22

I am not sure I understand what could possibly make a room file that big. Are you accumulating thousands of RoomVariables? The potential issue with this is that a very large room data file will also translate in huge Room objects on the server side.

If it's only a few maybe it's not that big of a deal but if you have hundreds of these, it will tax your memory usage significantly.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Re: loadRoom(roomname) fails

Postby mmilen » 17 Apr 2023, 14:01

It is one big private hidden variable (SFSObject), with and SFSArray that has some 90K entries :). In our tests saving every few seconds and reloading once in a blue moon worked well.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: loadRoom(roomname) fails

Postby Lapo » 18 Apr 2023, 13:37

We may be able to send you an update to test on your end soon, but I noticed you're running on 2.18.x while the update we would send you requires 2.19

Can you update?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Re: loadRoom(roomname) fails

Postby mmilen » 18 Apr 2023, 13:41

Latest one on our 2000 user license is 2.19 . and my test system is going 2.19 shortly.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: loadRoom(roomname) fails

Postby Lapo » 19 Apr 2023, 07:31

Great.
Please get in touch with us directly via our support@... mail box and we'll send the link to the update.

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Re: loadRoom(roomname) fails

Postby mmilen » 19 Apr 2023, 16:56

Sent an email. It will show as admin@thesharkbridge...
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: loadRoom(roomname) fails

Postby Lapo » 20 Apr 2023, 07:00

Thanks.
FYI: I've edited your email in your previous post to avoid spam bots catching it. It will save you some spam ;)
Lapo

--

gotoAndPlay()

...addicted to flash games
mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Re: loadRoom(roomname) fails

Postby mmilen » 20 Apr 2023, 12:44

Thanks mate. I think all our efforts in that area are in vain.
Anyway, the patch worked like a charm for both loadRoom and removeRoom by name.
Thanks a ton.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 51 guests