Player.IO

Build fun, powerful & scalable online and mobile games with the reliable backend your users expect

Sign Up | Sign In

.NET Client Reference

Multiplayer  class documentationClass 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
Connected  [read-only]

Is the connection currently connected to a remote host?

Methods

 
public void
AddOnDisconnect (DisconnectEventHandler disconnectHandler)

Add a disconnect handler to the OnDisconnect event

public void
AddOnMessage (MessageReceivedEventHandler onMessageHandler)

Add a message handler to the OnMessage event

public void
Disconnect ()

Disconnect from the game room

public void
Send (Message message)

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.

Connected

Is the connection currently connected to a remote host?

Return Value

AddOnDisconnect

Add a disconnect handler to the OnDisconnect event

Arguments

DisconnectEventHandler disconnectHandler

AddOnMessage

Add a message handler to the OnMessage event

Arguments

MessageReceivedEventHandler onMessageHandler

Disconnect

Disconnect from the game room

Send

Send a message to the connected client

Arguments

Message message
The message to send

Send

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