Skip to main content

Unity Package

The Unity Server Management tool#

This Unity tool is a custom asset we created to simplify the management of your Edgegap servers when you're developing your games in Unity. Currently, it allows you to:

  • Start and stop a game server at will
  • Monitor your game server status in real-time (updated every few seconds)
  • Access your game server address and open ports

All from the Unity editor!

Prerequisites#

To use the Edgegap Unity Package, you must have:

  • An application to deploy. See the relevant documentation if you don't have one yet.
  • An Edgegap API token. See how to get one here.

Downloading the package#

Contact us to get the Unity package, and we will send the .unitypackage file your way. We are currently working to make it available from the dashboard.

How to use#

  1. In the Unity editor, go to Assets > Import Package > Custom Package... and navigate to the .unitypackage file.

  2. You will see a window with the various files that are about to be imported into your project. Everything under Edgegap is related to our server management tool, and under Plugins is the dll file for Newtonsoft.Json.

    img

    If you already have this plugin installed in your project, or if your Unity version is above 2019.4, you should not import the Plugins folder to avoid duplicates and conflicts in your project files.

    If your Unity version is 2019.4 and you don't already have Newtonsoft.Json in your project, keep the Plugins folder selected.

  3. You should now find a new "Edgegap" tab in the upper menu. You can open the Edgegap Server Management tool by clicking on Edgegap > Server Management.

    You can now dock this window anywhere in the editor.

    img

  4. Enter your Edgegap API key (including the "token" part), choose your API environment and enter an app name and version, then click the "Connect" button. At any time, you may use the "Documentation" button to open this page in your browser.

    img

  5. You can start a server using the "Start Server" button when successfully connected.

    img

  6. When the server starts, the tool window will display the real-time status of your server and a button to open the deployment in our dashboard through your browser. Once it is up and running, you will have access to the server's open ports, with buttons to quickly copy the links to those ports.

    You may stop the server anytime by using the "Stop Server" button.

    img

The utility script#

In the Edgegap/Scripts folder imported with the tool, you can find a utility script (named EdgegapToolScript) that gives you access to your running server status info.

EdgegapToolScript edgegapToolScript;
Status serverStatus = edgegapToolScript.ServerStatus;
# serverStatus.RequestId
# serverStatus.Ports
# serverStatus.CurrentStatus
# serverStatus.ElapsedTime
# etc.

When attached to a GameObject in the scene, the script's inspector will display the same server status info as the Edgegap tool window and expose a public property containing the server status info.

This display feature lets you get your running server's info or connect to it before having a working matchmaker or server manager.

img