Problem after added unity 5 WebGL

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

Moderators: Lapo, Bax

Post Reply
PatrickActivate
Posts: 4
Joined: 25 May 2015, 02:46

Problem after added unity 5 WebGL

Post by PatrickActivate »

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.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Problem after added unity 5 WebGL

Post by Lapo »

Hi,
can you show us the Unity code you're using to create the Room?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
PatrickActivate
Posts: 4
Joined: 25 May 2015, 02:46

Re: Problem after added unity 5 WebGL

Post by PatrickActivate »

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.
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Problem after added unity 5 WebGL

Post by Bax »

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.
Paolo Bax
The SmartFoxServer Team
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Problem after added unity 5 WebGL

Post by Bax »

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
Post Reply