[SOLVED] error in reactor at agent leaving

All Union Platform questions, comments, feature requests, and bug reports.

error in reactor at agent leaving  

Postby cripito » Sat 21 Sep 2013 19:37

ypeError: Error #1009: Cannot access a property or method of a null object reference.
at ClientSet/contains()[/Users/moock/build/working/src/net/user1/reactor/ClientSet.as:36]
at net.user1.reactor::Room/removeOccupant()[/Users/moock/build/working/src/net/user1/reactor/Room.as:1081]
at CoreMessageListener/u37()[/Users/moock/build/working/src/net/user1/reactor/CoreMessageListener.as:522]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at net.user1.reactor::MessageManager/notifyMessageListeners()[/Users/moock/build/working/src/net/user1/reactor/MessageManager.as:720]
at net.user1.reactor::MessageManager/upcReceivedListener()[/Users/moock/build/working/src/net/user1/reactor/MessageManager.as:293]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at net.user1.reactor::XMLSocketConnection/dataListener()[/Users/moock/build/working/src/net/user1/reactor/XMLSocketConnection.as:219]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::XMLSocket/scanAndSendEvent()
cripito
 
Posts: 13
Joined: Sun 15 Jul 2012 11:54

Re: error in reactor at agent leaving

Postby colin » Fri 24 Jan 2014 20:16

the code listed in the stack trace you posted runs when the current client is in a room with a foreign client, and then the foreign client leaves the room. the current client learns of the foreign client's departure via a u37 UPC, which triggers some cleanup code in the room that the foreign client just left. unfortunately, i have not been able to reproduce the error you posted. the use case of a foreign client leaving a room is extremely common in union applications, and therefore deeply tested, so the error is very likely a remote edge case. nevertheless, we'd like to track it down if possible.

could you please post a code example demonstrating what lead to the error you encountered?

thank you for reporting this issue. i'm marking it solved until we can investigate with example code. if you post example code, please unsolve this post.

colin
colin
 
Posts: 232
Joined: Mon 17 Oct 2011 18:47

Re: error in reactor at agent leaving

Postby wisk » Sat 22 Mar 2014 04:06

I have the same problem, however I only get the error half the times. The other half it works well. What I'm doing is basically
-There are 3-4 players in a room (which is a lobby room)
-Room is set to die when empty
-If a player presses the start button, it sends a message to the whole room, and the message listener from every client "starts the game"
-They join a new room, named after the previous room + the ID of each player stringed together.
-They load the map
-They leave the previous room

And here's where I get the error. The following is the debugging right before the error happens.
Code: Select all
3/22/14 10:15:39.235 UTC+2 INFO:  [ROOM_MANAGER] Room added: [ROOM id: room262728].
3/22/14 10:15:39.237 UTC+2 INFO:  [ROOM_MANAGER] New room count: 3.
3/22/14 10:15:39.239 UTC+2 INFO:  [ROOM id: room] New occupant count: 2
3/22/14 10:15:39.242 UTC+2 INFO:  [ROOM id: room] Removed occupant: [CLIENT clientID: 28, userID: 3].
3/22/14 10:15:39.245 UTC+2 INFO:  [ROOM_MANAGER] Room creation result for room [room262728]: ROOM_EXISTS
3/22/14 10:15:39.252 UTC+2 INFO:  [ROOM id: room] Room left.
3/22/14 10:15:39.253 UTC+2 INFO:  [ROOM id: room] New occupant count: 0
[Fault] exception, information=TypeError: Error #1009: Cannot access a property or method of a null object reference.


I tried re-creating the error in an isolated case, however it didn't work. This, coupled with the fact that it works half the time has led me to believe that it has something to do with the Game/Map being loaded. Maybe some clients are lagging behind, leading to this whole situation.
wisk
 
Posts: 1
Joined: Sat 22 Mar 2014 02:07

Re: error in reactor at agent leaving

Postby cripito » Mon 21 Apr 2014 17:57

Colin

the moment I removed this reactor.getClientManager().removeEventListener("CLIENT_DISCONNECTED", ClientGone, false); problem fixed

protected function ClientGone(e:ClientManagerEvent):void
{
var client:IClient = e.getClient();

if (getUserName(client) == "system")
{

}
}
cripito
 
Posts: 13
Joined: Sun 15 Jul 2012 11:54


Return to Union Platform

Online

Users browsing this forum: No registered users and 6 guests