Share exact Navigator request builders with contract fixtures
This commit is contained in:
parent
9baca377a7
commit
d45fe6471c
1 changed files with 47 additions and 18 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff