Spawning a server instance programmatically without a client.

I have a small game project that I am wanting to port to Unity, I've spent time learning UNET and understand how most of it works, however I'm trying to figure out how to do one thing specific.

In the scope of my project there's two servers. I have the "Master Server" which is a server that I've already made which keeps track of things like user accounts, user currencies, friends, lobby-based chats, etc. Then there's the "Game Server" which would be the Unity's headless server instance.

I'd like the "Master Server" to be in charge of starting the "Game Server". When a set number of players have all queued up for a game, the "Master Server" should create a new "Game Server" instance and tell the players about the connection details. From there the players will connect to the "Game Server" and play the game.

Here's a quick graph of how I'd like this to work:

Master Server   --->   Game Server 
     ^---------Player---------^

If you need a game in mind to visualize this, think something like DoTA or League of Legends where each individual game is actually hosted on a different server / port. When players queue up for the game, and enough players are found, a game instance is created and the players establish a connection to the game server.

I'm just trying to find out how to spawn a Game Server instance via Code, without a currently active Unity Instance.

My server is written in NodeJS, but I can port it to C# if required but I would prefer to stick with NodeJS as there's already hundreds of hours into it.

1) https://github.com/alvyxaz/barebones-masterserver (widely known as "MSF")
->https://github.com/alvyxaz/barebones-masterserver/wiki/Introduction-To-The-Framework#the-big-picture

A standalone version of MSF (including some tweaks & fixes):
https://github.com/proepkes/SpeedDate

Regarding your automation a lobby has a "StartAutomation"-method:
https://github.com/proepkes/SpeedDate/blob/master/SpeedDate.ServerPlugins/Lobbies/Lobby.cs#L955

[quote=“proepkess”, post:2, topic: 709033]

  1. https://github.com/alvyxaz/barebones-masterserver (widely known as “MSF”)
    https://github.com/alvyxaz/barebones-masterserver/wiki/Introduction-To-The-Framework#the-big-picture

A standalone version of MSF (including some tweaks & fixes):
https://github.com/proepkes/SpeedDate

Regarding your automation a lobby has a “StartAutomation”-method:
https://github.com/proepkes/SpeedDate/blob/master/SpeedDate.ServerPlugins/Lobbies/Lobby.cs#L955
[/quote]

Thanks for your reply, I’ve gone over the original and also the standalone links vaguely and I think there may have been a miss-understanding. The first link won’t work, because I’m not using Unity for my master server. I also already have a master server created and functional. This game was originally, I’m just porting it over to Unity.

I just need to know how to create a Unity Server Instance via code, outside of Unity, as my server is NOT written in C# and cannot be compiled from within Unity. For example, starting an executable with parameters.

server.exe --map 3 --mode deathmatch --weather disabled --port 8080

as an example, which would start this instance on port 8080 using map 3, no weather, and the mode set to deathmatch.

This is obviously just for example purposes, but something similar to this would be lovely.

[quote=“Christian.Tucker”, post:3, topic: 709033]
Thanks for your reply, I’ve gone over the original and also the standalone links vaguely and I think there may have been a miss-understanding. The first link won’t work, because I’m not using Unity for my master server. I also already have a master server created and functional. This game was originally, I’m just porting it over to Unity.

I just need to know how to create a Unity Server Instance via code, outside of Unity, as my server is NOT written in C# and cannot be compiled from within Unity. For example, starting an executable with parameters.

server.exe --map 3 --mode deathmatch --weather disabled --port 8080

as an example, which would start this instance on port 8080 using map 3, no weather, and the mode set to deathmatch.

This is obviously just for example purposes, but something similar to this would be lovely.
[/quote]
Hi, @Christian.Tucker , how did you manage to do that? I would love to know what steps did you take in the end