private String getEngineDependentEntityName(String entityName) { switch (runner.getEngineType().getId()) { case SOURCE1: return "DT_DOTA_" + entityName; case SOURCE2: return "CDOTA_" + entityName; default: throw new RuntimeException("invalid engine type"); } }
@OnInit public void onInit() { fieldReader = engineType.getNewFieldReader(); entities = new Entity[1 << engineType.getIndexBits()]; deletions = new int[1 << engineType.getIndexBits()]; }
protected void determineLastTick() throws IOException { if (engineType == null) { throw new ClarityException("cannot determine last tick before engine type is known"); } lastTick = engineType.determineLastTick(this); }
throw new ClarityException("class for new entity %d is %d, but no dtClass found!.", entityIndex, clsId); serial = stream.readUBitInt(engineType.getSerialBits()); if (engineType.getId() == EngineId.SOURCE2) { if (engineType.handleDeletions() && message.getIsDelta()) { int n = fieldReader.readDeletions(stream, engineType.getIndexBits(), deletions); for (int i = 0; i < n; i++) { entityIndex = deletions[i];
BitStream bs = BitStream.createBitStream(bytes); while (bs.remaining() >= 8) { int kind = engineType.readEmbeddedKind(bs); if (kind == 0) { ); Class<? extends GeneratedMessage> messageClass = engineType.embeddedPacketClassForKind(kind); if (messageClass == null) { logUnknownMessage("embedded", kind); Class<? extends GeneratedMessage> umClazz = engineType.userMessagePacketClassForKind(userMessage.getMsgType()); if (umClazz == null) { logUnknownMessage("usermessage", userMessage.getMsgType());
@OnInit public void onInit() { fieldReader = engineType.getNewFieldReader(); }
file.position(0); engineType = readEngineType(); engineType.skipHeader(this); nextTickOffset = file.position(); } else { file.position(nextTickOffset); PacketInstance<GeneratedMessage> pi = engineType.getNextPacketInstance(this); if (lastTickOffset < nextTickOffset) { setLastTick(pi.getTick());
offset = src.getPosition(); try { pi = engineType.getNextPacketInstance(src); } catch (EOFException e) { pi = PacketInstance.EOF; Demo.CDemoPacket message = (Demo.CDemoPacket) pi.parse(); evMessageContainer.raise(Demo.CDemoPacket.class, message.getData()); } else if (engineType.isSendTablesContainer() && messageClass == Demo.CDemoSendTables.class) { Demo.CDemoSendTables message = (Demo.CDemoSendTables) pi.parse(); evMessageContainer.raise(Demo.CDemoSendTables.class, message.getData());
/** * Retrieves summary-data from the given input source * * @param source the {@code Source} providing the replay data * @return the {@code CDemoFileInfo} protobuf message * @throws IOException if the given source is invalid * @see Source */ public static Demo.CDemoFileInfo infoForSource(final Source source) throws IOException { EngineType engineType = source.readEngineType(); source.setPosition(source.readFixedInt32()); PacketInstance<GeneratedMessage> pi = engineType.getNextPacketInstance(source); return (Demo.CDemoFileInfo) pi.parse(); }
protected void initAndRunWith(Object... processors) throws IOException { initWithProcessors(this, getEngineType(), source, processors); engineType.emitHeader(); context.createEvent(OnInputSource.class, Source.class, LoopController.class).raise(source, loopController); }
public ListenerAdapter(EventListener<OnEntityPropertyChanged> listener) { classPattern = Pattern.compile(listener.getAnnotation().classPattern()); propertyPattern = Pattern.compile(listener.getAnnotation().propertyPattern()); int count = 1 << engineType.getIndexBits(); classMatchesForEntity = new TriStateTable(count); propertyMatchesForEntity = new Map[count]; for (int i = 0; i < count; i++) { propertyMatchesForEntity[i] = new HashMap<>(); } }
public int getHandle() { return engineType.handleForIndexAndSerial(index, serial); }
throw new ClarityException("class for new entity %d is %d, but no dtClass found!.", entityIndex, clsId); serial = stream.readUBitInt(engineType.getSerialBits()); if (engineType.getId() == EngineId.SOURCE2) { if (engineType.handleDeletions() && message.getIsDelta()) { int n = fieldReader.readDeletions(stream, engineType.getIndexBits(), deletions); for (int i = 0; i < n; i++) { entityIndex = deletions[i];
BitStream bs = BitStream.createBitStream(bytes); while (bs.remaining() >= 8) { int kind = engineType.readEmbeddedKind(bs); if (kind == 0) { ); Class<? extends GeneratedMessage> messageClass = engineType.embeddedPacketClassForKind(kind); if (messageClass == null) { logUnknownMessage("embedded", kind); Class<? extends GeneratedMessage> umClazz = engineType.userMessagePacketClassForKind(userMessage.getMsgType()); if (umClazz == null) { logUnknownMessage("usermessage", userMessage.getMsgType());
@OnInit public void onInit() { fieldReader = engineType.getNewFieldReader(); }
file.position(0); engineType = readEngineType(); engineType.skipHeader(this); nextTickOffset = file.position(); } else { file.position(nextTickOffset); PacketInstance<GeneratedMessage> pi = engineType.getNextPacketInstance(this); if (lastTickOffset < nextTickOffset) { setLastTick(pi.getTick());
offset = src.getPosition(); try { pi = engineType.getNextPacketInstance(src); } catch (EOFException e) { pi = PacketInstance.EOF; Demo.CDemoPacket message = (Demo.CDemoPacket) pi.parse(); evMessageContainer.raise(Demo.CDemoPacket.class, message.getData()); } else if (engineType.isSendTablesContainer() && messageClass == Demo.CDemoSendTables.class) { Demo.CDemoSendTables message = (Demo.CDemoSendTables) pi.parse(); evMessageContainer.raise(Demo.CDemoSendTables.class, message.getData());
/** * Retrieves summary-data from the given input source * * @param source the {@code Source} providing the replay data * @return the {@code CDemoFileInfo} protobuf message * @throws IOException if the given source is invalid * @see Source */ public static Demo.CDemoFileInfo infoForSource(final Source source) throws IOException { EngineType engineType = source.readEngineType(); source.setPosition(source.readFixedInt32()); PacketInstance<GeneratedMessage> pi = engineType.getNextPacketInstance(source); return (Demo.CDemoFileInfo) pi.parse(); }
protected void initAndRunWith(Object... processors) throws IOException { initWithProcessors(this, getEngineType(), source, processors); engineType.emitHeader(); context.createEvent(OnInputSource.class, Source.class, LoopController.class).raise(source, loopController); }
public ListenerAdapter(EventListener<OnEntityPropertyChanged> listener) { classPattern = Pattern.compile(listener.getAnnotation().classPattern()); propertyPattern = Pattern.compile(listener.getAnnotation().propertyPattern()); int count = 1 << engineType.getIndexBits(); classMatchesForEntity = new TriStateTable(count); propertyMatchesForEntity = new Map[count]; for (int i = 0; i < count; i++) { propertyMatchesForEntity[i] = new HashMap<>(); } }