Mirror Networking
|
NetworkClient with connection to server. More...
Static Public Member Functions | |
static void | Connect (string address) |
Connect client to a NetworkServer by address. More... | |
static void | Connect (Uri uri) |
Connect client to a NetworkServer by Uri. More... | |
static void | ConnectHost () |
static void | ConnectLocalServer () |
Connect host mode More... | |
static void | Disconnect () |
Disconnect from server. More... | |
static void | Send< T > (T message, int channelId=Channels.Reliable) |
Send a NetworkMessage to the server over the given channel. More... | |
static void | RegisterHandler< T > (Action< T > handler, bool requireAuthentication=true) |
Register a handler for a message type T. Most should require authentication. More... | |
static void | ReplaceHandler< T > (Action< NetworkConnection, T > handler, bool requireAuthentication=true) |
Replace a handler for a particular message type. Should require authentication by default. More... | |
static void | ReplaceHandler< T > (Action< T > handler, bool requireAuthentication=true) |
Replace a handler for a particular message type. Should require authentication by default. More... | |
static bool | UnregisterHandler< T > () |
Unregister a message handler of type T. More... | |
static bool | GetPrefab (Guid assetId, out GameObject prefab) |
Find the registered prefab for this asset id. More... | |
static void | RegisterPrefab (GameObject prefab, Guid newAssetId) |
Register spawnable prefab with custom assetId. More... | |
static void | RegisterPrefab (GameObject prefab) |
Register spawnable prefab. More... | |
static void | RegisterPrefab (GameObject prefab, Guid newAssetId, SpawnDelegate spawnHandler, UnSpawnDelegate unspawnHandler) |
Register a spawnable prefab with custom assetId and custom spawn/unspawn handlers. More... | |
static void | RegisterPrefab (GameObject prefab, SpawnDelegate spawnHandler, UnSpawnDelegate unspawnHandler) |
Register a spawnable prefab with custom spawn/unspawn handlers. More... | |
static void | RegisterPrefab (GameObject prefab, Guid newAssetId, SpawnHandlerDelegate spawnHandler, UnSpawnDelegate unspawnHandler) |
Register a spawnable prefab with custom assetId and custom spawn/unspawn handlers. More... | |
static void | RegisterPrefab (GameObject prefab, SpawnHandlerDelegate spawnHandler, UnSpawnDelegate unspawnHandler) |
Register a spawnable prefab with custom spawn/unspawn handlers. More... | |
static void | UnregisterPrefab (GameObject prefab) |
Removes a registered spawn prefab that was setup with NetworkClient.RegisterPrefab. More... | |
static void | RegisterSpawnHandler (Guid assetId, SpawnDelegate spawnHandler, UnSpawnDelegate unspawnHandler) |
This is an advanced spawning function that registers a custom assetId with the spawning system. More... | |
static void | RegisterSpawnHandler (Guid assetId, SpawnHandlerDelegate spawnHandler, UnSpawnDelegate unspawnHandler) |
This is an advanced spawning function that registers a custom assetId with the spawning system. More... | |
static void | UnregisterSpawnHandler (Guid assetId) |
Removes a registered spawn handler function that was registered with NetworkClient.RegisterHandler(). More... | |
static void | ClearSpawners () |
This clears the registered spawn prefabs and spawn handler functions for this client. More... | |
static bool | Ready () |
Sends Ready message to server, indicating that we loaded the scene, ready to enter the game. More... | |
static bool | AddPlayer () |
Sends AddPlayer message to the server, indicating that we want to join the world. More... | |
static void | PrepareToSpawnSceneObjects () |
Call this after loading/unloading a scene in the client after connection to register the spawnable objects More... | |
static void | DestroyAllClientObjects () |
Destroys all networked objects on the client. More... | |
static void | Shutdown () |
Shutdown the client. More... | |
Static Public Attributes | |
static readonly Dictionary< uint, NetworkIdentity > | spawned |
All spawned NetworkIdentities by netId. More... | |
static bool | ready |
True if client is ready (= joined world). More... | |
static Action | OnConnectedEvent |
static Action | OnDisconnectedEvent |
static Action< TransportError, string > | OnErrorEvent |
static readonly Dictionary< Guid, GameObject > | prefabs |
Registered spawnable prefabs by assetId. More... | |
static InterestManagement | aoi |
static bool | isLoadingScene |
Properties | |
static NetworkConnection | connection [get, set] |
Client's NetworkConnection to server. More... | |
static NetworkIdentity | localPlayer [get, set] |
NetworkIdentity of the localPlayer More... | |
static string | serverIp [get] |
IP address of the connection to server. More... | |
static bool | active [get] |
active is true while a client is connecting/connected More... | |
static bool | isConnecting [get] |
Check if client is connecting (before connected). More... | |
static bool | isConnected [get] |
Check if client is connected (after connecting). More... | |
static bool | isHostClient [get] |
True if client is running in host mode. More... | |
NetworkClient with connection to server.
Definition at line 21 of file NetworkClient.cs.
|
static |
Sends AddPlayer message to the server, indicating that we want to join the world.
Definition at line 974 of file NetworkClient.cs.
|
static |
This clears the registered spawn prefabs and spawn handler functions for this client.
Definition at line 900 of file NetworkClient.cs.
|
static |
Connect client to a NetworkServer by address.
Definition at line 160 of file NetworkClient.cs.
|
static |
Connect client to a NetworkServer by Uri.
Definition at line 176 of file NetworkClient.cs.
|
static |
Definition at line 193 of file NetworkClient.cs.
|
static |
Connect host mode
Definition at line 216 of file NetworkClient.cs.
|
static |
Destroys all networked objects on the client.
Definition at line 1444 of file NetworkClient.cs.
|
static |
Disconnect from server.
Definition at line 234 of file NetworkClient.cs.
|
static |
Find the registered prefab for this asset id.
Definition at line 508 of file NetworkClient.cs.
|
static |
Call this after loading/unloading a scene in the client after connection to register the spawnable objects
Definition at line 1158 of file NetworkClient.cs.
|
static |
Sends Ready message to server, indicating that we loaded the scene, ready to enter the game.
Definition at line 923 of file NetworkClient.cs.
|
static |
Register a handler for a message type T. Most should require authentication.
T | : | struct | |
T | : | NetworkMessage |
Definition at line 462 of file NetworkClient.cs.
|
static |
Register spawnable prefab.
Definition at line 589 of file NetworkClient.cs.
|
static |
Register spawnable prefab with custom assetId.
Definition at line 556 of file NetworkClient.cs.
|
static |
Register a spawnable prefab with custom assetId and custom spawn/unspawn handlers.
Definition at line 612 of file NetworkClient.cs.
|
static |
Register a spawnable prefab with custom assetId and custom spawn/unspawn handlers.
Definition at line 670 of file NetworkClient.cs.
|
static |
Register a spawnable prefab with custom spawn/unspawn handlers.
Definition at line 626 of file NetworkClient.cs.
|
static |
Register a spawnable prefab with custom spawn/unspawn handlers.
Definition at line 743 of file NetworkClient.cs.
|
static |
This is an advanced spawning function that registers a custom assetId with the spawning system.
Definition at line 837 of file NetworkClient.cs.
|
static |
This is an advanced spawning function that registers a custom assetId with the spawning system.
Definition at line 855 of file NetworkClient.cs.
|
static |
Replace a handler for a particular message type. Should require authentication by default.
T | : | struct | |
T | : | NetworkMessage |
Definition at line 480 of file NetworkClient.cs.
|
static |
Replace a handler for a particular message type. Should require authentication by default.
T | : | struct | |
T | : | NetworkMessage |
Definition at line 490 of file NetworkClient.cs.
|
static |
Send a NetworkMessage to the server over the given channel.
T | : | struct | |
T | : | NetworkMessage |
Definition at line 446 of file NetworkClient.cs.
|
static |
Shutdown the client.
Definition at line 1509 of file NetworkClient.cs.
|
static |
Unregister a message handler of type T.
T | : | struct | |
T | : | NetworkMessage |
Definition at line 497 of file NetworkClient.cs.
|
static |
Removes a registered spawn prefab that was setup with NetworkClient.RegisterPrefab.
Definition at line 808 of file NetworkClient.cs.
|
static |
Removes a registered spawn handler function that was registered with NetworkClient.RegisterHandler().
Definition at line 893 of file NetworkClient.cs.
|
static |
Definition at line 100 of file NetworkClient.cs.
|
static |
Definition at line 103 of file NetworkClient.cs.
|
static |
Definition at line 72 of file NetworkClient.cs.
|
static |
Definition at line 73 of file NetworkClient.cs.
|
static |
Definition at line 74 of file NetworkClient.cs.
|
static |
Registered spawnable prefabs by assetId.
Definition at line 77 of file NetworkClient.cs.
|
static |
True if client is ready (= joined world).
Definition at line 41 of file NetworkClient.cs.
|
static |
All spawned NetworkIdentities by netId.
Definition at line 29 of file NetworkClient.cs.
|
staticget |
active is true while a client is connecting/connected
Definition at line 55 of file NetworkClient.cs.
|
staticgetset |
Client's NetworkConnection to server.
Definition at line 33 of file NetworkClient.cs.
|
staticget |
Check if client is connected (after connecting).
Definition at line 62 of file NetworkClient.cs.
|
staticget |
Check if client is connecting (before connected).
Definition at line 59 of file NetworkClient.cs.
|
staticget |
True if client is running in host mode.
Definition at line 65 of file NetworkClient.cs.
|
staticgetset |
NetworkIdentity of the localPlayer
Definition at line 44 of file NetworkClient.cs.
|
staticget |
IP address of the connection to server.
Definition at line 51 of file NetworkClient.cs.