Skip to content

Commit

Permalink
Mirror: Adds logging for refunds (#275)
Browse files Browse the repository at this point in the history
## Mirror of PR #26274: [Adds logging for
refunds](space-wizards/space-station-14#26274)
from <img src="https://avatars.githubusercontent.com/u/10567778?v=4"
alt="space-wizards" width="22"/>
[space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14)

###### `85f4b43db1c0256e6d4c48a01558e8cc0a883ada`

PR opened by <img
src="https://avatars.githubusercontent.com/u/54602815?v=4"
width="16"/><a href="https://github.com/keronshb"> keronshb</a> at
2024-03-19 23:42:22 UTC

---

PR changed 2 files with 4 additions and 0 deletions.

The PR had the following labels:
- Status: Needs Review


---

<details open="true"><summary><h1>Original Body</h1></summary>

> <!-- Please read these guidelines before opening your PR:
https://docs.spacestation14.io/en/getting-started/pr-guideline -->
> <!-- The text between the arrows are comments - they will not be
visible on your PR. -->
> 
> ## About the PR
> <!-- What did you change in this PR? -->
> 
> Refunds now have logging
> 
> ## Why / Balance
> <!-- Why was it changed? Link any discussions or issues here. Please
discuss how this would affect game balance. -->
> 
> Good for admins to keep track of.
> 
> ## Technical details
> <!-- If this is a code change, summarize at high level how your new
code works. This makes it easier to review. -->
> A Store Refund entry was added into the logging enum and a log entry
is made when a refund is successful.


</details>

Signed-off-by: VMSolidus <[email protected]>
Co-authored-by: SimpleStation14 <Unknown>
Co-authored-by: VMSolidus <[email protected]>
  • Loading branch information
SimpleStation14 and VMSolidus authored May 29, 2024
1 parent 8223dca commit 2affb3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Content.Server/Store/Systems/StoreSystem.Ui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Content.Server.Stack;
using Content.Server.Store.Components;
using Content.Shared.Actions;
using Content.Shared.Administration.Logs;
using Content.Shared.Database;
using Content.Shared.FixedPoint;
using Content.Shared.Hands.EntitySystems;
Expand Down Expand Up @@ -323,6 +324,8 @@ private void OnRequestRefund(EntityUid uid, StoreComponent component, StoreReque
if (!component.RefundAllowed || component.BoughtEntities.Count == 0)
return;

_admin.Add(LogType.StoreRefund, LogImpact.Low, $"{ToPrettyString(buyer):player} has refunded their purchases from {ToPrettyString(uid):store}");

for (var i = component.BoughtEntities.Count - 1; i >= 0; i--)
{
var purchase = component.BoughtEntities[i];
Expand Down
1 change: 1 addition & 0 deletions Content.Shared.Database/LogType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,5 @@ public enum LogType
ChatRateLimited = 87,
AtmosTemperatureChanged = 88,
DeviceNetwork = 89,
StoreRefund = 90
}

0 comments on commit 2affb3e

Please sign in to comment.