Service.cs 703 B

12345678910111213141516171819202122232425262728293031323334
  1. using TBL.CSharp.Game.Server.Message;
  2. namespace TBL.CSharp.Game.Server;
  3. /// <summary>
  4. /// 服务
  5. /// </summary>
  6. public abstract class Service
  7. {
  8. /// <summary>
  9. /// 服务队列
  10. /// </summary>
  11. public readonly SignalQueue SignalQueue;
  12. /// <summary>
  13. /// 服务句柄
  14. /// </summary>
  15. public int Handle { get; internal set; }
  16. /// <summary>
  17. /// 服务容器
  18. /// </summary>
  19. public ServiceContainer Container { get; internal set; }
  20. public Service()
  21. {
  22. SignalQueue = new SignalQueue(this);
  23. }
  24. /// <summary>
  25. /// 服务信号反应
  26. /// </summary>
  27. public abstract void OnSignal(Signal signal, ServiceContainer serviceContainer);
  28. }