The network class is at the heart of the network implementation and provides the core functions.
This class configures the network interface and all the network parameters. You use it to set up a server or connect to one and have a row of helper functions to help you with those tasks. For more information on what is exposed in the editor see the Network Manger component reference.
connections | Todos los jugadores conectados. |
connectionTesterIP | The IP address of the connection tester used in Network.TestConnection. |
connectionTesterPort | The port of the connection tester used in Network.TestConnection. |
incomingPassword | Set the password for the server (for incoming connections). |
isClient | Returns true if your peer type is client. |
isMessageQueueRunning | Enable or disable the processing of network messages. |
isServer | Returns true if your peer type is server. |
logLevel | Set the log level for network messages (default is Off). |
maxConnections | Set the maximum amount of connections/players allowed. |
minimumAllocatableViewIDs | Get or set the minimum number of ViewID numbers in the ViewID pool given to clients by the server. |
natFacilitatorIP | The IP address of the NAT punchthrough facilitator. |
natFacilitatorPort | The port of the NAT punchthrough facilitator. |
peerType | The status of the peer type, i.e. if it is disconnected, connecting, server or client. |
player | Get the local NetworkPlayer instance. |
proxyIP | La dirección IP del servidor proxy. |
proxyPassword | Definir la contraseña del servidor proxy. |
proxyPort | El puerto del servidor proxy. |
sendRate | The default send rate of network updates for all Network Views. |
time | Get the current network time (seconds). |
useProxy | Indicate if proxy support is needed, in which case traffic is relayed through the proxy server. |
AllocateViewID | Query for the next available network view ID number and allocate it (reserve). |
CloseConnection | Cierra la conexión con otro sistema. |
Connect | Connect to the specified host (ip or domain name) and server port. |
Destroy | Destroy the object associated with this view ID across the network. |
DestroyPlayerObjects | Destroy all the objects based on view IDs belonging to this player. |
Disconnect | Cierra todas las conexiones y apaga la interfaz de red. |
GetAveragePing | The last average ping time to the given player in milliseconds. |
GetLastPing | The last ping time to the given player in milliseconds. |
HavePublicAddress | Check if this machine has a public IP address. |
InitializeSecurity | Initializes security layer. |
InitializeServer | Inicializar el servidor. |
Instantiate | Network instantiate a prefab. |
RemoveRPCs | Remove all RPC functions which belong to this player ID. |
RemoveRPCsInGroup | Remove all RPC functions which belong to given group number. |
SetLevelPrefix | Set the level prefix which will then be prefixed to all network ViewID numbers. |
SetReceivingEnabled | Enable or disables the reception of messages in a specific group number from a specific player. |
SetSendingEnabled | Enables or disables transmission of messages and RPC calls on a specific network group number. |
TestConnection | Comprobar la conexión de red de esta máquina. |
TestConnectionNAT | Test the connection specifically for NAT punch-through connectivity. |
OnConnectedToServer | Llamado en el cliente cuando usted se ha conectado con éxito a un servidor. |
OnDisconnectedFromServer | Called on client during disconnection from server, but also on the server when the connection has disconnected. |
OnFailedToConnect | Llamado en el cliente cuando un intento de conexión falla por alguna razón. |
OnNetworkInstantiate | Llamado en objetos que han sido instaciados en la red con Network.Instantiate. |
OnPlayerConnected | Llamado en el servidor cuando un nuevo player se ha conectado con éxito. |
OnPlayerDisconnected | Called on the server whenever a player is disconnected from the server. |
OnSerializeNetworkView | Utilizado para personalizar la sincronización de variables en un script observado por un network view. |
OnServerInitialized | Llamado en el servidor cada vez que un Network.InitializeServer fue invocado y se ha completado. |