I get the following two errors when a user leaves/closes the browser session. I think the first is for the person leaving and the second is for the person who stays.
Is there a way to catch these errors and prevent them from happening?
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.adobe.rtc.messaging.manager::MessageManager/onUserRemove()[C:\work\main\connect\cocomo\src\com\adobe\rtc\messaging\manager\MessageManager.as:745]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.adobe.rtc.sharedManagers::UserManager/userRemoved()[C:\work\main\connect\cocomo\src\com\adobe\rtc\sharedManagers\UserManager.as:1056]
at com.adobe.rtc.sharedManagers::UserManager/onItemRetract()[C:\work\main\connect\cocomo\src\com\adobe\rtc\sharedManagers\UserManager.as:957]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.adobe.rtc.sharedModel::CollectionNode/http://www.adobe.com/2006/connect/cocomo/messaging/internal::receiveItemRetraction()[C:\work\main\connect\cocomo\src\com\adobe\rtc\sharedModel\CollectionNode.as:755]
at com.adobe.rtc.messaging.manager::MessageManager/http://www.adobe.com/2006/connect/cocomo/messaging/internal::receiveItemRetraction()[C:\work\main\connect\cocomo\src\com\adobe\rtc\messaging\manager\MessageManager.as:679]
at com.adobe.rtc.session.managers::SessionManagerBase/receiveItemRetraction()[C:\work\main\connect\cocomo\src\com\adobe\rtc\session\managers\SessionManagerBase.as:341]
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.adobe.rtc.pods::SimpleChat/onUserRemove()[C:\work\main\connect\cocomo\src\com\adobe\rtc\pods\SimpleChat.as:693]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.adobe.rtc.sharedManagers::UserManager/userRemoved()[C:\work\main\connect\cocomo\src\com\adobe\rtc\sharedManagers\UserManager.as:1056]
at com.adobe.rtc.sharedManagers::UserManager/onItemRetract()[C:\work\main\connect\cocomo\src\com\adobe\rtc\sharedManagers\UserManager.as:957]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.adobe.rtc.sharedModel::CollectionNode/http://www.adobe.com/2006/connect/cocomo/messaging/internal::receiveItemRetraction()[C:\work\main\connect\cocomo\src\com\adobe\rtc\sharedModel\CollectionNode.as:755]
at com.adobe.rtc.messaging.manager::MessageManager/http://www.adobe.com/2006/connect/cocomo/messaging/internal::receiveItemRetraction()[C:\work\main\connect\cocomo\src\com\adobe\rtc\messaging\manager\MessageManager.as:679]
at com.adobe.rtc.session.managers::SessionManagerBase/receiveItemRetraction()[C:\work\main\connect\cocomo\src\com\adobe\rtc\session\managers\SessionManagerBase.as:341]
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
Why do you need to use the same instance of authentication for every connectsession. I think you should use separate authenticators to authenticate and start a session. Looking at the MultipleSessions example in sampleApps folder.
Once you have a connectsession, you can use it for various components outside session containers.
Hope this helps.
Thanks
Hironmay Basu
Views
Replies
Total Likes
Hi,
I tried to simulate the scenario you mentioned and didnt hit the exceptions you encountered. I am guessing you are mannually removing or booting the users out of the room before closing the app that might be leading to exceptions you posted.
Can you post your code if possible..
Thanks
Arun
Views
Replies
Total Likes
Hi Arun
Thanks for your response. I have done a little debugging and have found that the issue only occurs if both players are logged in to the two sessions (ie. The lobby is the first and then the game is the second.) I also tried removing the SimpleChat and this had no effect. My guess is that it relates to the internal workings of the UserManager ie. maybe a cleanup routine when a user is removed.... but then again maybe I have an event that gets fired before the userRemove event ( I don't think so but I might try some more debugging later ).
Here is a bit more info about the scenario (if you can easily replicate this that would be great - it took me a while):
Session 1: The lobby contains a roster and a SimpleChat (In a ViewStack). It uses a SharedCollection to manage game challenges.
Session 2: The game contains a roster, SimpleChat. It uses a SharedProperty to identify opponents and a SharedCollection to store game data. A BatonProperty is also used.
Views
Replies
Total Likes
So now I am thinking the error comes from using the same AdobeHSAuthenticator for both sessions.
Perhaps someone could shed some light as to whether this is allowable (ie. using the same authenticator in multiple sessions)?
I would test it myself but have got account-time-limit-reached ... I am a bit surprised to have gone beyond quota as I have only been testing thus far.
Views
Replies
Total Likes
Hi Arun
I have attached a text file which contains all the session login and authentication code.
Please advise if you can improve on it or can identify any key issues.
It would be cool if everyone could add their little bit, remembering to share their additions for re-use (it would be nice to have a basis for lobbying and separate game rooms, rather than rely on suggestion)
Thanks
Oliver
Views
Replies
Total Likes
Hi,
Why do you need to use the same instance of authentication for every connectsession. I think you should use separate authenticators to authenticate and start a session. Looking at the MultipleSessions example in sampleApps folder.
Once you have a connectsession, you can use it for various components outside session containers.
Hope this helps.
Thanks
Hironmay Basu
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies