quickJoinGame
Posted: 01 Dec 2010, 20:53
Why function quickJoinGame in GameApi fire Exception, when I try call it on empty server zone? In my opinion if the zone does not have any room it should return null and not exception.
Code: Select all
findRoomsMathExpression = new MatchExpression(RoomProperties.IS_GAME, BoolMatch.EQUALS, true).and
(RoomProperties.HAS_FREE_PLAYER_SLOTS, BoolMatch.EQUALS, true);
getGameApi().quickJoinGame(user, findRoomsMathExpression, getZone(), "battle");
Code: Select all
ERROR [com.smartfoxserver.v2.controllers.ExtensionController-1] v2.controllers.ExtensionController -
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Exception: java.lang.IllegalArgumentException
Message: No Room provided for searching.
Description: Error while handling client request in extension: { Ext: XCOMExtension, Type: JAVA, Lev: ZONE, { Zone: XCOMExtension }, {} }
Extension Cmd: MSG_JOINT_TO_BATTLE
+--- --- ---+
Stack Trace:
+--- --- ---+
com.smartfoxserver.v2.api.SFSGameApi.quickJoinGame(SFSGameApi.java:252)
com.smartfoxserver.v2.api.SFSGameApi.quickJoinGame(SFSGameApi.java:196)
com.smartfoxserver.v2.api.SFSGameApi.quickJoinGame(SFSGameApi.java:190)
com.smartfoxserver.v2.api.SFSGameApi.quickJoinGame(SFSGameApi.java:184)
sfs2extensions.games.xcom.gamezone.model.proxy.BattleRoomsProxy.jointBattle(BattleRoomsProxy.java:101)
sfs2extensions.games.xcom.gamezone.view.handlers.JointToBattleHandler.handleClientRequest(JointToBattleHandler.java:31)
com.smartfoxserver.v2.extensions.SFSExtension.handleClientRequest(SFSExtension.java:187)
com.smartfoxserver.v2.controllers.ExtensionController.processRequest(ExtensionController.java:137)
com.smartfoxserver.bitswarm.controllers.AbstractController.run(AbstractController.java:96)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)