Self Hosted Photon Server

I'm desperately trying to find how to write Server API for my game. Starting SelfHosted server and write client logic is okay. There is no difference from Photon Cloud. But how to write my own Server Logic for example to generate InGame events or something like that? I can't see any examples... Thanks for any help!

Comments

  • Hi, @FoxyShadow

    We do not produce games. That is why we do not have any good tutorial for that. In general, it is quite complex to extend LoadBalancing. That is why we recommend developers write their own plugins.
    Here are docs related to self hosted server: https://doc.photonengine.com/en-us/onpremise/current/getting-started/photon-server-intro . You may find section related to plugins there.

    As a hint, I could say that you need to overwrite OnRaiseEvent handler in order to handle different operations produced by your clients, and use IPluginHost.BroadcastEvent in order to send server side events to clients.

    best,
    ilya
  • @FoxyShadow
    I would design the framework so that domain of the framework does not know of Photon Server, that way you don't need to rewrite your framework if they change the API. There is a good video playlist on designing your Server Framework(like sending events, handling S2S traffic, handling forwarding request/response from client).