AlAuctions is a simple game-independent auction house server. It serves as a base api, that needs to be implemented and configured.
public class AlauctionsServerExampleImpl {
enum ItemType {
WEAPON,
CONSUMABLE
}
@Getter
static class Item extends AuctionItem {
@OpenApiName("item_name")
private final @NotNull String itemName;
@OpenApiName("item_type")
private final @NotNull ItemType itemType;
@JsonCreator
public Item(@NotNull @JsonProperty("item_id") String itemId,
@NotNull @JsonProperty("item_name") String itemName,
@NotNull @JsonProperty("item_type") ItemType itemType) {
super(itemId);
this.itemName = itemName;
this.itemType = itemType;
}
}
public static void main(String[] args) {
AlauctionServer<Item> server = new AlauctionServer<>(((config, logger) -> config
.addAuctionHouse("auction-1", logger, ahConfig -> ahConfig
.withMinSeconds(1)
.withMaxSeconds(1000)
.withGracePeriodSeconds(30))
.addAuctionHouse("auction-2", logger, ahConfig -> ahConfig
.withMinSeconds(100)
.withMaxSeconds(1000)
.withMaxSeconds(30))
.withOpenApi(true, "mailto:amraleth@proton.me")
.withPort(5555)
), Item.class);
server.startServer();
}
}