How do I separate everything into Server/Client/View?

I would like to have code in an area for the server only. Then have code in an area for the client that sends and receives data from the server and displays relevant data on the view(Unity). Then have the view which is the unity client itself that is only responsible for displaying visuals and sending inputs.

See screenshot. This is for keeping code clean, and to help with debugging. I got this from the 2016 UNITE EUROPE conference: https://youtu.be/x_4Y2-B-THo?t=439

I should be able to get a standalone server fron Photon's offering here:https://www.photonengine.com/Server right?

But based on the conference video, how do I create a client dll library for unity to interact with and respond to?

If I can figure this out then I'm more than half way to separating everything into these three categories.

Answers

  • hi, @Sfoxx28

    the video you saw is about Unity but not photon. It might be more difficult to get exactly same representation.

    I would recommend you to create your own plugin for server. Then you will be able to slice your code into layers, so that some parts can be reused between server and clients code if you need

    >I should be able to get a standalone server fron Photon's offering here:https://www.photonengine.com/Server right?

    well, almost. you can download server sdk from here: Photon Engine SDKs | Photon Engine

    best,

    ilya

  • JohnTube
    JohnTube mod
    edited December 2021

    Hi @Sfoxx28,

    Thank you for choosing Photon!

    I wanted to clarify a bit since I saw this but I couldn't find the time earlier...

    So to answer your questions:

    The Server SDK is what you need for server side of things yes.

    The client side you could grab our Photon Unity library (Photon3Unity3d.dll or PhotonRealtime-NetStandard.dll) and build your client library (DLL) or project on top of it. You could take our Unity/C# client SDKs code as a reference especially LoadBalancingClient and LoadBalancingPeer. But you would have to modify them.

    I would start here first to get familiar w/ how server starts and maybe try our default SDKs.

    Then take a look here (this is for v4) but you can try to port it to v5 which is recommended most recent version now. It's basically a hello world for server-client apps made from scratch.