Client Hashtable parsers for events and operation results ??

Options
Ascendion
Ascendion
edited May 2011 in DotNet
There was some discussion last year about having reflection code similar to how the server processes incoming operation requests into strongly typed classes using attributes available on C# clients. (I'm using Unity)

Has anything been done to test the reflection support in Mono to see if hash table processing to fill event and operation objects with data is now possible ?? (that being the reason used at the time to block the idea, but everything that I have found seems to indicate that mono supports enough reflection to handle this and has for quite some time)

Being able to have the request and response fields in a single object on the server looked like a great idea, until I found that I could not just move my operation classes out into a separate class library project that I could reference from my unity project and have everything instantly in sync between the client and server !!

If nothing else, give me a parameterless constructor on the Operation class so I can extend it and add the capability myself !! (I need the constructor so the client can create an instance, fill in the values, then get a request to sent to the server from the base class, plus I need to add a constructor that takes a hash table and fills in the result fields)

Comments

  • Boris
    Options
    It's not that our intention is to block the idea, other things just had a higher priority.
    You shouldn't inherit from Operation on the client side since photon.socketserver.dll is not optimized for client usage and not tested under mono/unity.
    There was a thread (viewtopic.php?f=6&t=497&p=2314) that contains all the code necessary to convert the hashtable to a class with properties, you could use that on client and server side. There is also the public class Photon.SocketServer.Rpc.Reflection.ObjectDataMemberMapper that you can use for conversion on the server side instead of Operation base class - the Operation constructor does just the same.
  • Ascendion
    Options
    No problem -- I'll contribute my code that I've already created once I get to the point that I can debug it.. I've done something very similar for another project targeting a binary stream rather than a hashtable... doing this one up was so much simpler than the stream implementation :) I'll also throw in the event and result routers that I use once they are fully tested.