|
@@ -3,14 +3,12 @@ using System.Collections.Generic;
|
|
|
|
|
|
|
|
namespace ET
|
|
namespace ET
|
|
|
{
|
|
{
|
|
|
- public class OpcodeType: SingletonLock<OpcodeType>, ISingletonAwake
|
|
|
|
|
|
|
+ public class OpcodeType: Singleton<OpcodeType>, ISingletonAwake
|
|
|
{
|
|
{
|
|
|
// 初始化后不变,所以主线程,网络线程都可以读
|
|
// 初始化后不变,所以主线程,网络线程都可以读
|
|
|
private readonly DoubleMap<Type, ushort> typeOpcode = new();
|
|
private readonly DoubleMap<Type, ushort> typeOpcode = new();
|
|
|
|
|
|
|
|
- private readonly HashSet<ushort> outrActorMessage = new HashSet<ushort>();
|
|
|
|
|
-
|
|
|
|
|
- private readonly Dictionary<Type, Type> requestResponse = new Dictionary<Type, Type>();
|
|
|
|
|
|
|
+ private readonly Dictionary<Type, Type> requestResponse = new();
|
|
|
|
|
|
|
|
public void Awake()
|
|
public void Awake()
|
|
|
{
|
|
{
|
|
@@ -57,11 +55,6 @@ namespace ET
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public override void Load()
|
|
|
|
|
- {
|
|
|
|
|
- World.Instance.AddSingleton<OpcodeType>(true);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
public ushort GetOpcode(Type type)
|
|
public ushort GetOpcode(Type type)
|
|
|
{
|
|
{
|
|
|
return this.typeOpcode.GetValueByKey(type);
|
|
return this.typeOpcode.GetValueByKey(type);
|