Assets.Scripts.Services.Communication.WebSocketService.AddOutboundInterceptor C# (CSharp) Method

AddOutboundInterceptor() public method

public AddOutboundInterceptor ( ICommandInterceptor interceptor, Type commandType ) : void
interceptor ICommandInterceptor
commandType System.Type
return void
        public void AddOutboundInterceptor(ICommandInterceptor interceptor, Type commandType)
        {
            outboundCommandInterceptors.AddOrReplace(commandType, interceptor);
        }

Usage Example

 void Start()
 {
     webSocketService = FindObjectOfType<WebSocketService>();
     webSocketService.AddOutboundInterceptor(this, typeof(BossAttackDTO));
     webSocketService.AddInboundInterceptor(this, typeof(BossStatusUpdateDTO));
 }