Creating a game logic class

When writing game servers, it's very common that you need some central class for processing game logic. What we have right now doesn't allow for that, so we're going to modify our ack server to add a central class for processing game logic.

Our game class will accomplish the same thing that our ack server already does (sends acknowledgements in response to operation requests). It will also be able to keep track of a list of peers connected to the server, and when the server shuts down it will automatically disconnect any peers that are currently connected.

using Photon.SocketServer; using PhotonHostRuntimeInterfaces; using System.Collections.Generic; public class PhotonAckGame { public static PhotonAckGame Instance; public ...

Get Unity Multiplayer Games now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.