Create personal room for each player

Post here your questions about the OpenSpace 2.x or notify bugs and suggestions.

Moderators: Lapo, Bax

leooi77
Posts: 7
Joined: 25 Aug 2011, 01:39

Create personal room for each player

Postby leooi77 » 25 Aug 2011, 08:29

Hi
Can I create a personal room for each player. i try the sample code from doc (Server-side Actionscript API):
var roomObj = {}
roomObj.name = "Room_user1"
roomObj.maxU = 25

var newRoom = _server.createRoom(roomObj, null)

if (newRoom != null)
trace("Great the room was created")
else
trace("A problem occurred, better check the server logs")

but i get the following error:
1120: Access of undefined property _server.

regards
Ooi
jamalsoueidan
Posts: 153
Joined: 15 Aug 2011, 16:33

Postby jamalsoueidan » 27 Aug 2011, 17:49

That means you havn't assigned instance of smartfoxserver to _server.

_server = new SmartFoxServer(); etc.
---------------------------------------------------
Jamal Soueidan
http://linkedin.com/in/jamalsoueidan
leooi77
Posts: 7
Joined: 25 Aug 2011, 01:39

Postby leooi77 » 29 Aug 2011, 09:06

thx for reply
Btw, may i know wat class file i need to import?

import it.gotoandplay.smartfoxserver.SmartFoxServer; ?

regards
Ooi
jamalsoueidan
Posts: 153
Joined: 15 Aug 2011, 16:33

Postby jamalsoueidan » 29 Aug 2011, 09:23

Import these

import com.smartfoxserver.v2.*;
import com.smartfoxserver.v2.core.*;
---------------------------------------------------

Jamal Soueidan

http://linkedin.com/in/jamalsoueidan
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 31 Aug 2011, 07:54

I think leooi77 is using SmartFoxServer Pro, not 2X.
Please check the online documentation of SFS Pro to get a better understanding on Extensions development.
Paolo Bax
The SmartFoxServer Team
leooi77
Posts: 7
Joined: 25 Aug 2011, 01:39

Postby leooi77 » 07 Sep 2011, 03:52

Hi
Yup, i'm using smartFox server Pro..
But i can't found any documentation related to create new room in flash AS3.

thx
leooi77
Posts: 7
Joined: 25 Aug 2011, 01:39

Postby leooi77 » 07 Sep 2011, 04:31

Hi
Finally i manage to create a room..but it was deleted after i close the flash.

is it possible create a permanent dynamic room?

thx
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 07 Sep 2011, 05:35

Please read the "Auto-remove mode" paragraph of the Room architecture document.
In order to create a Room which never gets removed (unless you restart the server of course) you will need to do it in a server-side Extension.
Paolo Bax
The SmartFoxServer Team
leooi77
Posts: 7
Joined: 25 Aug 2011, 01:39

Postby leooi77 » 07 Sep 2011, 06:20

Hi Bax
Sorry, the link u given is for smartfoxServer 2x rite? is the autoRemoveMode applicable in smartFoxServer Pro?

i go through the online doc (http://www.smartfoxserver.com/docs/), i didnt see any topic related to "autoRemoveMode"


thx
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 08 Sep 2011, 06:29

In SFS Pro you can't define the auto-remove mode. It is predefined based on the room type.
In order to create a room that doesn't get destroyed when empty (or when the client which created it disconnects) you will need to do it in a server-side extension.
Paolo Bax
The SmartFoxServer Team
leooi77
Posts: 7
Joined: 25 Aug 2011, 01:39

Postby leooi77 » 08 Sep 2011, 07:04

Hi Bax
Do u mean i need to write own server-side extension?

thx
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 09 Sep 2011, 06:22

Yes.
Paolo Bax
The SmartFoxServer Team

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 28 guests