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.incomingPassword 入站密码
static var incomingPassword : string
Description描述
Set the password for the server (for incoming connections).
为服务器设置密码(入站连接)。
This must be matched in the Network.Connect routine on the clients. Pass "" to specify no password (this is default).
这个必须与客户端上Network.Connect中的相同,传递 "" 表示没有密码(默认)。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void ConnectToServer() {
Network.Connect("127.0.0.1", 25000, "HolyMoly");
}
void LaunchServer() {
Network.incomingPassword = "HolyMoly";
Network.InitializeServer(32, 25000);
}
}
function ConnectToServer () {
Network.Connect("127.0.0.1", 25000, "HolyMoly");
}
function LaunchServer () {
Network.incomingPassword = "HolyMoly";
Network.InitializeServer(32, 25000);
}
最后修改:2011年4月2日 Saturday 11:58