@OnEntityEntered public void onEntityEntered(Context ctx, Entity e) { if (e.getDtClass().getDtName().equals("CDOTAWearableItem")) { Integer accountId = getEntityProperty(e, "m_iAccountID", null); Integer itemDefinitionIndex = getEntityProperty(e, "m_iItemDefinitionIndex", null); Integer ownerHandle = getEntityProperty(e, "m_hOwnerEntity", null); Entity owner = ctx.getProcessor(Entities.class).getByHandle(ownerHandle); //System.err.format("%s,%s\n", accountId, itemDefinitionIndex); if (accountId > 0) { // Get the owner (a hero entity) Integer playerId = getEntityProperty(owner, "m_iPlayerID", null); Long accountId64 = 76561197960265728L + accountId; Integer playerSlot = steamid_to_playerslot.get(accountId64); cosmeticsMap.put(itemDefinitionIndex, playerSlot); } } }
private void logCreate(DotaUserMessages.CDOTAUserMsg_ParticleManager message) { int entityHandle = message.getCreateParticle().getEntityHandle(); // int entityIndex = Handle.indexForHandle(entityHandle); // int entitySerial = Handle.serialForHandle(entityHandle); Entity parent = entities.getByHandle(entityHandle); log.info("{} {} [index={}, entity={}({}), effect={}, attach={}]", getTick(), "PARTICLE_CREATE", message.getIndex(), entityHandle, parent == null ? "NOT_FOUND" : parent.getDtClass().getDtName(), message.getCreateParticle().getParticleNameIndex(), message.getCreateParticle().getAttachType() ); //log.info(message.toString()); }
private Entry buildWardEntry(Context ctx, Entity e) { Entry entry = new Entry(time); boolean isObserver = !e.getDtClass().getDtName().contains("TrueSight"); Integer x = getEntityProperty(e, "CBodyComponent.m_cellX", null); Integer y = getEntityProperty(e, "CBodyComponent.m_cellY", null); Integer z = getEntityProperty(e, "CBodyComponent.m_cellZ", null); Integer life_state = getEntityProperty(e, "m_lifeState", null); Integer[] pos = {x, y}; entry.x = x; entry.y = y; entry.z = z; entry.type = isObserver ? "obs" : "sen"; entry.entityleft = life_state == 1; entry.key = Arrays.toString(pos); entry.ehandle = e.getHandle(); if (entry.entityleft) { entry.type += "_left"; } Integer owner = getEntityProperty(e, "m_hOwnerEntity", null); Entity ownerEntity = ctx.getProcessor(Entities.class).getByHandle(owner); entry.slot = ownerEntity != null ? (Integer) getEntityProperty(ownerEntity, "m_iPlayerID", null) : null; return entry; } }
private void logUpdateEnt(DotaUserMessages.CDOTAUserMsg_ParticleManager message) { int entityHandle = message.getUpdateParticleEnt().getEntityHandle(); Entity parent = entities.getByHandle(entityHandle); log.info("{} {} [index={}, entity={}({}), controlPoint={}, attachmentType={}, attachment={}, includeWearables={}]", getTick(), "PARTICLE_UPDATE_ENT", message.getIndex(), entityHandle, parent == null ? "NOT_FOUND" : parent.getDtClass().getDtName(), message.getUpdateParticleEnt().getControlPoint(), ParticleAttachmentType.forId(message.getUpdateParticleEnt().getAttachType()), message.getUpdateParticleEnt().getAttachment(), message.getUpdateParticleEnt().getIncludeWearables() ); //log.info(message.toString()); }
return null; Entity eItem = entities.getByHandle(hItem); if(eItem == null) { throw new UnknownItemFoundException(String.format("Can't find item by its handle (%d)", hItem));
Entity e = ctx.getProcessor(Entities.class).getByHandle(handle);