About switching to self-hosting

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

About switching to self-hosting

SW95
2022-02-24 02:02:27

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 ;

  • 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?

  • Can I easily switch to self-hosting with my current fetaures (rooms etc.) without need of modifying my code base?

  • Can I still use Photon Voice over self hosting?

  • 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
2022-02-24 04:59:06

Hi @SW95,

  • No need to purchase a PUN plan. You only need a Photon Server license.

  • 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.)

  • 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.

  • Yes you are free to do so but we still don't recommend it. There are some settings to change.

SW95
2022-02-24 06:52:14

JohnTube 2022-02-24T04:59:06+00:00

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
2022-02-24 07:29:33

Yes.

Markus
2022-02-24 08:14:18

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
2022-02-24 11:52:45

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
2022-02-24 18:19:21

hey @chvetsov check this out!

chvetsov
2022-03-01 09:07:13

@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

Tobias
2022-06-01 08:06:50

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.

Back to top