Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding helper function to start Server in single player #1158

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Assets/Mirage/Runtime/NetworkServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,20 @@ public void Stop()
Application.quitting -= Stop;
}

/// <summary>
/// Starts the server in single player move. This will set up the server in host mode but not start the transport.
/// This allow you to make a multiplaye game first, that will also support single player.
/// <para>
/// Mirage is lightweight so starting in single player mode reduces code complexity of needing to check if network is active in all your code.
/// </para>
/// </summary>
/// <param name="localClient"></param>
public void StartSinglePlayer(NetworkClient localClient)
{
Listening = false;
StartServer(localClient);
}

/// <summary>
/// Start the server
/// <para>If <paramref name="localClient"/> is given then will start in host mode</para>
Expand Down