IMRegister.cs 492 B

123456789101112131415161718192021
  1. using System;
  2. using Model;
  3. namespace Model
  4. {
  5. public interface IMessageDispather
  6. {
  7. ushort GetOpcode(Type type);
  8. void RegisterHandler<Message>(ushort opcode, Action<Session, Message> action) where Message : AMessage;
  9. void RegisterRpcHandler<Request, Response>(ushort opcode, Action<Session, Request, Action<Response>> action)
  10. where Request : ARequest
  11. where Response : AResponse;
  12. }
  13. public interface IMRegister
  14. {
  15. void Register(IMessageDispather messageDispather);
  16. }
  17. }