Tabnine Logo
StringTable
Code IndexAdd Tabnine to your IDE (free)

How to use
StringTable
in
skadistats.clarity.model

Best Java code snippets using skadistats.clarity.model.StringTable (Showing top 20 results out of 315)

origin: skadistats/clarity

protected void setSingleEntry(StringTable table, int mode, int index, String name, ByteString value) {
  if (name.isEmpty() && table.hasIndex(index)) {
    // With console recorded replays, the replay sometimes has no name entry,
    // and supposedly expects us to use the one that is existing
    // see: https://github.com/skadistats/clarity/issues/147#issuecomment-409619763
    //      and Slack communication with Lukas
    // reuse the old key, and see if that works
    name = table.getNameByIndex(index);
  }
  table.set(mode, index, name, value);
  raise(table, index, name, value);
}
origin: com.skadistats/clarity

  @Override
  public boolean apply(Object[] args) {
    StringTable t = (StringTable) args[0];
    return "*".equals(tableName) || t.getName().equals(tableName);
  }
});
origin: com.skadistats/clarity

public void set(int tbl, int index, String name, ByteString value) {
  ensureSize(index + 1);
  if ((tbl & 1) != 0) {
    initialEntryCount = Math.max(initialEntryCount, index + 1);
    this.names[index][0] = name;
    this.values[index][0] = value;
  }
  if ((tbl & 2) != 0) {
    entryCount = Math.max(entryCount, index + 1);
    this.names[index][1] = name;
    this.values[index][1] = value;
  }
}
origin: skadistats/clarity

private String readCombatLogName(int idx) {
  return combatLogNames.hasIndex(idx) ? combatLogNames.getNameByIndex(idx) : null;
}
origin: skadistats/clarity

@OnReset
public void onReset(Demo.CDemoStringTables packet, ResetPhase phase) {
  if (phase == ResetPhase.CLEAR) {
    resetStringTables.clear();
    for (StringTable table : stringTables.byName.values()) {
      table.reset();
    }
  } else if (phase == ResetPhase.ACCUMULATE) {
    for (Demo.CDemoStringTables.table_t tt : packet.getTablesList()) {
      if (!stringTables.byName.containsKey(tt.getTableName())) {
        continue;
      }
      resetStringTables.put(tt.getTableName(), tt);
    }
  } else if (phase == ResetPhase.APPLY) {
    for (StringTable table : stringTables.byName.values()) {
      Demo.CDemoStringTables.table_t tt = resetStringTables.get(table.getName());
      if (tt != null) {
        for (int i = 0; i < tt.getItemsCount(); i++) {
          Demo.CDemoStringTables.items_t it = tt.getItems(i);
          setSingleEntry(table, 2, i, it.getStr(), it.getData());
        }
      } else {
        for (int i = 0; i < table.getEntryCount(); i++) {
          raise(table, i, table.getNameByIndex(i), table.getValueByIndex(i));
        }
      }
    }
  }
}
origin: skadistats/clarity-examples

StringTable baselines = stringTables.forName("instancebaseline");
for (int i = 0; i < baselines.getEntryCount(); i++) {
  DTClass dtClass = dtClasses.forClassId(Integer.valueOf(baselines.getNameByIndex(i)));
  String fileName = String.format("%s%s%s.txt", dir.getPath(), File.separator, dtClass.getDtName());
  log.info("writing {}", fileName);
  fieldReader.DEBUG_STREAM = new PrintStream(new FileOutputStream(fileName), true, "UTF-8");
  BitStream bs = BitStream.createBitStream(baselines.getValueByIndex(i));
  try {
    fieldReader.readFields(bs, dtClass, dtClass.getEmptyStateArray(), true);
origin: skadistats/clarity

    log.warn("Working around keyHistory underflow. Key '%s' in table '%s' is incomplete.", nameBuf.toString(), table.getName());
  } else {
    nameBuf.append(keyHistory.get(basis).substring(0, length));
boolean isCompressed = false;
int bitLength;
if (table.getUserDataFixedSize()) {
  bitLength = table.getUserDataSizeBits();
} else {
  if ((table.getFlags() & 0x1) != 0) {
origin: skadistats/clarity

private String readCombatLogName(int idx) {
  return idx == 0 ? null : combatLogNames.getNameByIndex(idx);
}
origin: skadistats/clarity

private void decodeEntries(StringTable table, int mode, ByteString data, int numEntries) {
  BitStream stream = BitStream.createBitStream(data);
  int bitsPerIndex = Util.calcBitsNeededFor(table.getMaxEntries() - 1);
  LinkedList<String> keyHistory = new LinkedList<>();
    if (stream.readBitFlag()) {
      int bitLength;
      if (table.getUserDataFixedSize()) {
        bitLength = table.getUserDataSizeBits();
      } else {
        bitLength = stream.readUBitInt(14) * 8;
origin: skadistats/clarity

@OnMessage(S1NetMessages.CSVCMsg_CreateStringTable.class)
public void onCreateStringTable(S1NetMessages.CSVCMsg_CreateStringTable message) {
  if (isProcessed(message.getName())) {
    StringTable table = new StringTable(
      message.getName(),
      message.getMaxEntries(),
      message.getUserDataFixedSize(),
      message.getUserDataSize(),
      message.getUserDataSizeBits(),
      message.getFlags()
    );
    decodeEntries(table, 3, message.getStringData(), message.getNumEntries());
    evCreated.raise(numTables, table);
  }
  numTables++;
}
origin: com.skadistats/clarity

@OnReset
public void onReset(Demo.CDemoStringTables packet, ResetPhase phase) {
  if (phase == ResetPhase.CLEAR) {
    resetStringTables.clear();
    for (StringTable table : stringTables.byName.values()) {
      table.reset();
    }
  } else if (phase == ResetPhase.ACCUMULATE) {
    for (Demo.CDemoStringTables.table_t tt : packet.getTablesList()) {
      if (!stringTables.byName.containsKey(tt.getTableName())) {
        continue;
      }
      resetStringTables.put(tt.getTableName(), tt);
    }
  } else if (phase == ResetPhase.APPLY) {
    for (StringTable table : stringTables.byName.values()) {
      Demo.CDemoStringTables.table_t tt = resetStringTables.get(table.getName());
      if (tt != null) {
        for (int i = 0; i < tt.getItemsCount(); i++) {
          Demo.CDemoStringTables.items_t it = tt.getItems(i);
          setSingleEntry(table, 2, i, it.getStr(), it.getData());
        }
      } else {
        for (int i = 0; i < table.getEntryCount(); i++) {
          raise(table, i, table.getNameByIndex(i), table.getValueByIndex(i));
        }
      }
    }
  }
}
origin: com.skadistats/clarity

    log.warn("Working around keyHistory underflow. Key '%s' in table '%s' is incomplete.", nameBuf.toString(), table.getName());
  } else {
    nameBuf.append(keyHistory.get(basis).substring(0, length));
boolean isCompressed = false;
int bitLength;
if (table.getUserDataFixedSize()) {
  bitLength = table.getUserDataSizeBits();
} else {
  if ((table.getFlags() & 0x1) != 0) {
origin: com.skadistats/clarity

private String readCombatLogName(int idx) {
  return combatLogNames.hasIndex(idx) ? combatLogNames.getNameByIndex(idx) : null;
}
origin: com.skadistats/clarity

private String readCombatLogName(int idx) {
  return idx == 0 ? null : combatLogNames.getNameByIndex(idx);
}
origin: com.skadistats/clarity

private void decodeEntries(StringTable table, int mode, ByteString data, int numEntries) {
  BitStream stream = BitStream.createBitStream(data);
  int bitsPerIndex = Util.calcBitsNeededFor(table.getMaxEntries() - 1);
  LinkedList<String> keyHistory = new LinkedList<>();
    if (stream.readBitFlag()) {
      int bitLength;
      if (table.getUserDataFixedSize()) {
        bitLength = table.getUserDataSizeBits();
      } else {
        bitLength = stream.readUBitInt(14) * 8;
origin: com.skadistats/clarity

@OnMessage(S1NetMessages.CSVCMsg_CreateStringTable.class)
public void onCreateStringTable(S1NetMessages.CSVCMsg_CreateStringTable message) {
  if (isProcessed(message.getName())) {
    StringTable table = new StringTable(
      message.getName(),
      message.getMaxEntries(),
      message.getUserDataFixedSize(),
      message.getUserDataSize(),
      message.getUserDataSizeBits(),
      message.getFlags()
    );
    decodeEntries(table, 3, message.getStringData(), message.getNumEntries());
    evCreated.raise(numTables, table);
  }
  numTables++;
}
origin: com.skadistats/clarity

protected void setSingleEntry(StringTable table, int mode, int index, String name, ByteString value) {
  if (name.isEmpty() && table.hasIndex(index)) {
    // With console recorded replays, the replay sometimes has no name entry,
    // and supposedly expects us to use the one that is existing
    // see: https://github.com/skadistats/clarity/issues/147#issuecomment-409619763
    //      and Slack communication with Lukas
    // reuse the old key, and see if that works
    name = table.getNameByIndex(index);
  }
  table.set(mode, index, name, value);
  raise(table, index, name, value);
}
origin: skadistats/clarity

  @Override
  public boolean apply(Object[] args) {
    StringTable t = (StringTable) args[0];
    return "*".equals(tableName) || t.getName().equals(tableName);
  }
});
origin: odota/parser

  throw new UnknownItemFoundException(String.format("Can't find item by its handle (%d)", hItem));
String itemName = stEntityNames.getNameByIndex(eItem.getProperty("m_pEntity.m_nameStringableIndex"));
if(itemName == null) {
  throw new UnknownItemFoundException("Can't get item name from EntityName string table");
origin: skadistats/clarity

@OnMessage(S2NetMessages.CSVCMsg_CreateStringTable.class)
public void onCreateStringTable(S2NetMessages.CSVCMsg_CreateStringTable message) throws IOException {
  if (isProcessed(message.getName())) {
    StringTable table = new StringTable(
      message.getName(),
      100,
      message.getUserDataFixedSize(),
      message.getUserDataSize(),
      message.getUserDataSizeBits(),
      message.getFlags()
    );
    ByteString data = message.getStringData();
    if (message.getDataCompressed()) {
      byte[] dst;
      if (context.getBuildNumber() != -1 && context.getBuildNumber() <= 962) {
        dst = LZSS.unpack(data);
      } else {
        dst = Snappy.uncompress(ZeroCopy.extract(data));
      }
      data = ZeroCopy.wrap(dst);
    }
    decodeEntries(table, 3, data, message.getNumEntries());
    evCreated.raise(numTables, table);
  }
  numTables++;
}
skadistats.clarity.modelStringTable

Most used methods

  • getNameByIndex
  • getEntryCount
  • getName
  • getValueByIndex
  • <init>
  • ensureSize
  • getFlags
  • getMaxEntries
  • getUserDataFixedSize
  • getUserDataSizeBits
  • hasIndex
  • reset
  • hasIndex,
  • reset,
  • set,
  • toString

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSystemService (Context)
  • scheduleAtFixedRate (Timer)
  • addToBackStack (FragmentTransaction)
  • Menu (java.awt)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now