public void Serialize(Message message, BinaryWriter writer) { //GetMsgId(message); //_serializer.GetSerializer(message.GetType())(writer, message); _serializer.Serialize(writer.BaseStream, message); }
public void Invoke(IMessageSender sender, Message message) { foreach(var listener in Listeners) { listener.Value.Invoke(listener.Key, sender, message); } }
public void SendMessage(Message message) { foreach(var listener in _listeners) { listener.SendMessage(message); } }
public int GetMsgId(Message message) { var index = Types.IndexOf(message.GetType()); if (index == -1) { throw new Exception("Not registered"); } return index; }
public void Error(Message message, ErrorMessage errorMessage) { throw new NotImplementedException(); }
public void SendMessage(Message message) { throw new NotImplementedException(); }
public override void Invoke(object target, IMessageSender sender, Message message) { MethodInfo.Invoke(target, new object[] { sender, message }); }
public EntityMessage(IHost host, int entity, Message message) { _serializer = host.ServiceManager.GetProvider<MsgDes>(); Entity = entity; Message = message; }
public void Error(Message message, ErrorMessage error) { Console.WriteLine(error.ToString()); throw new Exception(error.ToString()); }
public abstract void Invoke(object target, IMessageSender sender, Message message);