Jelajahi Sumber

删除废弃代码

tanghai 2 tahun lalu
induk
melakukan
ec5d1fbd36

+ 0 - 40
Unity/Assets/Scripts/Core/Fiber/Module/Synchronization/FiberTaskScheduler.cs

@@ -1,40 +0,0 @@
-using System.Collections.Concurrent;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace ET
-{
-    public class FiberTaskScheduler: TaskScheduler
-    {
-        private readonly ConcurrentQueue<Task> queue = new();
-
-        public void Update()
-        {
-            while (true)
-            {
-                if (!this.queue.TryDequeue(out Task task))
-                {
-                    return;
-                }
-
-                base.TryExecuteTask(task);
-            }
-        }
-
-        protected override IEnumerable<Task> GetScheduledTasks()
-        {
-            return this.queue;
-        }
-
-        protected override void QueueTask(Task task)
-        {
-            queue.Enqueue(task);
-        }
-
-        protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
-        {
-            queue.Enqueue(task);
-            return true;
-        }
-    }
-}

+ 0 - 11
Unity/Assets/Scripts/Core/Fiber/Module/Synchronization/FiberTaskScheduler.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 54538c8374bfae744a9a242c227e48ad
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 19
Unity/Assets/Scripts/Core/Map.cs

@@ -1,19 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace ET
-{
-    public class Map<T, K>: SortedDictionary<T, K>, IDisposable
-    {
-        public static Map<T, K> Create()
-        {
-            return ObjectPool.Instance.Fetch(typeof (Map<T, K>)) as Map<T, K>;
-        }
-
-        public void Dispose()
-        {
-            this.Clear();
-            ObjectPool.Instance.Recycle(this);
-        }
-    }
-}

+ 0 - 11
Unity/Assets/Scripts/Core/Map.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 289937f851b049744aebb761639041dc
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 66
Unity/Assets/Scripts/Core/Network/MessagePool.cs

@@ -1,66 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace ET
-{
-    public class MessagePool
-    {
-        private readonly Dictionary<Type, Queue<MessageObject>> pool = new();
-        
-        public T Fetch<T>() where T: MessageObject
-        {
-            return this.Fetch(typeof (T)) as T;
-        }
-
-        // 只有客户端才用消息池,服务端不使用
-        public MessageObject Fetch(Type type)
-        {
-            lock (this.pool)
-            {
-                MessageObject messageObject;
-                Queue<MessageObject> queue = null;
-                if (!pool.TryGetValue(type, out queue))
-                {
-                    messageObject = Activator.CreateInstance(type) as MessageObject;
-                }
-                else if (queue.Count == 0)
-                {
-                    messageObject = Activator.CreateInstance(type) as MessageObject;
-                }
-                else
-                {
-                    messageObject = queue.Dequeue();
-                }
-                
-                messageObject.IsFromPool = true;
-                return messageObject;
-            }
-        }
-
-        public void Recycle(MessageObject obj)
-        {
-            if (!obj.IsFromPool)
-            {
-                return;
-            }
-            Type type = obj.GetType();
-            
-            lock (this.pool)
-            {
-                Queue<MessageObject> queue = null;
-                if (!pool.TryGetValue(type, out queue))
-                {
-                    queue = new Queue<MessageObject>();
-                    pool.Add(type, queue);
-                }
-
-                // 一种对象最大为100个
-                if (queue.Count > 100)
-                {
-                    return;
-                }
-                queue.Enqueue(obj);
-            }
-        }
-    }
-}

+ 0 - 11
Unity/Assets/Scripts/Core/Network/MessagePool.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 21b73f9512ba740f78c657a1e87792db
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 16
Unity/Assets/Scripts/Core/Network/OpcodeHelper.cs

@@ -1,16 +0,0 @@
-
-namespace ET
-{
-    public static class OpcodeHelper
-    {
-        public static bool IsOuterMessage(ushort opcode)
-        {
-            return opcode < OpcodeRangeDefine.OuterMaxOpcode;
-        }
-
-        public static bool IsInnerMessage(ushort opcode)
-        {
-            return opcode >= OpcodeRangeDefine.InnerMinOpcode;
-        }
-    }
-}

+ 0 - 11
Unity/Assets/Scripts/Core/Network/OpcodeHelper.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 9f70c945e6c5ab84ab4a50cb0448927b
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 1 - 6
Unity/Assets/Scripts/Core/UnOrderMultiMapSet.cs

@@ -1,9 +1,4 @@
-/**
- * 多重映射结构
- *
- */
-
-using System.Collections.Generic;
+using System.Collections.Generic;
 
 namespace ET
 {