Unity3D Client Reference
Class Connection
Namespace: PlayerIOClient
Language: C# / .NET
A connection into a running Player.IO multiplayer room
Here is an example of joining a multiplayer room and listening to all messages
Properties
|
| public bool |
Is the connection currently connected to a remote host?
|
Methods
|
| public void |
Add a disconnect handler to the OnDisconnect event
|
| public void |
Add a message handler to the OnMessage event
|
| public void |
Disconnect from the game room
|
| public void |
Send a message to the connected client
|
| public void |
| Send |
(string type, params object[] parameters) |
Send a message to the connected client without first having to construct a Message object.
|
Connection.Connected
Is the connection currently connected to a remote host?
Connection.AddOnDisconnect
Add a disconnect handler to the OnDisconnect event
Arguments
| DisconnectEventHandler |
disconnectHandler |
|
|
Connection.AddOnMessage
Add a message handler to the OnMessage event
Arguments
| MessageReceivedEventHandler |
onMessageHandler |
|
|
Connection.Disconnect
Disconnect from the game room
Connection.Send
Send a message to the connected client
Arguments
| Message |
message |
|
The message to send |
Connection.Send
| public void |
| Send |
(string type, params object[] parameters) |
|
Send a message to the connected client without first having to construct a Message object.
Arguments
| string |
type |
|
The type of message to send |
| params object[] |
parameters |
|
The data to put in the message to send |