Max room "name" size + description?

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

m-productions
Posts: 7
Joined: 02 Jun 2009, 22:33

Max room "name" size + description?

Postby m-productions » 13 Jun 2009, 15:36

Well after finding out I can not ask for a room var from outside a room, I need a new way to store the rooms "map #" and room maker. I have three thoughts on this.

The first was to make the room name

roomname+"~~"+_global.username+"~~"+_root.mappick

then, when I use room.getName(), i could just split the name, and get all three vars I need for each room, however, it seems a room can only have a max of 20 chars. Ive looked all over, and can find no way to change this (is it possible?) If not then...

While looking around the API, I noticed a var that has been left out "description" that would be a perfect place to put everything I need. Im wondering if this would be simple enough to get running, (I have not looked over all the API, so thats why im unsure how simple this would be)
I noticed

Code: Select all

//xmlMsg += "<desc><![CDATA[" + roomObj.description + "]]></desc>"
could be activated. then under the room api, simply add description to the room function, then add a .getDescription() function to return the rooms drescription. would there be more than this to get it working?


My last idea, and the one that looks like im going to have to use until some information on the above two items, is just to use the lobbies room vars to hold the information I need for the other rooms.


But some feedback on 1) max room name size, and 2) enabled the "description" would be nice, thanks!
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 14 Jun 2009, 19:13

Well after finding out I can not ask for a room var from outside a room, I need a new way to store the rooms "map #" and room maker. I have three thoughts on this.

It's not that you can't. It's not provided out of the box to avoid bad bandwidth usage, but you can do that with a little bit of server side coding.

Here we discuss the topic in details:
viewtopic.php?p=12388#12388
Lapo
--
gotoAndPlay()
...addicted to flash games
m-productions
Posts: 7
Joined: 02 Jun 2009, 22:33

Postby m-productions » 14 Jun 2009, 21:54

Here we discuss the topic in details:
viewtopic.php?p=12388#12388


thanks lapo, however that is the thread I read myself in which I found out that I could not get the room var from outside that room (I search like crazy before posting). Im trying to make this prototype with no server side scripts for now (that way it will be usable with basic.) but is something I have in the back of my head if the time comes and it needs to be done as such.

I am wondering tho, if there is a way to increase the max chars in a room name?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 15 Jun 2009, 06:05

Yes, as per the documentation, you can set the maximum room name length using <MaxRoomNamesLen> inside your Zone definition.

More details in Chapter 2.1 of the docs:
http://www.smartfoxserver.com/docs
Lapo

--

gotoAndPlay()

...addicted to flash games
Amra
Posts: 3
Joined: 18 Feb 2009, 07:44

Where should I put this code?

Postby Amra » 02 Jul 2009, 06:05

I have tried to put this <MaxRoomNamesLen> in several places in config.xml-file but it doesn't work.

I'm trying to define max room name chars in Theo Chat Zone and tried the following combinations:

betweeen the <Zone> and </Zone>:
<MaxRoomNamesLen>500</MaxRoomNamesLen>

and also:

<Zone name="TheoChat" maxRoomNamesLen="500" >

Can you please help me with this?

Regards, Niina
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 02 Jul 2009, 06:17

Hi,
betweeen the <Zone> and </Zone>:
<MaxRoomNamesLen>500</MaxRoomNamesLen>

That's correct, it goes under the <Zone> node.
To take effect you need to restart the server.

NOTE: I would not suggest to allow names that long for multiple reasons.

1- it's unlikely you will ever be able to show names on screen that are longer than 100-150 characters
2- you will waste tons of bandwidth when the server sends the user list
3- is it really necessary? how can a user remember a nickname that is longer than 30-40 characters? sounds really odd.

cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 35 guests