KS.Reactor.Client.Unity.ksConnect Class Reference

Reactor Connection component for connecting to Reactor server rooms and registering event handlers. More...

Inheritance diagram for KS.Reactor.Client.Unity.ksConnect:

Classes

struct  ConnectEvent
 Connect event passed to OnConnect event handlers. More...
 
struct  DisconnectEvent
 Disconnect event passed to OnDisconnect event handlers. More...
 
struct  GetRoomsEvent
 Get rooms event passed to OnGetRooms event handlers. More...
 

Public Types

enum class  ConnectProtocols { TCP = 0 , RUDP = 2 }
 List of protocols the connection script uses to connect to a server. More...
 
enum class  ConnectModes { ONLINE , REMOTE , LOCAL }
 List of methods the connection script uses to find a server. More...
 

Public Member Functions

void BeginConnect ()
 Begin connecting to a room. More...
 
void Connect (ksRoomInfo roomInfo, params ksMultiType[] connectParams)
 Connect to a room. More...
 
void Disconnect (bool immediate)
 Disconnect from a connected room. More...
 

Public Attributes

bool ConnectOnStart = true
 
ConnectProtocols ConnectProtocol = ConnectProtocols.TCP
 
ConnectModes ConnectMode = ConnectModes.LOCAL
 
string RemoteHost = "localhost"
 
ushort RemotePort = 8000
 
UnityEvent< GetRoomsEventOnGetRooms = new UnityEvent<GetRoomsEvent>()
 
UnityEvent< ConnectEventOnConnect = new UnityEvent<ConnectEvent>()
 
UnityEvent< DisconnectEventOnDisconnect = new UnityEvent<DisconnectEvent>()
 
ksRoom Room = null
 

Detailed Description

Reactor Connection component for connecting to Reactor server rooms and registering event handlers.

Member Enumeration Documentation

◆ ConnectModes

List of methods the connection script uses to find a server.

Enumerator
ONLINE 

Use the Reactor API to find and connect to a public server.

REMOTE 

Connect directly to a remote server using a host and port.

LOCAL 

Connect to the localhost using the ksRoomType configuration.

◆ ConnectProtocols

List of protocols the connection script uses to connect to a server.

Enumerator
TCP 

TCP

RUDP 

Reliable UDP

Member Function Documentation

◆ BeginConnect()

void KS.Reactor.Client.Unity.ksConnect.BeginConnect ( )

Begin connecting to a room.

◆ Connect()

void KS.Reactor.Client.Unity.ksConnect.Connect ( ksRoomInfo  roomInfo,
params ksMultiType[]  connectParams 
)

Connect to a room.

<param name=""roomInfo"">Room connection paremeters. If this is not null then the connect parameters from the component will be used..

◆ Disconnect()

void KS.Reactor.Client.Unity.ksConnect.Disconnect ( bool  immediate)

Disconnect from a connected room.