Skip to content

Tamper-sealed Cargo orders: You Will (Not) Deliver#4764

Open
redmushie wants to merge 45 commits into
ss14Starlight:starlight-devfrom
redmushie:feature/locked-orders
Open

Tamper-sealed Cargo orders: You Will (Not) Deliver#4764
redmushie wants to merge 45 commits into
ss14Starlight:starlight-devfrom
redmushie:feature/locked-orders

Conversation

@redmushie

@redmushie redmushie commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Short description

Makes almost every type of order you can submit though cargo locked to the department that ordered it.

  • Opening the seal requires the matching departments' access.
    • This rewards cargo 10% of the order value.
  • Destroying the seal has a long do-after using your hands, or a shorter do-after if you have the matching tool.
    • A destroyed seal makes Cargo refund 20% of the order price to the purchasing department.

The only types of orders that aren't covered are large Science artifacts and large instruments.

Why we need to add this

TL;DR: Apparently it's a very common problem that Cargo fails to deliver, or even steals orders for themself (e.g.: Salvage taking advanced medkits that Medical ordered).

Media (Video/Screenshots)

Tamper-sealed containers

Three kinds of containers are supported, and will be equipped with a departmental tamper seal upon summoning:

  • Canisters
  • Crates
    • Regular ones, but also..
    • Freezers
    • Toy boxes
    • Pirate chests
  • Livestock crates
image image

Opening seals

2026-06-19.14-26-47.mp4

Examine text

Currently only when unsealed.

image

Integrity tracking

If >30% of orders have their tamper seals destroyed, the ITG informs the station.

image

Admin logging

image image

Todos

  • Fix access denied locale key
  • Disable penalties and rewards if DelivererAccount == RecipientAccount
  • Re-add buzzing noise when destroying a seal
  • Count full-on destruction of an entity as the seal being destroyed.
  • Count deconstruction of an entity as the seal being destroyed. Prevent deconstruction while tamper-sealed.
  • Make the "destroy-begin" text big and white
  • Make the "destroy-end" text big and red
  • Track how many are destroyed
  • Announce when too many are destroyed in a certain timeframe
  • Admin logging for fund changes
  • Ensure cyborgs can only open crates belonging to their department? Opted not to do anything to this end for now.

Checks

  • I do not require assistance to complete the PR.
  • Before posting/requesting review of a PR, I have verified that the changes work.
  • I have added screenshots/videos of the changes, or this PR does not change in-game mechanics.
  • I affirm that my changes are licensed under the MIT License and grant permission for use in this repository under its conditions.

Changelog

🆑 redmushie

  • add: Tamper-sealed cargo orders! Only the department that ordered something can open it without incurring a penalty.
  • add: Opening a tamper-sealed order rewards Cargo with 10% of the order price.
  • add: Destroying a tamper-sealed order penalizes Cargo for 10% of the order price, and refunds the ordering department 50% at Cargo's expense.
  • add: Cyborgs can open tamper-sealed orders belonging to their departments.
  • add: The Interstellar Trade Guild will warn the station if a lot of tamper seals are destroyed.

@github-actions github-actions Bot added S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. S: Needs Review Status: Requires additional reviews before being fully accepted. Not to be replaced by S: Approved. Changes: Sprites Changes: C# Changes: Prototypes size/M and removed S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. S: Needs Review Status: Requires additional reviews before being fully accepted. Not to be replaced by S: Approved. labels Jun 13, 2026

@Conflee Conflee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sprites approved.

@redmushie redmushie force-pushed the feature/locked-orders branch from 6c17f8a to e2795e8 Compare June 14, 2026 05:43
@redmushie redmushie changed the title Tamper-sealed Cargo orders: You Will (Not) Steal Tamper-sealed Cargo orders: You Will (Not) Deliver Jun 14, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 19, 2026
@redmushie

Copy link
Copy Markdown
Contributor Author

@coderabbitai Re-review

@coderabbitai

This comment was marked as outdated.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 19, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
Content.Server/Cargo/Systems/CargoSystem.Orders.cs (1)

681-693: 💤 Low value

Nice work on the tamper seal integration! The conditional sealing logic is clean and the component wiring is well-structured.

Minor: Consider defensively copying the HashSet to avoid shared mutable state.

Line 693 assigns the DestroyToolQualities HashSet by reference. If multiple entities are spawned from the same prototype, they'll share the same HashSet instance. While the downstream code only reads this set (never mutates it), a defensive copy would prevent subtle bugs if future changes introduce mutations.

🛡️ Suggested defensive copy
-            seal.DestroyToolQualities = tamperSealable.DestroyToolQualities;
+            seal.DestroyToolQualities = new HashSet<ProtoId<ToolQualityPrototype>>(tamperSealable.DestroyToolQualities);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Content.Server/Cargo/Systems/CargoSystem.Orders.cs` around lines 681 - 693,
In the TamperSealComponent initialization block, the DestroyToolQualities
property is being assigned by reference from the tamperSealable component. To
prevent shared mutable state issues across multiple entities, apply a defensive
copy pattern similar to what is already done for seal.Accesses. Replace the
direct assignment of seal.DestroyToolQualities with a new HashSet instance that
copies the contents from tamperSealable.DestroyToolQualities, ensuring each
entity has its own independent copy of the collection.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@Content.Server/Cargo/Systems/CargoSystem.Orders.cs`:
- Around line 681-693: In the TamperSealComponent initialization block, the
DestroyToolQualities property is being assigned by reference from the
tamperSealable component. To prevent shared mutable state issues across multiple
entities, apply a defensive copy pattern similar to what is already done for
seal.Accesses. Replace the direct assignment of seal.DestroyToolQualities with a
new HashSet instance that copies the contents from
tamperSealable.DestroyToolQualities, ensuring each entity has its own
independent copy of the collection.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 35e2cd0b-f6c4-48bb-a02f-9f3cb74b2e17

📥 Commits

Reviewing files that changed from the base of the PR and between 6cf18b7 and 40b7ddd.

📒 Files selected for processing (10)
  • Content.Server/Cargo/Systems/CargoSystem.Orders.cs
  • Content.Shared/_Starlight/CCVar/StarlightCCVars.Cargo.cs
  • Content.Shared/_Starlight/Cargo/TamperSeal/Components/TamperSealComponent.cs
  • Content.Shared/_Starlight/Cargo/TamperSeal/Components/TamperSealValueComponent.cs
  • Content.Shared/_Starlight/Cargo/TamperSeal/Components/TamperSealableComponent.cs
  • Content.Shared/_Starlight/Cargo/TamperSeal/SharedTamperSealSystem.cs
  • Resources/Locale/en-US/_Starlight/cargo/tamper-seal.ftl
  • Resources/Prototypes/Entities/Structures/Storage/Canisters/gas_canisters.yml
  • Resources/Prototypes/Entities/Structures/Storage/Crates/base_structurecrates.yml
  • Resources/Prototypes/Entities/Structures/Storage/Crates/crates.yml
🚧 Files skipped from review as they are similar to previous changes (7)
  • Content.Shared/_Starlight/CCVar/StarlightCCVars.Cargo.cs
  • Content.Shared/_Starlight/Cargo/TamperSeal/Components/TamperSealValueComponent.cs
  • Resources/Prototypes/Entities/Structures/Storage/Crates/base_structurecrates.yml
  • Resources/Locale/en-US/_Starlight/cargo/tamper-seal.ftl
  • Resources/Prototypes/Entities/Structures/Storage/Crates/crates.yml
  • Content.Shared/_Starlight/Cargo/TamperSeal/Components/TamperSealComponent.cs
  • Content.Shared/_Starlight/Cargo/TamperSeal/SharedTamperSealSystem.cs

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 19, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 19, 2026
@redmushie

Copy link
Copy Markdown
Contributor Author

@Rinary1 Need your review on this one since I made it

@starlightgithub starlightgithub Bot added S: Approved Status: Reviewed and approved by at least one maintainer or dev; a PR may require another approval. and removed S: Needs Review Status: Requires additional reviews before being fully accepted. Not to be replaced by S: Approved. labels Jun 21, 2026
@Rinary1 Rinary1 enabled auto-merge June 21, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changes: C# Changes: Prototypes Changes: Sprites S: Approved Status: Reviewed and approved by at least one maintainer or dev; a PR may require another approval. size/L T: New Content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants