Class MainBootstrapSystem
Main bootstrap system for FishMMO. Handles initialization, logging, version management, and graceful shutdown.
public class MainBootstrapSystem : BootstrapSystem
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourMainBootstrapSystem
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.GetComponent<T>()Component.TryGetComponent<T>(out T)Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentInParent<T>()Component.GetComponentsInParent<T>()Component.GetComponents<T>()Component.GetComponentIndex()Component.CompareTag(TagHandle)Component.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Fields
BootstrapTargetFrameRate
Frame rate the client is capped to during bootstrap, launcher, and the login/character-select screens.
public const int BootstrapTargetFrameRate = 60
Field Value
Remarks
Nothing sets UnityEngine.Application.targetFrameRate before a network connection exists, and its default is -1 (unlimited), so the launcher and login menus render as fast as the GPU allows and peg a CPU core to draw a static screen.
This is the default a client with no saved preference keeps, and not merely a
value that survives until the settings load. ClientDisplaySettings reads it back
as the no-preference default, so boot no longer replaces it with the display's fastest
mode moments after setting it — which it did, making this constant dead in every
practical sense and running the menus of a fresh install as fast as the panel allows.
A player who chooses a cap gets theirs instead; the applied value is bounded below by
the network tick rate and above by the display's fastest mode.
FishNet is deliberately not part of that chain any more. Its
NetworkManager.UpdateFramerate overwrites Application.targetFrameRate
from ClientManager.FrameRate on every connection-state change, so with
ChangeFrameRate enabled the scene's value silently became a hard ceiling on
what a player could render at. The client scene now ships with that flag off, leaving
the render rate entirely to this default and the player's preference. Simulation is
unaffected either way: gameplay runs on the fixed 30 Hz TimeManager tick.
GameVersion
The current game version string. Set during initialization.
public static string GameVersion
Field Value
configFileName
The name of the logging configuration JSON file (e.g., logging.json).
[Tooltip("The name of the logging configuration JSON file (e.g., logging.json).")]
public string configFileName
Field Value
Methods
Awake()
protected override void Awake()
InitiateShutdown()
Initiates the shutdown process, including graphics cleanup and logging system shutdown.
public void InitiateShutdown()
OnDestroy()
Unity OnDestroy message. Handles shutdown and cleanup when the object is destroyed.
protected override void OnDestroy()
OnPreload()
Initializes the logging system and other bootstrap components. Loads version info and configures initial scene loading.
public override void OnPreload()
Events
OnApplyClientBootSettings
Raised during client preload, immediately after the boot-time frame rate and VSync defaults are installed, so a client can apply the player's saved settings over them.
public static event Action OnApplyClientBootSettings
Event Type
Remarks
Subscribe from a RuntimeInitializeOnLoadMethod(BeforeSceneLoad), which is
guaranteed to run before any scene's Awake and therefore before this system
starts its bootstrap chain. Never raised on a headless server: it has no display, no
audio and no player settings to honour.