Custom JoinRequest class

Options
archmaegus
edited July 2012 in DotNet
I'm writing my own version of LiteLobby, my implementation still inherits from the core Lite application. I have a custom JoinRequest class that looks like this:
    public class JoinRequest : Lite.Operations.JoinRequest
    {
        public JoinRequest() :
            base()
        {
        }

        public JoinRequest(IRpcProtocol protocol, OperationRequest operationRequest)
            : base(protocol, operationRequest)
        {
        }

        [DataMember(Code = (byte)MyCustomEnum.LobbyRoom, IsOptional = true)]
        public bool IsLobby { get; set; }
    }

On the client side (.NET Windows Forms) I'm calling OpJoin like this:
            Hashtable actorProps = new Hashtable();
            Hashtable joinProps = new Hashtable();

            joinProps.Add((byte)MyCustomEnum.LobbyRoom, bool.Parse("true"));
            actorProps.Add((byte)MyCustomEnum.LobbyRoom, bool.Parse("true"));
            actorProps.Add((byte)LiteOpKey.Broadcast, bool.Parse("true"));

            this.peer.OpJoin(lobbyName, joinProps, actorProps, true);

I connect succesfully and I am sending the OpJoin request succesfully, but on the server side, when JoinRequest is created from the OperationRequest, IsLobby within my custom JoinRequest class is always false. It wasn't clear to me whether the join properties or the actor properties was supposed to have MyCustomEnum value, so I put it in both, but I've also tried scenarios using only actorProps and only using joinProps. No matter what I've tried so far, IsLobby is always false. What am I doing wrong?

Comments

  • I discovered that using OpCustom works instead of OpJoin. Is OpJoin deprecated?
  • Tobias
    Options
    OpJoin is not deprecated and works nicely for me. I use a Lite server and client without modifications (and didn't try to send your props yet, admitted).
    It must be something else.

    In the inner parts, OpJoin is just a OpCustom with specific parameters and code. So you're fine doing it this way.
  • As long as I'm fine using OpCustom, and there are no performance or other benefits for using OpJoin, then I'm good. If I figure it out, I'll post the answer back here. Thanks.