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

namespace Booma.Proxy
{
	[Injectee]
	public sealed class PlayerPickupItemOnGroundEventHandler : Command60Handler<Sub60PickupItemFromGroundCommand>
	{
		[Inject]
		private INetworkEntityRegistery<INetworkItem> WorldItemRegistery { get; }

		/// <inheritdoc />
		public PlayerPickupItemOnGroundEventHandler(ILog logger) 
			: base(logger)
		{
		
		}

		/// <inheritdoc />
		protected override Task HandleSubMessage(IPeerMessageContext<PSOBBGamePacketPayloadClient> context, Sub60PickupItemFromGroundCommand command)
		{
			if(this.Logger.IsDebugEnabled)
				Logger.Debug($"Encountered ItemPickup ClientId: {command.Identifier} ZoneId: {command.ZoneId} ItemId: {command.ItemId}.");

			//TODO: Convert to using uint or change payload to use int
			//Despawns the world represenation. We should still track it locally though as it still exists
			WorldItemRegistery.RemoveEntity((int)command.ItemId)?.Despawn();

			return Task.CompletedTask;
		}
	}
}<commit_msg>Removed Inject from PlayerPickupItemOnGroundEventHandler<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common.Logging;
using GladNet;
using SceneJect.Common;
using UnityEngine;

namespace Booma.Proxy
{
	public sealed class PlayerPickupItemOnGroundEventHandler : Command60Handler<Sub60PickupItemFromGroundCommand>
	{
		private INetworkEntityRegistery<INetworkItem> WorldItemRegistery { get; }

		/// <inheritdoc />
		public PlayerPickupItemOnGroundEventHandler([NotNull] INetworkEntityRegistery<INetworkItem> worldItemRegistery, ILog logger) 
			: base(logger)
		{
			WorldItemRegistery = worldItemRegistery ?? throw new ArgumentNullException(nameof(worldItemRegistery));
		}

		/// <inheritdoc />
		protected override Task HandleSubMessage(IPeerMessageContext<PSOBBGamePacketPayloadClient> context, Sub60PickupItemFromGroundCommand command)
		{
			if(this.Logger.IsDebugEnabled)
				Logger.Debug($"Encountered ItemPickup ClientId: {command.Identifier} ZoneId: {command.ZoneId} ItemId: {command.ItemId}.");

			//TODO: Convert to using uint or change payload to use int
			//Despawns the world represenation. We should still track it locally though as it still exists
			WorldItemRegistery.RemoveEntity((int)command.ItemId)?.Despawn();

			return Task.CompletedTask;
		}
	}
}
{'fraction_non_alphanumeric': 0.0880253766851705, 'fraction_numerical': 0.004758128469468675, 'mean_word_length': 5.6923076923076925, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '538594', 'n_tokens_mistral': 824, 'n_tokens_neox': 756, 'n_words': 171}