Creating a server application

Let's create a new server application. Upon receiving any message, it will simply get an echo, a confirmation that it has received the message (an acknowledgement).

Creating a class library

Create a new class library project called PhotonAckServer. I have put mine in the src-server directory.

Now, we'll add three references to our project. These can be found in the libs directory of the Photon Server:

  • ExitGamesLibs.dll
  • Photon.SocketServer.dll
  • PhotonHostRuntimeInterfaces.dll

With these added, create a new PhotonAckServer class. This will inherit from ApplicationBase, code for the same is as follows:

using Photon.SocketServer; public class PhotonAckServer : ApplicationBase { protected override PeerBase CreatePeer( InitRequest ...

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.