Photon Fusion 1.1.9

Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
NetworkProjectConfig Class Reference

The core Fusion config file that is shared with all peers at startup. More...

Public Types

enum  DeltaCompressors
 Delta Compression Implementations. More...
 
enum  PeerModes
 Options for running one or multiple peers in one Unity instance. Multiple is useful for testing multiple players/clients inside of the Unity editor without needing to build executables. Each peer is assigned its own independent physics scene and NetworkRunner instance. More...
 
enum  PhysicsEngines
 Options for which Physics engines Fusion will use for simulations. More...
 
enum  PhysicsModes
 Options for how physics is simulated on clients. More...
 
enum  SceneLoadSpawnModes
 Spawn Modes while Scene is being loaded. More...
 

Public Member Functions

delegate NetworkProjectConfigAsset AssetLoadingDelegate ()
 GlobalAssetLoading
 
delegate void AssetUndloadingDelegate (NetworkProjectConfigAsset asset)
 GlobalAssetUnloading
 
override string ToString ()
 ToString() implementation.
 

Static Public Member Functions

static LocalPhysicsMode ConvertPhysicsMode (NetworkProjectConfig.PhysicsEngines engine)
 Convert between NetworkProjectConfig.PhysicsEngines to LocalPhysicsMode
 
static NetworkProjectConfig Deserialize (string data)
 De-serialize a NetworkProjectConfig from a JSON string (typically sent by the Room's Creator).
 
static string Serialize (NetworkProjectConfig config)
 Serialize a NetworkProjectConfig into a JSON string.
 
static void UnloadGlobal ()
 Unloads Global, if already loaded. If loading Global has faulted, resets the state and next call to the Global accessor will attempt to load the config again.
 

Public Attributes

AccuracyDefaults AccuracyDefaults = new AccuracyDefaults()
 The named global accuracies used by this project.
 
string[] AssembliesToWeave
 Names of assemblies Fusion is going to weave. Not case sensitive.
 
bool CheckNetworkedPropertiesBeingEmpty = false
 If set, the weaver will check if NetworkedAttribute properties getters and setters are empty.
 
bool CheckRpcAttributeUsage = false
 If set, the weaver will check if RpcAttribute is used in types that do not support it. This requires all types to be scanned and can increase weaving duration.
 
DeltaCompressors DeltaCompressor
 Current DeltaCompressor type.
 
bool EnableHostMigration = false
 Enable support for Host Migration.
 
HeapConfiguration Heap = new HeapConfiguration()
 Heap Settings.
 
bool HideNetworkObjectInactivityGuard = false
 Inactive NetworkObject need special handling in case they get destroyed without ever being activated. This is achieved with adding a nested GameObject called "NetworkObjectInactivityGuard" that tracks the OnDestroy message. HideNetworkObjectInactivityGuard can be used to control whether these guards are visible in the hierarchy or not.
 
uint HostMigrationSnapshotInterval = 60
 Delay in seconds between each time the Host sends a Snapshot of the current Simulation State, for use in Host Migration.
 
InterpolationConfiguration Interpolation = new InterpolationConfiguration()
 Reference to InterpolationConfiguration settings for this NetworkProjectConfig.
 
bool InvokeRenderInBatchMode = true
 Signal if the SimulationBehaviour.Render callbacks should be invoked in Batch Mode.
 
LagCompensationSettings LagCompensation = new LagCompensationSettings()
 Advanced lag compensation buffer settings.
 
ushort MaxNetworkedObjectCount = 1 << 13
 Max number of allowed NetworkObjects in a room.
 
NetworkConfiguration Network = new NetworkConfiguration()
 Reference to NetworkConfiguration settings for this NetworkProjectConfig.
 
NetworkSimulationConfiguration NetworkConditions = new NetworkSimulationConfiguration()
 Settings for simulating network conditions of latency and loss.
 
bool NetworkIdIsObjectName
 Signal if the NetworkId of the NetworkObject should be included on the name of the GameObject.
 
bool NullChecksForNetworkedProperties = true
 If set, the weaver will add a check to all [Networked] properties on each NetworkBehaviour to verify if owing NetworkObject has been attached to.
 
PeerModes PeerMode
 Setting for whether multiple peers can run per Unity instance (typically to allow easy testing of multiple peers inside of the editor).
 
PhysicsEngines PhysicsEngine
 Setting for which physics engine Fusion will simulate with.
 
NetworkPrefabTable PrefabTable = new NetworkPrefabTable()
 Reference to the NetworkPrefabTable instance for this NetworkProjectConfig.
 
SceneLoadSpawnModes SceneLoadSpawnMode = SceneLoadSpawnModes.NotAllowed
 Current SceneLoadSpawnMode.
 
PhysicsModes ServerPhysicsMode
 Setting for which ServerPhysicsMode Fusion will use in server or host mode. Not used in shared mode.
 
SimulationConfig Simulation = new SimulationConfig()
 Reference to SimulationConfig settings for this NetworkProjectConfig.
 
string TypeId = CurrentTypeId
 Current NetworkProjectConfig Type ID.
 
bool UseLagCompensation = true
 Use lag compensation. Not used in shared mode.
 
bool UseSerializableDictionary = true
 Use Fusion.SerializableDictionary to store [Networked] dictionary properties initial value. If unchecked, the weaver will emit System.Generic.Dictionary instead - a type that's not Unity-serializable, but custom serializers (e.g. Odin) may support it.
 
int Version = CurrentVersion
 Current NetworkProjectConfig version.
 

Static Public Attributes

static NetworkRunner. BuildTypes
 Get the version information for the Fusion.Runntime.dll.
 
const string CurrentTypeId = nameof(NetworkProjectConfig)
 Current NetworkProjectConfig Type ID.
 
const int CurrentVersion = 1
 Current NetworkProjectConfig version.
 
const string DefaultResourceName = nameof(NetworkProjectConfig)
 Default file name for the NetworkProjectConfig asset.
 

Properties

static NetworkRunner.System.Diagnostics.FileVersionInfo FusionVersionInfo [get]
 
static NetworkProjectConfig Global [get]
 Reference for the default NetworkProjectConfig
 
static AssetLoadingDelegate GlobalAssetLoading
 Invoked when a config is a about to be loaded from a default location (a Resource DefaultResourceName). If the event returns a non-null value, it will accepted as the config source and no attempt to load the default asset will be made.
 
static AssetUndloadingDelegate GlobalAssetUnloading
 Invoked when a config is about to be unloaded (due to UnloadGlobal).
 

Detailed Description

The core Fusion config file that is shared with all peers at startup.

Member Enumeration Documentation

◆ DeltaCompressors

Delta Compression Implementations.

Enumerator
Managed 

Default Implementation.

Burst 

Burst Implementation.

DebugUncompressed 

Debug Implementation without compression. NOT FOR GENERAL USE.

◆ PeerModes

enum PeerModes

Options for running one or multiple peers in one Unity instance. Multiple is useful for testing multiple players/clients inside of the Unity editor without needing to build executables. Each peer is assigned its own independent physics scene and NetworkRunner instance.

Enumerator
Single 

This is the normal use case, where every build and the editor run a single server, host or client peer.

Multiple 

This is the optional use case, which allows running multiple peers in the Unity editor, or in a build.

◆ PhysicsEngines

Options for which Physics engines Fusion will use for simulations.

Enumerator
Physics3D 

The Unity PhysX simulation is used, but auto-simulation is disabled and simulations are controlled by Fusion.

Physics2D 

The Unity Box2D simulation is used, but auto-simulation is disabled and simulations are controlled by Fusion.

None 

Fusion preforms no Physics Simulate() calls.

◆ PhysicsModes

Options for how physics is simulated on clients.

PhysicsModes.ServerOnly - Clients do not predict remote objects, and render in their remote time frame (relative past).
PhysicsModes.ClientPrediction - Clients predict remote objects and have options for rendering them in local and/or remote time frames.

Enumerator
ServerOnly 

The server simulates and sends states to all clients. Clients do not attempt prediction and will render remote objects in the server (relative past) time frame.

ClientPrediction 

The server simulates and sends states to all clients. Clients simulate remote states forward into the local time frame (prediction).

◆ SceneLoadSpawnModes

Spawn Modes while Scene is being loaded.

Enumerator
NotAllowed 

Block all Spawns.

Allowed 

Allow all Spawns.

Queued 

Queue spawn for when Scene is fully loaded.

Member Function Documentation

◆ Deserialize()

static NetworkProjectConfig Deserialize ( string  data)
static

De-serialize a NetworkProjectConfig from a JSON string (typically sent by the Room's Creator).

Parameters
dataJSON string of a serialized NetworkProjectConfig
Returns
NetworkProjectConfig reference de-serialized from JSON string

◆ Serialize()

static string Serialize ( NetworkProjectConfig  config)
static

Serialize a NetworkProjectConfig into a JSON string.

Parameters
configNetworkProjectConfig reference
Returns
JSON String

Member Data Documentation

◆ AssembliesToWeave

string [] AssembliesToWeave
Initial value:
= new string[] {
"Assembly-CSharp", "Assembly-CSharp-firstpass"
}

Names of assemblies Fusion is going to weave. Not case sensitive.