<commit_before>﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
using Items;
using UI;

namespace Equipment{
	//For items that are the ownership of players, the items are kept in a pool serverside and sprites references
	//sent to the client UI and playerobj
public class ObjectPool : MonoBehaviour {

		public Dictionary<NetworkIdentity,ItemAttributes> currentObjects = new Dictionary<NetworkIdentity, ItemAttributes>();

		public void AddGameObject(GameObject obj){
			obj.transform.position = transform.position;
			obj.transform.parent = transform;
			NetworkIdentity id = obj.GetComponent<NetworkIdentity>();
			ItemAttributes att = obj.GetComponent<ItemAttributes>();

			if (currentObjects.ContainsKey(id)) {
				currentObjects.Remove(id);
				currentObjects.Add(id, att);
			} else {
				currentObjects.Add(id, att);
			}
		}

	public void DestroyGameObject(GameObject gObj)
	{
		DropGameObject(gObj, Vector3.zero);
	}

	//When dropping items etc, remove them from the player equipment pool and place in scene
		public void DropGameObject(GameObject gObj, Vector3 dropPos)
		{
			NetworkIdentity id = gObj.GetComponent<NetworkIdentity>();
			if ( !currentObjects.ContainsKey(id) )
			{
				Debug.Log("item: " + gObj.name + "was not found in Player Equipment pool");
			}
			else
			{
				if ( !dropPos.Equals(Vector3.zero) )
				{
					currentObjects[id].gameObject.transform.parent = null;
					currentObjects[id].gameObject.transform.position = dropPos;
					EditModeControl e = gObj.GetComponent<EditModeControl>();
					e.Snap();
				}
				currentObjects.Remove(id);
			}
		}
}
}
<commit_msg>included some NetTransform send experiments<commit_after>﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
using Items;
using UI;

namespace Equipment{
	//For items that are the ownership of players, the items are kept in a pool serverside and sprites references
	//sent to the client UI and playerobj
public class ObjectPool : MonoBehaviour {

		public Dictionary<NetworkIdentity,ItemAttributes> currentObjects = new Dictionary<NetworkIdentity, ItemAttributes>();
	private bool IsWaiting;
	private bool AbortDelayedDrop;

	public void AddGameObject(GameObject obj){
			obj.transform.position = transform.position;
			obj.transform.parent = transform;
//			lastSync = Time.time;
	
			NetworkIdentity id = obj.GetComponent<NetworkIdentity>();
			ItemAttributes att = obj.GetComponent<ItemAttributes>();

			if (currentObjects.ContainsKey(id)) {
				currentObjects.Remove(id);
				currentObjects.Add(id, att);
			} else {
				currentObjects.Add(id, att);
			}
		}

	public void DestroyGameObject(GameObject gObj)
	{
		DropGameObject(gObj, Vector3.zero);
	}

//	private float lastSync;
	//When dropping items etc, remove them from the player equipment pool and place in scene
		public void DropGameObject(GameObject gObj, Vector3 dropPos)
		{
			NetworkIdentity id = gObj.GetComponent<NetworkIdentity>();
			if ( !currentObjects.ContainsKey(id) )
			{
				Debug.Log("item: " + gObj.name + "was not found in Player Equipment pool");
			}
			else
			{
				if ( !dropPos.Equals(Vector3.zero) )
				{
					var o = currentObjects[id].gameObject;
//					var delta = Time.time - lastSync;
//					if ( delta > 0.25f )
//					{
						DropNow(o, dropPos);
//					}
//					else
//					{
//						StartCoroutine(DropWait(o, dropPos, delta));
//					}
					
				}
				currentObjects.Remove(id);
			}
		}

//	private IEnumerator DropWait(GameObject gObj, Vector3 dropPos, float waitTime)
//	{
//		AbortDelayedDrop = false;
//		if (!IsWaiting)
//		{
//			IsWaiting = true;
//			Debug.LogFormat("DropWait {0}", waitTime);
//			yield return new WaitForSeconds(waitTime);
//			IsWaiting = false;
//			if(!AbortDelayedDrop) DropNow(gObj, dropPos);
//		}
//		else
//		{
//			AbortDelayedDrop = true;
//			DropNow(gObj, dropPos);
//		}
//	}

	private void DropNow(GameObject gObj, Vector3 dropPos)
	{
		gObj.transform.parent = null;
		gObj.transform.position = dropPos;
		EditModeControl e = gObj.GetComponent<EditModeControl>();
		e.Snap();
//		lastSync = Time.time;
	}
}
}

{'fraction_non_alphanumeric': 0.11291477679637145, 'fraction_numerical': 0.0028646455001193603, 'mean_word_length': 3.707865168539326, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 16, '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': '234376', 'n_tokens_mistral': 1489, 'n_tokens_neox': 1289, 'n_words': 322}