Login system help.

Options
crzyone9584
edited December 2011 in Photon Server
So I'm working on a login system for my game. To test it I'm sending the following to the server
var loginInfo = new Dictionary<byte, object>
                                {
                                    {(byte) DataCode.Username, username},
                                    {(byte) DataCode.Password, password}
                                };
            
            return Server.OpCustom((byte)OperationCode.Login, loginInfo, true);

My problem is I'm unable to figure out how to get the username and password on the server side? I'm using Photon 3 SDK for the server and Photon Dot Net for the client. I may have things a little backwards. This is from reading tutorials. I'm just not sure how to get the username and password on the server so I can check them with a username and password that I'm testing against.

Comments

  • You can use our Lite application and simply extend it to handle your custom "Login" operation.
    You can check http://doc.exitgames.com/v3/liteandlite ... operations for an example. This should be a good starting point.
    If you have a more specific question, let us know how!
  • I understand how to send a single string and receive it. I'm having an issue with sending two different string and being able to add them to different variables.
  • Would something like this work?
    var parameter = new Hashtable { { (byte)100, username } {(byte)101, pwd} }; 
    09
            this.Peer.OpCustom(1, parameter, true);
    

    then in the server have the following
    var message = (string)request.Params[100];
    var message2 = (string)request.Params[101];
    

    I'm going to feel like an idiot if it is that simple....
  • Tobias
    Options
    It's one way to do it, yes.

    The server offers a automatic "mapping" from the Hashtable to your custom classes, which extend Operation (or maybe it's Request - i'm answering out of memory). As the logic code is open source for the server side, you can take a look at the operations in there. The fields of those are filled in when you create your specific request.
  • Thanks for the help. Now i feel stupid... Now to fix up the client so it will actually build.