Files
Bubberstation/code/modules/admin/verbs/adminhelp.dm
SpaceLoveSs13 7aa6664021 Mirror (#27453)
* Fix Conflicts

* Change COGBAR_ANIMATION_TIME to seconds and not deciseconds (#82530)

Most people should not be using this define

* New Battle Arcade (#81810)

Remakes Battle Arcade from just about the ground up, with exceptions
taken for emagged stuff since I didn't really want to touch its
behavior.

The Battle Arcade now has stages that players can go through, unlocking
a stage by beating 2 enemies and the boss of the previous one, but this
must all be done in a row. You can choose to take a break between each
battle and there's a good chance you'll sleep just fine but there's also
a chance it can go wrong either through an ambush or robbery.

The Inn lets you restore everything for 15 gold and you can buy a sword
and armor, each level you unlock is a new sword and armor pair you can
buy that's better than the last, it's 30 gold each but scales up as you
progress through levels. They are really worth getting so it's best to
try to not lose your money early in.

The battle system is nearly the same as how it was before but I removed
the poor combo system that plagued the old arcade as one big knowledge
lock, now it's more just turn based. The game is built on permadeath so
dying means you restart from the beginning, but if you are going to lose
you can try to escape instead which costs you half of your gold.

Getting to higher levels increases the difficulty of enemies but also
increases the gaming exp rewards which could make this a better way to
get exp if you can get good at it.

Gaming EXP is used to increase chances of counterattacking but doesn't
give any extra health to the player.

I also removed the exploit of being able to screwdriver arcade cabinets
because people would do that if they thought they were on the verge of
losing to bypass the effects of loss. I instead replaced it with a new
interaction that the Curator's display case key can be used to reset
arcade cabinets (there's several keys on the chain so it made sense to
me), which I added solely because I thought Curators would be the type
of person to have run an actual arcade.

This is some gameplay

https://github.com/tgstation/tgstation/assets/53777086/499083f5-75cc-43b5-b457-017a012beede

As a misc sidenote, I also split up the arcade file just like how Orion
Trail was before, just for neat code organization.
The Inn keeper is straight up just a photo of my localhost dude, he's
not a player reference or anything it's not my actual character.
I also have no idea how well balanced this is cause I suck at it lol.

Battle Arcade is one of 3 last machines in my hackmd here to turn into
TGUI https://hackmd.io/XLt5MoRvRxuhFbwtk4VAUA?view
I've always thought the current version of battle arcade is quite lame
and lacks any progression, like Orion Trail I thought that since I was
moving this to TGUI, it would also be a perfect opportunity to revamp it
and try to improve on where it failed before, especially since the
alternative (NTOS Arcade) is also lame as hell and is even lamer than
HTML battle arcade (spam mana, then spam health, then just spam attack,
rinse and repeat).
This will hopefully be more entertaining and give players sense that
they are getting through a series of tasks rather than doing one same
one again and again.

🆑 JohnFulpWillard, Zeek the Rat
add: Battle Arcade has been completely overhauled in a new progression
system, this time using TGUI.
add: The Curator's keys can now reset arcade cabinets.
balance: You now need to be literate to play arcade games, except for
Mediborg's Amputation Adventure.
fix: You can no longer screwdriver emagged arcade consoles. Accept your
fate.
fix: Silicons can no longer play Mediborg's Amputation Adventure.
/🆑

---------

Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>

* Change setting item weight class to a setter to patch some weight class related shenanigans (#82494)

## About The Pull Request

Fixes #81052 
Fixes #58008

Setting weight class of items is now done via `update_weight_class`.

I updated as many occurrences of manually setting `w_class` as I could
find but I may have missed some. Let me know if you know of any I
missed.

This is done to allow datums to react to an item having its weight class
changed.

Humans and atom storage are two such datums which now react to having an
item in its contents change weight class, to allow it to expel items
that grow to a weight class beyond what is normally allowed.

## Changelog

🆑 Melbert
fix: You can't fit items which are normally too large for a storage by
fitting it in the storage when it is small, then growing it to a larger
size.
/🆑

* Material datum color update, plus touching up some material items (knight armor, tiles) (#82500)

## About The Pull Request

Tries to bring the material datum colors in closer approximation to the
stacks they're attached too. I literally used the colors on the stacks.
some might need to be lighter or darker, but for the most part they'll
look...closer to their actual material hues.

![material datum stuff
2](https://github.com/tgstation/tgstation/assets/40847847/a3a5968f-cab3-43dd-8699-3dae879b21fb)

I've also tweaked the sprites of both the tile object and the actual
material tile turf to give it the right shading.


![image](https://github.com/tgstation/tgstation/assets/40847847/56489479-8774-492b-b8cc-aeabc6c0a67f)

In addition to the tiles, I've also updated the knight armor and helmet
to look closer to the much higher quality plate armor already in the
game.

## Why It's Good For The Game

It bothered me that the material datum coloring was inconsistent with
the actual colors used for the material stacks. When they were updated,
and even before they were updated, material datum stuff just never
looked _right_. I wanted to change that so that it looks just right.

I did not like the old material knight armor whatsoever. It was a
dithered mess, and seemed to already use parts of the standard plate
armor but with all the actual shading removed or replaced with the wrong
colors. This fixes that so that the armor is actually readable for what
it is.

## Changelog
🆑
image: Updates the colors of various material datum to bring them closer
in-line with their actual material stacks
image: Improves the sprites for the material knight armor and helmet.
/🆑

* LateInitialize is not allowed to call parent anymore (#82540)

## About The Pull Request

I've seen a few cases in the past where LateInitialize is done cause of
the init return value being set to do so for no real reason, I thought I
should try to avoid that by ensuring LateInitialize isn't ever called
without overriding.

This fixes a ton of machine's LateInitialize not calling parent
(mechpad, door buttons, message monitor, a lot of tram machines,
abductor console, holodeck computer & disposal bin), avoiding having to
set itself up to be connected to power. If they were intended to not
connect to power, they should be using ``NO_POWER_USE`` instead.

Also removes a ton of returns to LateInit when it's already getting it
from parent regardless (many cases of that in machine code).

## Why It's Good For The Game

I think this is better for coding standard reasons as well as just
making sure we're not calling this proc on things that does absolutely
nothing with them. A machine not using power can be seen evidently not
using power with ``NO_POWER_USE``, not so much if it's LateInitialize
not calling parent.

## Changelog

🆑
fix: Mech pads, door buttons, message monitors, tram machines, abductor
consoles & holodeck computers now use power.
/🆑

* Fix table top deconstruction (#82508)

## About The Pull Request

Edited: updated changelog, read comments for changes in implementation
details

So previously, tables would let you use a wrench to fully deconstruct
them, or a screwdriver to take off only their top.
This, however, broke in two different ways in #82280, when their
deconstruction logic got changed.

First off, deconstructed tables would only drop the materials for their
top and not their frame.
For this, the primary culprit seems to be on line 307:

c34d56a45b/code/game/objects/structures/tables_racks.dm (L300-L307)
Where `new framestack(target_turf, framestackamount)` accidentally got
an extra indent, and ended up in the less common half of the if-else
chain.
Just moving this outside of the if-else chain again fixes it.

Secondly, tables had their own special deconstruction logic, which got
'standardized'.
Issue. This was special to accommodate for having two different
deconstruction logics: full or top only.
With `deconstruct(...)` no longer being overridable, I feel it's awkward
to attempt to proxy that information to the new `atom_deconstruct(...)`
So we introduce a new method, `deconstruct_top`, for the screwdriver to
use, which handles deconstructing only the top.
```dm
/obj/structure/table/proc/deconstruct_top()
	var/obj/table_frame = new frame(loc)
	if(obj_flags & NO_DECONSTRUCTION)
		table_frame.obj_flags |= NO_DECONSTRUCTION
	else // Mimic deconstruction logic, only drop our materials without NO_DECONSTRUCTION
		var/turf/target_turf = get_turf(src)
		drop_top_mats(target_turf)
	qdel(src)
```
Mimicking the `NO_DECONSTRUCTION` logic of normal deconstruction, and
copying over the flag onto its frames if need be.
This fixes screwdriver deconstruction.
## Why It's Good For The Game

Fixes #82503.
We can now deconstruct the table top separately again, AND get the right
materials back too.

## Changelog
🆑 00-Steven, SyncIt21
fix: Wrench table deconstruction gives the right materials again.
fix: Screwdriver table deconstruction only deconstructs the top again.
/🆑

* [NO GBP] Reagent grinders display reagents on examination (#82535)

## About The Pull Request
- Fixes #82531

Somehow omitted this during the general maintenance thing

## Changelog
🆑
fix: Reagent grinders display reagents of its beaker on examination
/🆑

* Monkeys now use height offset (and monkey tail works) (#81598)

This PR adds the ability for monkeys to wear any jumpsuit in the game,
and adds support for them to wear things like coats, gloves, and shoes
(though this cannot be obtained in-game and is solely achieved through
admins, which I also improved a bit upon by adding a defined bitfield
for no equip flags).

This reverts a lot of changes from
https://github.com/tgstation/tgstation/pull/73325 - We no longer check
height from limbs and such to bring sprites down, instead monkeys now
work more similarly to humans, so the entire PR was made irrelevant, and
I didn't really want to leave around dead code for the sake of having a
human with longer legs.

I've now also added support for Dwarfism, which makes monkeys look even
smaller. Very minor change but at least now the mutation doesn't feel
like it does literally nothing to monkeys (since they can already walk
over tables).

Here's a few examples of how it can appear in game (purely for
demonstration, as it is currently intentionally made impossible to
obtain in-game, though if someone wants to change that post-this PR now
that support is added, feel free):

Tails have been broken for a while now, the only reason you see them
in-game is because they are baked into the monkey sprites. This fixes
that, which means humans can now get monkey tails implanted into them
(hell yeah) and monkeys can have their tails removed (also hell yeah)

* Gets [weird] with (spies) by adding protect and deuteragonist-flavored objectives. (#82447)

## About The Pull Request

What are their goals? Why are they doing this? gets weird with Spy
objectives - namely by adding a lot more ways spies might be asked to
affect various targets around the station.

the first of these is by several flavors of Protecting targets (these do
NOT print a success at roundend in keeping with Spy design:)
- Protect (get a humanoid target off alive)
- Protect Nonhuman (get an entity off alive)
- Jailbreak (make sure a humanoid target escapes free)
- Detain (make sure a humanoid target gets taken out arrested)

the second of this is by a new escape condition: 
- Exile (get off-station or off the Z-level by the end of the shift -
sometimes it's not just pods, you need to fuck off to space to win.)

the third is through a massive increase in the number of possible:
- objective templates 
- departments to target (Command + Service added)
- specific locations to target
- general classes of objects to target (medicines, floor tiles, critical
infrastructure, etc.)
- efforts to target (such as meals, mechs, public supplies)
- ways to leave (you can be asked to abscond from the scene of your
crimes?)

## Why It's Good For The Game

More goofy and weird prompts to do more interesting things with Spies.
One thing I think we're sorely missing in our lineup is antagonists that
can act a bit more as deuteragonists - very possibly helping the crew
under certain conditions and frustrating the Hell out of them in others.

Since there's no way to check their objectives, and they get their
gear/progression through stealing shit, they're still very much an
antagonist and exist under the suspicion of doing bad... but, just going
by their objectives, introducing more varied (and in some cases even
benign) goals for them creates suggestions pointing to a lot more varied
and interesting stories if people choose to run with it.

* Adds anosmia quirk (#82206)

## About The Pull Request

Adds anosmia quirk. Anosmia, also known as smell blindness, is the loss
of the ability to detect one or more smells.

I tried to find all smells action and (most likely) update all of them,
unfortunately I can't change descriptions for this quirk.

## Why It's Good For The Game

Some characters will be able to not feel smells
That affect:
* Gases feelings and alerts (CO2, Plasma, miasm) - you don't feel them
* Bakery and cooking
* Changeling ability to feel other changelings by smell
* Some unimportant spans

* Explosions Part I - Directional Explosions (#82429)

## About The Pull Request

Adds the ability for explosions to be directional. This is achieved by
adding an angle check to `prepare_explosion_turfs()` to drop any turfs
outside the cone of the explosion. If the arc covers a full 360 degrees,
as is the default, it will accept all the turfs without performing the
angle check.

Uses this functionality to rework both rocket launcher backblast and X4
explosions. Rocket launcher backblast has been changed from a shotgun of
indendiary bullets to a directional explosion of similar length. X4 now
uses a directional explosion to "ensure user safety".

Apparently the old method of moving the explosion one tile away didn't
even work, as it blew up `target` before trying to check its density for
the directional behaviour.

https://youtu.be/Mzdt7d7Le2Y

## Why It's Good For The Game

Directional explosions - Useful functionality for a range of potential
use cases, which can be implemented with minimal extra processing cost
(Worst case scenario being very large directional explosions)

Backblast - Looks way cooler than a bunch of projectiles, and should be
significantly more functional in high-lag situations where projectile
code tends to get fucky

X4 - More predictable for players wanting to use it as a breaching
charge, you can actually stand near the charge and not have to worry
about being hoist upon your own petard.

## Changelog
🆑
add: Added support for directional explosions.
add: Rocket launcher backblast is now 271% more explosive, check your
six for friendlies!
add: X4 charges now explode in a cone away from the user when placed on
a sufficiently solid object.
fix: X4 charges will now behave correctly when placed on dense atoms
(note: don't try to read a variable from an atom you just blew up)
/🆑

* Add balloon alerts to plunging (#82559)

## About The Pull Request

Makes all plunging actions (pretty much anything using `plunger_act`)
have a visible balloon alert.

## Why It's Good For The Game

Makes sense that others would easily notice you plunging the shit out of
something.

Also, more people might finally learn that you can plunge the vent clogs
instead of welding them.

## Changelog
🆑
qol: Added balloon alerts whenever you start plunging something (i.e )
/🆑

* Fixes spurious runtime on Icemoon caused by turf calling unimplemented LateInitialize() (#82572)

## About The Pull Request

As of https://github.com/tgstation/tgstation/pull/82540 this runtime was
happening,


![image](https://github.com/tgstation/tgstation/assets/13398309/4d838fda-c157-4e33-ae64-77eafca1806f)

`/turf/open/openspace/icemoon/` can be changed to
`/turf/open/misc/asteroid/snow/icemoon/do_not_chasm` before
`Initialize()` returns, which resulted in it `INITIALIZE_HINT_LATELOAD`
getting returned on a turf that does not have an implementation of that
proc.

This should fix that.

## Why It's Good For The Game

Fixes CI error

* Blueprints tgui (#82565)

Blueprints now use a TGUI panel instead of the old HTML one.
Also did general code improvement and maintaining to blueprints in
general and also destroyed the ``areaeditor`` level, repathing it to
just 'blueprints'.
Also adds a sound when you look at structural data cause why not

Video demonstration:

https://github.com/tgstation/tgstation/assets/53777086/861773fd-3d57-472d-bc94-d67b0d4f1dbd

The 4 blueprint types:

![image](https://github.com/tgstation/tgstation/assets/53777086/bfd68eb5-c430-4608-a3f7-d6ac86727882)

Another HTML menu dead underground.
This is more responsive and doesn't require constant updating to see
which area you're in, feels less OOC (instead of saying "the blueprints
say", just say it, you ARE the blueprints).

Like, come on

![image](https://github.com/tgstation/tgstation/assets/53777086/fcf1b8b6-37c3-4c94-969f-3b121c983dc0)

Look at all this wasted space

![image](https://github.com/tgstation/tgstation/assets/53777086/1d3e61cd-bc56-4280-a3bb-0c66604e75b3)

🆑
refactor: Blueprints now use TGUI.
qol: Blueprints can now be used while lying down.
/🆑

* General maintenance for chem master (#82002)

**1. Qol**
- Adds screen tips & examines for screwdriver, wrench, crowbar & beaker
insertion, removal & replacing actions
- Analyzing reagents is now a client side feature & not a back end mode,
meaning one person can see details of a reagent while the other can
print stuff and do other operations so it's a non blocking operation.
This also means 2 players can see information of 2 different reagents in
their own screens, With that the overlay for analysis mode has been
removed
- You cannot do any tool acts on machines while printing. Balloon alerts
will be displayed warning you of that.
- The preferred container for the master reagent in the beaker is now
showed in both condiment & chem master. It can be enabled/disabled via a
CheckBox

**2. Code Improvements**
- Removed defines like `TARGET_BEAKER` , `TARGET_BEAKER` etc. ther
functionality is implemented as params in the `transfer_reagent()` proc
directly
- Removed all variables relating to analyzing reagents like
`reagent_analysis_mode`, `has_container_suggestion` etc. all memory
savings
- `printable_containers` now stores static values that can be shared
across many chem masters
- Updates only overlays and not the whole icon during operations for
efficiency

**3. Fixes**
- You can hit the chem master with the screwdriver, wrench, crowbar &
beaker when in combat mode
 - You cannot insert hologram items into the chem master
- Deconstructing a condiment master will give you the circuit board
already pre-programmed with that option selected so you don't need to
use a screwdriver to re program it
- `printing_amount` is now the maximum number of containers that can be
printed at a time. Presently this number with upgraded parts would print
out empty containers especially for patches. This is because
`volume_per_item` does not take into consideration this var. Also this
var would not give control to the player on exactly how many containers
to print as whatever amount the player entered would be multiplied with
this value producing a lot of waste & worse empty containers. Now this
var determines exactly how many containers you can print and is imposed
on the client side UI as well

**4. Refactors (UI performance)**
- Beaker data is compressed into a single entity & sent to the UI. This
is set to null if no beaker is loaded thus saving data sent
- Reuses Beaker props from chem synthesizer to reduce code
- reagent REF replaced with direct type converted to text and later
converted with `text2path()` cause its much faster

🆑
qol: Adds screen tips & examines for screwdriver, wrench, crowbar &
beaker insertion, removal & replacing actions
qol: Analyzing reagents no longer blocks other players from doing other
operations. Multiple players can analyze different reagents on the same
machine
qol: You cannot do any tool acts on the machine while printing to
prevent any side effects.
qol: The preferred container for the master reagent in the beaker is now
showed in both condiment & chem master. The feature can be
enabled/disabled via a check box
code: removed defines for reagent transfer, vars for reagent analyzis to
save memory. Autodoc for other vars & procs
fix: You can hit the chem master with tools like screwdriver, crowbar,
wrench & beaker in combat mode
fix: You cannot insert hologram items into the chem master
fix: Deconstructing a condiment master will give you the circuit board
already pre-programmed with that option
fix: You now print the exact amount of containers requested even with
upgraded parts without creating empty containers. Max printable
containers is 13 with tier 4 parts able to print 50 containers.
refactor: Optimized client side UI code & chem master as a whole.
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>

* Wraps `lowertext()` to ensure proper stringification. (#82442)

Fixes #82440

This PR just creates a new macro, `LOWER_TEXT()` (yes the irony is not
lost on me) to wrap around all calls of `lowertext()` and ensure that
whatever we input into that proc will be stringified using the `"[]"`
(or `tostring()` for the nerds) operator. very simple.

I also added a linter to enforce this (and prevent all forms of
regression) because I think that machines should do the menial work and
we shouldn't expect maintainers to remember this, let me know if you
disagree. if there is a time when it should be opted out for some
reason, the linter does respect it if you wrap your input with the
`UNLINT()` function.

* Clowns can now make balloon... toys. And also mallets and hats. (#82288)

<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

Clowns will now start with a box of 24 random long balloons and a
skillchip in their noggin allowing them to create balloon animals by
combining two of them of different colour together. Owners of the
skillchip also gain access to crafting recepies of balloon mallets,
vests, helmets and tophats, all created from long balloons. A crate of
long balloons, with a box of balloons inside, can be bought at cargo, in
case the clown runs out. I might edit this once I wake up, its 3 in the
morning right now.
Oh also, resprited how balloons look in inventory.

![image](https://github.com/tgstation/tgstation/assets/122572637/2d7ce955-c787-48a5-bfda-4613d2eed837)

Balloon animals funny.
Silly features are my favourite kind of features, and this one's
open-ended too.
Someone on the coder chat recommended someone would do it that one time,
here it goes.

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

🆑
add: Added long balloon box to the clown's starting inventory, and a
skill-chip of long lost honk-motherian knowledge to their brain.
add: Added long balloons. Consequently, added balloon animals to make
from such balloons. Also, balloon top hat, vest, helmet, and a mallet.
Don't ask about the mallet.
add: A long balloons box harvested fresh from the farms on the clown
planet will be able to be shipped in a crate to the cargo department
near you!
add: As per requests; water balloons can now be printed at service
lathe, and entertainment modsuit can now blow long balloons!
image: Balloons will now have an unique sprite when in the inventory,
compared when to on the ground.
/🆑

<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com>
Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Jacquerel <hnevard@gmail.com>

* Quick spellcheck 'steall' (#82560)

## About The Pull Request

https://github.com/tgstation/tgstation/pull/82447 quick followup to
this, caught it while glancing through the code.

* Fix

* merge conflicts

* Revert "Monkeys now use height offset (and monkey tail works) (#81598)"

This reverts commit 5cfdc5972d16c6b509220e8874a927696249d36a.

* fix

* Fixed lateinitialize

* This should cut it

* Oh right

* There?

* Damn, here?

* There

* [NO GBP] Fixes spurious runtime caused by icemoon (again) (#82582)

## About The Pull Request

https://github.com/tgstation/tgstation/pull/82572 I tried to fix this
but there was an unaccounted race condition which just caused a separate
runtime...


![firefox_GxGibAO281](https://github.com/tgstation/tgstation/assets/13398309/f251aecc-ef17-4bae-a741-5aade40de423)

Since the type is being changed mid-execution `replacement_turf` will
become out of scope. My bad--this should fix it now for good.

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
Co-authored-by: necromanceranne <40847847+necromanceranne@users.noreply.github.com>
Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com>
Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: Higgin <cdonny11@yahoo.com>
Co-authored-by: NeonNik2245 <106491639+NeonNik2245@users.noreply.github.com>
Co-authored-by: Thunder12345 <Thunder12345@users.noreply.github.com>
Co-authored-by: Lucy <lucy@absolucy.moe>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: YesterdaysPromise <122572637+YesterdaysPromise@users.noreply.github.com>
Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: Useroth <37159550+Useroth@users.noreply.github.com>
2024-04-26 01:22:24 +02:00

1190 lines
44 KiB
Plaintext

/// Client var used for returning the ahelp verb
/client/var/adminhelptimerid = 0
/// Client var used for tracking the ticket the (usually) not-admin client is dealing with
/client/var/datum/admin_help/current_ticket
GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
/**
* # Adminhelp Ticket Manager
*/
/datum/admin_help_tickets
/// The set of all active tickets
var/list/active_tickets = list()
/// The set of all closed tickets
var/list/closed_tickets = list()
/// The set of all resolved tickets
var/list/resolved_tickets = list()
var/obj/effect/statclick/ticket_list/astatclick = new(null, null, AHELP_ACTIVE)
var/obj/effect/statclick/ticket_list/cstatclick = new(null, null, AHELP_CLOSED)
var/obj/effect/statclick/ticket_list/rstatclick = new(null, null, AHELP_RESOLVED)
/datum/admin_help_tickets/Destroy()
QDEL_LIST(active_tickets)
QDEL_LIST(closed_tickets)
QDEL_LIST(resolved_tickets)
QDEL_NULL(astatclick)
QDEL_NULL(cstatclick)
QDEL_NULL(rstatclick)
return ..()
/datum/admin_help_tickets/proc/TicketByID(id)
var/list/lists = list(active_tickets, closed_tickets, resolved_tickets)
for(var/I in lists)
for(var/J in I)
var/datum/admin_help/AH = J
if(AH.id == id)
return J
/datum/admin_help_tickets/proc/TicketsByCKey(ckey)
. = list()
var/list/lists = list(active_tickets, closed_tickets, resolved_tickets)
for(var/I in lists)
for(var/J in I)
var/datum/admin_help/AH = J
if(AH.initiator_ckey == ckey)
. += AH
//private
/datum/admin_help_tickets/proc/ListInsert(datum/admin_help/new_ticket)
var/list/ticket_list
switch(new_ticket.state)
if(AHELP_ACTIVE)
ticket_list = active_tickets
if(AHELP_CLOSED)
ticket_list = closed_tickets
if(AHELP_RESOLVED)
ticket_list = resolved_tickets
else
CRASH("Invalid ticket state: [new_ticket.state]")
var/num_closed = ticket_list.len
if(num_closed)
for(var/I in 1 to num_closed)
var/datum/admin_help/AH = ticket_list[I]
if(AH.id > new_ticket.id)
ticket_list.Insert(I, new_ticket)
return
ticket_list += new_ticket
//opens the ticket listings for one of the 3 states
/datum/admin_help_tickets/proc/BrowseTickets(state)
var/list/l2b
var/title
switch(state)
if(AHELP_ACTIVE)
l2b = active_tickets
title = "Active Tickets"
if(AHELP_CLOSED)
l2b = closed_tickets
title = "Closed Tickets"
if(AHELP_RESOLVED)
l2b = resolved_tickets
title = "Resolved Tickets"
if(!l2b)
return
var/list/dat = list("<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><title>[title]</title></head>")
dat += "<A href='?_src_=holder;[HrefToken()];ahelp_tickets=[state]'>Refresh</A><br><br>"
for(var/I in l2b)
var/datum/admin_help/AH = I
dat += "[span_adminnotice("[span_adminhelp("Ticket #[AH.id]")]: <A href='?_src_=holder;[HrefToken()];ahelp=[REF(AH)];ahelp_action=ticket'>[AH.initiator_key_name]: [AH.name]</A>")]<br>"
usr << browse(dat.Join(), "window=ahelp_list[state];size=600x480")
//Tickets statpanel
/datum/admin_help_tickets/proc/stat_entry()
SHOULD_CALL_PARENT(TRUE)
SHOULD_NOT_SLEEP(TRUE)
var/list/L = list()
var/num_disconnected = 0
L[++L.len] = list("Active Tickets:", "[astatclick.update("[active_tickets.len]")]", null, REF(astatclick))
astatclick.update("[active_tickets.len]")
for(var/I in active_tickets)
var/datum/admin_help/AH = I
if(AH.initiator)
var/obj/effect/statclick/updated = AH.statclick.update()
L[++L.len] = list("[AH.handler ? "H-[AH.handler]" : ""]#[AH.id]. [AH.initiator_key_name]:", "[updated.name]", REF(AH)) //SKYRAT EDIT CHANGE - ADMIN
else
++num_disconnected
if(num_disconnected)
L[++L.len] = list("Disconnected:", "[astatclick.update("[num_disconnected]")]", null, REF(astatclick))
L[++L.len] = list("Closed Tickets:", "[cstatclick.update("[closed_tickets.len]")]", null, REF(cstatclick))
L[++L.len] = list("Resolved Tickets:", "[rstatclick.update("[resolved_tickets.len]")]", null, REF(rstatclick))
//SKYRAT EDIT ADDITION
if(LAZYLEN(SSopposing_force.submitted_applications))
for(var/datum/opposing_force/opposing_force as anything in SSopposing_force.submitted_applications)
L[++L.len] = list("[opposing_force.handling_admin ? "H-[opposing_force.handling_admin]. " : ""]OPFOR:", "[opposing_force.stat_button.update(" [opposing_force.ckey] ")]", null, REF(opposing_force.stat_button))
//SKYRAT EDIT END
return L
//Reassociate still open ticket if one exists
/datum/admin_help_tickets/proc/ClientLogin(client/C)
C.current_ticket = CKey2ActiveTicket(C.ckey)
if(C.current_ticket)
C.current_ticket.initiator = C
C.current_ticket.AddInteraction("Client reconnected.")
SSblackbox.LogAhelp(C.current_ticket.id, "Reconnected", "Client reconnected", C.ckey)
//Dissasociate ticket
/datum/admin_help_tickets/proc/ClientLogout(client/C)
if(C.current_ticket)
var/datum/admin_help/T = C.current_ticket
T.AddInteraction("Client disconnected.")
//Gotta async this cause clients only logout on destroy, and sleeping in destroy is disgusting
INVOKE_ASYNC(SSblackbox, TYPE_PROC_REF(/datum/controller/subsystem/blackbox, LogAhelp), T.id, "Disconnected", "Client disconnected", C.ckey)
T.initiator = null
//Get a ticket given a ckey
/datum/admin_help_tickets/proc/CKey2ActiveTicket(ckey)
for(var/I in active_tickets)
var/datum/admin_help/AH = I
if(AH.initiator_ckey == ckey)
return AH
//
//TICKET LIST STATCLICK
//
/obj/effect/statclick/ticket_list
var/current_state
/obj/effect/statclick/ticket_list/Initialize(mapload, name, state)
. = ..()
current_state = state
/obj/effect/statclick/ticket_list/Click()
if (!usr.client?.holder)
message_admins("[key_name_admin(usr)] non-holder clicked on a ticket list statclick! ([src])")
usr.log_message("non-holder clicked on a ticket list statclick! ([src])", LOG_ADMIN)
return
GLOB.ahelp_tickets.BrowseTickets(current_state)
//called by admin topic
/obj/effect/statclick/ticket_list/proc/Action()
Click()
#define WEBHOOK_NONE 0
#define WEBHOOK_URGENT 1
#define WEBHOOK_NON_URGENT 2
/**
* # Adminhelp Ticket
*/
/datum/admin_help
/// Unique ID of the ticket
var/id
/// The current name of the ticket
var/name
/// The current state of the ticket
var/state = AHELP_ACTIVE
/// The time at which the ticket was opened
var/opened_at
/// The time at which the ticket was closed
var/closed_at
/// Semi-misnomer, it's the person who ahelped/was bwoinked
var/client/initiator
/// The ckey of the initiator
var/initiator_ckey
/// The key name of the initiator
var/initiator_key_name
/// If any admins were online when the ticket was initialized
var/heard_by_no_admins = FALSE
/// The collection of interactions with this ticket. Use AddInteraction() or, preferably, admin_ticket_log()
var/list/ticket_interactions
/// Statclick holder for the ticket
var/obj/effect/statclick/ahelp/statclick
/// Static counter used for generating each ticket ID
var/static/ticket_counter = 0
/// The list of clients currently responding to the opening ticket before it gets a response
var/list/opening_responders
/// Whether this ahelp has sent a webhook or not, and what type
var/webhook_sent = WEBHOOK_NONE
/// List of player interactions
var/list/player_interactions
/// List of admin ckeys that are involved, like through responding
var/list/admins_involved = list()
/// Has the player replied to this ticket yet?
var/player_replied = FALSE
/**
* Call this on its own to create a ticket, don't manually assign current_ticket
*
* Arguments:
* * msg_raw - The first message of this admin_help: used for the initial title of the ticket
* * is_bwoink - Boolean operator, TRUE if this ticket was started by an admin PM
*/
/datum/admin_help/New(msg_raw, client/C, is_bwoink, client/admin_C, urgent = FALSE) //SKYRAT EDIT CHANGE
//clean the input msg
var/msg = sanitize(copytext_char(msg_raw, 1, MAX_MESSAGE_LEN))
if(!msg || !C || !C.mob)
qdel(src)
return
//SKYRAT EDIT ADDITION BEGIN
if(admin_C && is_bwoink)
handler = "[admin_C.ckey]"
//SKYRAT EDIT END
id = ++ticket_counter
opened_at = world.time
name = copytext_char(msg, 1, 100)
full_text = msg //SKYRAT EDIT ADDITION - Adminhelps into mentorhelps converting.
initiator = C
initiator_ckey = initiator.ckey
initiator_key_name = key_name(initiator, FALSE, TRUE)
if(initiator.current_ticket) //This is a bug
stack_trace("Multiple ahelp current_tickets")
initiator.current_ticket.AddInteraction("Ticket erroneously left open by code")
initiator.current_ticket.Close()
initiator.current_ticket = src
TimeoutVerb()
statclick = new(null, src)
ticket_interactions = list()
player_interactions = list()
addtimer(CALLBACK(src, PROC_REF(add_to_ping_ss), 2 MINUTES)) //SKYRAT EDIT ADDITION - Ticket Ping | this is not responsible for the notification itself, but only for adding the ticket to the list of those to notify.
if(is_bwoink)
AddInteraction("<font color='blue'>[key_name_admin(usr)] PM'd [LinkedReplyName()]</font>", player_message = "<font color='blue'>[key_name_admin(usr, include_name = FALSE)] PM'd [LinkedReplyName()]</font>")
message_admins("<font color='blue'>Ticket [TicketHref("#[id]")] created</font>")
else
MessageNoRecipient(msg_raw, urgent)
send_message_to_tgs(msg, urgent)
GLOB.ahelp_tickets.active_tickets += src
/datum/admin_help/proc/format_embed_discord(message)
var/datum/discord_embed/embed = new()
embed.title = "Ticket #[id]"
embed.description = "<byond://[world.internet_address]:[world.port]>"
embed.author = key_name(initiator_ckey)
var/round_state
switch(SSticker.current_state)
if(GAME_STATE_STARTUP, GAME_STATE_PREGAME, GAME_STATE_SETTING_UP)
round_state = "Round has not started"
if(GAME_STATE_PLAYING)
round_state = "Round is ongoing."
if(SSshuttle.emergency.getModeStr())
round_state += "\n[SSshuttle.emergency.getModeStr()]: [SSshuttle.emergency.getTimerStr()]"
if(SSticker.emergency_reason)
round_state += ", Shuttle call reason: [SSticker.emergency_reason]"
if(GAME_STATE_FINISHED)
round_state = "Round has ended"
var/list/admin_counts = get_admin_counts(R_BAN)
var/stealth_admins = jointext(admin_counts["stealth"], ", ")
var/afk_admins = jointext(admin_counts["afk"], ", ")
var/other_admins = jointext(admin_counts["noflags"], ", ")
var/admin_text = ""
var/player_count = "**Total**: [length(GLOB.clients)], **Living**: [length(GLOB.alive_player_list)], **Dead**: [length(GLOB.dead_player_list)], **Observers**: [length(GLOB.current_observers_list)]"
if(stealth_admins)
admin_text += "**Stealthed**: [stealth_admins]\n"
if(afk_admins)
admin_text += "**AFK**: [afk_admins]\n"
if(other_admins)
admin_text += "**Lacks +BAN**: [other_admins]\n"
embed.fields = list(
"CKEY" = initiator_ckey,
"PLAYERS" = player_count,
"ROUND STATE" = round_state,
"ROUND ID" = GLOB.round_id,
"ROUND TIME" = ROUND_TIME(),
"MESSAGE" = message,
"ADMINS" = admin_text,
)
if(CONFIG_GET(string/adminhelp_ahelp_link))
var/ahelp_link = replacetext(CONFIG_GET(string/adminhelp_ahelp_link), "$RID", GLOB.round_id)
ahelp_link = replacetext(ahelp_link, "$TID", id)
embed.url = ahelp_link
return embed
/datum/admin_help/proc/send_message_to_tgs(message, urgent = FALSE)
var/message_to_send = message
if(urgent)
var/extra_message = CONFIG_GET(string/urgent_ahelp_message)
to_chat(initiator, span_boldwarning("Notified admins to prioritize your ticket"))
var/datum/discord_embed/embed = format_embed_discord(message)
embed.content = extra_message
embed.footer = "This player requested an admin"
send2adminchat_webhook(embed, urgent = TRUE)
webhook_sent = WEBHOOK_URGENT
//send it to TGS if nobody is on and tell us how many were on
var/admin_number_present = send2tgs_adminless_only(initiator_ckey, "Ticket #[id]: [message_to_send]")
log_admin_private("Ticket #[id]: [key_name(initiator)]: [name] - heard by [admin_number_present] non-AFK admins who have +BAN.")
if(admin_number_present <= 0)
to_chat(initiator, span_notice("No active admins are online, your adminhelp was sent to admins who are available through IRC or Discord."), confidential = TRUE)
heard_by_no_admins = TRUE
var/regular_webhook_url = CONFIG_GET(string/regular_adminhelp_webhook_url)
if(regular_webhook_url && (!urgent || regular_webhook_url != CONFIG_GET(string/urgent_adminhelp_webhook_url)))
var/extra_message = CONFIG_GET(string/ahelp_message)
var/datum/discord_embed/embed = format_embed_discord(message)
embed.content = extra_message
embed.footer = "This player sent an ahelp when no admins are available [urgent? "and also requested an admin": ""]"
send2adminchat_webhook(embed, urgent = FALSE)
webhook_sent = WEBHOOK_NON_URGENT
/proc/send2adminchat_webhook(message_or_embed, urgent)
var/webhook = CONFIG_GET(string/urgent_adminhelp_webhook_url)
if(!urgent)
webhook = CONFIG_GET(string/regular_adminhelp_webhook_url)
if(!webhook)
return
var/list/webhook_info = list()
if(istext(message_or_embed))
var/message_content = replacetext(replacetext(message_or_embed, "\proper", ""), "\improper", "")
message_content = GLOB.has_discord_embeddable_links.Replace(replacetext(message_content, "`", ""), " ```$1``` ")
webhook_info["content"] = message_content
else
var/datum/discord_embed/embed = message_or_embed
webhook_info["embeds"] = list(embed.convert_to_list())
if(embed.content)
webhook_info["content"] = embed.content
if(CONFIG_GET(string/adminhelp_webhook_name))
webhook_info["username"] = CONFIG_GET(string/adminhelp_webhook_name)
if(CONFIG_GET(string/adminhelp_webhook_pfp))
webhook_info["avatar_url"] = CONFIG_GET(string/adminhelp_webhook_pfp)
// Uncomment when servers are moved to TGS4
// send2chat(new /datum/tgs_message_conent("[initiator_ckey] | [message_content]"), "ahelp", TRUE)
var/list/headers = list()
headers["Content-Type"] = "application/json"
var/datum/http_request/request = new()
request.prepare(RUSTG_HTTP_METHOD_POST, webhook, json_encode(webhook_info), headers, "tmp/response.json")
request.begin_async()
/datum/admin_help/Destroy()
RemoveActive()
GLOB.ahelp_tickets.closed_tickets -= src
GLOB.ahelp_tickets.resolved_tickets -= src
return ..()
/datum/admin_help/proc/AddInteraction(formatted_message, player_message)
if (!isnull(usr) && usr.ckey != initiator_ckey)
admins_involved |= usr.ckey
if(heard_by_no_admins)
heard_by_no_admins = FALSE
send2adminchat(initiator_ckey, "Ticket #[id]: Answered by [key_name(usr)]")
ticket_interactions += "[time_stamp()]: [formatted_message]"
if (!isnull(player_message))
player_interactions += "[time_stamp()]: [player_message]"
//Removes the ahelp verb and returns it after 2 minutes
/datum/admin_help/proc/TimeoutVerb()
remove_verb(initiator, /client/verb/adminhelp)
initiator.adminhelptimerid = addtimer(CALLBACK(initiator, TYPE_PROC_REF(/client, giveadminhelpverb)), 1200, TIMER_STOPPABLE) //2 minute cooldown of admin helps
//private
/datum/admin_help/proc/FullMonty(ref_src)
if(!ref_src)
ref_src = "[REF(src)]"
. = ADMIN_FULLMONTY_NONAME(initiator.mob)
. += " (<A href='?_src_=holder;[HrefToken()];showmessageckey=[initiator.ckey]'>NOTES</A>)"
if(state == AHELP_ACTIVE)
if (CONFIG_GET(flag/popup_admin_pm))
. += " (<A HREF='?_src_=holder;[HrefToken(forceGlobal = TRUE)];adminpopup=[REF(initiator)]'>POPUP</A>)"
. += ClosureLinks(ref_src)
//private
/datum/admin_help/proc/ClosureLinks(ref_src)
if(!ref_src)
ref_src = "[REF(src)]"
. = " (<A HREF='?_src_=holder;[HrefToken(forceGlobal = TRUE)];ahelp=[ref_src];ahelp_action=reject'>REJT</A>)"
. += " (<A HREF='?_src_=holder;[HrefToken(forceGlobal = TRUE)];ahelp=[ref_src];ahelp_action=icissue'>IC</A>)"
. += " (<A HREF='?_src_=holder;[HrefToken(forceGlobal = TRUE)];ahelp=[ref_src];ahelp_action=close'>CLOSE</A>)"
. += " (<A HREF='?_src_=holder;[HrefToken(forceGlobal = TRUE)];ahelp=[ref_src];ahelp_action=resolve'>RSLVE</A>)"
//private
/datum/admin_help/proc/LinkedReplyName(ref_src)
if(!ref_src)
ref_src = "[REF(src)]"
return "<A HREF='?_src_=holder;[HrefToken(forceGlobal = TRUE)];ahelp=[ref_src];ahelp_action=reply'>[initiator_key_name]</A>"
//private
/datum/admin_help/proc/TicketHref(msg, ref_src, action = "ticket")
if(!ref_src)
ref_src = "[REF(src)]"
return "<A HREF='?_src_=holder;[HrefToken(forceGlobal = TRUE)];ahelp=[ref_src];ahelp_action=[action]'>[msg]</A>"
//message from the initiator without a target, all admins will see this
//won't bug irc/discord
/datum/admin_help/proc/MessageNoRecipient(msg, urgent = FALSE)
msg = sanitize(copytext_char(msg, 1, MAX_MESSAGE_LEN))
var/ref_src = "[REF(src)]"
//Message to be sent to all admins
var/admin_msg = span_adminnotice(span_adminhelp("Ticket [TicketHref("#[id]", ref_src)]</span><b>: [LinkedReplyName(ref_src)] [FullMonty(ref_src)]:</b> [span_linkify(keywords_lookup(msg))]"))
AddInteraction("<font color='red'>[LinkedReplyName(ref_src)]: [msg]</font>", player_message = "<font color='red'>[LinkedReplyName(ref_src)]: [msg]</font>")
log_admin_private("Ticket #[id]: [key_name(initiator)]: [msg]")
//send this msg to all admins
for(var/client/X in GLOB.admins)
if(X.prefs.toggles & SOUND_ADMINHELP)
SEND_SOUND(X, sound('sound/effects/adminhelp.ogg'))
window_flash(X, ignorepref = TRUE)
to_chat(X,
type = MESSAGE_TYPE_ADMINPM,
html = admin_msg,
confidential = TRUE)
//show it to the person adminhelping too
reply_to_admins_notification(msg)
SSblackbox.LogAhelp(id, "Ticket Opened", msg, null, initiator.ckey, urgent = urgent)
/// Sends a message to the player that they are replying to admins.
/datum/admin_help/proc/reply_to_admins_notification(message)
to_chat(
initiator,
type = MESSAGE_TYPE_ADMINPM,
html = span_notice("PM to-<b>Admins</b>: [span_linkify(message)]"),
confidential = TRUE,
)
player_replied = TRUE
//Reopen a closed ticket
/datum/admin_help/proc/Reopen()
if(state == AHELP_ACTIVE)
to_chat(usr, span_warning("This ticket is already open."), confidential = TRUE)
return
if(GLOB.ahelp_tickets.CKey2ActiveTicket(initiator_ckey))
to_chat(usr, span_warning("This user already has an active ticket, cannot reopen this one."), confidential = TRUE)
return
statclick = new(null, src)
GLOB.ahelp_tickets.active_tickets += src
GLOB.ahelp_tickets.closed_tickets -= src
GLOB.ahelp_tickets.resolved_tickets -= src
switch(state)
if(AHELP_CLOSED)
SSblackbox.record_feedback("tally", "ahelp_stats", -1, "closed")
if(AHELP_RESOLVED)
SSblackbox.record_feedback("tally", "ahelp_stats", -1, "resolved")
state = AHELP_ACTIVE
closed_at = null
if(initiator)
initiator.current_ticket = src
AddInteraction("<font color='purple'>Reopened by [key_name_admin(usr)]</font>", player_message = "Ticket reopened!")
var/msg = span_adminhelp("Ticket [TicketHref("#[id]")] reopened by [key_name_admin(usr)].")
message_admins(msg)
log_admin_private(msg)
SSblackbox.LogAhelp(id, "Reopened", "Reopened by [usr.key]", usr.ckey)
SSblackbox.record_feedback("tally", "ahelp_stats", 1, "reopened")
TicketPanel() //can only be done from here, so refresh it
//private
/datum/admin_help/proc/RemoveActive()
if(state != AHELP_ACTIVE)
return
closed_at = world.time
QDEL_NULL(statclick)
GLOB.ahelp_tickets.active_tickets -= src
if(initiator && initiator.current_ticket == src)
initiator.current_ticket = null
SEND_SIGNAL(src, COMSIG_ADMIN_HELP_MADE_INACTIVE)
//Mark open ticket as closed/meme
/datum/admin_help/proc/Close(key_name = key_name_admin(usr), silent = FALSE)
if(state != AHELP_ACTIVE)
return
//SKYRAT EDIT ADDITION BEGIN - ADMIN
if(handler && handler != usr.ckey)
var/response = tgui_alert(usr, "This ticket is already being handled by [handler]. Do you want to continue?", "Ticket already assigned", list("Yes", "No"))
if(!response || response == "No")
return
//SKYRAT EDIT ADDITION END
RemoveActive()
state = AHELP_CLOSED
GLOB.ahelp_tickets.ListInsert(src)
AddInteraction("<font color='red'>Closed by [key_name].</font>", player_message = "<font color='red'>Ticket closed!</font>")
if(!silent)
SSblackbox.record_feedback("tally", "ahelp_stats", 1, "closed")
var/msg = "Ticket [TicketHref("#[id]")] closed by [key_name]."
message_admins(msg)
SSblackbox.LogAhelp(id, "Closed", "Closed by [usr.key]", null, usr.ckey)
log_admin_private(msg)
//Mark open ticket as resolved/legitimate, returns ahelp verb
/datum/admin_help/proc/Resolve(key_name = key_name_admin(usr), silent = FALSE)
if(state != AHELP_ACTIVE)
return
//SKYRAT EDIT ADDITION BEGIN - ADMIN
if(handler && handler != usr.ckey)
var/response = tgui_alert(usr, "This ticket is already being handled by [handler]. Do you want to continue?", "Ticket already assigned", list("Yes", "No"))
if(!response || response == "No")
return
//SKYRAT EDIT ADDITION END
RemoveActive()
state = AHELP_RESOLVED
GLOB.ahelp_tickets.ListInsert(src)
addtimer(CALLBACK(initiator, TYPE_PROC_REF(/client, giveadminhelpverb)), 5 SECONDS)
AddInteraction("<font color='green'>Resolved by [key_name].</font>", player_message = "<font color='green'>Ticket resolved!</font>")
to_chat(initiator, span_adminhelp("Your ticket has been resolved by an admin. The Adminhelp verb will be returned to you shortly."), confidential = TRUE)
if(!silent)
SSblackbox.record_feedback("tally", "ahelp_stats", 1, "resolved")
var/msg = "Ticket [TicketHref("#[id]")] resolved by [key_name]"
message_admins(msg)
SSblackbox.LogAhelp(id, "Resolved", "Resolved by [usr.key]", null, usr.ckey)
log_admin_private(msg)
//Close and return ahelp verb, use if ticket is incoherent
/datum/admin_help/proc/Reject(key_name = key_name_admin(usr))
if(state != AHELP_ACTIVE)
return
//SKYRAT EDIT ADDITION BEGIN - ADMIN
if(handler && handler != usr.ckey)
var/response = tgui_alert(usr, "This ticket is already being handled by [handler]. Do you want to continue?", "Ticket already assigned", list("Yes", "No"))
if(!response || response == "No")
return
//SKYRAT EDIT ADDITION END
if(initiator)
initiator.giveadminhelpverb()
SEND_SOUND(initiator, sound('sound/effects/adminhelp.ogg'))
to_chat(initiator, "<font color='red' size='4'><b>- AdminHelp Rejected! -</b></font>", confidential = TRUE)
to_chat(initiator, "<font color='red'><b>Your admin help was rejected.</b> The adminhelp verb has been returned to you so that you may try again.</font>", confidential = TRUE)
to_chat(initiator, "Please try to be calm, clear, and descriptive in admin helps, do not assume the admin has seen any related events, and clearly state the names of anybody you are reporting.", confidential = TRUE)
SSblackbox.record_feedback("tally", "ahelp_stats", 1, "rejected")
var/msg = "Ticket [TicketHref("#[id]")] rejected by [key_name]"
message_admins(msg)
log_admin_private(msg)
AddInteraction("Rejected by [key_name].", player_message = "Ticket rejected!")
SSblackbox.LogAhelp(id, "Rejected", "Rejected by [usr.key]", null, usr.ckey)
Close(silent = TRUE)
//Resolve ticket with IC Issue message
/datum/admin_help/proc/ICIssue(key_name = key_name_admin(usr))
if(state != AHELP_ACTIVE)
return
//SKYRAT EDIT ADDITION BEGIN - ADMIN
if(handler && handler != usr.ckey)
var/response = tgui_alert(usr, "This ticket is already being handled by [handler]. Do you want to continue?", "Ticket already assigned", list("Yes", "No"))
if(!response || response == "No")
return
//SKYRAT EDIT ADDITION END
var/msg = "<font color='red' size='4'><b>- AdminHelp marked as IC issue! -</b></font><br>"
msg += "<font color='red'>Your issue has been determined by an administrator to be an in character issue and does NOT require administrator intervention at this time. For further resolution you should pursue options that are in character.</font>"
if(initiator)
to_chat(initiator, msg, confidential = TRUE)
SSblackbox.record_feedback("tally", "ahelp_stats", 1, "IC")
msg = "Ticket [TicketHref("#[id]")] marked as IC by [key_name]"
message_admins(msg)
log_admin_private(msg)
AddInteraction("Marked as IC issue by [key_name]", player_message = "Marked as IC issue!")
SSblackbox.LogAhelp(id, "IC Issue", "Marked as IC issue by [usr.key]", null, usr.ckey)
Resolve(silent = TRUE)
//Show the ticket panel
/datum/admin_help/proc/TicketPanel()
var/list/dat = list("<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><title>Ticket #[id]</title></head>")
var/ref_src = "[REF(src)]"
dat += "<h4>Admin Help Ticket #[id]: [LinkedReplyName(ref_src)]</h4>"
dat += "<b>State: [ticket_status()]</b>"
dat += "[FOURSPACES][TicketHref("Refresh", ref_src)][FOURSPACES][TicketHref("Re-Title", ref_src, "retitle")]"
if(state != AHELP_ACTIVE)
dat += "[FOURSPACES][TicketHref("Reopen", ref_src, "reopen")]"
dat += "<br><br>Opened at: [gameTimestamp(wtime = opened_at)] (Approx [DisplayTimeText(world.time - opened_at)] ago)"
if(closed_at)
dat += "<br>Closed at: [gameTimestamp(wtime = closed_at)] (Approx [DisplayTimeText(world.time - closed_at)] ago)"
dat += "<br><br>"
if(initiator)
dat += "<b>Actions:</b> [FullMonty(ref_src)]<br>"
else
dat += "<b>DISCONNECTED</b>[FOURSPACES][ClosureLinks(ref_src)]<br>"
dat += "<br><b>Log:</b><br><br>"
for(var/I in ticket_interactions)
dat += "[I]<br>"
// Helper for opening directly to player ticket history
dat += "<br><br><b>Player Ticket History:</b>"
dat += "[FOURSPACES]<A href='?_src_=holder;[HrefToken()];player_ticket_history=[initiator_ckey]'>Open</A>"
// Append any tickets also opened by this user if relevant
var/list/related_tickets = GLOB.ahelp_tickets.TicketsByCKey(initiator_ckey)
if (related_tickets.len > 1)
dat += "<br/><b>Other Tickets by User</b><br/>"
for (var/datum/admin_help/related_ticket in related_tickets)
if (related_ticket.id == id)
continue
dat += "[related_ticket.TicketHref("#[related_ticket.id]")] ([related_ticket.ticket_status()]): [related_ticket.name]<br/>"
usr << browse(dat.Join(), "window=ahelp[id];size=750x480")
/**
* Renders the current status of the ticket into a displayable string
*/
/datum/admin_help/proc/ticket_status()
switch(state)
if(AHELP_ACTIVE)
return "<font color='red'>OPEN</font>"
if(AHELP_RESOLVED)
return "<font color='green'>RESOLVED</font>"
if(AHELP_CLOSED)
return "CLOSED"
else
stack_trace("Invalid ticket state: [state]")
return "INVALID, CALL A CODER"
/datum/admin_help/proc/Retitle()
var/new_title = input(usr, "Enter a title for the ticket", "Rename Ticket", name) as text|null
if(new_title)
name = new_title
//not saying the original name cause it could be a long ass message
var/msg = "Ticket [TicketHref("#[id]")] titled [name] by [key_name_admin(usr)]"
message_admins(msg)
log_admin_private(msg)
TicketPanel() //we have to be here to do this
//Forwarded action from admin/Topic
/datum/admin_help/proc/Action(action)
testing("Ahelp action: [action]")
if(webhook_sent != WEBHOOK_NONE)
var/datum/discord_embed/embed = new()
embed.title = "Ticket #[id]"
if(CONFIG_GET(string/adminhelp_ahelp_link))
var/ahelp_link = replacetext(CONFIG_GET(string/adminhelp_ahelp_link), "$RID", GLOB.round_id)
ahelp_link = replacetext(ahelp_link, "$TID", id)
embed.url = ahelp_link
embed.description = "[key_name(usr)] has sent an action to this ticket. Action ID: [action]"
if(webhook_sent == WEBHOOK_URGENT)
send2adminchat_webhook(embed, urgent = TRUE)
if(webhook_sent == WEBHOOK_NON_URGENT || CONFIG_GET(string/regular_adminhelp_webhook_url) != CONFIG_GET(string/urgent_adminhelp_webhook_url))
send2adminchat_webhook(embed, urgent = FALSE)
webhook_sent = WEBHOOK_NONE
switch(action)
if("ticket")
TicketPanel()
if("retitle")
Retitle()
if("reject")
Reject()
if("reply")
// SKYRAT EDIT START - ADMIN HANDLE
if(handle_issue())
usr?.client.cmd_ahelp_reply(initiator)
// SKYRAT EDIT END
if("icissue")
ICIssue()
if("close")
Close()
if("resolve")
Resolve()
if("reopen")
Reopen()
// SKYRAT EDIT ADDITION
if("handle_issue")
handle_issue()
if("pingmute")
ticket_ping_stop = !ticket_ping_stop
SSblackbox.record_feedback("tally", "ahelp_stats", 1, "pingmute")
var/msg = "Ticket [TicketHref("#[id]")] has been [ticket_ping_stop ? "" : "un"]muted from the Ticket Ping Subsystem by [key_name_admin(usr)]."
message_admins(msg)
log_admin_private(msg)
if("convert")
convert_to_mentorhelp()
// SKYRAT EDIT ADDITION END
/datum/admin_help/proc/player_ticket_panel()
var/list/dat = list("<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><title>Player Ticket</title></head>")
dat += "<b>State: "
switch(state)
if(AHELP_ACTIVE)
dat += "<font color='red'>OPEN</font></b>"
if(AHELP_RESOLVED)
dat += "<font color='green'>RESOLVED</font></b>"
if(AHELP_CLOSED)
dat += "CLOSED</b>"
else
dat += "UNKNOWN</b>"
dat += "\n[FOURSPACES]<A href='?_src_=holder;[HrefToken(forceGlobal = TRUE)];player_ticket_panel=1'>Refresh</A>"
dat += "<br><br>Opened at: [gameTimestamp("hh:mm:ss", opened_at)] (Approx [DisplayTimeText(world.time - opened_at)] ago)"
if(closed_at)
dat += "<br>Closed at: [gameTimestamp("hh:mm:ss", closed_at)] (Approx [DisplayTimeText(world.time - closed_at)] ago)"
dat += "<br><br>"
dat += "<br><b>Log:</b><br><br>"
for (var/interaction in player_interactions)
dat += "[interaction]<br>"
var/datum/browser/player_panel = new(usr, "ahelp[id]", 0, 620, 480)
player_panel.set_content(dat.Join())
player_panel.open()
//
// TICKET STATCLICK
//
/obj/effect/statclick/ahelp
var/datum/admin_help/ahelp_datum
/obj/effect/statclick/ahelp/Initialize(mapload, datum/admin_help/AH)
ahelp_datum = AH
. = ..()
/obj/effect/statclick/ahelp/update()
return ..(ahelp_datum.name)
/obj/effect/statclick/ahelp/Click()
if (!usr.client?.holder)
message_admins("[key_name_admin(usr)] non-holder clicked on an ahelp statclick! ([src])")
usr.log_message("non-holder clicked on an ahelp statclick! ([src])", LOG_ADMIN)
return
ahelp_datum.TicketPanel()
/obj/effect/statclick/ahelp/Destroy()
ahelp_datum = null
return ..()
//
// CLIENT PROCS
//
/client/proc/giveadminhelpverb()
add_verb(src, /client/verb/adminhelp)
deltimer(adminhelptimerid)
adminhelptimerid = 0
GLOBAL_DATUM_INIT(admin_help_ui_handler, /datum/admin_help_ui_handler, new)
/datum/admin_help_ui_handler
var/list/ahelp_cooldowns = list()
/datum/admin_help_ui_handler/ui_state(mob/user)
return GLOB.always_state
/datum/admin_help_ui_handler/ui_data(mob/user)
. = list()
var/list/admins = get_admin_counts(R_BAN)
.["adminCount"] = length(admins["present"])
/datum/admin_help_ui_handler/ui_static_data(mob/user)
. = list()
.["bannedFromUrgentAhelp"] = is_banned_from(user.ckey, "Urgent Adminhelp")
.["urgentAhelpPromptMessage"] = CONFIG_GET(string/urgent_ahelp_user_prompt)
var/webhook_url = CONFIG_GET(string/urgent_adminhelp_webhook_url)
if(webhook_url)
.["urgentAhelpEnabled"] = TRUE
/datum/admin_help_ui_handler/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "Adminhelp")
ui.open()
ui.set_autoupdate(FALSE)
/datum/admin_help_ui_handler/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(.)
return
var/client/user_client = usr.client
var/message = sanitize_text(trim(params["message"]))
var/urgent = !!params["urgent"]
var/list/admins = get_admin_counts(R_BAN)
if(length(admins["present"]) != 0 || is_banned_from(user_client.ckey, "Urgent Adminhelp"))
urgent = FALSE
if(user_client.adminhelptimerid)
return
perform_adminhelp(user_client, message, urgent)
ui.close()
/datum/admin_help_ui_handler/proc/perform_adminhelp(client/user_client, message, urgent)
if(GLOB.say_disabled) //This is here to try to identify lag problems
to_chat(usr, span_danger("Speech is currently admin-disabled."), confidential = TRUE)
return
if(!message)
return
//handle muting and automuting
if(user_client.prefs.muted & MUTE_ADMINHELP)
to_chat(user_client, span_danger("Error: Admin-PM: You cannot send adminhelps (Muted)."), confidential = TRUE)
return
if(user_client.handle_spam_prevention(message, MUTE_ADMINHELP))
return
BLACKBOX_LOG_ADMIN_VERB("Adminhelp")
if(urgent)
if(!COOLDOWN_FINISHED(src, ahelp_cooldowns?[user_client.ckey]))
urgent = FALSE // Prevent abuse
else
COOLDOWN_START(src, ahelp_cooldowns[user_client.ckey], CONFIG_GET(number/urgent_ahelp_cooldown) * (1 SECONDS))
if(user_client.current_ticket)
user_client.current_ticket.TimeoutVerb()
if(urgent)
var/sanitized_message = sanitize(copytext_char(message, 1, MAX_MESSAGE_LEN))
user_client.current_ticket.send_message_to_tgs(sanitized_message, urgent = TRUE)
user_client.current_ticket.MessageNoRecipient(message, urgent)
return
new /datum/admin_help(message, user_client, FALSE, null, urgent) // SKYRAT EDIT - Handling tickets - ORIGINAL: new /datum/admin_help(message, user_client, FALSE, urgent)
/client/verb/no_tgui_adminhelp(message as message)
set name = "NoTguiAdminhelp"
set hidden = TRUE
if(adminhelptimerid)
return
message = trim(message)
GLOB.admin_help_ui_handler.perform_adminhelp(src, message, FALSE)
/client/verb/adminhelp()
set category = "Admin"
set name = "Adminhelp"
GLOB.admin_help_ui_handler.ui_interact(mob)
to_chat(src, span_boldnotice("Adminhelp failing to open or work? <a href='?src=[REF(src)];tguiless_adminhelp=1'>Click here</a>"))
/client/verb/view_latest_ticket()
set category = "Admin"
set name = "View Latest Ticket"
if(!current_ticket)
// Check if the client had previous tickets, and show the latest one
var/list/prev_tickets = list()
var/datum/admin_help/last_ticket
// Check all resolved tickets for this player
for(var/datum/admin_help/resolved_ticket in GLOB.ahelp_tickets.resolved_tickets)
if(resolved_ticket.initiator_ckey == ckey) // Initiator is a misnomer, it's always the non-admin player even if an admin bwoinks first
prev_tickets += resolved_ticket
// Check all closed tickets for this player
for(var/datum/admin_help/closed_ticket in GLOB.ahelp_tickets.closed_tickets)
if(closed_ticket.initiator_ckey == ckey)
prev_tickets += closed_ticket
// Take the most recent entry of prev_tickets and open the panel on it
if(LAZYLEN(prev_tickets))
last_ticket = pop(prev_tickets)
last_ticket.player_ticket_panel()
return
// client had no tickets this round
to_chat(src, span_warning("You have not had an ahelp ticket this round."))
return
current_ticket.player_ticket_panel()
//
// LOGGING
//
/// Use this proc when an admin takes action that may be related to an open ticket on what
/// what can be a client, ckey, or mob
/// player_message: If the message should be shown in the player ticket panel, fill this out
/// log_in_blackbox: Whether or not this message with the blackbox system.
/// If disabled, this message should be logged with a different proc call
/proc/admin_ticket_log(what, message, player_message, log_in_blackbox = TRUE)
var/client/mob_client
var/mob/Mob = what
if(istype(Mob))
mob_client = Mob.client
else
mob_client = what
if(istype(mob_client) && mob_client.current_ticket)
if (isnull(player_message))
mob_client.current_ticket.AddInteraction(message)
else
mob_client.current_ticket.AddInteraction(message, player_message)
if(log_in_blackbox)
SSblackbox.LogAhelp(mob_client.current_ticket.id, "Interaction", message, mob_client.ckey, usr.ckey)
return mob_client.current_ticket
if(istext(what)) //ckey
var/datum/admin_help/active_admin_help = GLOB.ahelp_tickets.CKey2ActiveTicket(what)
if(active_admin_help)
if (isnull(player_message))
active_admin_help.AddInteraction(message)
else
active_admin_help.AddInteraction(message, player_message)
if(log_in_blackbox)
SSblackbox.LogAhelp(active_admin_help.id, "Interaction", message, what, usr.ckey)
return active_admin_help
//
// HELPER PROCS
//
/proc/get_admin_counts(requiredflags = R_BAN)
. = list("total" = list(), "noflags" = list(), "afk" = list(), "stealth" = list(), "present" = list())
for(var/client/X in GLOB.admins)
.["total"] += X
if(requiredflags != NONE && !check_rights_for(X, requiredflags))
.["noflags"] += X
else if(X.is_afk())
.["afk"] += X
else if(X.holder.fakekey)
.["stealth"] += X
else
.["present"] += X
/proc/send2tgs_adminless_only(source, msg, requiredflags = R_BAN)
var/list/adm = get_admin_counts(requiredflags)
var/list/activemins = adm["present"]
. = activemins.len
if(. <= 0)
var/final = ""
var/list/afkmins = adm["afk"]
var/list/stealthmins = adm["stealth"]
var/list/powerlessmins = adm["noflags"]
var/list/allmins = adm["total"]
if(!afkmins.len && !stealthmins.len && !powerlessmins.len)
final = "[msg] - No admins online"
else
final = "[msg] - All admins stealthed\[[english_list(stealthmins)]\], AFK\[[english_list(afkmins)]\], or lacks +BAN\[[english_list(powerlessmins)]\]! Total: [allmins.len] "
send2adminchat(source,final)
send2otherserver(source,final)
/**
* Sends a message to a set of cross-communications-enabled servers using world topic calls
*
* Arguments:
* * source - Who sent this message
* * msg - The message body
* * type - The type of message, becomes the topic command under the hood
* * target_servers - A collection of servers to send the message to, defined in config
* * additional_data - An (optional) associated list of extra parameters and data to send with this world topic call
*/
/proc/send2otherserver(source, msg, type = "Ahelp", target_servers, list/additional_data = list())
if(!CONFIG_GET(string/comms_key))
debug_world_log("Server cross-comms message not sent for lack of configured key")
return
var/our_id = CONFIG_GET(string/cross_comms_name)
additional_data["message_sender"] = source
additional_data["message"] = msg
additional_data["source"] = "([our_id])"
additional_data += type
var/list/servers = CONFIG_GET(keyed_list/cross_server)
for(var/I in servers)
if(I == our_id) //No sending to ourselves
continue
if(target_servers && !(I in target_servers))
continue
world.send_cross_comms(I, additional_data)
/// Sends a message to a given cross comms server by name (by name for security).
/world/proc/send_cross_comms(server_name, list/message, auth = TRUE)
set waitfor = FALSE
if (auth)
var/comms_key = CONFIG_GET(string/comms_key)
if(!comms_key)
debug_world_log("Server cross-comms message not sent for lack of configured key")
return
message["key"] = comms_key
var/list/servers = CONFIG_GET(keyed_list/cross_server)
var/server_url = servers[server_name]
if (!server_url)
CRASH("Invalid cross comms config: [server_name]")
world.Export("[server_url]?[list2params(message)]")
/proc/tgsadminwho()
var/list/message = list("Admins: ")
var/list/admin_keys = list()
for(var/adm in GLOB.admins)
var/client/C = adm
admin_keys += "[C][C.holder.fakekey ? "(Stealth)" : ""][C.is_afk() ? "(AFK)" : ""]"
for(var/admin in admin_keys)
if(LAZYLEN(message) > 1)
message += ", [admin]"
else
message += "[admin]"
return jointext(message, "")
/proc/keywords_lookup(msg,external)
//This is a list of words which are ignored by the parser when comparing message contents for names. MUST BE IN LOWER CASE!
var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","alien","as", "i")
//explode the input msg into a list
var/list/msglist = splittext(msg, " ")
//generate keywords lookup
var/list/surnames = list()
var/list/forenames = list()
var/list/ckeys = list()
var/founds = ""
for(var/mob/M in GLOB.mob_list)
var/list/indexing = list(M.real_name, M.name)
if(M.mind)
indexing += M.mind.name
for(var/string in indexing)
var/list/L = splittext(string, " ")
var/surname_found = 0
//surnames
for(var/i=L.len, i >= 1, i--)
var/word = ckey(L[i])
if(word)
surnames[word] = M
surname_found = i
break
//forenames
for(var/i in 1 to surname_found-1)
var/word = ckey(L[i])
if(word)
forenames[word] = M
//ckeys
ckeys[M.ckey] = M
var/ai_found = 0
msg = ""
var/list/mobs_found = list()
for(var/original_word in msglist)
var/word = ckey(original_word)
if(word)
if(!(word in adminhelp_ignored_words))
if(word == "ai")
ai_found = 1
else
var/mob/found = ckeys[word]
if(!found)
found = surnames[word]
if(!found)
found = forenames[word]
if(found)
if(!(found in mobs_found))
mobs_found += found
if(!ai_found && isAI(found))
ai_found = 1
var/is_antag = 0
if(is_special_character(found))
is_antag = 1
founds += "Name: [found.name]([found.real_name]) Key: [found.key] Ckey: [found.ckey] [is_antag ? "(Antag)" : null] "
msg += "[original_word]<font size='1' color='[is_antag ? "red" : "black"]'>(<A HREF='?_src_=holder;[HrefToken(forceGlobal = TRUE)];adminmoreinfo=[REF(found)]'>?</A>|<A HREF='?_src_=holder;[HrefToken(forceGlobal = TRUE)];adminplayerobservefollow=[REF(found)]'>F</A>)</font> "
continue
msg += "[original_word] "
if(external)
if(founds == "")
return "Search Failed"
else
return founds
return msg
/proc/get_mob_by_name(msg)
//This is a list of words which are ignored by the parser when comparing message contents for names. MUST BE IN LOWER CASE!
var/list/ignored_words = list("unknown","the","a","an","of","monkey","alien","as", "i")
//explode the input msg into a list
var/list/msglist = splittext(msg, " ")
//who might fit the shoe
var/list/potential_hits = list()
for(var/i in GLOB.mob_list)
var/mob/M = i
var/list/nameWords = list()
if(!M.mind)
continue
for(var/string in splittext(LOWER_TEXT(M.real_name), " "))
if(!(string in ignored_words))
nameWords += string
for(var/string in splittext(LOWER_TEXT(M.name), " "))
if(!(string in ignored_words))
nameWords += string
for(var/string in nameWords)
if(string in msglist)
potential_hits += M
break
return potential_hits
/**
* Checks a given message to see if any of the words are something we want to treat specially, as detailed below.
*
* There are 3 cases where a word is something we want to act on
* 1. Admin pings, like @adminckey. Pings the admin in question, text is not clickable
* 2. Datum refs, like @0x2001169 or @mob_23. Clicking on the link opens up the VV for that datum
* 3. Ticket refs, like #3. Displays the status and ahelper in the link, clicking on it brings up the ticket panel for it.
* Returns a list being used as a tuple. Index ASAY_LINK_NEW_MESSAGE_INDEX contains the new message text (with clickable links and such)
* while index ASAY_LINK_PINGED_ADMINS_INDEX contains a list of pinged admin clients, if there are any.
*
* Arguments:
* * msg - the message being scanned
*/
/proc/check_asay_links(msg)
var/list/msglist = splittext(msg, " ") //explode the input msg into a list
var/list/pinged_admins = list() // if we ping any admins, store them here so we can ping them after
var/modified = FALSE // did we find anything?
var/i = 0
for(var/word in msglist)
i++
if(!length(word))
continue
switch(word[1])
if("@")
var/stripped_word = ckey(copytext(word, 2))
// first we check if it's a ckey of an admin
var/client/client_check = GLOB.directory[stripped_word]
if(client_check?.holder)
msglist[i] = "<u>[word]</u>"
pinged_admins[stripped_word] = client_check
modified = TRUE
continue
// then if not, we check if it's a datum ref
var/word_with_brackets = "\[[stripped_word]\]" // the actual memory address lookups need the bracket wraps
var/datum/datum_check = locate(word_with_brackets)
if(!istype(datum_check))
continue
msglist[i] = "<u><a href='?_src_=vars;[HrefToken(forceGlobal = TRUE)];Vars=[word_with_brackets]'>[word]</A></u>"
modified = TRUE
if("#") // check if we're linking a ticket
var/possible_ticket_id = text2num(copytext(word, 2))
if(!possible_ticket_id)
continue
var/datum/admin_help/ahelp_check = GLOB.ahelp_tickets?.TicketByID(possible_ticket_id)
if(!ahelp_check)
continue
var/state_word
switch(ahelp_check.state)
if(AHELP_ACTIVE)
state_word = "Active"
if(AHELP_CLOSED)
state_word = "Closed"
if(AHELP_RESOLVED)
state_word = "Resolved"
msglist[i]= "<u><A href='?_src_=holder;[HrefToken(forceGlobal = TRUE)];ahelp=[REF(ahelp_check)];ahelp_action=ticket'>[word] ([state_word] | [ahelp_check.initiator_key_name])</A></u>"
modified = TRUE
if(modified)
var/list/return_list = list()
return_list[ASAY_LINK_NEW_MESSAGE_INDEX] = jointext(msglist, " ") // without tuples, we must make do!
return_list[ASAY_LINK_PINGED_ADMINS_INDEX] = pinged_admins
return return_list
#undef WEBHOOK_URGENT
#undef WEBHOOK_NONE
#undef WEBHOOK_NON_URGENT