[[NEW]] SmartFoxServer 2X 2.8.0 released!

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

jeff
Posts: 14
Joined: 18 Jan 2013, 06:42
Contact:

Re: [[NEW]] SmartFoxServer 2X 2.8.0 released!

Postby jeff » 26 Nov 2013, 07:19

does OpenSpace work on MMO Room? Do you any sample on this?
User avatar
Bax
Site Admin
Posts: 4448
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: [[NEW]] SmartFoxServer 2X 2.8.0 released!

Postby Bax » 26 Nov 2013, 08:47

jeff wrote:does OpenSpace work on MMO Room? Do you any sample on this?

We don't have plans to update OpenSpace so that it uses MMORooms. The reason is that OpenSpace has some limitations in the Editor when creating the maps. It is not possible to create incredibly large maps, or it would be impossible to edit them. In fact you are limited to maps with a size of 100x100 tiles maximum.
MMORooms are supposed to be use for much larger virtual environments. For the OpenSpace maps, regular Rooms behavior is more than enough.
Paolo Bax
The SmartFoxServer Team
Zanpher
Posts: 96
Joined: 05 Oct 2009, 23:15

Re: [[NEW]] SmartFoxServer 2X 2.8.0 released!

Postby Zanpher » 26 Nov 2013, 21:58

With the introduction of MMOItems, it is now easier to make NPCs AKA less coding on the developer's part. So very cool!

Here's to hoping we can have multiple AOIs and MMOItems in the same x,y,z location.
User avatar
Lapo
Site Admin
Posts: 20761
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: [[NEW]] SmartFoxServer 2X 2.8.0 released!

Postby Lapo » 27 Nov 2013, 08:54

Multiple AOIs: it can already be done provided that you set the Room's AOI as the largest AOI you want to use. From server side you can dispatch all sort of events with a custom AOI that is <= Room's AOI. If you check the SFSMMOApi you will notice you can send all sorts of messages with a custom AOI.

MMOItems in the same x,y,z location I don't see any problem with this, besides the fact that visually it might create some confusion
Lapo
--
gotoAndPlay()
...addicted to flash games
Tulrath
Posts: 26
Joined: 11 Dec 2013, 16:38

Re: [[NEW]] SmartFoxServer 2X 2.8.0 released!

Postby Tulrath » 15 Dec 2013, 06:59

I tried to convert your Python example to Java, but this is as far as I got.

Can we please get this example in Java?

Code: Select all

import com.smartfoxserver.v2.core.ISFSEvent;
import com.smartfoxserver.v2.core.SFSEventParam;
import com.smartfoxserver.v2.entities.User;
import com.smartfoxserver.v2.entities.variables.Variable;
import com.smartfoxserver.v2.exceptions.SFSException;
import com.smartfoxserver.v2.extensions.BaseServerEventHandler;

public class UserVarsUpdateListener extends BaseServerEventHandler {
    @Override
    public void handleServerEvent(ISFSEvent event) throws SFSException{
        User user = (User) event.getParameter(SFSEventParam.USER);
        Variable variables = (Variable) event.getParameter(SFSEventParam.VARIABLES);
       
        // doco says that variables should now be type List
        // but trying to use a for-loop on it states that
        // it is not Iterable
       
       
    }
}
Last edited by Tulrath on 16 Dec 2013, 02:17, edited 1 time in total.
User avatar
Lapo
Site Admin
Posts: 20761
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: [[NEW]] SmartFoxServer 2X 2.8.0 released!

Postby Lapo » 15 Dec 2013, 12:00

The two listeners should be separate classes just like in Python. In other words you need to define those as separate classes (in separate files) and then reference them in your Extension code.
Lapo

--

gotoAndPlay()

...addicted to flash games
Tulrath
Posts: 26
Joined: 11 Dec 2013, 16:38

Re: [[NEW]] SmartFoxServer 2X 2.8.0 released!

Postby Tulrath » 15 Dec 2013, 16:10

Could you please provide this Python code in Java instead?
User avatar
Lapo
Site Admin
Posts: 20761
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: [[NEW]] SmartFoxServer 2X 2.8.0 released!

Postby Lapo » 16 Dec 2013, 11:54

Here you go.
Make sure you create the package folder structure sfs2x.extension.mmo or modify the package declaration to suit your needs.
Attachments
MMORoomDemoExtension.java.zip
(1.83 KiB) Downloaded 607 times
Lapo

--

gotoAndPlay()

...addicted to flash games
Tulrath
Posts: 26
Joined: 11 Dec 2013, 16:38

Re: [[NEW]] SmartFoxServer 2X 2.8.0 released!

Postby Tulrath » 17 Dec 2013, 23:09

Thanks for putting this together, Lapo, but I just can't get this to load :cry:

I have this in the Smartfox installation folder under the following path: /extensions/MMORoomDemo/MMORoomDemoExtension.jar

I have tried the following on the client:

Tried:
settings.Extension = new RoomExtension("MMORoomDemo","MMORoomDemoExtension");

Tried:
settings.Extension = new RoomExtension("MMORoomDemo","MMORoomDemoExtension.jar");

Here is the error I am getting (the "Class not found" message changes to match whatever I put into the "class" parameter above)

Code: Select all


16:29:27,417 INFO  [com.smartfoxserver.v2.controllers.SystemController-1] api.SFSApi     - User login: { Zone: BasicExamples }, ( Us
er Name: tester, Id: 0, Priv: 0, Sess: 127.0.0.1:50144 ) , Type: Unity
16:29:27,514 WARN  [com.smartfoxserver.v2.controllers.SystemController-1] managers.SFSRoomManager     - com.smartfoxserver.v2.except
ions.SFSExtensionException:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Exception: com.smartfoxserver.v2.exceptions.SFSExtensionException
Message: Class not found: MMORoomDemoExtension
Description: Failure while creating room extension.
Possible Causes: If the CreateRoom request was sent from client make sure that the extension name matches the name of an existing ex
tension
+--- --- ---+
Stack Trace:
+--- --- ---+
com.smartfoxserver.v2.entities.managers.SFSExtensionManager.createJavaExtension(SFSExtensionManager.java:357)

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

Re: [[NEW]] SmartFoxServer 2X 2.8.0 released!

Postby Lapo » 18 Dec 2013, 16:43

The class name must be the fully qualified name, in other words <packageName> + <className>.
If your package is my.game.test and the class is TheGameClass you must use --> my.game.test.TheGameClass
Lapo

--

gotoAndPlay()

...addicted to flash games
thanhbv
Posts: 10
Joined: 02 Jul 2011, 02:30
Contact:

Re: [[NEW]] SmartFoxServer 2X 2.8.0 released!

Postby thanhbv » 20 Dec 2013, 11:48

When I updated server to 2.8.0, I found out server does not send SFSEvent.USER_ENTER_ROOM, SFSEvent.USER_EXIT_ROOM to client has User.isItMe == true .
Everything works fine with SFS 2X 2.7.0 no matter AS3 client version.

Please let me know if something wrong here.
User avatar
Lapo
Site Admin
Posts: 20761
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: [[NEW]] SmartFoxServer 2X 2.8.0 released!

Postby Lapo » 20 Dec 2013, 12:06

Hi,
SFSEvent.USER_ENTER_ROOM is never sent to the local User (isItMe == true), because upon entering a new Room he already receives a ROOM_JOIN event.
The event fires only when a new User joins a Room where the local User is already in.

Similarly SFSEvent.USER_EXIT_ROOM fires for every user leaving the Room, regardless the isItMe flag.

If the problem you are describing is something that can be reproduced we'd like to learn the details and see how it is done.
Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
thanhbv
Posts: 10
Joined: 02 Jul 2011, 02:30
Contact:

Re: [[NEW]] SmartFoxServer 2X 2.8.0 released!

Postby thanhbv » 20 Dec 2013, 21:01

If clientA send LeaveRoomRequest => all joined clients include clientA will be notified USER_EXIT_EVENT => OK

But in 2.8, when calling sfsApi.leaveRoom(userA, room) //server side
=> server will notify all joined clients EXCEPT userA.

I think something has changed in SFSResponseApi.notifyUserExitRoom in SFS 2.8.


thanks,
thanhbv
User avatar
Lapo
Site Admin
Posts: 20761
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: [[NEW]] SmartFoxServer 2X 2.8.0 released!

Postby Lapo » 21 Dec 2013, 10:00

Hi,
I am sorry but there must be something else missing if the problem exists.

The scenario you are describing works without problems. I double checked to be sure but it was clear that calling from server side doesn't make any difference. The client request invokes the same Server API method.

Please check the steps you are doing to reproduce this issue. If you want you can send us a repro-case to our support@... email box.

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
hoangdoanh
Posts: 253
Joined: 21 Jun 2013, 04:54
Location: Vietnam

Re: [[NEW]] SmartFoxServer 2X 2.8.0 released!

Postby hoangdoanh » 16 Jan 2014, 11:45

Hi Lapo

We are having C++ client works with SmartFoxServer. Now we already upgraded to SmartFoxServer 2.8. Do we need to do something with C++ client ?

Thanks & regards,

Doanh

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 10 guests