mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-17 18:40:33 +00:00
fix: Edgegap Plugin now creates Dedicated Server instead of Headless --nographics builds which should include #UNITY_SERVER define
This commit is contained in:
parent
bccebc67b4
commit
de4ce2e468
@ -19,14 +19,23 @@ internal static class EdgegapBuildUtils
|
||||
|
||||
public static BuildReport BuildServer()
|
||||
{
|
||||
// MIRROR CHANGE
|
||||
// Switch to the desired build target. As of 2021.3.19f1 there is a bug where
|
||||
// appropriate scripts are not being executed by BuildPlayer.
|
||||
// https://forum.unity.com/threads/unity-2021-2-dedicated-server-target-and-stripping-optimizations-now-live-please-share-feedback.1143734/page-4
|
||||
EditorUserBuildSettings.standaloneBuildSubtarget = StandaloneBuildSubtarget.Server;
|
||||
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.LinuxHeadlessSimulation, BuildTarget.StandaloneLinux64);
|
||||
// END MIRROR CHANGE
|
||||
|
||||
IEnumerable<string> scenes = EditorBuildSettings.scenes.Select(s=>s.path);
|
||||
BuildPlayerOptions options = new BuildPlayerOptions
|
||||
{
|
||||
scenes = scenes.ToArray(),
|
||||
target = BuildTarget.StandaloneLinux64,
|
||||
#pragma warning disable CS0618 // disable deprecated warning until Edgegap updates this
|
||||
options = BuildOptions.EnableHeadlessMode,
|
||||
#pragma warning restore CS0618
|
||||
// MIRROR CHANGE
|
||||
// options = BuildOptions.EnableHeadlessMode, // obsolete and missing UNITY_SERVER define
|
||||
subtarget = (int)StandaloneBuildSubtarget.Server, // dedicated server with UNITY_SERVER define
|
||||
// END MIRROR CHANGE
|
||||
locationPathName = "Builds/EdgegapServer/ServerBuild"
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user