Difference between revisions of "Dedicated Server Kit Unity Project"

From gamevanilla wiki
Jump to: navigation, search
(Core)
(Core)
Line 19: Line 19:
 
* '''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.).
 
* '''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.
 
* '''ClientObject:''' The MonoBehaviour wrapper around the Client class.
* '''RestApiTypes:''' The types returned by the Client's REST calls.
+
* '''RestApiTypes:''' The types used by the Client's REST-based API calls.
  
 
= Demo =
 
= Demo =
  
 
|}
 
|}

Revision as of 05:35, 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 used by the Client's REST-based API calls.

Demo