Search Unity

Auth Psuedo Idea - Is this a good solution?

Discussion in 'Multiplayer' started by dklompmaker, Jul 28, 2009.

  1. dklompmaker

    dklompmaker

    Joined:
    Sep 12, 2008
    Posts:
    80
    I was thinking about an easy Authoritative server Idea... is this somewhat a good Idea?


    Code (csharp):
    1.  
    2.  
    3. // Server Code would have an RPC
    4.  
    5. @RPC
    6. function PlayerWantsSomething(Player : NetworkPlayer){
    7. if(condition with player is met){
    8. network.rpc(player, PlayerGetsSomething);
    9. }
    10. else{
    11. network.rpc(player, errorMessageHandle, Message);
    12. }
    13. }
    14.  
    15. // Client who wants something
    16.  
    17. function WantsSomething(){
    18. network.rpc(RPCMode.Server, PlayerWantsSomething);
    19. }
    20.  
    21. @RPC
    22. function PlayerGetsSomething(){
    23.  
    24. }
    25.  
    26. @RPC
    27. function errorMessageHandle(){
    28. }
    29.  
    30.  
    31.  
    Is this a good start to getting a functioning auth server.. I know it is only pseudo but its the logic that counts.
     
  2. Veli

    Veli

    Joined:
    Mar 10, 2009
    Posts:
    301
    Thats how it's usually done.
     
  3. dklompmaker

    dklompmaker

    Joined:
    Sep 12, 2008
    Posts:
    80
    are there any better alternatives to raknet rpc? I have read that unity is not really developed for auth type servers in mind.. as far as having an overhead, or is this incorrect?
     
  4. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Any c++ or c# type networking engine. Even torque network engine works
    for non dot net assemblies you need pro and write your own dll import so you need to know the public methods
     
  5. dklompmaker

    dklompmaker

    Joined:
    Sep 12, 2008
    Posts:
    80
    Yea, what about an implementation of RakNet on its own?
     
  6. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    That works also, you can compile raknet for a mac or pc once you grab the code.
    http://www.jenkinssoftware.com/

    As long as you have Pro that is.
    I have a SWING version of RakNet but on player.connect Unity bombs out, I have a ticket opened on it but I can't seem to get any help or response as to why Unity just shuts down. Once they get back with me and we figure out why it bombs out, then I can post the C# DLL of raknet and how to use it straight in Unity so even an Indy can use it.

    So unfortunately until they help me track it down, its useless and without there help I can't do anything about it, its pure internal Unity mechanics that is dyeing.