Limbo room question

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

Moderators: Lapo, Bax

cBroadbo
Posts: 20
Joined: 16 Apr 2009, 17:49

Limbo room question

Postby cBroadbo » 08 Jun 2009, 20:25

Hi All,

I have a room that users will join and get a feed of data (imagine a news data feed). It is possible that 3000 - 4000 users will join.

There is no need for those users to get any of the notifications that come with a normal room. So a Limbo room looks like just the thing I need......except you can't send public messages.

Is there a way to send public messages to a limbo room as a moderator or with an extension?

Disabling the various notifications at the zone level in the config.xml file is not an option because I need other rooms in that zone to get all those notifications.

Thanks,
Craig
Last edited by cBroadbo on 09 Jun 2009, 17:02, edited 1 time in total.
Gnoll
Posts: 128
Joined: 10 Mar 2009, 10:14

Postby Gnoll » 09 Jun 2009, 04:51

Well you still have private messages, and could have an extension loop through each user and send, if needed

Good luck,
Gnoll
cBroadbo
Posts: 20
Joined: 16 Apr 2009, 17:49

Postby cBroadbo » 09 Jun 2009, 12:04

Sure. I suppose that is what SendPublicMessage probably does anyway. I'm just hoping that perhaps there was some facility built in, but if not, then that will be the solution.

Craig
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 09 Jun 2009, 14:26

Sending public messages in a room of that capacity is not a good idea. Imagine the amount of traffic it would generate... the chat would be impossible to follow. Also bandwidth consumption would hit the stars as each message would result in a broadcast of thousands of messages per second.

Limbo rooms don't support Public Message for this reason. Private Messages and the buddy list allow are allowed in order to create a Skype/MSN-like chat system.
Lapo
--
gotoAndPlay()
...addicted to flash games
cBroadbo
Posts: 20
Joined: 16 Apr 2009, 17:49

Postby cBroadbo » 09 Jun 2009, 14:37

Well it is going to be necessary as all of these users are basically subscribing to a "feed". So one way or another we will need to send out the same messages to 3000-4000 users. You certainly understand why we don't want all the other notifications. No one wants to get user lists of 3000+ each time someone joins a room:)

I'm all ears if you have another suggestion.

Though from what I've read and what I'm hearing, our only option if we use a "limbo" room is to write an extension that iterates through the user list and sends private messages to each.

Thanks,
Craig
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 09 Jun 2009, 15:16

This is not necessary.
From server side you can use a method called dispatchPublicMessage() which fires a public message in any room, Limbo included.

(from server side everything is possible :) )
Lapo

--

gotoAndPlay()

...addicted to flash games
cBroadbo
Posts: 20
Joined: 16 Apr 2009, 17:49

Postby cBroadbo » 09 Jun 2009, 17:01

Thanks Lapo! You are the man!!!
asakhapour
Posts: 9
Joined: 08 May 2009, 03:35

Postby asakhapour » 17 Jun 2009, 23:10

Hi Lapo,

I work with Craig and I have been trying your suggestion on using dispatchPublicMessage() on extension I have written for limbo room that mimics the sendpublicmessage on server side. I am running to problem and every time this method is called I get disconnected from server. The following are the code snip of my extension:

public void handleRequest(String cmd, String[] params, User u, int fromRoom)
{
trace("The command -> " + cmd + " was invoked by user -> " u.getName());

if(cmd != null && cmd.equalsIgnoreCase("pubMsg"))
{
Room r = null;
Zone z = helper.getZone("buzztime");
trace("The zone name ---> " + z.getName());
if(z != null)
{
r = z.getRoom(fromRoom);
trace("The room name ---> " + r.getName());
}

if(r != null)
{
try
{
trace("The message ---> " + params[0]);
helper.dispatchPublicMessage(params[0], r, u);
trace("After the message dispatched. ");
}catch(Exception e){
e.printStackTrace();
}
}
}
}

And the following is my client code calls the extension:

if(smfClient == null)
{
throw new BuzztimeException("Client connection is lost.");
}

Room rm = smfClient.getRoomByName(configInfo.get(SmartfoxUtil.DEFAULT_ROOM));

//check to see if the admin user already in the room

if(rm != null &&
rm.getUser(configInfo.get(SmartfoxUtil.SMART_FOX_ADMIN_USER)) != null)
{
logger.info("About to send public message from broadCastMessage ...");
//smfClient.sendPublicMessage(msg);
String[] params = new String[1];
params[0] = msg;
smfClient.sendXtMessage(SPORTS_EXTENSION, "pubMsg",
params,rm.getId());
}
else
{
logger.info("Get Room list from broadCastMessage ...");
smfClient.getRoomList();
}

In the server side config.xml for the room we are using above I have set limbo= true.

Below are my info debugs messages. I have not given you the full code …

Succeeded connecting to <IP Address>
00:57:33,210 INFO Successfully logged in to zone.
00:57:33,210 INFO Successfully obtained room list.
00:57:33,210 INFO About to join room ...
00:57:33,225 Successfully obtained room list.
00:57:33,225 INFO About to join room ...
00:57:33,225 INFO Inside onJoinRoom event ...
00:57:33,225 INFO About to call sendXtMessage
00:57:33,225 INFO After the call sendXtMessage
00:57:33,241 INFO Connection lost

I am puzzled of what I am doing wrong here. Any information regarding this would be greatly appreciated.

Thanks,

Al

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 33 guests