Search Unity

Web player p2p

Discussion in 'Multiplayer' started by Kyle Poole, Oct 1, 2010.

  1. Kyle Poole

    Kyle Poole

    Joined:
    Mar 13, 2010
    Posts:
    8
    I am a little bit confused by the new security sandbox in Unity 3... Is there any way to have the web player function as a p2p multiplayer game? Which of these will work, if any?

    1. Using built-in unity networking and the masterserver
    2. Using "roll your own" tcp/udp networking code with .net sockets (eg lidgren)
    3. Using UDP and send a valid policy file from each side of the p2p

    I understand the need for security, but the "webplayers cannot communicate with each other directly (peer 2 peer)" is alarming and one of the main reasons we chose unity...

    Thanks in advance to anyone that can shed some light on this!
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    The previous anti-security was alarming as it was the main reason that many larger places prevented the webplayer from installing.
    freeform network access is inacceptable for a freely distributable player ...

    you can still do a lot, but only against servers that fullfill the basic security requirements of the web as policy security etc.

    As long as the other side offers that, it can act as server.
     
  3. zekizeki

    zekizeki

    Joined:
    Jul 22, 2007
    Posts:
    22
    Hi Kyle,

    I agree the statement on P2P is a little confusing. Basically you cannot create a P2P Webplayer game unless it uses the built in Unity Networking.

    I'm deducing this from a line early on in the Security Sandbox document which states that ...

    "This does not affect the built in mutiplayer networking functionality of Unity (UnityEngine.Network, UnityEngine.NetworkView classes etc). "

    So in your number list only option wil work for a WebPlayer 1. Using built-in unity networking and the masterserver

    option 2 and option 3 will not work because the docuentation states "You cannot create listening sockets in the webplayer, it cannot act as a server." this means that you cannot run a policy server in the web player.

    hope this helps clear things up
    Rob