recently i added html 5 websockets conenction (for unity 5 webgl), im enable to connect to server, but after i sent create room reuqest, this warning message prompt out in the server log:
java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Integer
com.smartfoxserver.v2.entities.data.SFSArray.getInt(SFSArray.java:281)
com.smartfoxserver.v2.entities.data.SFSObjectLite.getIntArray(SFSObjectLite.java:124)
com.smartfoxserver.v2.controllers.system.CreateRoom.preProcess(CreateRoom.java:220)
com.smartfoxserver.v2.controllers.system.CreateRoom.execute(CreateRoom.java:264)
com.smartfoxserver.v2.controllers.v290.SystemReqController.processRequest(SystemReqController.java:164)
com.smartfoxserver.v2.controllers.v290.SystemReqController.enqueueRequest(SystemReqController.java:119)
com.smartfoxserver.bitswarm.io.protocols.AbstractProtocolCodec.dispatchRequestToController(AbstractProtocolCodec.java:39)
com.smartfoxserver.bitswarm.websocket.WebSocketProtocolCodec.dispatchRequest(WebSocketProtocolCodec.java:139)
com.smartfoxserver.bitswarm.websocket.WebSocketProtocolCodec.onPacketRead(WebSocketProtocolCodec.java:65)
com.smartfoxserver.bitswarm.websocket.netty.WebSocketServerHandler$WSIOExecutor.run(WebSocketServerHandler.java:105)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)
then server never return room create success notification message anymore, this only happen when i use WebGL platform.
Problem after added unity 5 WebGL
-
PatrickActivate
- Posts: 4
- Joined: 25 May 2015, 02:46
Re: Problem after added unity 5 WebGL
Hi,
can you show us the Unity code you're using to create the Room?
Thanks
can you show us the Unity code you're using to create the Room?
Thanks
-
PatrickActivate
- Posts: 4
- Joined: 25 May 2015, 02:46
Re: Problem after added unity 5 WebGL
sorry for late replying, below are the code i used to create the room:
MMORoomSettings setting = new MMORoomSettings (roomName);
setting.MaxUsers = maxUser;
setting.GroupId = "default";
setting.DefaultAOI = new Vec3D (99.9f,1.0f, 99.9f);
setting.Variables.Add(new SFSRoomVariable("zone", (int)zone));
setting.Variables.Add(new SFSRoomVariable("host", ManagerHolder.GetGameManager().characterInfo [Constants.PlayerCharacterKey.Name].ToString()));
client.Send(new CreateRoomRequest(setting, true));
i tried to changed the DefaultAOI's float numbers to int numbers, and the error disappeared, don't know is it the right way to solve this problem.
MMORoomSettings setting = new MMORoomSettings (roomName);
setting.MaxUsers = maxUser;
setting.GroupId = "default";
setting.DefaultAOI = new Vec3D (99.9f,1.0f, 99.9f);
setting.Variables.Add(new SFSRoomVariable("zone", (int)zone));
setting.Variables.Add(new SFSRoomVariable("host", ManagerHolder.GetGameManager().characterInfo [Constants.PlayerCharacterKey.Name].ToString()));
client.Send(new CreateRoomRequest(setting, true));
i tried to changed the DefaultAOI's float numbers to int numbers, and the error disappeared, don't know is it the right way to solve this problem.
Re: Problem after added unity 5 WebGL
Make sure you are using the latest version of the API published on our website on May 20th: http://www.smartfoxserver.com/download/sfs2x#p=client
We tested your code and we can create the MMORoom successfully using the float coordinates.
We tested your code and we can create the MMORoom successfully using the float coordinates.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Re: Problem after added unity 5 WebGL
We are aware of this issue in Room creation. We will fix it in the next SFS2X release (v2.12) due soon.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team