Skip to content

Doobzi/DoobzisDeepSleep

Repository files navigation

Doobzi's Deep Sleep

A Rust-inspired offline loot plugin for Unturned
Built for RocketMod v4 • .NET Framework 4.8

Version Platform Framework Game License


Table of Contents


✨ Features

Feature Details
Mannequin Display When a player disconnects, a mannequin spawns at their position wearing their actual clothing — shirt, pants, vest, hat, backpack, mask, glasses — all visible to every player on the server
Lootable Plaque A plaque (storage) spawns next to the mannequin holding all of the player's inventory items. Other players can raid it while the owner is offline
Lock System Mannequin + plaque spawn as locked barricades (metal mannequin / locked plaque) for a configurable duration, preventing looting until the lock expires
Auto-Restore When the owner reconnects, all remaining items are restored to their inventory, clothing is re-equipped, and the mannequin + plaque are removed
Loot Diff On reconnect, the player is told exactly how many items were taken while they were away
Despawn Timer Old sleepers are automatically cleaned up after a configurable number of hours
Snapshot Tracking Inventory is polled every 5 seconds while online, so disconnects (even crashes) never lose data
Server Restart Recovery After a server restart, orphaned mannequins + plaques are automatically re-linked to their sleeper entries
Discord Webhooks Optional real-time notifications for disconnect, loot diff, and despawn events posted to your Discord channel
Fully Configurable Mannequin/plaque IDs, lock duration, plaque position & rotation offsets, mannequin pose, despawn hours, bypass permissions, and more — all from one XML config
Admin Commands List, inspect, remove, restore, or clear all sleepers with /sleeper

🔄 How It Works

Player disconnects
    ↓
Inventory + clothing captured
    ↓
Mannequin spawns with clothing baked into barricade state
Plaque spawns with inventory items inside
    ↓
(Optional) Both are locked for X minutes
    ↓
Other players can loot the plaque once unlocked
    ↓
Player reconnects
    ↓
Remaining items restored → mannequin + plaque destroyed
    ↓
Player is told what was taken (loot diff)

📦 Installation

Quick Install (Recommended)

  1. Download the latest release from the Releases page
  2. Copy DoobzisDeepSleep.dll into your server's Rocket/Plugins/ folder
  3. Restart your server
  4. The plugin will auto-generate its config file at:
    Rocket/Plugins/DoobzisDeepSleep/DoobzisDeepSleep.configuration.xml
    
  5. Edit the config to your liking, then restart or reload

Note: The plugin uses Unturned's built-in mannequin (1408/1409) and plaque (1412/1413) barricades. No custom workshop items needed.


🔨 Building from Source

git clone https://github.com/Doobzi/DoobzisDeepSleep.git
cd DoobzisDeepSleep
dotnet build -c Release

The compiled DLL will be at bin/Release/net48/DoobzisDeepSleep.dll.

All dependencies (RocketMod, Unturned) are pulled automatically via NuGet — no manual DLL copying required.


🎮 Commands

Sleeper Management

Command Alias Permission Description
/sleeper list /deepsleep list deepsleep.admin Show all active sleepers with item counts and position
/sleeper info <player> /deepsleep info deepsleep.admin Detailed info for a specific sleeper (items, clothing, time offline)
/sleeper remove <player> /deepsleep remove deepsleep.admin Force-remove a sleeper's mannequin + plaque
/sleeper restore <player> /deepsleep restore deepsleep.admin Force-restore items from JSON data to an online player
/sleeper clear /deepsleep clear deepsleep.admin Remove ALL sleepers from the map

Tip: The <player> argument accepts both player names (partial match) and Steam IDs.


⚙️ Configuration

The plugin generates a fully-structured XML config at: Rocket/Plugins/DoobzisDeepSleep/DoobzisDeepSleep.configuration.xml

General Settings

Setting Default Description
Enabled true Master switch — turn the whole plugin on/off
IncludeClothing true Save and display clothing on the mannequin
BypassPermission deepsleep.bypass Players with this permission won't have sleepers created

Spawning Settings

Setting Default Description
MannequinId 1408 Cloth mannequin barricade ID
PlaqueId 1412 Unlocked plaque barricade ID (storage)
MannequinPose 0 Mannequin pose byte (0 = default)
PlaqueOffsetX 0 Plaque X offset from mannequin position
PlaqueOffsetY 0.25 Plaque Y (height) offset from mannequin position
PlaqueOffsetZ 0 Plaque Z offset from mannequin position
PlaqueRotationX 180 Plaque euler rotation X
PlaqueRotationY 90 Plaque euler rotation Y
PlaqueRotationZ 0 Plaque euler rotation Z

Locking Settings

Setting Default Description
LockEnabled true Lock mannequin + plaque on spawn
LockDurationMinutes 30 Minutes before the lock auto-expires and barricades swap to unlocked
LockedMannequinId 1409 Metal (locked) mannequin barricade ID
LockedPlaqueId 1413 Locked plaque barricade ID

Notification Settings

Setting Default Description
ShowRestoredMessage true Tell the player their loot was restored on reconnect
LootDiffEnabled true Show a diff of what was taken while they were away

Despawn Settings

Setting Default Description
DespawnEnabled true Auto-remove old sleepers
DespawnAfterHours 24 Hours before a sleeper is cleaned up

Discord Webhook Settings

Setting Default Description
WebhookEnabled false Send events to a Discord webhook
WebhookUrl "" Your Discord webhook URL
NotifyOnDisconnect true Notify when a player disconnects and loot is saved
NotifyOnLootDiff true Notify when someone takes items from a sleeper
NotifyOnDespawn true Notify when a sleeper despawns

🔐 Permissions

Add these to your Permissions.config.xml to control access.

All Permission Nodes

Permission Role Used By
deepsleep.admin Admin /sleeper list, /sleeper info, /sleeper remove, /sleeper restore, /sleeper clear
deepsleep.bypass Player Players with this permission are excluded from the sleeper system entirely

Recommended Admin Group

<Group>
  <Id>admin</Id>
  <DisplayName>Admin</DisplayName>
  <Prefix />
  <Suffix />
  <Color>red</Color>
  <Members />
  <Permissions>
    <Permission>deepsleep.admin</Permission>
  </Permissions>
  <Priority>100</Priority>
</Group>

Recommended Bypass Group (e.g. VIPs)

<Group>
  <Id>vip</Id>
  <DisplayName>VIP</DisplayName>
  <Prefix />
  <Suffix />
  <Color>yellow</Color>
  <Members />
  <Permissions>
    <Permission>deepsleep.bypass</Permission>
  </Permissions>
  <Priority>50</Priority>
</Group>

💾 Data Storage

All data is stored as a JSON file in Rocket/Plugins/DoobzisDeepSleep/:

File Contents
sleepers.json All active sleeper entries — player info, position, items, clothing, timestamps

The file is updated on every disconnect, reconnect, lock expiry, and despawn event. After a server restart, orphaned mannequins and plaques are automatically re-linked to their entries.


🔔 Discord Integration

Send real-time notifications to your Discord server:

  1. In your Discord server, go to Channel Settings → Integrations → Webhooks
  2. Create a new webhook and copy the URL
  3. Paste the URL into the config under Discord > WebhookUrl
  4. Set Discord > WebhookEnabled to true
  5. Toggle individual event types on/off as needed

Supported events:

  • 🔌 Player disconnected (sleeper created)
  • 📦 Loot diff (items taken from a sleeper)
  • 💀 Sleeper despawned (auto-cleanup)

❓ Troubleshooting

Mannequin spawns but clothing doesn't show

This plugin bakes clothing directly into the mannequin's barricade state bytes before spawning. If clothing still doesn't show:

  • Make sure IncludeClothing is set to true in the config
  • Verify the player actually had clothing equipped when they disconnected
  • Check the server console for [DeepSleep] log messages
Plaque is in a weird position

Adjust PlaqueOffsetX, PlaqueOffsetY, PlaqueOffsetZ and the rotation values in the Spawning config section. The offset is relative to the mannequin's position.

Plugin doesn't load
  • Make sure DoobzisDeepSleep.dll is in Rocket/Plugins/
  • Check that you're running Unturned 3.x with RocketMod v4
  • Look at the server console for error messages on startup
Items not restoring on reconnect
  • Check that the sleepers.json file exists and contains the player's data
  • Use /sleeper info <player> to inspect the entry
  • Use /sleeper restore <player> to force-restore manually

📄 License

This project is provided as-is for use on Unturned servers. Feel free to modify and distribute.


Made with ❤️ by Doobzi

About

Doobzi's Deep Sleep - A Rust-inspired offline loot plugin for Unturned (RocketMod v4)

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages