Best way to do a multiplayer game?

I started and made some simple games and now I wanted to put a multiplayer functionality to some of them. I am trying to do this using the photon cloud (is looked like a good option since I got a free hosting to up to 20 connections), but I have to make one of the players act as the server to reach what I want to do. I found that photon is not well documented (I have only seen examples and all on 3D, im working on 2D right now so they mess up the camera and other things). So I wanted to know if there is any place where this is clearly explained (how to do a photon cloud authoritative game) or if it is better to have another starting point? (I also tried that zero to hero guide but I can’t host right now).

You can’t do authoritative game code on the cloud. All your logic needs to sit on the client. Libraries like Photon and AppWarp cloud are not ideal if you want to do server side AI or adding a player on the server like a dealer in a poker game.

For such cases you needed to use a game server which will allow you to write extensions like AppWarp S2 on-premise or Smartfox server on-premise.