Network
- AllocateViewID
- CloseConnection
- connections
- connectionTesterIP
- connectionTesterPort
- Connect
- DestroyPlayerObjects
- Destroy
- Disconnect
- GetAveragePing
- GetLastPing
- HavePublicAddress
- incomingPassword
- InitializeSecurity
- InitializeServer
- Instantiate
- isClient
- isMessageQueueRunning
- isServer
- logLevel
- maxConnections
- minimumAllocatableViewIDs
- natFacilitatorIP
- natFacilitatorPort
- OnConnectedToServer
- OnDisconnectedFromServer
- OnFailedToConnectToM...
- OnFailedToConnect
- OnNetworkInstantiate
- OnPlayerConnected
- OnPlayerDisconnected
- OnSerializeNetworkView
- OnServerInitialized
- peerType
- player
- proxyIP
- proxyPassword
- proxyPort
- RemoveRPCsInGroup
- RemoveRPCs
- sendRate
- SetLevelPrefix
- SetReceivingEnabled
- SetSendingEnabled
- TestConnectionNAT
- TestConnection
- time
- useProxy
Network 网络
The network class is at the heart of the network implementation and provides the core functions.
Network类是网络实现的核心并提供核心函数。
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.
这个类配置了网络接口和所有网络参数。可以使用它来设置一个服务器或连接到一个服务器并有一些辅助函数来帮助你完成这些功能。获取更多信息请参考Network Manger component reference。
Messages Sent发送消息
-
Called on the server whenever a new player has successfully connected.
每当一个新玩家成功连接时,在服务器上调用这个函数。 -
Called on the server whenever a Network.InitializeServer was invoked and has completed.
每当一个Network.InitializeServer被调用并完成时,在服务器上调用这个函数。 -
Called on the client when you have successfully connected to a server
当成功连接到服务器时,在客户端调用这个函数。 -
Called on the server whenever a player is disconnected from the server
每当一个玩家从服务器断开时,在服务器调用这个函数。 -
Called on client during disconnection from server, but also on the server when the connection has disconnected.
在服务器上当连接已经断开,在客户端调用这个函数。 -
Called on the client when a connection attempt fails for some reason.
当一个连接因为某些原因失败时,从客户端调用这个函数。 -
Called on clients or servers when there is a problem connecting to the master server.
当连接到主服务器(MasterServer)有问题时,从客户端或服务器调用这个函数。 -
Called on objects which have been network instantiated with Network.Instantiate
当一个物体使用Network.Instantiate已经网络实例化,在该物体上调用这个函数。 -
Used to customize synchronization of variables in a script watched by a network view.
用来在一个由网络视图监控的脚本中自定义变量同步。
Class Variables类变量
-
Set the password for the server (for incoming connections).
为服务器设置密码(入站连接)。 -
Set the log level for network messages (default is Off).
设置用于网络消息的日志级别(默认是关闭的)。 -
All connected players.
所有连接的玩家。 -
Get the local NetworkPlayer instance
获取本地NetworkPlayer实例。 -
Returns true if your peer type is client.
如果端点类型是客户端,返回true。 -
Returns true if your peer type is server.
如果端点类型是服务器,返回true。 -
The status of the peer type, i.e. if it is disconnected, connecting, server or client.
端类型的状态,即disconnected, connecting, server 或 client四种。 -
The default send rate of network updates for all Network Views.
用于所有网络视图,网络更新的默认发送速率。 -
Enable or disable the processing of network messages.
启用或禁用网络消息处理。 -
Get the current network time (seconds).
获取带当前网络时间(秒)。 -
Get or set the minimum number of ViewID numbers in the ViewID pool given to clients by the server.
在ViewID池中获取或设置由服务器分配给客户端ViewID的最小数。 -
The IP address of the NAT punchthrough facilitator.
NAT穿透服务商的IP地址。 -
The port of the NAT punchthrough facilitator.
NAT穿透服务商的端口。 -
The IP address of the connection tester used in Network.TestConnection.
用在Network.TestConnection中的连接测试的IP地址。 -
The port of the connection tester used in Network.TestConnection.
用在Network.TestConnection中的连接测试的端口。 -
Set the maximum amount of connections/players allowed.
设置允许连接(玩家)的最大数量。 -
The IP address of the proxy server.
代理服务器的IP地址。 -
The port of the proxy server.
代理服务器的端口。 -
Indicate if proxy support is needed, in which case traffic is relayed through the proxy server.
表示是否需要代理支持,在这种情况下,流量通过代理服务器传递。 -
Set the proxy server password.
设置代理服务器的密码。
Class Functions类函数
-
Initialize the server.
初始化服务器。 -
Initializes security layer.
初始化安全层。 -
Connect to the specified host (ip or domain name) and server port.
连接到特定的主机(IP或域名)和服务器端口。 -
Close all open connections and shuts down the network interface.
关闭所有开放的连接并关闭网络接口。 -
Close the connection to another system.
关闭与其他系统的连接。 -
Query for the next available network view ID number and allocate it (reserve).
查询下一个可用的网络视图ID号并分配它(保留)。 -
Network instantiate a prefab.
网络实例化预设。 -
Destroy the object associated with this view ID across the network.
跨网络销毁与该viewID相关的物体。 -
Destroy all the objects based on view IDs belonging to this player.
基于viewID销毁所有属于这个玩家的所有物体。 -
Remove all RPC functions which belong to this player ID.
移除所有属于这个玩家的ID的RPC函数。 -
Remove all RPC functions which belong to given group number.
移除属于给定组的所有RPC函数。 -
Remove the RPC function calls accociated with this view ID number.
移除所有与这个viewID数相关的RPC函数调用。 -
Set the level prefix which will then be prefixed to all network ViewID numbers.
设置关卡前缀,然后所有网络ViewID数都会使用该前缀。 -
The last ping time to the given player in milliseconds.
到给定player的最后ping时间,以毫秒计。 -
The last average ping time to the given player in milliseconds.
到给定player的最后平均ping时间,以毫秒计。 -
Enable or disables the reception of messages in a specific group number from a specific player.
启用或禁用一个特定组中来自特定玩家的信息接收。 -
Enables or disables transmission of messages and RPC calls on a specific network group number.
启用或禁用在特定网络组的信息传输和RPC调用。 -
Test this machines network connection.
测试这台机器的网络连接。 -
Test the connecction specifically for NAT punchthrough connectivity.
用于测试特定连接的NAT穿透连接性。 -
Check if this machine has a public IP address.
检测这台机器是否有一个公网IP地址。
最后修改:2011年5月17日 Tuesday 3:39