Way to increase allowed message length?

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
User avatar
Carl Lydon
Posts: 298
Joined: 12 Nov 2007, 16:15
Location: NYC

Way to increase allowed message length?

Post by Carl Lydon »

Hi,

I have a clubhouse feature that saves the clubhouse layout by sending data to extension, which then saves to the database.

I give each furniture item an ID code, rotational value and x, y position.

I'm getting errors like this, and some items fail to save:

Code: Select all

2011/07/01 02:29:39.242 - [ WARNING ] [id: 61] (SmartFoxServer.readIncomingMessages): Message exceed allowed max length! 
(4217 bytes) from > /213.190.164.43
The data I'm sending is a text object that looks like the following. I can't seem to save much more than this:

Code: Select all

2,2001015,2002001,2003004,2004001,15212054,11038394,15985620,15985620,furni:,
#,5001,340,380,6,#,5004,420,320,2,#,5005,740,400,4,#,5010,520,380,3,
#,5012,520,320,6,#,50057,260,420,6,#,5013,740,200,2,#,5003,680,380,2,
#,5002,460,460,2,#,50052,280,340,8,#,50056,400,420,4,#,5004,620,320,8
To me, this doesn't seem like much data. Is there a way to increase the allowed message size? I don't see anything in the config file, and a search of the forums doesn't give me anything.

Otherwise, how do you think I should get around this? I guess I could make th ecode numbers for the furniture items much smaller ("2001015" etc) but I would still run into problems as the user's clubhouses get bigger and bigger.

Thanks, any help is always appreciated!
User avatar
Carl Lydon
Posts: 298
Joined: 12 Nov 2007, 16:15
Location: NYC

Post by Carl Lydon »

I feel like smartfox must be adding alot to the message size by converting it to xml?
User avatar
Carl Lydon
Posts: 298
Joined: 12 Nov 2007, 16:15
Location: NYC

Post by Carl Lydon »

Oops, I did find the answer with a couple more searches:

http://forums.smartfoxserver.com/viewtopic.php?p=26475
User avatar
Carl Lydon
Posts: 298
Joined: 12 Nov 2007, 16:15
Location: NYC

Post by Carl Lydon »

That being said, how should I be sending data to database through extension without running up agains this limit? Should I be dividing my message up into parts and sending it in pieces?
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

If your database is MySql or MSSQL or similar, you could create a php script to save such data to the database.

Or.. only send the 'changes' to the server (i.e. subtraction or additional). The server would then verify the changes (against user's money etc), and then update the user's full clubhouse data internally for storing into the database at later stage (i.e. at log out or disconnection). This approach can reduce cheating / hacking.

Otherwise, you'll need to split up the data if you're not going to touch the MaxMsgLen value.
Smartfox's forum is my daily newspaper.
User avatar
Carl Lydon
Posts: 298
Joined: 12 Nov 2007, 16:15
Location: NYC

Post by Carl Lydon »

Thanks! I think if I send a message each time the user adds, deletes, turns or moves a furniture it would be a lot of messages and a lot of checking for the extension (As opposed to just doing it once at the end)... But I guess that's the way to go.

BTW, here is what it looks like, if you're interested. I've added more furniture since this was taken but the kids seem to be able to do a lot with a little. Some items can be color tinted, liek the floors and walls, for greater variety. Was pretty complicated for me to make this :-(

Image
Image
Image[/img]
Sarevok
Posts: 75
Joined: 12 Apr 2011, 22:12

Post by Sarevok »

Nice pictures :) I adore isometric view, it always reminds me of Fallout :D
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

The graphics looks great Carl! 8)
Smartfox's forum is my daily newspaper.
Post Reply