||unity-dev|| Bug? Unity wasn't reporting all the created rooms. Restart fixed the problem.

Discussion list for Unity developers. unity-dev at moock.org
Thu Jun 7 14:43:03 CDT 2007


i should mention that if you know a room exists on the server, but you 
don't have a client-side object for it, you can still join it via 
UClient.joinRoom().

colin


Discussion list for Unity developers. wrote:
> Hi  Colin,
> 
> thanks for the info. I've only seen the server get in this state once, but I'll change to debug logging and keep an eye out for it. 
> 
> As long as it's not a known (or common) thing, I guess I'm not too worried about it. 
> 
> Thanks,
> 
> Derek
> 
> ----- Original Message ----
> From: Discussion list for Unity developers. <unity-dev at moock.org>
> To: unity-dev at moock.org
> Sent: Thursday, June 7, 2007 11:43:46 AM
> Subject: Re: ||unity-dev|| Bug? Unity wasn't reporting all the created rooms. Restart fixed the problem.
> 
> hi derek,
> if I had to guess, I would say this is not a Unity server bug. we've 
> never had an issue like this reported before, and we've had millions of 
> connections go through hundreds of real-world applications. that doesn't 
> mean it isn't a server bug, just that it's unlikely.
> 
> in order to isolate the problem, you'll need to determine where the 
> rooms are lost. to do that, you should monitor your server log and your 
> client log for all UPCs sent and received by the client.
> 
> set your server log to debug mode in the ss.lcf file:
> # Attach appender Unity to root. Set root priority to Prority.DEBUG.
> log4j.rootLogger=debug, Unity
> 
> then install the debug version of uClientCore component in flash, and 
> set the log level to DEBUG (probably through your config.xml file):
> 
> <?xml version="1.0"?>
> <config>
>    <server>host</server>
>    <port>9100</port>
>    <logLevel>DEBUG</logLevel>
>    <policyPort></policyPort>
> </config>
> 
> write a simple test app with as little code as possible to represent 
> your situation. then watch the UPCs as they travel from the server to 
> the client. make sure you are observing the namespace in question, then 
> look particularly for upcNSRoomList, upcNSRoomAdded and upcNSRoomRemoved 
> UPCs.
> 
> if you can demonstrate a case where upcNSRoomList or upcNSRoomAdded 
> arrive, but the rooms they contain aren't added to the appropriate 
> client-side NameSpace object, then post your findings. i can help you 
> debug if you can create an isolated test application that demonstrates 
> the problem.
> 
> note that your custom URoom subclass shouldn't be a problem, but it 
> doesn't hurt to create two separate tests (one with a custom URoom 
> subclass and one without).
> 
> also, the order in which a namespace's rooms are reported is arbitrary, 
> and not guaranteed to remain the same. your application should not rely 
> on room order.
> 
> colin
> 
> Discussion list for Unity developers. wrote:
>> Hey guys,
>>
>>
>>  
>>
>>
>> I ran into another problem (bug?) with Unity the other
>> day.  I’ve got an app that has multiple
>> chat rooms. These rooms are created dynamically and are persistent once
>> everyone leaves the room.   So basically,
>> after a Unity server restart, there are no rooms yet and the first time someone
>> joins a room it’s created and stays around for good. So, once a client connects
>> to the server and creates the namespace, Unity tells the client what rooms
>> exist on in that namespace.  
>>
>>
>>  
>>
>>
>> The problem I ran into was that Unity got into a state where about 25% of the time the server
>> would not report all the rooms that were in that namespace. Specifically, I had
>> the following rooms; chat, blue, red, red32, green. (I did NOT create the rooms
>> in this order. I believe they were created in the order green, blue red, chat,
>> red32.) Watching the output window in Studio 8, Unity would normally report all
>> the rooms in that order every time (output below)
>>
>>
>> DEBUG: RoomManager now adding
>> NameSpace: server1
>>
>>
>> DEBUG: UClient notified of new
>> NameSpace object: 'server1'.
>>
>>
>> DEBUG: NameSpace 'server1' added
>> listener: A NamespaceView instance
>>
>>
>> DEBUG: Room factory for NameSpace
>> 'server1' set to: LocationRoomFactory
>>
>>
>> DEBUG: NameSpace 'server1'
>> notifying observers of new room: 'chat'.
>>
>>
>> DEBUG: NameSpace 'server1'
>> notifying observers of new room: 'blue'.
>>
>>
>> DEBUG: NameSpace 'server1'
>> notifying observers of new room: 'red'.
>>
>>
>> DEBUG: NameSpace 'server1'
>> notifying observers of new room: 'red32'.
>>
>>
>> DEBUG: NameSpace 'server1'
>> notifying observers of new room: 'green'.
>>
>>
>>  
>>
>>
>> However, I got to a point where Unity would not report the
>> first 2 rooms; chat and blue. So it would just tell me the following
>>
>>
>> DEBUG: RoomManager now adding
>> NameSpace: server1
>>
>>
>> DEBUG: UClient notified of new
>> NameSpace object: 'server1'.
>>
>>
>> DEBUG: NameSpace 'server1' added
>> listener: A NamespaceView instance
>>
>>
>> DEBUG: Room factory for NameSpace
>> 'server1' set to: LocationRoomFactory
>>
>>
>> DEBUG: NameSpace 'server1'
>> notifying observers of new room: 'red'.
>>
>>
>> DEBUG: NameSpace 'server1'
>> notifying observers of new room: 'red32'.
>>
>>
>> DEBUG: NameSpace 'server1'
>> notifying observers of new room: 'green'.
>>
>>
>>  
>>
>>
>> My code would think the chat and blue rooms hadn’t been
>> created yet. So when I wanted to join one of these rooms, my code would call
>> the createRoomOnServer to which Unity would reply with a ROOM_ALREADY_EXISTS.
>> But… the namespace instance did not have those 2 rooms in its room list. So it
>> was impossible for me to join them as I could not get an instance of the rooms
>> (e.g. ns.getRoom(“blue”) would return null).  
>>
>>
>>  
>>
>>
>> Like I said this was happening about 25% of the time I
>> connected and was happening with different apps as well. So I restarted the server
>> and all was well.  
>>
>>
>>
>> Has anyone else
>> experienced anything like this?  I'm pretty sure it was a server side issue and not a flash issue because I was seeing it in multiple
>> flash apps. Is there something that would cause this? Notice I do have a custom
>> URoom (Flash side, not server side). Not sure if that is relevant or not. 
>>
>>
>>  
>>
>>
>> Also, how does Unity decide what order to store these rooms
>> on the server?  If I create rooms in the
>> order green, blue, red, the next time I run the app and create the namespace,
>> Unity always reports back with the rooms in the order blue, red, green. i.e.
>>
>>
>> DEBUG: NameSpace 'server1'
>> notifying observers of new room: 'blue'.
>>
>>
>> DEBUG: NameSpace 'server1'
>> notifying observers of new room: 'red'.
>>
>>
>> DEBUG: NameSpace 'server1'
>> notifying observers of new room: 'green'.
>>
>>
>>  
>>
>>
>> Sorry, for the super long email
>> but I would appreciate any input as this would be a big problem for me if it
>> happens regularly. 
>>
>>
>>
>>  
>>
>>
>> Thanks,
>> Derek
>>
>>
>>
>> --
>> you're a unity-dev subscriber. to unsubscribe, visit www.moock.org/mailman/listinfo/unity-dev/
>>
>> superb hosting for this list and moock.org is generously provided by Rackspace. See: http://www.rackspace.com/?supbid=moock
> --
> you're a unity-dev subscriber. to unsubscribe, visit www.moock.org/mailman/listinfo/unity-dev/
> 
> superb hosting for this list and moock.org is generously provided by Rackspace. See: http://www.rackspace.com/?supbid=moock
> 
> 
> 
> 
> --
> you're a unity-dev subscriber. to unsubscribe, visit www.moock.org/mailman/listinfo/unity-dev/
> 
> superb hosting for this list and moock.org is generously provided by Rackspace. See: http://www.rackspace.com/?supbid=moock


More information about the unity-dev mailing list