About switching to self-hosting

SW95
SW95

Hello,

We currently have a project that is using PUN 2 and Photon Clould. We are thinking about switching to self hosting but I have few questions about it ;

  1. Do I still need to subscribe to PUN even though I don't use any of the cloud features and just want to use client side apk in my self-hosting?
  2. Can I easily switch to self-hosting with my current fetaures (rooms etc.) without need of modifying my code base?
  3. Can I still use Photon Voice over self hosting?
  4. As I know there is have 500KB message sending limit on the cloud for sending files. How about If we use self-hosting? Is there any limit? Can I somehow transfer huge files over my self server?

Thank you.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭

    Hi @SW95,

    1. No need to purchase a PUN plan. You only need a Photon Server license.
    2. Yes. The only main change is how to connect but in PUN you can achieve this via PhotonServerSettings w/o code change. There may be slight tiny differences but that's not generally the case (e.g. Photon Server does not have AppVersion but you can add it, etc.)
    3. Yes of course. You may need to tweak some server configuration to allow some higher limits (e.g. OpChangeGroups per second on GameServer) as the Photon Server SDK is stricter than cloud.
    4. Yes you are free to do so but we still don't recommend it. There are some settings to change.
  • Thank you for your reply. Just to be clear about first question, so you are saying If I have Photon Server licence I can still use PUN features things such like character sync,RPCs,Rooms etc. but I don't need to purchase it because I have Photon Server license, did I understood you correctly?

  • JohnTube
    JohnTube ✭✭✭✭✭

    Yes.

  • Just to avoid any confusion and as we regularly see this question relating to reduce cost

    • the 100 ccu Server license is free for development
    • when going live/using Photon Server commercially you need a paid server license

    From a cost perspective it will most likely be hard to beat our cloud pricing. You should only use self-host server if you need features not provided in the cloud.

  • Meep
    Meep ✭✭✭
    edited February 2022

    Since the AppVersion feature is quite important, I will share my 'fix' for it below in the event any other developers run into the issue and find this thread. There are many ways of doing this but I thought this was best.

    MasterClientPeer.HandleCreateGame must be modified, add the code below into the function:

    createGameRequest.LobbyName += unencryptedAuthToken.ApplicationVersion;
    

    MasterClientPeer.HandleJoinGame must be modified, add the code below into the function:

    joinGameRequest.LobbyName += unencryptedAuthToken.ApplicationVersion;
    

    MasterClientPeer.HandleJoinLobby must be modified, add the code below into the function:

    joinLobbyRequest.LobbyName += unencryptedAuthToken.ApplicationVersion;
    

    If any of the engineers know a better way or want to share the deep dark secrets of how they do it on the Cloud, would be interested in it 😉

    Also yes, keep below 500KB like John said, in fact you should try to get this as low as possible for your game and not try to increase it.

  • JohnTube
    JohnTube ✭✭✭✭✭

    hey @chvetsov check this out!

  • @Meep this is clever solution.

    In cloud we do not do much. SDK already has GameApplication class we just have list of those objects and select corresponding basing on authentication information. that is it


    best,

    ilya

  • You must be careful when using FindFriends, as this version handling does not apply for it. Maybe you could extend it to also check the lobby / version.