6 major server modules (PdkFriendServer/GlobalSever/ServerCore/GameModule/GameNetModule) + game logic (GameFix/GameDAL/ServerData) + network layer (NetWorkMessage) + data layer (ObjectModel) + utilities (MrWu/Core/Config/CloudAPI/dll) + adapters (zyxAdapter/base) .NET 8.0 C# solution, 16 projects, 958 source files
54 lines
1.4 KiB
C#
54 lines
1.4 KiB
C#
using System;
|
|
using MrWu.Debug;
|
|
|
|
namespace Server.Core
|
|
{
|
|
public class CoroutineLock : Reference
|
|
{
|
|
public int Type
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
public long Key
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
public int Level
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
public CoroutineLockManager CoroutineLockManager
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
public static CoroutineLock Create(int type,long key,int level,CoroutineLockManager coroutineLockManager)
|
|
{
|
|
CoroutineLock coroutineLock = ReferencePool.Fetch<CoroutineLock>();
|
|
coroutineLock.Type = type;
|
|
coroutineLock.Key = key;
|
|
coroutineLock.Level = level;
|
|
coroutineLock.CoroutineLockManager = coroutineLockManager;
|
|
return coroutineLock;
|
|
}
|
|
|
|
public override void Dispose()
|
|
{
|
|
Debug.Log("CoroutineLock Dispose!");
|
|
CoroutineLockManager.RunNextCoroutine(this.Type, this.Key, this.Level + 1);
|
|
this.Type = CoroutineLockType.None;
|
|
this.Key = 0;
|
|
this.Level = 0;
|
|
this.CoroutineLockManager = null;
|
|
|
|
ReferencePool.Recycle(this);
|
|
}
|
|
}
|
|
} |