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

DispatchCommand() private method

private DispatchCommand ( string jsonData ) : bool
jsonData string
return bool
        private bool DispatchCommand(string jsonData)
        {
            CommandDefinitionDTO commandDefinitionDTO = JsonUtility.FromJson<CommandDefinitionDTO>(jsonData);
            if (!registeredCommands.ContainsKey(commandDefinitionDTO.command.name))
            {
                return false;
            }
            foreach (CommandRegistration commandRegistration in registeredCommands[commandDefinitionDTO.command.name])
            {
                CommandDTO commandDTO = (CommandDTO)JsonUtility.FromJson(jsonData, commandRegistration.Type);
                if (DispatchIncomingCommandToInterceptors(commandDTO))
                {
                    commandRegistration.CallbackMethod(commandDTO);
                }
            }
            return true;
        }