<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autofac;
using GladNet;
using SceneJect.Common;

namespace Booma.Proxy
{
	/// <summary>
	/// Dependency registeration component that should be used created at runtime
	/// when we need to export the network client and switch scenes.
	/// </summary>
	[Injectee]
	public sealed class ExportedClientDependencyRegisterModule : NonBehaviourDependency
	{
		/// <summary>
		/// The exported managed client that will be used in the next scene.
		/// </summary>
		[Inject]
		private IManagedNetworkClient<PSOBBGamePacketPayloadClient, PSOBBGamePacketPayloadServer> ManagedClient { get; }

		/// <inheritdoc />
		public override void Register(ContainerBuilder register)
		{
			if(ManagedClient == null)
				throw new InvalidOperationException($"The {nameof(ManagedClient)} was null in the exported client dependency register.");

			//We just need to register this and then others can check if it has been registered and avoid registering a new client.
			register.RegisterInstance(ManagedClient)
				.As<IManagedNetworkClient<PSOBBGamePacketPayloadClient, PSOBBGamePacketPayloadServer>>()
				.As<IPeerPayloadSendService<PSOBBGamePacketPayloadClient>>()
				.As<IPayloadInterceptable>()
				.As<IConnectionService>();

			register.RegisterType<DefaultMessageContextFactory>()
				.As<IPeerMessageContextFactory>()
				.SingleInstance();

			register.RegisterType<PayloadInterceptMessageSendService<PSOBBGamePacketPayloadClient>>()
				.As<IPeerRequestSendService<PSOBBGamePacketPayloadClient>>()<commit_msg>Removed some network client service Registreration As<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autofac;
using GladNet;
using SceneJect.Common;

namespace Booma.Proxy
{
	/// <summary>
	/// Dependency registeration component that should be used created at runtime
	/// when we need to export the network client and switch scenes.
	/// </summary>
	[Injectee]
	public sealed class ExportedClientDependencyRegisterModule : NonBehaviourDependency
	{
		/// <summary>
		/// The exported managed client that will be used in the next scene.
		/// </summary>
		[Inject]
		private IManagedNetworkClient<PSOBBGamePacketPayloadClient, PSOBBGamePacketPayloadServer> ManagedClient { get; }

		/// <inheritdoc />
		public override void Register(ContainerBuilder register)
		{
			if(ManagedClient == null)
				throw new InvalidOperationException($"The {nameof(ManagedClient)} was null in the exported client dependency register.");

			//We just need to register this and then others can check if it has been registered and avoid registering a new client.
			register.RegisterInstance(ManagedClient)
				.As<IManagedNetworkClient<PSOBBGamePacketPayloadClient, PSOBBGamePacketPayloadServer>>()
				.As<IPeerPayloadSendService<PSOBBGamePacketPayloadClient>>()
				.As<IPayloadInterceptable>();

			register.RegisterType<DefaultMessageContextFactory>()
				.As<IPeerMessageContextFactory>()
				.SingleInstance();

			register.RegisterType<PayloadInterceptMessageSendService<PSOBBGamePacketPayloadClient>>()
				.As<IPeerRequestSendService<PSOBBGamePacketPayloadClient>>()
{'fraction_non_alphanumeric': 0.0898842169408897, 'fraction_numerical': 0.0, 'mean_word_length': 5.277246653919694, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 38, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4112426', 'n_tokens_mistral': 973, 'n_tokens_neox': 873, 'n_words': 244}