[SOLVED] URGENT: Type Error with Custom Client Class in Reactor 1.02

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

URGENT: Type Error with Custom Client Class in Reactor 1.02  

Postby sean » Sun 13 Nov 2011 16:16

Hi Guys,

It's me again Sean T...noticed the new forums...I guess you won't be importing all the old posts from the old system to here? (I imagine there must be a lot of useful information over there :)

Anyhoo...So the multiplayer coding war still continues for me and recently I have decided to make my "networking management" more organized since the Reactor API allows you to specify custom client and room classes - nice! So I spent about a month overhauling my code (blindly without testing) and I continue to learn soooo much about Union along the way. I've hit a bit of a road block that is out of my control, seems to be an oversight on your end but shouldn't be too hard to fix (hopefully) and you can let me know if it is already taken care of in Reactor 1.1.

So the issue has to do with me extending CustomClient for my own client class. Somewhere in the process where MessageListeners are being notified, the reactor code-base is referencing my CustomClient object attempting to cast it to a net.user1.reactor.Client. I guess this is an error because CustomClient does not extend Client. So I'm thinking that if you change in your code to cast to Reactor's IClient instead, we should be okay? Here is the stack trace:

Code: Select all
TypeError: Error #1034: Type Coercion failed: cannot convert client.common.serverInterfaces.reactor::JamDomClient@a1f22c1 to net.user1.reactor.Client.
   at CoreMessageListener/u103()[/Users/colin/build/working/src/net/user1/reactor/CoreMessageListener.as:1226]
   at Function/http://adobe.com/AS3/2006/builtin::apply()
   at net.user1.reactor::MessageManager/notifyMessageListeners()[/Users/colin/build/working/src/net/user1/reactor/MessageManager.as:718]
   at net.user1.reactor::MessageManager/upcReceivedListener()[/Users/colin/build/working/src/net/user1/reactor/MessageManager.as:291]
   at flash.events::EventDispatcher/dispatchEventFunction()
   at flash.events::EventDispatcher/dispatchEvent()
   at net.user1.reactor::XMLSocketConnection/dataListener()[/Users/colin/build/working/src/net/user1/reactor/XMLSocketConnection.as:219]
   at flash.events::EventDispatcher/dispatchEventFunction()
   at flash.events::EventDispatcher/dispatchEvent()
   at flash.net::XMLSocket/scanAndSendEvent()


Hopefully by casting to IClient, it is enough for that framework code to function properly??? It seems as though once I set the custom class that Reactor now permanently uses that class for it's internal functions. As you can see in the stack trace above, none of my code is referenced so it seems to be out of my control apart from reverting back to Reactor's default Client class. u103 seems to be Union's ClientRemoved message so it looks like I'll get this failed type conversion every time the ClientManager gets this update.

Please advise as soon as you can as my Union programming is now on hold. :(

Thanks in advance!
sean
 
Posts: 40
Joined: Sun 13 Nov 2011 15:47

Re: URGENT: Type Error with Custom Client Class in Reactor 1

Postby colin » Wed 16 Nov 2011 17:46

hi sean,
thanks for taking the time to submit such a detailed problem report. the issue you described is in fact a bug in both 1.0.2 and 1.1.0. see:

http://factory.user1.net/issues/show/567

the bug has been fixed in the latest development build, which you can download here:

http://www.unionplatform.com/staging/re ... or/latest/

could you please try the 1.1.1 dev release and let us know if it resolves your issue?

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

Re: URGENT: Type Error with Custom Client Class in Reactor 1

Postby sean » Wed 16 Nov 2011 18:28

Hey Colin,

You're very welcome for the detailed report - I think it was because I was so passionate about all the overhauled coding that I've been working on so you got a burst of that energy since I was literally stopped in my tracks! Also, I know that it makes your job easier if I give as much detail as possible...also I felt accomplished as a programmer for the fact that I knew exactly what was happening! (As you can see, I have invested a lot of time into Union development :)

Anyhoo, thanks for compiling that new development build and it seems as though the problem is fixed - I no longer get a fatal error when another client disconnects. Thanks a lot!

I also noticed that with this dev build SWC, code hinting is working again which is great (as per my other post re: it not working in 1.1.0 release SWC).

I also like all the new UPC Message statistic features that were added to 1.1 and I've already started using them to work on some server-side module code enhancements. This really helps to give us developers some insight into how the server is processing messages. I also trust that the overhauled message management system should do us good as well - glad if I was able to influence that with some of my past feedback.

Thanks again!
sean
 
Posts: 40
Joined: Sun 13 Nov 2011 15:47


Return to Union Platform

Online

Users browsing this forum: No registered users and 11 guests