You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

43 lines
1.1 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Sog
{
// 所有逻辑服务器类不能包含静态函数,统一管理
// c# 的dll加载了无法卸载,用AppDomain模式用起来不方便,所以每reload一次内存中多一份所有类的Assembly
// 用静态函数也许容易出错,待后期验证
public abstract class BaseReloadableService : IReloadableService
{
/// <summary>
/// 用来区分reload后不同的service,名字一样,id不同
/// </summary>
uint m_serviceSeqID;
/// <summary>
/// 接口实现
/// </summary>
/// <returns></returns>
public uint GetServiceSeqID()
{
return m_serviceSeqID;
}
public abstract int GetServiceType();
public abstract void Dispose();
/// <summary>
/// 生成唯一id,方便通过日志找bug
/// </summary>
public BaseReloadableService()
{
m_serviceSeqID = ServiceMgr.Instance.GenNextSeqID();
}
}
}