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

AddInboundInterceptor() public method

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

Usage Example

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