After 1st septemer bug

hey, i have a problem, after 1st september update, when server restarted, you can dupe your inventory when you die on first 5-10 min after restart

Can you elaborate on this? Do you have to do anything before the server restarts, or do you just die before the first server save? Does this work every time the server is restarted, or only right after a wipe?

This happens after restart. In the first 5-10 minutes after restart when you die, or do suicide there is a chance that all loot will remain in the corpse, but it will also be restored upon resurrection. So you receive twice all loot :)

Ok, I'm pretty sure the patch I submitted for review yesterday will fix this issue. I'll test to confirm, and submit a new patch if necessary.

Merged post

Below are the steps I took to reproduce inventory duplication around the time of server reboots. This is the only way I can see this issue happening.

  1. Die, but don't respawn. Restore Upon Death will cache your inventory information in memory, then it will delete your items. At this point, the only record of your inventory is in the plugin memory, since it hasn't written to the data file yet.
  2. Server saves. Restore Upon Death will write its saved cache of your inventory to the data file.
  3. Respawn (shortly before the server reboots). Restore Upon Death will restore your inventory from the memory cache, and will clear the cache. The data file will still have a copy of your inventory until the server saves again.
  4. Shut down the server (before the server saves). This unloads Restore Upon Death without writing the cache to the data file, then the server performs a normal save which records your inventory. At this point, your inventory is saved in two places: in the server save file, and in the plugin data file.
  5. Boot the server and connect. You will still have the items previously saved by Rust. Restore Upon Death will do nothing besides read its data file to cache it into memory.
  6. Die. Restore Upon Death will see that you have saved data and will do nothing. All your items will stay on your corpse.
  7. Respawn. Restore Upon Death will restore your inventory from the saved data. Your corpse still has the duplicate items from earlier.
What's weird is that this requires the player to be dead during a server save (any save, as long as they don't respawn), then to respawn after the last server save that occurs before the server shuts down (e.g., respawn in the last 10 minutes). I find it pretty unlikely that you are running into this by accident, but I could imagine players intentionally timing this with scheduled restarts. Another thing that makes this unlikely to be what you are encountering is that it won't matter when you rejoin the server after the reboot, which doesn't align with the details you provided, since you both stated that this only occurs if you die within the first 5-10 minutes, not the last 5-10 minutes.

This particular exploit is resolved in the patch I submitted since I made it so that the plugin will save the data file when it unloads. That is the same mitigation I applied to Backpacks 2 years ago when a similar exploit was reported.

Please let me know if you see any other ways duplication could happen, or if you can provide exact reproduction steps, since my steps above don't match the details both of you provided.