Repair native profile precision, recipe components and stillsuit delivery

This commit is contained in:
unimatrixgit 2026-11-22 23:20:28 +01:00
commit da7c8747e1
24 changed files with 264 additions and 29 deletions

View file

@ -1,7 +1,7 @@
{
"recipeType": "FURNACE",
"input1": "minecraft:rabbit{\"minecraft:custom_data\":{\"PublicBukkitValues\":{\"executableitems:ei-id\":\"jerboa_raw_meat\",\"score:usage\":-1,\"dunerealms:quality\":\"uncommon\",\"dunerealms:equipment_mark\":\"3\",\"dunerealms:item_class\":\"consumable\",\"dunerealms:metadata_policy\":\"s1-item-metadata-v1\"}},\"minecraft:custom_name\":\"{\\\"text\\\":\\\"Raw Jerboa meat\\\",\\\"color\\\":\\\"green\\\",\\\"italic\\\":false}\",\"minecraft:lore\":[\"{\\\"text\\\":\\\"UNCOMMON | MK III\\\",\\\"color\\\":\\\"gray\\\",\\\"italic\\\":false}\",\"{\\\"text\\\":\\\"S1 · ARRAKIS\\\",\\\"color\\\":\\\"gray\\\",\\\"italic\\\":false}\"]}",
"result": "minecraft:cooked_rabbit{\"minecraft:custom_data\":{\"PublicBukkitValues\":{\"executableitems:ei-id\":\"jerboa_cooked_meat\",\"score:usage\":-1,\"dunerealms:quality\":\"rare\",\"dunerealms:equipment_mark\":\"6\",\"dunerealms:item_class\":\"consumable\",\"dunerealms:metadata_policy\":\"s1-item-metadata-v1\"}},\"minecraft:custom_name\":\"{\\\"text\\\":\\\"Cooked Jerboa meat\\\",\\\"color\\\":\\\"blue\\\",\\\"italic\\\":false}\",\"minecraft:lore\":[\"{\\\"text\\\":\\\"RARE | MK VI\\\",\\\"color\\\":\\\"gray\\\",\\\"italic\\\":false}\",\"{\\\"text\\\":\\\"S1 · ARRAKIS\\\",\\\"color\\\":\\\"gray\\\",\\\"italic\\\":false}\"]}",
"input1": "minecraft:rabbit[minecraft:custom_data={\"PublicBukkitValues\":{\"executableitems:ei-id\":\"jerboa_raw_meat\",\"score:usage\":-1,\"dunerealms:quality\":\"uncommon\",\"dunerealms:equipment_mark\":\"3\",\"dunerealms:item_class\":\"consumable\",\"dunerealms:metadata_policy\":\"s1-item-metadata-v1\"}},minecraft:custom_name={\"text\":\"Raw Jerboa meat\",\"color\":\"green\",\"italic\":false},minecraft:lore=[{\"text\":\"UNCOMMON | MK III\",\"color\":\"gray\",\"italic\":false},{\"text\":\"S1 · ARRAKIS\",\"color\":\"gray\",\"italic\":false}]]",
"result": "minecraft:cooked_rabbit[minecraft:custom_data={\"PublicBukkitValues\":{\"executableitems:ei-id\":\"jerboa_cooked_meat\",\"score:usage\":-1,\"dunerealms:quality\":\"rare\",\"dunerealms:equipment_mark\":\"6\",\"dunerealms:item_class\":\"consumable\",\"dunerealms:metadata_policy\":\"s1-item-metadata-v1\"}},minecraft:custom_name={\"text\":\"Cooked Jerboa meat\",\"color\":\"blue\",\"italic\":false},minecraft:lore=[{\"text\":\"RARE | MK VI\",\"color\":\"gray\",\"italic\":false},{\"text\":\"S1 · ARRAKIS\",\"color\":\"gray\",\"italic\":false}]]",
"experience": 0.35,
"cookingTime": 200,
"itemCheckers": {

View file

@ -1,12 +1,12 @@
{
"recipeType": "CRAFTING",
"typeOfCraftingTableRecipe": "SHAPELESS",
"input1": "minecraft:cooked_rabbit{\"minecraft:custom_data\":{\"PublicBukkitValues\":{\"executableitems:ei-id\":\"jerboa_cooked_meat\",\"score:usage\":-1,\"dunerealms:quality\":\"rare\",\"dunerealms:equipment_mark\":\"6\",\"dunerealms:item_class\":\"consumable\",\"dunerealms:metadata_policy\":\"s1-item-metadata-v1\"}},\"minecraft:custom_name\":\"{\\\"text\\\":\\\"Cooked Jerboa meat\\\",\\\"color\\\":\\\"blue\\\",\\\"italic\\\":false}\",\"minecraft:lore\":[\"{\\\"text\\\":\\\"RARE | MK VI\\\",\\\"color\\\":\\\"gray\\\",\\\"italic\\\":false}\",\"{\\\"text\\\":\\\"S1 · ARRAKIS\\\",\\\"color\\\":\\\"gray\\\",\\\"italic\\\":false}\"]}",
"input1": "minecraft:cooked_rabbit[minecraft:custom_data={\"PublicBukkitValues\":{\"executableitems:ei-id\":\"jerboa_cooked_meat\",\"score:usage\":-1,\"dunerealms:quality\":\"rare\",\"dunerealms:equipment_mark\":\"6\",\"dunerealms:item_class\":\"consumable\",\"dunerealms:metadata_policy\":\"s1-item-metadata-v1\"}},minecraft:custom_name={\"text\":\"Cooked Jerboa meat\",\"color\":\"blue\",\"italic\":false},minecraft:lore=[{\"text\":\"RARE | MK VI\",\"color\":\"gray\",\"italic\":false},{\"text\":\"S1 · ARRAKIS\",\"color\":\"gray\",\"italic\":false}]]",
"input2": "minecraft:carrot",
"input3": "minecraft:baked_potato",
"input4": "minecraft:orange_dye{\"minecraft:custom_data\":{\"PublicBukkitValues\":{\"executableitems:ei-id\":\"polluted_refined_spice\",\"score:usage\":-1,\"dunerealms:quality\":\"rare\",\"dunerealms:equipment_mark\":\"3\",\"dunerealms:item_class\":\"resource\",\"dunerealms:metadata_policy\":\"s1-item-metadata-v1\"}},\"minecraft:custom_name\":\"{\\\"text\\\":\\\"Contaminated spice\\\",\\\"color\\\":\\\"blue\\\",\\\"italic\\\":false}\",\"minecraft:lore\":[\"{\\\"text\\\":\\\"RARE | MK III\\\",\\\"color\\\":\\\"gray\\\",\\\"italic\\\":false}\",\"{\\\"text\\\":\\\"S1 · ARRAKIS\\\",\\\"color\\\":\\\"gray\\\",\\\"italic\\\":false}\"]}",
"input4": "minecraft:orange_dye[minecraft:custom_data={\"PublicBukkitValues\":{\"executableitems:ei-id\":\"polluted_refined_spice\",\"score:usage\":-1,\"dunerealms:quality\":\"rare\",\"dunerealms:equipment_mark\":\"3\",\"dunerealms:item_class\":\"resource\",\"dunerealms:metadata_policy\":\"s1-item-metadata-v1\"}},minecraft:custom_name={\"text\":\"Contaminated spice\",\"color\":\"blue\",\"italic\":false},minecraft:lore=[{\"text\":\"RARE | MK III\",\"color\":\"gray\",\"italic\":false},{\"text\":\"S1 · ARRAKIS\",\"color\":\"gray\",\"italic\":false}]]",
"input5": "minecraft:bowl",
"result": "minecraft:rabbit_stew{\"minecraft:custom_data\":{\"PublicBukkitValues\":{\"executableitems:ei-id\":\"jerboa_stew\",\"score:usage\":-1,\"dunerealms:quality\":\"very_rare\",\"dunerealms:equipment_mark\":\"9\",\"dunerealms:item_class\":\"consumable\",\"dunerealms:metadata_policy\":\"s1-item-metadata-v1\"}},\"minecraft:custom_name\":\"{\\\"text\\\":\\\"Jerboa stew\\\",\\\"color\\\":\\\"dark_purple\\\",\\\"italic\\\":false}\",\"minecraft:lore\":[\"{\\\"text\\\":\\\"VERY RARE | MK IX\\\",\\\"color\\\":\\\"gray\\\",\\\"italic\\\":false}\",\"{\\\"text\\\":\\\"S1 · ARRAKIS\\\",\\\"color\\\":\\\"gray\\\",\\\"italic\\\":false}\",\"{\\\"text\\\":\\\"Jerboa meat, enriched with contaminated spice.\\\",\\\"color\\\":\\\"gray\\\",\\\"italic\\\":false}\"]}",
"result": "minecraft:rabbit_stew[minecraft:custom_data={\"PublicBukkitValues\":{\"executableitems:ei-id\":\"jerboa_stew\",\"score:usage\":-1,\"dunerealms:quality\":\"very_rare\",\"dunerealms:equipment_mark\":\"9\",\"dunerealms:item_class\":\"consumable\",\"dunerealms:metadata_policy\":\"s1-item-metadata-v1\"}},minecraft:custom_name={\"text\":\"Jerboa stew\",\"color\":\"dark_purple\",\"italic\":false},minecraft:lore=[{\"text\":\"VERY RARE | MK IX\",\"color\":\"gray\",\"italic\":false},{\"text\":\"S1 · ARRAKIS\",\"color\":\"gray\",\"italic\":false},{\"text\":\"Jerboa meat, enriched with contaminated spice.\",\"color\":\"gray\",\"italic\":false}]]",
"itemCheckers": {
"itemCheckerType": "CUSTOM_CHECKS",
"checkAmount": false,

View file

@ -37,6 +37,6 @@
"animation": "EAT",
"sound": "ENTITY_GENERIC_EAT",
"hasConsumeParticles": true,
"consumeSeconds": 1.6
"consumeSeconds": 2
}
}

View file

@ -29,7 +29,7 @@
"foodFeatures": {
"isMeat": true,
"nutrition": 2,
"saturation": 1.2,
"saturation": 2,
"canAlwaysEat": false
},
"consumableFeatures": {
@ -37,6 +37,6 @@
"animation": "EAT",
"sound": "ENTITY_GENERIC_EAT",
"hasConsumeParticles": true,
"consumeSeconds": 1.6
"consumeSeconds": 2
}
}

View file

@ -38,6 +38,6 @@
"animation": "EAT",
"sound": "ENTITY_GENERIC_EAT",
"hasConsumeParticles": true,
"consumeSeconds": 1.6
"consumeSeconds": 2
}
}

View file

@ -1,6 +1,6 @@
plugins { java }
group = "com.dunerealms"
version = "0.5.10"
version = "0.5.11"
repositories { mavenCentral(); maven("https://repo.papermc.io/repository/maven-public/") }
dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.8-R0.1-SNAPSHOT")
@ -12,4 +12,3 @@ tasks.test { useJUnitPlatform() }
java { toolchain.languageVersion.set(JavaLanguageVersion.of(21)) }
tasks.withType<JavaCompile> { options.encoding = "UTF-8" }
tasks.jar { archiveFileName.set("jarvistranslator.jar") }

View file

@ -52,7 +52,7 @@ final class EquipmentLoreStyle implements Listener {
int q=QUALITIES.indexOf(quality);Component name=panels?LorePanels.row(q,0,card.name()):LorePanels.LEGACY.deserialize(card.name());
var lore=new ArrayList<Component>();lore.add(Component.empty());
lore.add(panels?LorePanels.row(q,1,card.lore().getFirst()):LorePanels.LEGACY.deserialize(card.lore().getFirst()));
lore.add(LorePanels.LEGACY.deserialize("&8S1 | Imperial Atelier"));lore.add(Component.empty());
lore.add(LorePanels.LEGACY.deserialize("&8S1 | STILLSUIT EQUIPMENT"));lore.add(Component.empty());
lore.add(LorePanels.LEGACY.deserialize("&7&oForged for the long desert."));lore.add(Component.empty());
var entries=card.lore().subList(6,card.lore().size());
lore.add(panels?LorePanels.row(q,2,colour(quality)+"&lENCHANTMENTS"):LorePanels.LEGACY.deserialize(colour(quality)+"&lENCHANTMENTS"));
@ -90,7 +90,7 @@ final class EquipmentLoreStyle implements Listener {
static ItemLoreCard.Card card(String quality,int mark,String title,Map<String,Integer> actual){
if(!valid(quality,mark))throw new IllegalArgumentException("Quality/MK mismatch");String colour=colour(quality),shade=shade(quality);var lines=new ArrayList<String>();
lines.add(colour+"&l"+quality.replace('_',' ').toUpperCase(Locale.ROOT)+" &r&8| "+shade+"&oMK "+roman(mark));
lines.add("&8S1 | Imperial Atelier");lines.add("");lines.add("&7&oForged for the long desert.");lines.add("");lines.add(colour+"&lENCHANTMENTS");
lines.add("&8S1 | STILLSUIT EQUIPMENT");lines.add("");lines.add("&7&oForged for the long desert.");lines.add("");lines.add(colour+"&lENCHANTMENTS");
actual.entrySet().stream().sorted(Comparator.<Map.Entry<String,Integer>>comparingInt(e->{int i=ENCHANT_ORDER.indexOf(e.getKey());return i<0?100:i;}).thenComparing(Map.Entry::getKey)).forEach(e->lines.add(colour+label(e.getKey())+" &r"+shade+"&o"+roman(e.getValue())));
if(actual.isEmpty())lines.add("&8None");
return new ItemLoreCard.Card(colour+"&l"+title.replaceAll("[§&][0-9a-fk-orA-FK-OR]", ""),List.copyOf(lines));

View file

@ -90,6 +90,20 @@ final class ExchangeInventory {
}return delivered;
});
}
int grantKit(Player p,UUID receipt,String fingerprint,List<ItemStack> items)throws Exception{
if(items.isEmpty()||items.size()>36||!fingerprint.matches("[a-f0-9]{64}"))throw new IllegalArgumentException("Invalid kit delivery");
return atomic(p,c->{
if(previous(c,receipt,p.getUniqueId(),"kit-grant",fingerprint)!=null)return 0;
int count=0;
for(var item:items){
if(item.isEmpty()||item.getAmount()<1||item.getAmount()>64||item.getItemMeta().getPersistentDataContainer().has(new NamespacedKey("dunerealms","preview_only")))throw new IllegalArgumentException("Invalid issued kit entry");
stamp.accept(item);
give(p,item,item.getAmount());
count+=item.getAmount();
}
record(c,receipt,p.getUniqueId(),"kit-grant",fingerprint,0);return count;
});
}
private static Long previous(Connection c,UUID id,UUID actor,String kind,String fingerprint)throws SQLException{
try(var q=prepare(c,"SELECT actor_uuid,kind,fingerprint,listing_id FROM dune_exchange_inventory_ops WHERE id=? FOR UPDATE")){q.setString(1,id.toString());try(var r=q.executeQuery()){if(!r.next())return null;if(!actor.toString().equals(r.getString("actor_uuid"))||!kind.equals(r.getString("kind"))||!fingerprint.equals(r.getString("fingerprint")))throw new IllegalArgumentException("This Exchange operation reference was already used.");return r.getLong("listing_id");}}
}

View file

@ -15,6 +15,11 @@ final class ItemDesignPreview {
ItemDesignPreview(ItemMetadataPolicy policy){this.policy=policy;}
ItemStack build(Player player,JsonObject response,boolean panels){
if(!Bukkit.isPrimaryThread()||!response.get("ok").getAsBoolean()||response.get("schema").getAsInt()!=1||!player.getUniqueId().toString().equals(response.get("playerUuid").getAsString())||!"draft".equals(response.get("state").getAsString()))throw new IllegalArgumentException("Invalid saved item preview");
return render(response,panels,false);
}
/** Called only by the console-only, centrally signed published-kit delivery. */
ItemStack issue(JsonObject definition,boolean panels){if(!Bukkit.isPrimaryThread())throw new IllegalStateException("Build items on the server thread");return render(definition,panels,true);}
private ItemStack render(JsonObject response,boolean panels,boolean issued){
var design=response.getAsJsonObject("design");var template=response.getAsJsonObject("template");
String id=design.get("templateId").getAsString(),materialName=template.get("material").getAsString().toUpperCase(Locale.ROOT);
var grade=policy.template(id,materialName);
@ -34,15 +39,24 @@ final class ItemDesignPreview {
var bound=bounds.getAsJsonObject(entry.getKey());int value=entry.getValue().getAsInt();if(value<bound.get("min").getAsInt()||value>bound.get("max").getAsInt()||value>255)throw new IllegalArgumentException("Enchantment is outside the saved item limits");
var enchantment=Registry.ENCHANTMENT.get(NamespacedKey.minecraft(entry.getKey()));if(enchantment==null)throw new IllegalArgumentException("Unsupported enchantment");meta.addEnchant(enchantment,value,true);actual.put(entry.getKey(),value);
}
meta.getPersistentDataContainer().set(new NamespacedKey("dunerealms","preview_only"),PersistentDataType.BYTE,(byte)1);item.setItemMeta(meta);
var data=meta.getPersistentDataContainer();
if(!issued)data.set(new NamespacedKey("dunerealms","preview_only"),PersistentDataType.BYTE,(byte)1);
else {
data.set(new NamespacedKey("dunerealms","quality"),PersistentDataType.STRING,grade.quality());data.set(new NamespacedKey("dunerealms","equipment_mark"),PersistentDataType.STRING,grade.mark());data.set(new NamespacedKey("dunerealms","item_class"),PersistentDataType.STRING,grade.itemClass());data.set(new NamespacedKey("dunerealms","metadata_policy"),PersistentDataType.STRING,ItemMetadataPolicy.VERSION);
boolean rocket=material==Material.FIREWORK_ROCKET&&Set.of("dr_s1_spice_rocket_mk1","dr_s1_refined_rocket_mk2","dr_s1_polluted_rocket_mk3").contains(id);
if(!Set.of("equipment","weapon","mining-tool","flight-equipment").contains(grade.itemClass())&&!rocket)throw new IllegalArgumentException("This kit entry needs its native consumable adapter");
if(rocket)((org.bukkit.inventory.meta.FireworkMeta)meta).setPower(id.equals("dr_s1_polluted_rocket_mk3")?4:id.equals("dr_s1_refined_rocket_mk2")?2:1);
if(id.matches("dr_s1_.*_(helmet|chestplate|leggings|boots)"))data.set(new NamespacedKey("executableitems","ei-id"),PersistentDataType.STRING,id);
}
item.setItemMeta(meta);
String colour=EquipmentLoreStyle.colour(grade.quality()),shade=EquipmentLoreStyle.shade(grade.quality());
meta=item.getItemMeta();meta.displayName(line(quality,0,colour+"&l"+design.get("name").getAsString(),panels));var lore=new ArrayList<Component>();lore.add(Component.empty());
lore.add(line(quality,1,colour+"&l"+grade.quality().replace('_',' ').toUpperCase(Locale.ROOT)+" &r&8| "+shade+"&oMK "+EquipmentLoreStyle.roman(Integer.parseInt(grade.mark())),panels));
lore.add(LorePanels.LEGACY.deserialize("&8S1 | Item design preview"));lore.add(Component.empty());
lore.add(LorePanels.LEGACY.deserialize(issued?"&8S1 | "+(grade.itemClass().equals("equipment")?"STILLSUIT EQUIPMENT":grade.itemClass().toUpperCase(Locale.ROOT)):"&8S1 | Item design preview"));lore.add(Component.empty());
var story=design.getAsJsonArray("lore");if(story.size()>6)throw new IllegalArgumentException("Too many lore lines");for(var entry:story){var row=entry.getAsJsonObject();String text=row.get("text").getAsString(),hex=row.get("color").getAsString();if(text.length()>120||!hex.matches("#[0-9a-fA-F]{6}"))throw new IllegalArgumentException("Invalid lore line");lore.add(Component.text(text,TextColor.fromHexString(hex)).decoration(TextDecoration.BOLD,row.get("bold").getAsBoolean()).decoration(TextDecoration.ITALIC,row.get("italic").getAsBoolean()));}
lore.add(Component.empty());lore.add(line(quality,2,colour+"&lENCHANTMENTS",panels));var rows=new ArrayList<String>();actual.forEach((key,value)->rows.add(colour+EquipmentLoreStyle.label(key)+" &r"+shade+"&o"+EquipmentLoreStyle.roman(value)));if(rows.isEmpty())rows.add("&8None");for(int i=0;i<rows.size();i++)lore.add(line(quality,i==rows.size()-1?4:3,rows.get(i),panels));
lore.add(Component.empty());var stats=EquipmentLoreStyle.stats(item);lore.add(line(quality,5,EquipmentLoreStyle.hex("78c6b0")+"&lSTATS",panels));for(int i=0;i<stats.size();i++)lore.add(line(quality,i==stats.size()-1?7:6,stats.get(i),panels));
lore.add(Component.empty());lore.add(LorePanels.LEGACY.deserialize("&8PREVIEW · NOT AN ISSUED ITEM"));meta.lore(lore);meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES,ItemFlag.HIDE_ENCHANTS);if(panels)meta.setTooltipStyle(new NamespacedKey("dunerealms","quality/"+grade.quality()));item.setItemMeta(meta);return item;
lore.add(Component.empty());lore.add(LorePanels.LEGACY.deserialize(issued?"&8J.A.R.V.I.S. | Published kit":"&8PREVIEW · NOT AN ISSUED ITEM"));meta.lore(lore);meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES,ItemFlag.HIDE_ENCHANTS);if(panels)meta.setTooltipStyle(new NamespacedKey("dunerealms","quality/"+grade.quality()));item.setItemMeta(meta);return item;
}
private Component line(int quality,int kind,String text,boolean panels){return panels?LorePanels.row(quality,kind,text):LorePanels.LEGACY.deserialize(text).decoration(TextDecoration.ITALIC,false);}
}

View file

@ -4,6 +4,7 @@ import java.io.IOException;
import java.util.*;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.TextDecoration;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
import org.bukkit.*;
import org.bukkit.entity.*;
@ -42,6 +43,14 @@ final class ItemMetadataOverlay implements Listener {
if(item==null||item.isEmpty()||!item.getType().isItem())return false;
var meta=item.getItemMeta();if(meta==null)return false;var data=meta.getPersistentDataContainer();
String engine=data.get(ENGINE_ID,PersistentDataType.STRING),legacy=data.get(LEGACY_ID,PersistentDataType.STRING);
if(engine!=null&&policy.stillsuit(engine,item.getType().name()))data.set(LEGACY_ID,PersistentDataType.STRING,"stillsuit");
if(item.getType()==Material.ORANGE_DYE&&"spice".equals(legacy)){
// Commodity drops must not differ by miner, House or price changes.
// Preserve Core's spice identity; do not add per-unit serial metadata.
meta.setMaxStackSize(64);
meta.displayName(Component.text("Melange Spice",NamedTextColor.GREEN).decoration(TextDecoration.ITALIC,false));
meta.lore(List.of(Component.text("Harvested from the sands of Arrakis.",NamedTextColor.GRAY).decoration(TextDecoration.ITALIC,true)));
}
var grade=engine==null?null:policy.template(engine,item.getType().name());
if(grade==null&&"spice".equals(legacy))grade=policy.template("spice",item.getType().name());
if(grade==null&&ItemMetadataPolicy.VERSION.equals(data.get(POLICY,PersistentDataType.STRING))){
@ -77,6 +86,9 @@ final class ItemMetadataOverlay implements Listener {
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void drag(InventoryDragEvent e){if(e.getWhoClicked() instanceof Player p)later(p);}
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void held(PlayerItemHeldEvent e){later(e.getPlayer());}
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void spawned(ItemSpawnEvent e){var item=e.getEntity().getItemStack();if(stamp(item))e.getEntity().setItemStack(item);}
@EventHandler(priority=EventPriority.MONITOR) public void loaded(com.destroystokyo.paper.event.entity.EntityAddToWorldEvent e){
if(e.getEntity() instanceof Item entity){var stack=entity.getItemStack();if(stack.getType()==Material.ORANGE_DYE&&"spice".equals(stack.getItemMeta().getPersistentDataContainer().get(LEGACY_ID,PersistentDataType.STRING))&&stamp(stack))entity.setItemStack(stack);}
}
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void pickup(EntityPickupItemEvent e){if(e.getEntity() instanceof Player p)later(p);}
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=true) public void moved(InventoryMoveItemEvent e){Bukkit.getScheduler().runTask(plugin,()->{inventory(e.getSource());inventory(e.getDestination());});}
@EventHandler(priority=EventPriority.HIGHEST,ignoreCancelled=true) public void smelt(FurnaceSmeltEvent e){var result=e.getResult().clone();stamp(result);e.setResult(result);}

View file

@ -21,6 +21,7 @@ final class ItemMetadataPolicy {
private record Template(String material,Grade grade){}
private final Map<String,Grade> nativeGrades=new HashMap<>();
private final Map<String,Template> templates=new HashMap<>();
boolean stillsuit(String id,String material){var grade=template(id,material);return grade!=null&&grade.itemClass().equals("equipment")&&material.matches("[A-Z_]+_(HELMET|CHESTPLATE|LEGGINGS|BOOTS)");}
ItemMetadataPolicy(InputStream input)throws IOException {
if(input==null)throw new IOException("Item template catalogue missing");
try(var reader=new InputStreamReader(input,StandardCharsets.UTF_8)){

View file

@ -20,6 +20,8 @@ public final class JarvisTranslator extends JavaPlugin implements Listener {
private GuildTransport guildTransport;
private ExchangeInventory exchangeInventory;
private QuestObservations questObservations;
private ItemMetadataOverlay itemMetadata;
private NativeKitGrant kitGrants;
public void citizenIntroduction(org.bukkit.entity.Player player){questObservations.introduce(player);}
public JsonObject requestExchange(UUID player,JsonObject input)throws Exception{if(!isEnabled()||player==null||input==null||input.has("uuid"))throw new IllegalArgumentException("Invalid Exchange request");var request=input.deepCopy();request.addProperty("uuid",player.toString());var response=api.exchange(request);if(response.has("rejectedStatus"))return response;if(!player.toString().equals(response.get("playerUuid").getAsString())||response.get("schema").getAsInt()!=1)throw new IllegalStateException("Invalid Exchange response");return response;}
public org.bukkit.inventory.ItemStack exchangeIcon(JsonObject row){return exchangeInventory.icon(row);}
@ -33,10 +35,11 @@ public final class JarvisTranslator extends JavaPlugin implements Listener {
@Override public void onEnable() {
Bukkit.getPluginManager().registerEvents(this,this);
new EquipmentLoreStyle(this);
try { var metadata=new ItemMetadataOverlay(this);exchangeInventory=new ExchangeInventory(item->metadata.stamp(item));itemPreview=new ItemDesignPreview(new ItemMetadataPolicy(getResource("item-templates.json"))); }
try { itemMetadata=new ItemMetadataOverlay(this);exchangeInventory=new ExchangeInventory(item->itemMetadata.stamp(item));itemPreview=new ItemDesignPreview(new ItemMetadataPolicy(getResource("item-templates.json"))); }
catch (java.io.IOException invalid) { throw new IllegalStateException("Shared item metadata catalogue is unavailable",invalid); }
api = new SharedGameApi(new File(getDataFolder().getParentFile(), "DuneEss/website-bridge.yml"));
serverKey=getConfig().getString("native.server-key",getDataFolder().getAbsoluteFile().getParentFile().getParentFile().getName().replace('_','-'));
kitGrants=new NativeKitGrant(this,exchangeInventory,itemPreview,serverKey);
questObservations=new QuestObservations(this,api,serverKey);
transport=new OrganisationTransport(this,api,serverKey);
guildTransport=new GuildTransport(this,api,serverKey);
@ -44,6 +47,10 @@ public final class JarvisTranslator extends JavaPlugin implements Listener {
work -> Bukkit.getScheduler().runTask(this, work),
command -> Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command));
Objects.requireNonNull(getCommand("jarvistranslator")).setExecutor((sender, command, label, args) -> {
if(args.length==2&&args[0].equalsIgnoreCase("grant-kit")){
if(!(sender instanceof org.bukkit.command.ConsoleCommandSender)){sender.sendMessage("Kit grants are server-console only.");return true;}
try{sender.sendMessage("J.A.R.V.I.S. kit grant "+kitGrants.execute(UUID.fromString(args[1])));}catch(Exception failure){sender.sendMessage("J.A.R.V.I.S. kit grant retained: "+failure.getMessage());}return true;
}
if(args.length==1&&args[0].equalsIgnoreCase("sync")&&nativeKeys!=null)nativeKeys.request();
sender.sendMessage("J.A.R.V.I.S. shared website API; native execution leaves player permissions unchanged.");
if(nativeKeys!=null)sender.sendMessage(nativeKeys.status());

View file

@ -0,0 +1,64 @@
package com.dunerealms.jarvis;
import com.google.gson.*;
import java.nio.file.*;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.*;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import org.bukkit.*;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.event.*;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
/** A fixed published-kit grant, centrally authorised and signed, never arbitrary commands. */
final class NativeKitGrant implements Listener {
private final Plugin plugin;private final ExchangeInventory inventory;private final ItemDesignPreview builder;private final String server;
NativeKitGrant(Plugin plugin,ExchangeInventory inventory,ItemDesignPreview builder,String server){this.plugin=plugin;this.inventory=inventory;this.builder=builder;this.server=server;Bukkit.getPluginManager().registerEvents(this,plugin);}
static JsonObject verified(JsonObject envelope,String secret,String server,UUID id,long now)throws Exception{
if(envelope.size()!=3||envelope.get("schema").getAsInt()!=1||secret.length()<32)throw new IllegalArgumentException("Invalid signed delivery");
String payload=envelope.get("payload").getAsString(),signature=envelope.get("signature").getAsString();
if(payload.length()>350000||!signature.matches("[a-f0-9]{64}"))throw new IllegalArgumentException("Invalid delivery signature");
var hmac=Mac.getInstance("HmacSHA256");hmac.init(new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8),"HmacSHA256"));
if(!MessageDigest.isEqual(hmac.doFinal(payload.getBytes(StandardCharsets.UTF_8)),HexFormat.of().parseHex(signature)))throw new IllegalArgumentException("Delivery signature rejected");
var data=JsonParser.parseString(new String(Base64.getDecoder().decode(payload),StandardCharsets.UTF_8)).getAsJsonObject();
long issued=data.get("issuedAt").getAsLong(),expires=data.get("expiresAt").getAsLong();
if(!"items.kitset-grant".equals(data.get("action").getAsString())||!server.equals(data.get("serverKey").getAsString())||!id.toString().equals(data.get("requestId").getAsString())||issued>now||now>=expires||expires-issued>900000||expires<=issued||data.getAsJsonArray("recipients").size()<1||data.getAsJsonArray("recipients").size()>2||data.getAsJsonArray("items").size()<1||data.getAsJsonArray("items").size()>36)throw new IllegalArgumentException("Delivery scope expired or changed");
var seen=new HashSet<UUID>();for(var recipient:data.getAsJsonArray("recipients")){var row=recipient.getAsJsonObject();if(!seen.add(UUID.fromString(row.get("uuid").getAsString())))throw new IllegalArgumentException("Duplicate recipient");UUID.fromString(row.get("receiptId").getAsString());}
return data;
}
String execute(UUID request)throws Exception {
if(!Bukkit.isPrimaryThread())throw new IllegalStateException("Deliver on the server thread");
Path folder=plugin.getDataFolder().toPath().resolve("grants"),file=folder.resolve(request+".json");
if(Files.isSymbolicLink(folder)||Files.isSymbolicLink(file)||Files.size(file)>400000)throw new IllegalArgumentException("Invalid delivery file");
var config=YamlConfiguration.loadConfiguration(new java.io.File(plugin.getDataFolder().getParentFile(),"DuneEss/website-bridge.yml"));
var data=verified(JsonParser.parseString(Files.readString(file)).getAsJsonObject(),config.getString("secret",""),server,request,System.currentTimeMillis());
var results=new JsonArray();
for(var recipient:data.getAsJsonArray("recipients")){
var row=recipient.getAsJsonObject();var id=UUID.fromString(row.get("uuid").getAsString());var result=new JsonObject();result.addProperty("uuid",id.toString());
var player=Bukkit.getPlayer(id);
if(player==null||!player.isOnline()){result.addProperty("state","queued-offline");results.add(result);continue;}
try{
var items=new ArrayList<ItemStack>();for(var entry:data.getAsJsonArray("items")){
var definition=entry.getAsJsonObject();int quantity=definition.get("quantity").getAsInt();if(quantity<1||quantity>64)throw new IllegalArgumentException("Invalid quantity");var item=builder.issue(definition,true);item.setAmount(quantity);items.add(item);
}
int n=inventory.grantKit(player,UUID.fromString(row.get("receiptId").getAsString()),ExchangeInventory.hash(data.get("grantFingerprint").getAsString()+"\n"+id),items);
result.addProperty("state",n==0?"already-delivered":"delivered");result.addProperty("items",n);
if(n>0)player.sendMessage("J.A.R.V.I.S. delivered "+data.get("kitName").getAsString()+" · complimentary stillsuit kit.");
}catch(Exception failure){result.addProperty("state","retained");result.addProperty("reason",failure.getMessage()==null?failure.getClass().getSimpleName():failure.getMessage());}
results.add(result);
}
Files.writeString(folder.resolve(request+".result.json"),results.toString());return results.toString();
}
@EventHandler(priority=EventPriority.MONITOR) public void joined(PlayerJoinEvent event){
Bukkit.getScheduler().runTaskLater(plugin,()->{
var folder=plugin.getDataFolder().toPath().resolve("grants");if(!Files.isDirectory(folder))return;
try(var files=Files.list(folder)){for(var file:files.filter(p->p.getFileName().toString().matches("[a-f0-9-]{36}\\.json")).limit(16).toList()){
try{execute(UUID.fromString(file.getFileName().toString().substring(0,36)));}catch(Exception ignored){/* Expired free grants never become automatic authority. */}
}}catch(java.io.IOException failure){plugin.getLogger().warning("Kit grant queue unavailable");}
},20);
}
}

View file

@ -1,6 +1,6 @@
name: JarvisTranslator
main: com.dunerealms.jarvis.JarvisTranslator
version: 0.5.10
version: 0.5.11
api-version: '1.21.8'
description: Shared J.A.R.V.I.S. website API and native server action translator.
softdepend: [SCore, ExecutableItems, ExecutableCrafting, DuneEss, ImageFrame, DecentHolograms, MedievalFactions, Towny]
@ -12,4 +12,3 @@ commands:
permissions:
dunerealms.jarvis.status:
default: op

View file

@ -27,4 +27,8 @@ class ItemMetadataPolicyTest {
assertThrows(IllegalArgumentException.class,()->new ItemMetadataPolicy.Grade("common","infinite","resource"));
assertThrows(IllegalArgumentException.class,()->new ItemMetadataPolicy.Grade("common","15","resource"));
}
@Test void onlyRegisteredMatchingKitArmorBecomesAStillsuit()throws Exception{
var p=policy();assertTrue(p.stillsuit("dr_s1_legendary_mk14_helmet","NETHERITE_HELMET"));
assertFalse(p.stillsuit("unregistered","NETHERITE_HELMET"));assertFalse(p.stillsuit("dr_s1_legendary_mk14_helmet","DIAMOND_HELMET"));assertFalse(p.stillsuit("spice","ORANGE_DYE"));
}
}

View file

@ -0,0 +1,18 @@
package com.dunerealms.jarvis;
import com.google.gson.*;
import java.nio.charset.StandardCharsets;
import java.util.*;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class NativeKitGrantTest {
static final UUID REQUEST=UUID.fromString("1fa03954-62cf-440a-b762-8b45924c3061");static final String SECRET="a".repeat(64);
JsonObject data(){return JsonParser.parseString("{\"action\":\"items.kitset-grant\",\"requestId\":\""+REQUEST+"\",\"serverKey\":\"lobby\",\"issuedAt\":1000,\"expiresAt\":2000,\"recipients\":[{\"uuid\":\"96d2f3d6-aa99-4f61-aa82-dc1920983422\",\"receiptId\":\"4c20d066-2795-4939-a12b-b7372dd9a31a\"}],\"items\":[{}]}").getAsJsonObject();}
JsonObject envelope(JsonObject data)throws Exception{String payload=Base64.getEncoder().encodeToString(data.toString().getBytes(StandardCharsets.UTF_8));var m=Mac.getInstance("HmacSHA256");m.init(new SecretKeySpec(SECRET.getBytes(StandardCharsets.UTF_8),"HmacSHA256"));var e=new JsonObject();e.addProperty("schema",1);e.addProperty("payload",payload);e.addProperty("signature",HexFormat.of().formatHex(m.doFinal(payload.getBytes(StandardCharsets.UTF_8))));return e;}
@Test void acceptsAnExactCurrentSignedGrant()throws Exception{assertEquals("lobby",NativeKitGrant.verified(envelope(data()),SECRET,"lobby",REQUEST,1500).get("serverKey").getAsString());}
@Test void expiryAndWrongWorldReject()throws Exception{var e=envelope(data());assertThrows(Exception.class,()->NativeKitGrant.verified(e,SECRET,"arrakis",REQUEST,1500));assertThrows(Exception.class,()->NativeKitGrant.verified(e,SECRET,"lobby",REQUEST,2000));}
@Test void modifiedPayloadRejects()throws Exception{var e=envelope(data());e.addProperty("payload",e.get("payload").getAsString()+"A");assertThrows(Exception.class,()->NativeKitGrant.verified(e,SECRET,"lobby",REQUEST,1500));}
@Test void duplicateRecipientsReject()throws Exception{var d=data();d.getAsJsonArray("recipients").add(d.getAsJsonArray("recipients").get(0).deepCopy());assertThrows(Exception.class,()->NativeKitGrant.verified(envelope(d),SECRET,"lobby",REQUEST,1500));}
@Test void anotherRequestCannotReplayTheManifest()throws Exception{assertThrows(Exception.class,()->NativeKitGrant.verified(envelope(data()),SECRET,"lobby",UUID.randomUUID(),1500));}
}

View file

@ -1,4 +1,4 @@
"""Switch only the five planet Core DB sections, preserving every plugin JAR."""
"""Switch Core only; preserve the legacy LuckPerms/CoreProtect tunnel on 13307."""
import pathlib,subprocess,yaml,json,re,urllib.parse,os,pwd
ROOT=pathlib.Path('/opt/dunerealms/servers')
NAMES=['arrakis','caladan','giedi_prime','kaitain','sigma_draconis_iv']
@ -10,7 +10,12 @@ def main():
staging=pathlib.Path('/root/dune-db-reconcile');central=yaml.safe_load((staging/'central-core.yml').read_text())['database']
uri=urllib.parse.urlparse(re.sub('^jdbc:','',central['jdbc-url']))
assert uri.hostname=='127.0.0.1' and uri.port==13308 and uri.path=='/dunegameplay'
target={k:central[k] for k in ['jdbc-url','username','password']};target['jdbc-url']=target['jdbc-url'].replace(':13308/',':13307/')
target={k:central[k] for k in ['jdbc-url','username','password']}
if 'useServerPrepStmts=' not in target['jdbc-url']:target['jdbc-url']+='&useServerPrepStmts=true'
old_tunnel=run('systemctl','cat','dune-db-tunnel.service')
assert 'dunegamedb@162.55.87.104' in old_tunnel and 'dev@91.107.196.242' not in old_tunnel,'Legacy plugin database routing must remain unchanged'
unit=pathlib.Path('/etc/systemd/system/dune-gameplay-db-tunnel.service')
assert not unit.exists(),'Inspect the existing central tunnel before retrying'
patches=[]
for name in NAMES:
path=ROOT/name/'plugins/DuneCore/config.yml';assert path.is_file() and not path.is_symlink()
@ -30,8 +35,7 @@ def main():
if recovery.exists():raise ValueError('This migration was already staged; inspect before retrying')
recovery.write_text(original);recovery.chmod(0o600)
tmp=path.with_name('config.yml.central-stage');tmp.write_text(changed);os.chown(tmp,uid.pw_uid,uid.pw_gid);tmp.chmod(path.stat().st_mode&0o777);tmp.replace(path)
drop=pathlib.Path('/etc/systemd/system/dune-db-tunnel.service.d/central.conf');drop.parent.mkdir(exist_ok=True)
drop.write_text('[Service]\nExecStart=\nExecStart=/usr/bin/ssh -NT -i /root/.ssh/dune-db-tunnel -o BatchMode=yes -o ExitOnForwardFailure=yes -o ServerAliveInterval=20 -o ServerAliveCountMax=3 -o StrictHostKeyChecking=yes -o UserKnownHostsFile=/root/.ssh/dune-central-known-hosts -L 127.0.0.1:13307:127.0.0.1:3306 dev@91.107.196.242\n')
run('systemctl','daemon-reload');run('systemctl','restart','dune-db-tunnel.service')
print(json.dumps({'configured':NAMES,'database':'central','pluginJars':'unchanged'}))
unit.write_text('[Unit]\nDescription=Central DuneRealms shared game storage\nAfter=network-online.target\nWants=network-online.target\n[Service]\nExecStart=/usr/bin/ssh -NT -i /root/.ssh/dune-db-tunnel -o BatchMode=yes -o ExitOnForwardFailure=yes -o ServerAliveInterval=20 -o ServerAliveCountMax=3 -o StrictHostKeyChecking=yes -o UserKnownHostsFile=/root/.ssh/dune-central-known-hosts -L 127.0.0.1:13308:127.0.0.1:3306 dev@91.107.196.242\nRestart=always\nRestartSec=5\n[Install]\nWantedBy=multi-user.target\n')
run('systemctl','daemon-reload');run('systemctl','enable','--now','dune-gameplay-db-tunnel.service')
print(json.dumps({'configured':NAMES,'database':'central:13308','otherPluginStorage':'original:13307','pluginJars':'unchanged'}))
if __name__=='__main__':main()

View file

@ -0,0 +1,26 @@
import pathlib,re,json,os,stat,time,sys
mode=sys.argv[1];names=['lobby'] if mode=='lobby' else ['arrakis','caladan','giedi_prime','kaitain','sigma_draconis_iv']
sections={'revert_on_unclaim','wild_revert_on_mob_explosion','wild_revert_on_block_explosion'}
for name in names:
base=pathlib.Path('/opt/dunerealms/lobby' if mode=='lobby' else '/opt/dunerealms/servers/'+name);p=base/'plugins/Towny/settings/config.yml';text=p.read_text();out=[];stack=[];found=set()
for line in text.splitlines(keepends=True):
m=re.match(r'^( *)([a-zA-Z0-9_-]+):\s*(.*?)(\r?\n)?$',line)
if m:
indent=len(m[1]);key=m[2];value=m[3]
while stack and stack[-1][0]>=indent:stack.pop()
path=[k for _,k in stack]+[key]
if len(path)==4 and path[:2]==['new_world_settings','plot_management'] and path[2] in sections and key=='enabled':
line=m[1]+key+": 'false'\n";found.add(path[2])
if not value or value.startswith('#'):stack.append((indent,key))
out.append(line)
assert found==sections,(name,found);p.write_text(''.join(out))
worlds=list((base/'plugins/Towny/data/worlds').glob('*.txt'));commands=['townyadmin reload config']
for world in worlds:
assert re.fullmatch('[a-zA-Z0-9_-]+',world.stem)
for feature in ['revertunclaim','revertentityexpl','revertblockexpl']:commands.append('townyworld '+world.stem+' toggle '+feature+' off')
fifo=base/'console.fifo';fd=os.open(fifo,os.O_WRONLY|os.O_NONBLOCK|os.O_NOFOLLOW);assert stat.S_ISFIFO(os.fstat(fd).st_mode)
try:
for cmd in commands:
data=(cmd+'\n').encode();assert os.write(fd,data)==len(data);time.sleep(0.15)
finally:os.close(fd)
print(json.dumps({'server':name,'futureWorldDefaults':'off','worlds':[w.stem for w in worlds],'commandsSent':len(commands)}),flush=True)

View file

@ -67,7 +67,9 @@ def sql_for(p,source):
columns=source['tables'][name]['columns']
for row in rows:sql.append('INSERT INTO `'+name+'`('+','.join('`'+c+'`' for c in columns)+') VALUES('+','.join(literal(v) for v in row)+');')
for key,value in p['schedule']:
sql.append('UPDATE dune_quest_definitions SET next_run_at='+literal(value)+' WHERE quest_key='+literal(key[0])+' AND next_run_at<'+literal(value)+';')
# Legacy tables use general_ci while the new server defaults to 0900.
# Quest identifiers are exact ASCII keys; compare bytes, not collations.
sql.append('UPDATE dune_quest_definitions SET next_run_at='+literal(value)+' WHERE BINARY quest_key=BINARY '+literal(key[0])+' AND next_run_at<'+literal(value)+';')
sql.append('COMMIT;');return '\n'.join(sql)
def main():

View file

@ -0,0 +1,37 @@
"""Guarded repair of a closed vanilla XP bar exactly at its next-level boundary.
Never touches inventory, balance, permissions, or arbitrary invalid profiles.
"""
import pathlib,json,hashlib,sys,re,urllib.parse,datetime
def vanilla_total(level):
if level<=16:return level*level+6*level
if level<=31:return (5*level*level-81*level+720)//2
return (9*level*level-325*level+4440)//2
def replacement(row):
if row['session_open']!=0 or not 0.999999<row['experience_progress']<=1.0 or not isinstance(row['experience_level'],int) or not 0<=row['experience_level']<100000:raise ValueError('Not an exact closed XP boundary')
level=row['experience_level']+1
if row['total_experience']!=vanilla_total(level):raise ValueError('XP total does not establish an exact next-level boundary')
return level,0.0
def main():
import yaml,pymysql
base=pathlib.Path(sys.argv[1]);expected=sys.argv[2] if len(sys.argv)>2 else None
d=yaml.safe_load((base/'plugins/DuneCore/config.yml').read_text())['database'];u=urllib.parse.urlparse(re.sub('^jdbc:','',d['jdbc-url']))
c=pymysql.connect(host=u.hostname,port=u.port,user=d['username'],password=d['password'],database=u.path.strip('/'),cursorclass=pymysql.cursors.DictCursor,autocommit=False)
try:
with c.cursor() as q:
q.execute('SELECT @@hostname AS host');assert q.fetchone()['host']=='ubuntu-4gb-fsn1-1'
# MySQL's FLOAT text protocol can print 0.99999958 as 1. Read full precision.
q.execute('SELECT uuid,experience_level,CAST(experience_progress AS DOUBLE) experience_progress,total_experience,session_open,inventory FROM dune_players WHERE experience_progress>0.999999 AND session_open=0 FOR UPDATE');rows=q.fetchall()
manifest=[]
for row in rows:
level,progress=replacement(row);manifest.append({'uuid':row['uuid'],'oldLevel':row['experience_level'],'level':level,'total':row['total_experience'],'inventoryHash':hashlib.sha256((row['inventory'] or '').encode()).hexdigest()})
fingerprint=hashlib.sha256(json.dumps(manifest,sort_keys=True).encode()).hexdigest()
if expected:
if expected!=fingerprint:raise ValueError('Profile repair plan changed')
for row in manifest:
q.execute('UPDATE dune_players SET experience_level=%s,experience_progress=0 WHERE uuid=%s AND experience_level=%s AND experience_progress>0.999999 AND total_experience=%s AND session_open=0',[row['level'],row['uuid'],row['oldLevel'],row['total']]);assert q.rowcount==1
q.execute('SELECT inventory FROM dune_players WHERE uuid=%s',[row['uuid']]);assert hashlib.sha256((q.fetchone()['inventory'] or '').encode()).hexdigest()==row['inventoryHash']
c.commit();receipt=base/'plugins/JarvisTranslator/xp-boundary-repair.json';receipt.write_text(json.dumps({'completed':datetime.datetime.now(datetime.timezone.utc).isoformat(),'planHash':fingerprint,'repairs':manifest},indent=2));receipt.chmod(0o600)
else:c.rollback()
print(json.dumps({'applied':bool(expected),'planHash':fingerprint,'profiles':[{k:v for k,v in r.items() if k!='uuid'} for r in manifest]}))
finally:c.close()
if __name__=='__main__':main()

Some files were not shown because too many files have changed in this diff Show more