C# Class Assets.Scripts.Services.Communication.WebSocketService

Inheritance: MonoSingleton
Show file Open project: maximecharron/GLO-3002-Frima Class Usage Examples

Public Methods

Method Description
AddInboundInterceptor ( ICommandInterceptor interceptor, Type commandType ) : void
AddOutboundInterceptor ( ICommandInterceptor interceptor, Type commandType ) : void
Connect ( ) : void
OnDestroy ( ) : void
RegisterCommand ( string commandName, Action callbackMethod, Type dtoType ) : void
SendCommand ( CommandDTO commandDTO, bool interceptable = true ) : void
UnregisterCommand ( string commandName, Action callbackMethod ) : void

Private Methods

Method Description
DispatchBufferedCommands ( ) : void
DispatchCommand ( string jsonData ) : bool
DispatchIncomingCommandToInterceptors ( CommandDTO commandDTO ) : bool
DispatchOutgoingCommandToInterceptors ( CommandDTO commandDTO ) : bool
KeepConnectionAlive ( ) : void
ReceiveCommands ( ) : void
Start ( ) : void
Update ( ) : void

Method Details

AddInboundInterceptor() public method

public AddInboundInterceptor ( ICommandInterceptor interceptor, Type commandType ) : void
interceptor ICommandInterceptor
commandType System.Type
return void

AddOutboundInterceptor() public method

public AddOutboundInterceptor ( ICommandInterceptor interceptor, Type commandType ) : void
interceptor ICommandInterceptor
commandType System.Type
return void

Connect() public method

public Connect ( ) : void
return void

OnDestroy() public method

public OnDestroy ( ) : void
return void

RegisterCommand() public method

public RegisterCommand ( string commandName, Action callbackMethod, Type dtoType ) : void
commandName string
callbackMethod Action
dtoType System.Type
return void

SendCommand() public method

public SendCommand ( CommandDTO commandDTO, bool interceptable = true ) : void
commandDTO Assets.Scripts.Services.Communication.DTOs.CommandDTO
interceptable bool
return void

UnregisterCommand() public method

public UnregisterCommand ( string commandName, Action callbackMethod ) : void
commandName string
callbackMethod Action
return void