Share exact Navigator request builders with contract fixtures
Some checks failed
Guild and Smuggler Navigator Build / navigator (push) Successful in 1m54s
DuneRealms Plugin CI / plugins (push) Failing after 3m11s

This commit is contained in:
unimatrixgit 2026-11-29 23:47:12 +01:00
commit d45fe6471c

View file

@ -92,9 +92,7 @@ final class QuestMenus implements Listener {
put(screen,13,offer.name(),"Smuggler fare: "+fare+"\nExisting unsanctioned arrival rules apply.",Material.COMPASS,null);
UUID requestId=UUID.randomUUID();
put(screen,31,"Confirm paid passage","Reserve this exact fare. Payment settles after arrival.",Material.LIME_DYE,()->{
var board=new JsonObject();board.addProperty("action","smuggler_board");board.addProperty("requestId",requestId.toString());
board.add("keyId",quote.get("keyId"));board.add("version",quote.get("version"));board.addProperty("fareMinor",offer.fareMinor());
board.addProperty("destination",offer.server());
var board=esmarBooking(quote,offer,requestId);
smugglerRequest(p,board,ticket->{try{bridge.dispatchGuild(p,ticket);}catch(Exception error){
p.sendMessage("The transfer was not dispatched; unused reservation expires.");
}});
@ -102,6 +100,11 @@ final class QuestMenus implements Listener {
put(screen,49,"Back","Smuggler Navigator",Material.ARROW,()->smugglerMenu(p,data,role));
show(p,screen);
}
static JsonObject esmarBooking(JsonObject quote,GuildRoutes.Offer offer,UUID requestId){
var board=new JsonObject();board.addProperty("action","smuggler_board");board.addProperty("requestId",requestId.toString());
board.add("keyId",quote.get("keyId"));board.add("version",quote.get("version"));board.addProperty("fareMinor",offer.fareMinor());
board.addProperty("destination",offer.server());return board;
}
private void smugglerOptIn(Player p,JsonObject data){
var introduction=data.getAsJsonArray("quests").asList().stream().map(JsonElement::getAsJsonObject)
.filter(q->text(q,"id","").equals("POL-SMUGGLERS-01")).findFirst().orElse(null);