/// <summary> /// Initializes a new instance of the <see cref="TeraClient" /> class using the specified configuration. /// </summary> /// <param name="clientConfiguration">The configuration for the <see cref="TeraClient" />.</param> /// <param name="dispatcherConfiguration"> /// The configuration for the <see cref="Lotus.Dispatching.Dispatcher" /> that will /// be used internally to dispatch messages. /// </param> public TeraClient( TeraClientConfiguration clientConfiguration, DispatcherConfiguration dispatcherConfiguration) { configuration = clientConfiguration; serializer = new TeraSerializer(new MemoryStream(outputBuffer), configuration); exceptionHandler = configuration.UnhandledExceptionHandler ?? throw new ArgumentNullException(nameof(configuration.UnhandledExceptionHandler)); dispatcherConfiguration.ModuleTypes.Add(typeof(CoreModule)); Dispatcher = new Dispatcher(dispatcherConfiguration); }
private void OnConfigurationReceived(TeraClientConfiguration configuration) => systemMessageReader = new SystemMessageReader(configuration.SystemMessageTypes);