Search Unity

strange server problem with network demo project

Discussion in 'Multiplayer' started by raoul, Dec 5, 2008.

  1. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi,

    I modified the scripts in the Loader scene of the network demo a little bit and all worked fine, compiled the project, run it as the server and logged in as a client from the editor.

    Then I exported the files into a unitypackage and imported it in my game. Initially running the server seemed fine but I couldn´t connect a client. I also tried a new project with the copied files instead of package import, same results.

    This is what I found:

    Original network Demo Console Output for server:
    Code (csharp):
    1.  
    2. 1.  Connected to master server at 72.52.207.14:23456
    3. 2.  Incoming host list query response from master server.
    4. 3.  Running as server. Player ID is 0.
    5. 4.  server initialized ( Debug.Log() in OnServerInitalized())
    6. 5.  Sent RPC call 'RegisterPlayer' to all connected clients  (RPC call in OnServerInitalized())
    7. 6.  Added RPC 'RegisterPlayer' to buffer.
    8. 7.  Attempting to connect to master server at 72.52.207.14:23456
    9. 8.  Connected to facilitator at 72.52.207.14:50001
    10. 9.  Connected to master server at 72.52.207.14:23456
    11. 10.  Sent host registration to master server, registering a NAT assisted game as
    12.  "VGN SUB TEST", 1, 33, not password protected, "VGN TEST"
    13. 11.  Received identifier 1 from master server
    14. [code]
    15.  
    16. * output Server copied/imported package project
    17. [code]
    18. 4.  server initialized
    19. 10.  Sent host registration to master server, registering a NAT assisted game as
    20.  "VGN SUB TEST", 1, 33, not password protected, "VGN TEST"  
    21. [code]
    22.  
    23. I put numbers in front of the lines so you can easily match lines between the 2 outputs. Note all the missing output in the imported package!
    24.  
    25. For the client:
    26. Imported package:
    27. [code]
    28. - Connecting directly to host
    29.  
    But OnConnectedToServer() is not triggered!

    I then tested this by running the server from the original project and the client from the project with the imported package. This works well!

    I finally checked the original Network Demo. Exported the original Loader scene with dependencies and imported it into a new project. When running the server I got exactly the same output results with missing facilitator and identifier info. It was however possible to connect to the server.

    The main difference in my modified script is that instead of manually creating a server or joining a server, the instance automatically becomes the server for a "gamename" when no server is found on the masterserver for this game name and joins the server as a client automatically when a server is found.

    I am not sure where the problem is but it seems weird that everything works well in the original project but not in a new project. Why is the facilitator and identifier info missing in the new project?

    Anyone knows what is going on or what I can try to fix this?

    Thanks,
    Raoul