Method | Description | |
---|---|---|
AddExternalConnection ( |
This accepts a network connection from another external source and adds it to the server.
|
|
AddPlayerForConnection ( |
When an AddPlayer message handler has received a request from a player, the server calls this to associate the player object with the connection.
|
|
AddPlayerForConnection ( |
||
BecomeHost ( |
||
ClearHandlers ( ) : void |
Clear all registered callback handlers.
|
|
ClearLocalObjects ( ) : void |
This clears all of the networked objects that the server is aware of. This can be required if a scene change deleted all of the objects without destroying them in the normal manner.
|
|
ClearSpawners ( ) : void |
Clears all registered spawn prefab and spawn handler functions for this server.
|
|
Configure ( |
This configures the transport layer settings for the server.
|
|
Configure ( |
This configures the transport layer settings for the server.
|
|
Destroy ( |
Destroys this object and corresponding objects on all clients.
|
|
DestroyPlayersForConnection ( |
This destroys all the player objects associated with a NetworkConnections on a server.
|
|
DisconnectAll ( ) : void |
Disconnect all currently connected clients.
|
|
FindLocalObject ( |
This finds the local NetworkIdentity object with the specified network Id.
|
|
GetConnectionStats ( ) : NetworkConnection.PacketStat>.Dictionary |
Gets aggregate packet stats for all connections.
|
|
GetStatsIn ( int &numMsgs, int &numBytes ) : void | ||
GetStatsOut ( int &numMsgs, int &numBufferedMsgs, int &numBytes, int &lastBufferedPerSecond ) : void | ||
Listen ( |
||
Listen ( int serverPort ) : bool |
Start the server on the given port number. Note that if a match has been created, this will listen using the Relay server instead of a local socket.
|
|
Listen ( string ipAddress, int serverPort ) : bool |
Start the server on the given port number. Note that if a match has been created, this will listen using the Relay server instead of a local socket.
|
|
ListenRelay ( string relayIp, int relayPort, NetworkID netGuid, SourceID sourceId, NodeID nodeId ) : void |
Starts a server using a Relay server. This is the manual way of using the Relay server, as the regular NetworkServer.Connect() will automatically use the Relay server if a match exists.
|
|
RegisterHandler ( short msgType, NetworkMessageDelegate handler ) : void |
Register a handler for a particular message type.
|
Method | Description | |
---|---|---|
ActivateLocalClientScene ( ) : void | ||
AddExternalConnectionInternal ( |
||
AddLocalClient ( |
||
BecomeHostInternal ( |
||
CheckForNullObjects ( ) : void | ||
CheckPlayerControllerIdForConnection ( |
||
DestroyObject ( |
||
DestroyObject ( |
||
FinishPlayerForConnection ( |
||
GenerateConnectError ( int error ) : void | ||
GenerateDataError ( |
||
GenerateDisconnectError ( |
||
GenerateError ( |
||
GetNetworkIdentity ( |
||
HideForConnection ( |
||
InternalAddPlayerForConnection ( |
||
InternalDisconnectAll ( ) : void | ||
InternalListen ( string ipAddress, int serverPort ) : bool | ||
InternalListenRelay ( string relayIp, int relayPort, NetworkID netGuid, SourceID sourceId, NodeID nodeId ) : void | ||
InternalReplacePlayerForConnection ( |
||
InternalSetClientNotReady ( |
||
InternalSetMaxDelay ( float seconds ) : void | ||
InternalUpdate ( ) : void | ||
InvokeBytes ( |
||
InvokeHandlerOnServer ( |
||
NetworkServer ( ) : System | ||
OnClientReadyMessage ( NetworkMessage netMsg ) : void | ||
OnCommandMessage ( NetworkMessage netMsg ) : void | ||
OnConnected ( |
||
OnData ( |
||
OnDisconnected ( |
||
OnRemovePlayerMessage ( NetworkMessage netMsg ) : void | ||
RegisterMessageHandlers ( ) : void |
public static AddExternalConnection ( |
||
conn | Network connection to add. | |
return | bool |
public static AddPlayerForConnection ( |
||
conn | Connection which is adding the player. | |
player | Player object spawned for the player. | |
playerControllerId | short | The player controller ID number as specified by client. |
return | bool |
public static AddPlayerForConnection ( |
||
conn | ||
player | ||
playerControllerId | short | |
assetId | ||
return | bool |
public static BecomeHost ( |
||
oldClient | ||
port | int | |
matchInfo | ||
oldConnectionId | int | |
peers | ||
return |
public static Configure ( |
||
config | Transport layer confuration object. | |
maxConnections | int | The maximum number of client connections to allow. |
return | bool |
public static Configure ( |
||
topology | Transport layer topology object to use. | |
return | bool |
public static Destroy ( |
||
obj | Game object to destroy. | |
return | void |
public static DestroyPlayersForConnection ( |
||
conn | The connections object to clean up for. | |
return | void |
public static FindLocalObject ( |
||
netId | The netId of the NetworkIdentity object to find. | |
return |
public static GetConnectionStats ( ) : NetworkConnection.PacketStat>.Dictionary |
||
return | NetworkConnection.PacketStat>.Dictionary |
public static GetStatsIn ( int &numMsgs, int &numBytes ) : void | ||
numMsgs | int | |
numBytes | int | |
return | void |
public static GetStatsOut ( int &numMsgs, int &numBufferedMsgs, int &numBytes, int &lastBufferedPerSecond ) : void | ||
numMsgs | int | |
numBufferedMsgs | int | |
numBytes | int | |
lastBufferedPerSecond | int | |
return | void |
public static Listen ( |
||
matchInfo | ||
listenPort | int | |
return | bool |
public static Listen ( int serverPort ) : bool | ||
serverPort | int | Listen port number. |
return | bool |
public static Listen ( string ipAddress, int serverPort ) : bool | ||
ipAddress | string | The IP address to bind to (optional). |
serverPort | int | Listen port number. |
return | bool |
public static ListenRelay ( string relayIp, int relayPort, NetworkID netGuid, SourceID sourceId, NodeID nodeId ) : void | ||
relayIp | string | Relay server IP Address. |
relayPort | int | Relay server port. |
netGuid | NetworkID | GUID of the network to create. |
sourceId | SourceID | This server's sourceId. |
nodeId | NodeID | The node to join the network with. |
return | void |
public static RegisterHandler ( short msgType, NetworkMessageDelegate handler ) : void | ||
msgType | short | Message type number. |
handler | NetworkMessageDelegate | Function handler which will be invoked for when this message type is received. |
return | void |