LoginAssistant doesn't work with ROOM LEVEL Extensions!

Post here your questions about the Java client / Android API for SFS2X

Moderators: Lapo, Bax

hoanghuybao
Posts: 35
Joined: 22 Aug 2015, 16:20

LoginAssistant doesn't work with ROOM LEVEL Extensions!

Postby hoanghuybao » 12 Sep 2015, 17:40

Hi admin,
When I create room in the runtime, I get error message in smartfox.log
Exception: com.smartfoxserver.v2.exceptions.SFSRuntimeException
Message: LoginAssistant doesn't work with ROOM LEVEL Extensions!
Description: Extension initialization failed.
+--- --- ---+
Stack Trace:
+--- --- ---+
com.smartfoxserver.v2.components.login.LoginAssistantComponent.<init>(LoginAssistantComponent.java:61)
com.ldthong.signup.Login.config(Login.java:17)
com.ldthong.signup.UserAssistantExtension.init(UserAssistantExtension.java:10)
com.smartfoxserver.v2.entities.managers.SFSExtensionManager.createExtension(SFSExtensionManager.java:303)
com.smartfoxserver.v2.entities.managers.SFSRoomManager.createRoomExtension(SFSRoomManager.java:259)
com.smartfoxserver.v2.entities.managers.SFSRoomManager.createRoom(SFSRoomManager.java:211)
com.smartfoxserver.v2.entities.SFSZone.createRoom(SFSZone.java:247)
com.smartfoxserver.v2.api.SFSApi.createRoom(SFSApi.java:727)
com.smartfoxserver.v2.api.SFSApi.createRoom(SFSApi.java:704)
com.smartfoxserver.v2.controllers.system.CreateRoom.execute(CreateRoom.java:271)
com.smartfoxserver.v2.controllers.v290.SystemReqController.processRequest(SystemReqController.java:157)
com.smartfoxserver.v2.controllers.v290.SystemReqController.enqueueRequest(SystemReqController.java:114)
com.smartfoxserver.bitswarm.io.protocols.AbstractProtocolCodec.dispatchRequestToController(AbstractProtocolCodec.java:39)
com.smartfoxserver.v2.protocol.SFSProtocolCodec.dispatchRequest(SFSProtocolCodec.java:125)
com.smartfoxserver.v2.protocol.SFSProtocolCodec.onPacketRead(SFSProtocolCodec.java:90)
com.smartfoxserver.v2.protocol.binary.BinaryIoHandler$1.run(BinaryIoHandler.java:525)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

13 Sep 2015 | 00:08:51,732 | INFO | SFSWorker:Sys:4 | entities.managers.SFSRoomManager | | Room created: { Zone: DemoZone }, [ Room: newRoom, Id: 6, Group: games, isGame: true ]


Login.java:17: lac = new LoginAssistantComponent(extension);
Request to create room:

Code: Select all

public void createGameRoom(String roomName) {
        if (roomName.length() > 0) {
            RoomExtension extension = new RoomExtension(EXTENSION_ID, EXTENSIONS_CLASS);
            RoomSettings settings = new RoomSettings(roomName);
            settings.setGroupId(GAME_ROOMS_GROUP_NAME);
            settings.setGame(true);
            settings.setMaxUsers(2);
            settings.setMaxSpectators(0);
            settings.setExtension(extension);
            sfsClient.send(new CreateRoomRequest(settings, true, sfsClient.getLastJoinedRoom()));
        }
    }


Why I get the error message?

Note: the room is created successfully. Room created: { Zone: DemoZone }, [ Room: newRoom
User avatar
Lapo
Site Admin
Posts: 20217
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: LoginAssistant doesn't work with ROOM LEVEL Extensions!

Postby Lapo » 12 Sep 2015, 17:56

The LOGIN event is only fired at Zone Level.
There is no reason why it should fire in a Room. Rooms can be joined by users AFTER they have logged in.

cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
hoanghuybao
Posts: 35
Joined: 22 Aug 2015, 16:20

Re: LoginAssistant doesn't work with ROOM LEVEL Extensions!

Postby hoanghuybao » 13 Sep 2015, 16:35

Thanks for your comment. I have more question with Sign up/Login assistant component:
The SignUp has event to listen:

Code: Select all

addRequestHandler(SignUpAssistantComponent.COMMAND_PREFIX, suac);

Why doesn't have the Login assistant component event to listen?

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

Re: LoginAssistant doesn't work with ROOM LEVEL Extensions!

Postby Lapo » 14 Sep 2015, 07:48

The login component works a bit differently and adds the login event listener internally.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Java / Android API”

Who is online

Users browsing this forum: No registered users and 1 guest