1. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  2. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  3. Unity 2017.1 is now released.
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  6. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice

Photon: How Do I Switch from Cloud to OnPremise Redistributable Server?

Discussion in 'Multiplayer Networking' started by IAMBATMAN, Mar 16, 2017.

  1. IAMBATMAN

    IAMBATMAN

    Joined:
    Aug 14, 2015
    Posts:
    258
    I'd like my players to host servers, I'm sure you've all heard this a 100 times before but... Like minecraft, terraria, unturned, dayz, and most modern pc games [​IMG]

    So I made my game with Photon Cloud, how do I switch to this? I can't seem to find any guide to get it into your game.

    Except this https://doc.photonengine.com/en/onpremise/current/getting-started/photon-server-in-5min

    But that doesn't show you how to set it up for your game.
     
  2. donnysobonny

    donnysobonny

    Joined:
    Jan 24, 2013
    Posts:
    197
    So PUN is what you're referring to here, which comprises of two parts:
    • a cloud server, hosted and run by ExitGames (the guys that made PUN)
    • a library for unity (which you likely obtained through the asset store) containing a set of functionality to set up your project to use the cloud server, and the associated functionality that it supports
    So ultimately, what you want to do is emulate their cloud server. However, the code that they run on their cloud server is not publicly available, so this just isn't possible. What they do say however is that PUN uses a slightly tweaked version of the Lite application that comes with the photon server SDK. So, you wont find a way to simply "convert" your current setup to one where you can ship the server-application out to your players. However, using the Lite application that comes along with the SDK will get you pretty close, you will just need to tweak your code to get it all working.

    Good luck!
     
  3. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    1,865
    Hi,
    We actually stopped building a Photon Redistributable Server package quite a while ago. That's how low demand for it was, while maintenance was high.
    Sorry. You either host a set of servers with the Photon Server SDK (but don't distribute that) or you use the Photon Cloud for your gamers (which saves you the need to build a listing of player-run servers, etc.).
     
  4. IAMBATMAN

    IAMBATMAN

    Joined:
    Aug 14, 2015
    Posts:
    258
    Ok, hmm... I guess I won't be using Redistributable :p

    How do I save my world? I'd like players who rejoin their game, to have the car they bought, and the house they built. To still be there when they return.

    But when all players leave the room closes, deleting it all. How do I keep/save this stuff somehow?
     
  5. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    1,865
    To keep stuff, you would have to save it when the room becomes empty. We have "webhooks" for that, so you can configure a webservice to provide persistence.
    Check out this:
    https://doc.photonengine.com/en-us/realtime/current/tutorials/persistence-guide/

    As this can become tricky, make sure you have a good idea of what you do in multiplayer in the first place. If rooms/states can be used forever, their state might grow and become unusable. We have no proper way to safeguard you against this.