v2.0.1 security
No more item and money duplication, and machines only work up close
15changes

No more item and money duplication, and machines only work up close
15changes

[02] Release
Players can no longer duplicate items or money by buying, restocking, withdrawing earnings or selling a machine at the same time, and can no longer buy from machines far away. Robberies are locked per machine, the creator no longer crashes with numeric job grades, and the server console now tells you when a new version is out.
vending_machines by itself. Your machines, owners and earnings are kept.config/main.lua keeps working. Two defaults changed, so check them if you copy the new file:
Config.Debug is now false.Config.Robbery.allowSelfRobbery is now false (owners can no longer rob their own machine).Config.AllowAnyRoutingBucket = true. Set it to false to allow machines only in routing bucket 0.custom/, server/custom/inventory/ or locales/locale.lua, compare them with the new versions. They changed in this update.Config.Phone.allowRemotePurchase is enabled.[vending-machine] v2.0.1 | up to date. When a newer version is out, it shows the update type, urgency and the most important changes, and checks again every 30 minutes.Replace every file in the resource, except what you edited yourself:
fxmanifest.luaconfig/main.lualocales/locale.luashared/functions.luashared/utils.luacustom/server.luacustom/esx/server.luacustom/qb/server.luaclient/modules/creator/nui.luaclient/modules/gameplay.luaclient/modules/helper.luaclient/modules/raycast.luaclient/modules/scaleform.luaserver/main.luaserver/ownership.luaserver/phone.luaserver/purchase.luaserver/robbery.luaserver/custom/inventory/codem.luaserver/custom/inventory/origen.luaserver/custom/inventory/qb.luaserver/custom/inventory/qs.luaserver/modules/creator.luaserver/modules/db/vending.luaserver/modules/locks.lua (new)server/modules/selfcheck.lua (new)server/modules/throttle.lua (new)server/modules/updater.lua (new)web/*Buying, restocking, withdrawing earnings and selling a machine at the same moment could give items or money twice. Each player and machine is now handled one action at a time, and if delivering the item or saving to the database fails, the money, items and stock are returned.
Players could buy from a machine anywhere on the map. Purchases now need you within 8 meters and in the same routing bucket. Buying from the phone still works when Config.Phone.allowRemotePurchase is enabled.
Buying, restocking, setting prices, collecting earnings, selling and robbing a machine now need you next to it and in the same routing bucket.
Only one player can rob a machine at a time, and the lockpick is checked again before the robbery pays out. The lock is released if the robber disconnects or changes character.
Other players with creator access can no longer add weapon items or set a price below 1. The teleport-to-machine action now checks permissions on the server too.
Players who spam purchase, restock or robbery actions are slowed down, so they can't flood the server.
Players see a clear message when the machine is busy, they are too far away, or the database failed.
The console warns you on startup if a dependency or setting is missing.
The resource checks for updates on startup and every 30 minutes. When you are behind, the console shows your version, the latest one, the update type, urgency and the most important changes.
On startup the resource adds any missing columns safely, works on MySQL 8.0+, and reads for_sale and robbable correctly as true/false.
The UI uses its bundled font and no longer loads Google Fonts.
Config.Debug and Config.Robbery.allowSelfRobbery are now false. New option Config.AllowAnyRoutingBucket (true by default).
The permission check crashed when Config.CreatorJobs used a number for the grade.
The free camera works again with the new Lua runtime.
The qs, qb, codem and origen inventory adapters edited the shared items list (QBCore.Shared.Items / ESX.Items) in place and could break item images in other resources. They now work on a copy.