Erebus Market and delivery flow
Core purchase lifecycle
The marketplace is server authoritative. Purchases and order transitions are validated on the server, with money, inventory, and database changes happening in the server/sv_*.lua modules.
The normal order flow is:
escrowed -> deposited -> completed
Additional terminal states include:
refundedexpiredcancelledseized
Listing flow
- Seller creates a listing.
- The listing is validated against fee, item, and reputation rules.
- Buyer purchases the listing and funds are escrowed.
- A drop location is selected.
- Seller receives the deposit deadline.
- Buyer receives pickup instructions after a successful deposit and any configured delay.
Dead-drop locations
Dead-drops are defined in Config.Delivery.locations and selected server-side. Current repo defaults use a random strategy, enforce one active order per location, and avoid immediate vendor repeats.
Direct transfer vs stash mode
Direct transfer
Used when:
useInventoryStash = false- the active inventory is not
ox_inventory - listing-time item removal makes stash deposit unnecessary
- claim-time item granting is disabled
Stash mode
Used when:
Config.Delivery.useInventoryStash = true- the detected inventory is
ox_inventory
Vendor flow:
- Interact with the dead-drop prop.
prepareDepositStashvalidates the order and registersskryptzos_drop_<orderId>.- The stash opens empty.
- Seller places the ordered items inside.
finalizeDepositvalidates the stash contents and moves the order todeposited.
Buyer flow:
- Interact with the dead-drop prop.
preparePickupStashregisters the stash and loads the ordered items.- Buyer removes the full contents.
finalizePickupconfirms the stash is empty and completes the order.
Offline timers and delayed pickup
If the vendor or buyer is offline at the relevant phase, deadlines are paused by storing NULL deadlines. When the player returns, ActivateDeferredOrders applies a fresh timer and sends the matching client event.
The current config also delays buyer coordinates for five minutes after deposit by default.
Ratings and payouts
- sellers gain reputation on successful sales
- buyers can submit one rating per order
- offline seller payout and offline buyer refund are processed in timer loops
seller_paidandbuyer_refundedguard against duplicate processing
The current repo also supports police dead-drop seizure targets through the law enforcement flow when drop interception is enabled.