public bool RegisterMessageObject(MessageOp opcode, uint secondary, Func <Message, Message> createFunc) { return(RegisterMessageObject((uint)opcode, secondary, createFunc)); }
public bool RegisterMessageObject <T>(MessageOp opcode, uint secondary) where T : Message, new() { return(RegisterMessageObject <T>((uint)opcode, secondary)); }
public MessageFactoryAttribute(MessageOp opcode) : this((uint)opcode) { }
public bool RegisterMessageObject <T>(MessageOp opcode) where T : Message, new() { return(RegisterMessageObject <T>((uint)opcode)); }
public RegisterBaselineMessageAttribute(MessageOp opcode, uint secondary) : base(opcode, secondary) { FactoryHandlerOpCodeEnum = MessageOp.BaselinesMessage; }
private byte[] ConvertOp(MessageOp op) { byte[] result = new byte[1]; result[0] = (byte)op; return(result); }
public static List <Message> WaitForMessages(this Queue <Message> queue, int timeout, MessageOp errorType, params MessageOp[] types) { List <Message> messages = new List <Message>(); var neededTypes = types.ToList(); bool error = false; var timeoutTime = DateTime.Now.AddMilliseconds(timeout); while (neededTypes.Count > 0 && !error) { if (timeoutTime <= DateTime.Now) { return(null); } while (queue.Count > 0) { var msg = queue.Dequeue(); messages.Add(msg); if (msg.MessageOpCodeEnum == errorType) { error = true; break; } var idx = neededTypes.IndexOf(msg.MessageOpCodeEnum); if (idx >= 0) { neededTypes.RemoveAt(idx); } timeoutTime = DateTime.Now.AddMilliseconds(timeout); } Thread.Sleep(timeout / 10); } return(messages); }
public RegisterDeltaMessageAttribute(MessageOp opcode) : this((uint)opcode) { }
public RegisterMessageWithSecondaryAttribute(MessageOp opcode, uint secondary) : this((uint)opcode, secondary) { }
public HandledByFactoryAttribute(MessageOp opcode) : this((uint)opcode) { }
public OpcodeKey(MessageOp opcode) { OpcodeEnum = opcode; }
public ObjectControllerMessageAttribute(MessageOp opcode) : this((uint)opcode) { }
public RegisterDeltaMessageAttribute(MessageOp opcode, uint secondary) : this((uint)opcode, secondary) { }
public RegisterMessageAttribute(MessageOp opcode) : base(opcode) { }
public RegisterBaselineMessageAttribute(MessageOp opcode) : this((uint)opcode) { }
public RegiserMessageWithOpcodeAttribute(MessageOp opcode) : this((uint)opcode) { }
public static List <Message> WaitForMessages(this List <Message> queue, int timeout, MessageOp errorType, params MessageOp[] types) { List <Message> messages = new List <Message>(); var neededTypes = types.ToList(); bool error = false; var timeoutTime = DateTime.Now.AddMilliseconds(timeout); while (true) { if (timeoutTime <= DateTime.Now) { return(null); } messages.AddRange(queue.Where(cur => !messages.Contains(cur) && (cur.MessageOpCodeEnum == errorType || types.Contains(cur.MessageOpCodeEnum)))); if (messages.Count == types.Length || messages.Any(cur => cur.MessageOpCodeEnum == errorType)) { break; } Thread.Sleep(timeout / 10); } return(messages); }