OpenSpace 2.04 and SFS2X RC3 issue

Post here your questions about the OpenSpace 2.x or notify bugs and suggestions.

Moderators: Lapo, Bax

ChrisP
Posts: 7
Joined: 13 Jul 2011, 22:37

OpenSpace 2.04 and SFS2X RC3 issue

Postby ChrisP » 13 Jul 2011, 22:41

I just upgraded SFS2X and OpenSpace to the latest versions and I am getting this error:

Code: Select all

TypeError: Error #1034: Type Coercion failed: cannot convert 0 to de.polygonal.ds.Hashable.
   at de.polygonal.ds::HashSet/set()
   at com.smartfoxserver.v2.requests::GenericMessageRequest/executeObjectMessage()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer2X/API/AS3/src/com/smartfoxserver/v2/requests/GenericMessageRequest.as:300]
   at com.smartfoxserver.v2.requests::GenericMessageRequest/execute()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer2X/API/AS3/src/com/smartfoxserver/v2/requests/GenericMessageRequest.as:127]
   at com.smartfoxserver.v2::SmartFox/send()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer2X/API/AS3/src/com/smartfoxserver/v2/SmartFox.as:1620]
   at RSOpen1/onAvatarClicked()[/Users/cpomer/code/smartfoxserver/OpenSpaceTest1/RSOpen1/src/RSOpen1.as:308]
   at flash.events::EventDispatcher/dispatchEventFunction()
   at flash.events::EventDispatcher/dispatchEvent()
   at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.x\frameworks\projects\framework\src\mx\core\UIComponent.as:9590]
   at com.smartfoxserver.openspace.components.flex::OpenSpace/forwardEvent()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer/OpenSpace/Client/Components/Flex_2X/src/com/smartfoxserver/openspace/components/flex/OpenSpace.as:291]
   at com.smartfoxserver.openspace.engine.control::OpenSpaceController2X/dispatchEvent()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer/OpenSpace/Client/Classes/src/com/smartfoxserver/openspace/engine/control/OpenSpaceController2X.as:2161]
   at com.smartfoxserver.openspace.engine.control::OpenSpaceController2X/onAvatarTrigger()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer/OpenSpace/Client/Classes/src/com/smartfoxserver/openspace/engine/control/OpenSpaceController2X.as:1356]
   at com.smartfoxserver.openspace.engine.control::IsoEngineController/onAvatarInteraction()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer/OpenSpace/Client/Classes/src/com/smartfoxserver/openspace/engine/control/IsoEngineController.as:1983]
   at flash.events::EventDispatcher/dispatchEventFunction()
   at flash.events::EventDispatcher/dispatchEvent()
   at com.smartfoxserver.openspace.shared.control.input::MouseController/mouseInteractionHandler()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer/OpenSpace/Client/Classes/src/com/smartfoxserver/openspace/shared/control/input/MouseController.as:341]


When making this call:

Code: Select all

   var attack:SFSObject = new SFSObject();
   attack.putUtfString("messageType", "attack");
   attack.putUtfString("attackType", "melee");
   attack.putInt("sourceID", myAvatar.id);
   attack.putInt("targetID", avatar.id);
   attack.putInt("sourceX", myAvatar.px);
   attack.putInt("sourceY", myAvatar.py);
   smartFox.send(new ObjectMessageRequest(attack, null, [user]));


I saw another post related to the de.polygonal.ds.Hashable class but thought this issue might be different.

Thanks,
Chris
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 14 Jul 2011, 14:09

Make sure you also use the latest SWC file of the SmartFoxServer AS3 API.
I believe you're project still uses the old version.
Paolo Bax
The SmartFoxServer Team
ChrisP
Posts: 7
Joined: 13 Jul 2011, 22:37

Postby ChrisP » 14 Jul 2011, 15:02

I've replaced my libraries several times even after downloading the latest versions just to be sure I am using the correct version. The error is still occurring. If it makes any difference the number from the error is the ID of the user. Could this be happening because I am using SmartFoxBits? I tried upgrading that as well.

I will setup the demo that came with OpenSpace and see if that is working properly. If it is I will try creating a project from scratch.

Thanks,
Chris
ChrisP
Posts: 7
Joined: 13 Jul 2011, 22:37

Postby ChrisP » 14 Jul 2011, 16:06

I was able to reproduce the error in the OpenSpace example by adding an avatarClick event handler. In the handler I do this:

Code: Select all


private function onAvatarClicked(evt:AvatarEvent):void
{
   var avatar:Avatar = openSpace.getAvatarById(evt.params.id);
   if (avatar.isMyAvatar) return;
   
   var user:User = smartFox.userManager.getUserById(avatar.id);

   var myAvatar:Avatar = openSpace.getMyAvatar();
   openSpace.setMyAvatarState({stateName: "attack"});
   
   var attack:SFSObject = new SFSObject();
   attack.putUtfString("messageType", "attack");
   attack.putUtfString("attackType", "melee");
   attack.putInt("sourceID", myAvatar.id);
   attack.putInt("targetID", avatar.id);
   attack.putInt("sourceX", myAvatar.px);
   attack.putInt("sourceY", myAvatar.py);
   smartFox.send(new ObjectMessageRequest(attack, null, [user]));
}



I attach the handler in initializeOpenSpace like this:

Code: Select all



   openSpace.addEventListener(AvatarEvent.CLICK, onAvatarClicked)



If I DO NOT target a specific user for the event then the error does not occur. It appears to only happen when adding a recipients list to the send call.

Note that you will need to open the page twice and login with 2 different users as I'm not sending the event when clicking on yourself.

Thanks,
Chris
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 15 Jul 2011, 09:14

It seems you discovered a bug in the Polygonal Data Structures we use internally in the SFS AS3 API. We need to contact the creator of that library.
Thank you for reporting.
Paolo Bax
The SmartFoxServer Team
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 18 Jul 2011, 07:55

Paolo Bax
The SmartFoxServer Team
_jrn
Posts: 5
Joined: 18 Jul 2011, 11:43

another problem

Postby _jrn » 18 Jul 2011, 13:28

Hello,

i've just updated SFS2X to RC3 and OpenSpace to 2.04 (both client and serverside) and got the error after loading the openspace map:

Code: Select all

TypeError: Error #1009: Cannot access a property or method of a null object reference.
   at com.smartfoxserver.openspace.engine.control::OpenSpaceController2X/onExtensionResponse()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer/OpenSpace/Client/Classes/src/com/smartfoxserver/openspace/engine/control/OpenSpaceController2X.as:1488]
   at flash.events::EventDispatcher/dispatchEventFunction()
   at flash.events::EventDispatcher/dispatchEvent()
   at com.smartfoxserver.v2.controllers::ExtensionController/handleMessage()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer2X/API/AS3/src/com/smartfoxserver/v2/controllers/ExtensionController.as:40]
   at com.smartfoxserver.v2.core::SFSProtocolCodec/dispatchRequest()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/core/SFSProtocolCodec.as:150]
   at com.smartfoxserver.v2.core::SFSProtocolCodec/onPacketRead()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/core/SFSProtocolCodec.as:54]
   at com.smartfoxserver.v2.core::SFSIOHandler/handlePacketData()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/core/SFSIOHandler.as:231]
   at com.smartfoxserver.v2.core::SFSIOHandler/onDataRead()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/core/SFSIOHandler.as:90]
   at com.smartfoxserver.v2.bitswarm::BitSwarmClient/onSocketData()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/bitswarm/BitSwarmClient.as:410]

The last OpenSpace trace message is:

Code: Select all

[OpenSpace|INFO]  Map received from OpenSpace Extension

The application worked fine using previous SFS2XRC2 and OpenSpace 2.03 version.
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 19 Jul 2011, 09:57

@_jrn, can you please trace the OpenSpace.version property after you initialize OpenSpace? You should read the client and the extension version. Please report it.
I suspect you are not using the latest version, because line 1488 in the OpenSpaceController2X.as class is just a comment.
Paolo Bax
The SmartFoxServer Team
_jrn
Posts: 5
Joined: 18 Jul 2011, 11:43

Postby _jrn » 19 Oct 2011, 13:47

indeed, it was the error message generated using older version. however, it is still present after the update:

Code: Select all

TypeError: Error #1009: Cannot access a property or method of a null object reference.
 Â   at com.smartfoxserver.openspace.engine.control::OpenSpaceController2X/onExtensionResponse()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer/OpenSpace/Client/Classes/src/com/smartfoxserver/openspace/engine/control/OpenSpaceController2X.as:1499]
 Â   at flash.events::EventDispatcher/dispatchEventFunction()
 Â   at flash.events::EventDispatcher/dispatchEvent()
 Â   at com.smartfoxserver.v2.controllers::ExtensionController/handleMessage()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer2X/API/AS3/src/com/smartfoxserver/v2/controllers/ExtensionController.as:40]
 Â   at com.smartfoxserver.v2.core::SFSProtocolCodec/dispatchRequest()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer2X/API/AS3/src/com/smartfoxserver/v2/core/SFSProtocolCodec.as:150]
 Â   at com.smartfoxserver.v2.core::SFSProtocolCodec/onPacketRead()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer2X/API/AS3/src/com/smartfoxserver/v2/core/SFSProtocolCodec.as:54]
 Â   at com.smarlog time 16:45:24.742 :: com.playsoft.app.MasterClass [147] :: [[ControllerChatRoom::onLoggerEvent] info :: [LoggerEvent type="info" bubbles=false cancelable=false eventPhase=2 params=[object Object]]
tfoxserver.v2.core::SFSIOHandler/handlePacketData()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer2X/API/AS3/src/com/smartfoxserver/v2/core/SFSIOHandler.as:246]
 Â   at com.smartfoxserver.v2.core::SFSIOHandler/onDataRead()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer2X/API/AS3/src/com/smartfoxserver/v2/core/SFSIOHandler.as:105]
 Â   at com.smartfoxserver.v2.bitswarm::BitSwarmClient/onSocketData()[/Users/Paolo/gotoAndPlay/gotoAndPlay/SmartFoxServer2X/API/AS3/src/com/smartfoxserver/v2/bitswarm/BitSwarmClient.as:416]


thanks for help in advance!
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 20 Oct 2011, 06:34

It seems OpenSpace is not receiving proper data when you load a map.
Double check you associated the right map file to the room (through the room variable) and the map file is not corrupted (maybe you should export it again from the Editor).
Also check the server-side log, in case you have errors other than the client one you reported here.
Paolo Bax
The SmartFoxServer Team

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 13 guests