Appearance
Appearance
If you followed the previous guide, your project now contains a fully-featured game server under the Backend/
directory that you can easily run and connect to on your local machine. Now you're ready to configure your project's identity accordingly and run the server for the first time.
You can configure your project's identity by giving it a name in GlobalOptions.cs
. This file defines your project's default Options
that are used to configure your project for different environments, such as local
, development
, and production
. They will be explained further in the coming pages, but you can check out the Further Reading section if you're curious.
// Let's give the project the name 'MyProject'.
public MetaplayCoreOptions Options { get; } = new MetaplayCoreOptions(
projectName: "MyProject",
...
Here's how to run the server locally:
Backend/
directory and named <project>-Server.sln
.Server
project is selected as the startup project (in Solution Explorer, right-click on Server
, and choose Set as StartUp Project).Backend/Server
directory.dotnet run
to start the backend.Q
to gracefully stop the backend.Backend/
directory and named <project>-Server.sln
.Server
project is selected as startup project.q
in the terminal window to stop the backend.Backend/Server
subfolder in your terminal app.dotnet run
to start the backend.q
to stop the backend.With the game server running, we can connect the game client to it in Unity. Open the environment configs editor under Metaplay/Environment Configs
and set 'Active Environment' to 'localhost'.
Hitting play will now form a connection to your locally running game server.
Check it out!
You can now view the LiveOps Dashboard at http://localhost:5550
when the server is running.
If you already have environments up and running in the cloud, you can follow the Environment Configs's Setup guide to enable connecting to the cloud environments.
Great! We've now got a server running. To continue with basics you should start understanding how Metaplay’s programming model works so you can prepare yourself and start working on your game. We recommend you stop by Saving Player Data to the Server to get started.
You might also want to take a detour by Working with Runtime Options to learn more about configuring the server for different environments (as mentioned in the Configuring the Project's Identity section), or Introduction to the LiveOps Dashboard to get a primer on one of the most useful features the SDK has to offer.