Difference between revisions of "Dedicated Server Kit Unity Project"

From gamevanilla wiki
Jump to: navigation, search
(Introduction)
(Core)
Line 12: Line 12:
  
 
= Core =
 
= Core =
 +
 +
These are the core C# scripts:
 +
 +
* '''GameServer:''' The main component of every game server instance in the game. It inherits from Mirror's NetworkManager.
 +
* '''Client:''' The main interface with the Go server. This interaction happens via REST calls.
 +
* '''ClientConfig:''' The configuration asset that allows you to easily define in the Inspector the IP address and port number of your Go server. This is a convenient way to manage different configurations (e.g., test, production, etc.).
 +
* '''ClientObject:''' The MonoBehaviour wrapper around the Client class.
 +
* '''RestApiTypes:''' The types returned by the Client's REST calls.
  
 
= Demo =
 
= Demo =
  
 
|}
 
|}

Revision as of 04:34, 9 February 2021

Introduction

The Unity project is divided in two main folders:

  • Core: This folder contains the source files of the Go server and the core C# source files that allow a Unity game to communicate with the Go server via the REST-based API provided by the kit.
  • Demo: This folder contains the source files of the C# game client demo. It is intended as a practical example of how a game client that uses the kit would look like; in the real world, you will replace/modify this as needed by your game.

Let's go over these folders in more detail next.

Core

These are the core C# scripts:

  • GameServer: The main component of every game server instance in the game. It inherits from Mirror's NetworkManager.
  • Client: The main interface with the Go server. This interaction happens via REST calls.
  • ClientConfig: The configuration asset that allows you to easily define in the Inspector the IP address and port number of your Go server. This is a convenient way to manage different configurations (e.g., test, production, etc.).
  • ClientObject: The MonoBehaviour wrapper around the Client class.
  • RestApiTypes: The types returned by the Client's REST calls.

Demo