/// <summary>
 /// This will start server in test mode
 /// </summary>
 protected virtual void StartServerInEditor()
 {
     if (startServerAsHost)
     {
         MirrorNetworkManager.StopHost();
         MsfTimer.WaitForSeconds(0.2f, () => MirrorNetworkManager.StartHost());
     }
     else
     {
         MirrorNetworkManager.StopServer();
         MsfTimer.WaitForSeconds(0.2f, () => MirrorNetworkManager.StartServer());
     }
 }
        /// <summary>
        /// Before we register our room we need to register spawned process if required
        /// </summary>
        protected void RegisterSpawnedProcess()
        {
            // Let's register this process
            Msf.Server.Spawners.RegisterSpawnedProcess(Msf.Args.SpawnTaskId, Msf.Args.SpawnTaskUniqueCode, (taskController, error) =>
            {
                if (taskController == null)
                {
                    logger.Error($"Room server process cannot be registered. The reason is: {error}");
                    return;
                }

                // If max players param was given from spawner task
                if (taskController.Options.Has(MsfDictKeys.maxPlayers))
                {
                    roomOptions.MaxConnections = taskController.Options.AsInt(MsfDictKeys.maxPlayers);
                }

                // If password was given from spawner task
                if (taskController.Options.Has(MsfDictKeys.roomPassword))
                {
                    roomOptions.Password = taskController.Options.AsString(MsfDictKeys.roomPassword);
                }

                // If max players was given from spawner task
                if (taskController.Options.Has(MsfDictKeys.roomName))
                {
                    roomOptions.Name = taskController.Options.AsString(MsfDictKeys.roomName);
                }

                // Set port of the Mirror server
                SetPort(roomOptions.RoomPort);

                // Finalize spawn task before we start mirror server
                taskController.FinalizeTask(new DictionaryOptions(), () =>
                {
                    // Start Mirror server
                    MirrorNetworkManager.StartServer();
                });
            });
        }