OnPublicMessage different rooms

Post here all your questions related with SmartFoxServer .Net/Unity3D API

Moderators: Lapo, Bax

matrix211v1
Posts: 61
Joined: 16 Jan 2009, 14:48

OnPublicMessage different rooms

Postby matrix211v1 » 28 Aug 2011, 18:30

Hello All!

Quick question. Using SFS 1.5.5 and the API 1.2.6 I am in RoomID 1 and I want to send a PublicMessage to everyone who is in RoomID2. Both rooms exist and have people in it. I am calling:

smartFoxClient.SendPublicMessage("Hello Everyone", 2);

The OnPublicMessage Event doesn't fire. I am wondering a couple of things because the OnPublicMessage works if I send it to RoomID (which defaults to the activeRoomId) 1 such as:

smartFoxClient.SendPublicMessage("Hello Everyone");

Do you have to be logged into RoomID 2 for this to work? If so, how to I multi-join two rooms at the same time?
Else, do you have any other suggestions I need to look into?

Thanks!
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 07 Sep 2011, 11:12

Hey James,

Hmmm - I cant remember if you need to be logged in to the room or not.

But you can join multiple rooms easily by passing a true to the dontLeave parameter in joinRoom.

E.g.:

smartFox.joinRoom(15, "", false, true)

This allows for being in multiple rooms at the same time.

Hope that helps

/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 20 guests