Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions auctions.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ var (
ErrAuctionBidInvalid = runtime.NewError("auction bid invalid", 3) // INVALID_ARGUMENT
ErrAuctionCannotClaim = runtime.NewError("auction cannot be claimed", 3) // INVALID_ARGUMENT
ErrAuctionCannotCancel = runtime.NewError("auction cannot be cancelled", 3) // INVALID_ARGUMENT
ErrAuctionBidNotAllowed = runtime.NewError("auction bid not allowed", 7) // PERMISSION_DENIED
ErrAuctionBidItemsInvalid = runtime.NewError("auction bid items invalid", 3) // INVALID_ARGUMENT
)

// AuctionsConfig is the data definition for the AuctionsSystem type.
Expand All @@ -57,6 +59,7 @@ type AuctionsConfigAuctionCondition struct {
ExtensionThresholdSec int64 `json:"extension_threshold_sec,omitempty"`
ExtensionSec int64 `json:"extension_sec,omitempty"`
ExtensionMaxSec int64 `json:"extension_max_sec,omitempty"`
InstantComplete bool `json:"instant_complete,omitempty"`
Fee *AuctionsConfigAuctionConditionFee `json:"fee,omitempty"`
}

Expand All @@ -68,6 +71,7 @@ type AuctionsConfigAuctionConditionCost struct {

type AuctionsConfigAuctionConditionBid struct {
Currencies map[string]int64 `json:"currencies,omitempty"`
ItemCounts map[string]int64 `json:"item_counts,omitempty"`
}

type AuctionsConfigAuctionConditionBidIncrement struct {
Expand All @@ -92,7 +96,7 @@ type AuctionsSystem interface {
GetTemplates(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string) (*AuctionTemplates, error)

// List auctions based on provided criteria.
List(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, query string, sort []string, limit int, cursor string) (*AuctionList, error)
List(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, query string, directedAtMe bool, sort []string, limit int, cursor string) (*AuctionList, error)

// Bid on an active auction.
Comment thread
Calm0 marked this conversation as resolved.
Bid(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, sessionID, auctionID, version string, bid *AuctionBidAmount, marshaler *protojson.MarshalOptions) (*Auction, error)
Expand All @@ -107,7 +111,7 @@ type AuctionsSystem interface {
Cancel(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, auctionID string) (*AuctionCancel, error)

// Create a new auction based on supplied parameters and available configuration.
Create(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, templateID, conditionID string, instanceIDs []string, startTimeSec int64, items []*InventoryItem, overrideConfig *AuctionsConfigAuction) (*Auction, error)
Create(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID, templateID, conditionID string, instanceIDs []string, startTimeSec int64, allowedUserIDs []string, items []*InventoryItem, overrideConfig *AuctionsConfigAuction) (*Auction, error)

Comment thread
Calm0 marked this conversation as resolved.
// ListBids returns auctions the user has successfully bid on.
ListBids(ctx context.Context, logger runtime.Logger, nk runtime.NakamaModule, userID string, limit int, cursor string) (*AuctionList, error)
Expand Down
31 changes: 31 additions & 0 deletions hiro-openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4772,11 +4772,24 @@ components:
AuctionBidAmount:
type: object
properties:
instance_ids:
type: array
items:
type: string
items:
type: array
items:
$ref: '#/components/schemas/InventoryItem'
currencies:
type: object
additionalProperties:
type: integer
format: int64
itemCounts:
type: object
additionalProperties:
type: integer
format: int64
Comment thread
Calm0 marked this conversation as resolved.
AuctionFee:
type: object
properties:
Expand Down Expand Up @@ -4834,6 +4847,8 @@ components:
format: int64
fee:
$ref: '#/components/schemas/AuctionFee'
instant_complete:
type: boolean
AuctionTemplate:
type: object
properties:
Expand Down Expand Up @@ -4949,6 +4964,12 @@ components:
type: array
items:
$ref: '#/components/schemas/AuctionBid'
allowed_user_ids:
type: array
items:
type: string
instant_complete:
type: boolean
AuctionNotificationBid:
type: object
properties:
Expand Down Expand Up @@ -4998,6 +5019,10 @@ components:
type: array
items:
$ref: '#/components/schemas/InventoryItem'
received_items:
type: array
items:
$ref: '#/components/schemas/InventoryItem'
AuctionCancel:
type: object
properties:
Expand Down Expand Up @@ -5028,6 +5053,8 @@ components:
format: int64
cursor:
type: string
directed_at_me:
type: boolean
AuctionBidRequest:
type: object
properties:
Expand Down Expand Up @@ -5066,6 +5093,10 @@ components:
start_time_sec:
type: integer
format: int64
allowed_user_ids:
type: array
items:
type: string
AuctionListBidsRequest:
type: object
properties:
Expand Down
Loading
Loading