Commit Graph

125 Commits

Author SHA1 Message Date
Roxy
d147913fc2 Fix some DB issues and lag (#91420)
## About The Pull Request

- ~~The DB schema version define was set to 5.30, the changelog readme
said the latest was 5.28, and the sample insert query in the readme said
it was 5.31~~ (fixed in #91127) Changes the define and readme to 5.32
- Add new entry in readme to rename `character` column in `manifest`
table to `character_name`, because `character` is a reserved word in SQL
and every insert query is failing
- Changed the initial roundstart manifest queries from
number_of_players_readied_up individual insert queries to one mass
insert because I suspect this is add several extra seconds to the start
time

## Why It's Good For The Game
fix yes :)
## Changelog
🆑
server: increment DB schema version to 5.32
server: changed column name in manifest table from character to
character_name because the former is a reserved word
fix: changed round start manifest DB queries from dozens of individual
inserts to one mass insert
fix: hopefully fixed some lag on round start
/🆑
2025-06-01 12:47:54 -07:00
Bloop
58cd0099d9 Fixes inconsistent tab/space issue in schema (#91127)
## About The Pull Request

This is something I wish I could just ignore and move on from but it
bothered me enough to make this PR so here we are

## Changelog

Nothing at all anyone will ever notice besides the people looking at
this file in the repo
2025-06-01 08:10:03 +00:00
Jeremiah
9db2f6916b Sets prettier to run on the repo (#91379)
## About The Pull Request
Prettier (an auto formatter) is set to only run within the tgui folder
currently. This removes that limitation, allowing it to automatically
format all supported files in the repo (.js, .html, .yml
[etc](https://prettier.io/docs/))

I made a few exceptions for bundled and generated files
## Why It's Good For The Game
I'm of the opinion that code should look uniform and am lazy enough to
want CTRL-S to format files without having to think beyond that
## Changelog
2025-05-29 21:23:59 -07:00
Nick
4e16eb111d Adds logging of the station manifest to the DB (#90993)
## About The Pull Request
This adds a `manifest` table to the database, basically a databasified
version of the `manifest.txt` log.

## Why It's Good For The Game
This is less of a game feature and more of an admin & Statbus tool. We
currently do not have a good way to see who played which character in a
given round. This aims to fix that.

~~Drafted because I'm not sure on some of the typecasting for the
`special` and `latejoin` columns, I would like someone to give that a
once-over.~~ We good.
2025-05-10 15:54:19 -07:00
RengaN02
7bb71d38fd Crimes are now logging in db (#90948)
<!-- 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. -->

## About The Pull Request

Crimes are now logged in db

Logging: 

![image](https://github.com/user-attachments/assets/6eee470d-863a-4f68-9836-04a0a0079aa2)

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
idk
we logging citations but not crimes, and i wanted to log the crimes too
<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->

## Changelog

<!-- 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 its 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. -->

🆑 Rengan
server: The crimes are now logging in the database.
/🆑

<!-- 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. -->
2025-05-10 12:17:20 -07:00
TiviPlus
a9fa5df0cd Fixes DB admin ranks being 16 bits wide instead of 24 (#89348)
## About The Pull Request
smallint is 2 bytes, increased it to mediumint which is 3 bytes
Issue has not cropped up yet as theres only 15 flags right now, but
there can be up to 24 in dm side soooo

```
DEBUG-SQL: MySqlError { ERROR 1264 (22003): Out of range value for column 'flags' at row 1 } | Query used: INSERT INTO admin_ranks
 - (rank, flags, exclude_flags, can_edit_flags)
```


my mysql is broken so I havent tested the update query but how bad can
it be :clueless:
## Changelog
🆑
server: An issue where more than 16 admin flags could not exist in the
DB has been corrected
/🆑

---------

Co-authored-by: TiviPlus <572233640+TiviPlus@users.noreply.com>
2025-02-06 19:57:48 +01:00
LemonInTheDark
a0b0ea2beb Realignes changelog header (#87695)
looks wrong
2024-11-06 14:12:43 -07:00
Ghom
e6253c7812 Adds a score for all species of fish that you've caught. (#86049)
## About The Pull Request
I'm adding a score that tracks which types of fish you've caught across
multiple rounds. To do so, I had to add a new score subtype that manages
the score value not being a number. Thankfully the achievement code is
fairly flexible so not a whole lot had to be done, although I've to add
a new column to the achievements table in the DB, because the 'value' is
for integers, while we need one for text strings ~~(the contents of the
list are converted to text with a delimiter before being saved cuz I'm
not sure if and how our DM slash SQL integration handles using lists
directly and I don't want to waste time finding it out)~~.

EDIT: It's mostly done beside the reviews that are going to point out
things that need to be changed. The UI changes are done. It's time for
reviews.

Here are screenshots of the UI with all fish still uncatched beside one
(I've since then the typo on its name and removed an extra zero from the
index number, as well as a nit with the spacing between cells):

![immagine](https://github.com/user-attachments/assets/a1dcfeb6-6d26-461e-aaa1-97c619f5cbfa)

![immagine](https://github.com/user-attachments/assets/768f6621-c992-4932-9bca-979dd1e43d6f)


## Why It's Good For The Game
We have about dozens over dozens of different fish in the game now, many
of which are just fluff anyway. It's getting to the point it's perhaps
doable to add a score or something to be a braggard about.

## Changelog
🆑
add: Added a new score that keeps track of all different fish that
you've caught between shifts.
server: Added a new schema table to store the aforementioned entries and
the ckeys associated to them, with an additional timestamp column.
/🆑
2024-11-04 13:48:25 -08:00
oranges
16d221f86d Fix a few mistakes I made (#82887)
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2024-05-06 02:19:35 +00:00
Zephyr
cbcf5a7108 ip intel mk2 (#82683)
Do not merge this without coordinating with your server's host.

## About The Pull Request

Slightly refactors the way we handle IP intel.
You can still use the old data stored in the database.
Adds the ability to automatically reject connections determined by
config flags.

## Why It's Good For The Game

We used to have IP intel to check for VPNs, although it was disabled due
to being bad and unhelpful.
This refactor should make it much more manageable for hosts and admins.

## HOSTS BEWARE
This adds a new SQL table `ipintel_whitelist`
Look at the schema!

## Changelog

🆑
admin: The return of IPIntel
/🆑

---------

Co-authored-by: MrStonedOne <kyleshome@gmail.com>
Co-authored-by: oranges <email@oranges.net.nz>
2024-04-26 14:52:54 +12:00
distributivgesetz
274eb2a52e Removes Clone Damage (#80109)
<!-- 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. -->

## About The Pull Request

Does what it says on the tin. We don't have any "special" sources of
clone damage left in the game, most of them are rather trivial so I
bunched them together into this PR.

Notable things removed:
- Clonexadone, because its entire thing was centered around clone damage
- Decloner gun, it's also centered around cloning damage, I couldn't
think of a replacement mechanic and nobody uses it anyways
- Everything else already dealt clone damage as a side (rainbow knife
deals a random damage type for example), so these sources were removed

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game

Consider the four sources of normal damage that you can get: Brute,
Burn, Toxins and Oxygen. These four horsemen of the apocalypse are very
well put together and it's no surprise that they are in the game, as you
can fit any way of damaging a mob into them. Getting beaten to death by
a security officer? Brute damage. Running around on fire? Burn damage.
Poisoned or irradiated? Toxin damage. Suffocating in space? Brute, burn
and oxygen damage. Technically there's also stamina damage but that's
its own ballpark and it also makes sense why we have a damage number for
it.

Picture this now: We have this cool mechanic called "clone pods" where
you can magically revive dead people with absolute ease. We don't want
it to be for free though, it comes at a cost. This cost is clone damage,
and it serves to restrain people from abusing cloning.

Fast forward time a bit and cloning is now removed from the game. What
stays with us is a damage number that is intrinsically tied to the
context of a removed feature. It was a good idea that we had it for that
feature at the time, but now it just sits there. It's the odd one out
from all the other damage types. You can easily explain why your blade
dealt brute damage, but how are you going to fit clone damage into any
context without also becoming extremely specific?

My point is: **clone damage is conceptually a flawed mechanic because it
is too specific**. That is the major issue why no one uses it, and why
that makes it unworthy of being a damage stat.
Don't take my word for it though, because a while ago we only had a
handful of sources for this damage type in the game. And in most of the
rounds where you saw this damage, it came from only one department. It's
not worthwhile to keep it around as a damage number. People also didn't
know what to do with this damage type, so we currently have two ways of
healing clone damage: Cryotubes as a roundstart way of healing clone
damage and Rezadone, which instantly sets your clone damage to 0 on the
first tick. As a medical doctor, when was the last time you saw someone
come in with clone damage and thought to yourself, "Oh, this person has
clone damage, I cannot wait to heal them!" ?

Now we have replacements for these clone damage sources. Slimes? Slime
status effect that deals brute instead of clone. Cosmic heretics? Random
organ damage, because their mechanics are already pretty fleshed out.
Decloning virus? The virus operated as a "ticking timebomb" which used
cloning damage as the timer, so it has been reworked to not use clone
damage. What remains after all this is now a basically unused damage
type. Every specific situation that used clone damage is now relying on
another damage type. Now it's time to put clone damage to rest once and
for all.

Sure, you can technically add some form of cellular degradation in the
future, but it shouldn't be a damage number. The idea of your cells
being degraded is a cool concept, don't get me wrong, but make it a
status effect or maybe even a wound for that matter.

<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->

## Changelog

<!-- 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. -->

🆑
del: Removed clone damage.
del: Removed the decloner gun.
del: Removed clonexadone.
/🆑

<!-- 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. -->
2023-12-04 14:42:43 -08:00
jimmyl
2ce7819d79 also removes exodrone adventures from prefixed sql schema (#78769)
## About The Pull Request

forgor

## Why It's Good For The Game


![image](https://github.com/tgstation/tgstation/assets/70376633/3ba3ae4f-64ae-47a1-98ba-05d1e2d6d912)

## Changelog

nothing playerfacing hopefully
2023-10-06 16:07:07 -06:00
jimmyl
44f7810e17 exodrone adventures are no longer database based (#78636)
## About The Pull Request

you now put the jsons into the folder at strings/exoadventures
no adventures have been lost i think
also deletes the example_adventures folder since theyre just duplicates
of the adventures in the other folder now

## Why It's Good For The Game

having it database based meant you had to ping someone with database
access to add it which isnt exactly optimal for contributions

## Changelog
🆑
code: exploration drone adventures are now file-based and not
database-based
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
2023-10-04 20:41:03 +02:00
LemonInTheDark
0065f020ed Removes line about adding a new index to the library_action table (#75808)
## About The Pull Request

I ended up walking back the index since it ended up being useless in
testing, just forgot to nuke the comment about it
2023-06-02 20:30:18 -06:00
LemonInTheDark
57ef596898 Admin Library Moderation (in-game edition) (#75645)
For the longest time, the only way admins could moderate the library was
by using statbus's external tool.
But a few months back statbus went down, and ever since then they've
been sitting lost. Shit sucks.

The whole external thing has been bugging me for a while, so let's fix
all that yeah?

This pr adds a new verb to the admin tab that allows admins to
ban/restore books from the library.
It includes expanded (ckey) search, faster response times, in tool book
viewing with and without markdown rendering, and viewing of deleted
books.

This is accomplished with a special subtype of library consoles, stored
on the admin datum.
It shouldn't let you do anything without +BAN, rip my live debugging or
whatever.

I've also hooked into (and fixed) Ned's existing library actions log,
and added viewing support to the ban/restore pages.
This logs banning admin, ban time, ban reason, etc.

As a part of this, I've fixed/expanded on the existing UIs.
I've added ID search to all existing consoles, and fixed an existing bug
with the visitor console not supporting category search (shows how many
people actually use the thing)

Changes to the library_action table were pretty minor. The ckey column
was too small, so longer keys just caused it to fail on ban. Bad.
That and the ip address column was signed, which wasted space and was
non standard with other tables.
2023-05-31 22:45:32 +00:00
Mothblocks
980f3adc70 ezdb - A one click script to quickly setting up a development database (#75053)
https://user-images.githubusercontent.com/35135081/235344815-8e825ba9-52cf-44e8-b8e2-a2aeb5d47276.mp4

- Downloads a portable MariaDB (doesn't pollute your main system)
- Sets up a database with a random password on port 1338 (configurable)
- Installs the initial schema
- Every time after, will run updates

Major versions right now explicitly escape hatch, because those
historically come with something like a Python script, and I do not want
it to pretend to work.

---------

Co-authored-by: san7890 <the@san7890.com>
2023-05-15 12:49:29 -06:00
Mothblocks
9740f104d0 Contextual tutorials for swapping hands and dropping items (#72292)
# Requires https://github.com/tgstation/tgstation/pull/72320

## About The Pull Request


https://user-images.githubusercontent.com/35135081/209700892-e54be6cf-d18c-4d12-acd1-e5eb46e9d82d.mp4


https://user-images.githubusercontent.com/35135081/209700911-751b8a0e-d770-49fa-a6eb-ce50aa0fa670.mp4

---

Adds a system for tutorials that:

- Are contextually given
- Are not given again after completion
- Can optionally not trigger for anyone who first played before a
certain date

Uses this system for a tutorial for switching hands/dropping items. This
tutorial is triggered when you try to click on an item with another
item, and `afterattack` return FALSE. In order for this to work as
smoothly as possible, I'm going to open a separate PR that cleans up the
`afterattack` on everything to either return TRUE/FALSE.

## Why It's Good For The Game

SS13 is an extremely confusing game, being able to do tutorials in a
non-intrusive way (like a separate tutorial mode) is nice.

The system in place is going to be perfectly usable for introducing
mechanics to both fresh players and experienced players alike (such as
for future content).

## Changelog
🆑
qol: New players will now get a contextual tutorial for how to switch
hands and drop items.
/🆑

Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
2023-01-09 01:29:18 +01:00
Mothblocks
cf69eb05f2 Fix IPs in telemetry_connections not being unsigned (#63573)
About The Pull Request

Fixes IPs not being unsigned, causing problems where they get capped if the IP is too big.

Not tested.
2021-12-27 12:59:28 +13:00
Mothblocks
f0c78c9667 Log telemetry connections in DB (#63435)
About The Pull Request

Logs tgui telemetry connections into the database. Useful since they are normally capped to 5.

Does not change the fact that the "banned account in connection history" part is still based on your history at that time. I figured it could potentially be very slow to go through your entire database history.
2021-12-22 16:52:17 +13:00
Mothblocks
d0f33354f6 Add admin ckey to known alts panel (#62761)
About The Pull Request

Adds the admin who added the known alt to the known alts panel.
Changelog

cl
admin: The admin who adds a known alt is now logged in the table.
/cl
2021-11-23 20:28:19 +13:00
Watermelon914
fb8d95a2f5 Allows players to send more visible adminhelps when no admins are on, which'll definitely alert admins (#62711)
Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
2021-11-20 03:06:50 -08:00
Mothblocks
6b3103e612 Add the known alts panel, which prevents suspicious login logs for whitelisted ckeys (#62520)
* Known alts panel

* Add notice before opening panel

* DB_MINOR_VERSION

* Better ban panel default

* Revert dbconfig

* Add TTL

* Add qdels
2021-11-08 20:43:52 +11:00
Mothblocks
da1a8096c5 Make round ID nullable in bans and tickets (#61985)
* Make round ID nullable in bans and tickets

* Apply to everything

* Jordie's feedback

* Change NOT NULL in admig_log
2021-10-12 16:54:04 +11:00
Nick
ec2189370d Adds the library_report table (#60599)
* Adds the library_report table

* Updating subsystem defines

* fix table name

* Update database_changelog.txt

* Update tgstation_schema.sql

* Update tgstation_schema_prefixed.sql

Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
Co-authored-by: Jordie <4343468+Jordie0608@users.noreply.github.com>
2021-08-03 12:59:45 +10:00
Mothblocks
3e1e7f7f92 2FA for Admins (#59467)
Adds a 2FA system for admins. When a config is enabled, a database storing your last CID and IP will be checked to see if you have connected through there before. If not, you will not be able to admin until you are verified. Verification is done by opening a website (decided by config), which is tasked with updating the database entry, which will then let you reverify.

MSO wants to implement this as a forum page, but the DM-side is completely agnostic to whatever the implementation is, just that it updates the database. This means that it could potentially be some TOTP stuff, even.

If the database is down, a backup file is checked for your most recent verified connection (IP + CID). If you are on this connection, you will be able to connect fine. If the database is down and you are on a new connection, someone with +PERMISSIONS can manually verify you through the Permissions Panel.

We've had repeated attacks of admins getting their accounts stolen, it's time.
2021-06-09 17:07:36 -07:00
AnturK
f989da1fc1 Moves explorer adventures to the database. (#59089)
* Moves explorer adventures to the database.

* Fixes default images not showing up in playtest.

* Review changes.

* Please

* SPACING

* Makes this a bit atomic.

Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
2021-05-24 16:56:14 -04:00
Nick
e3b1e3c8c5 Security citations are now logged to the DB (#58827)
Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
2021-05-03 05:17:04 -07:00
Bobbahbrown
b35a1dd122 Fix sql changelog (#57972)
Fixed bad SQL that I originally wrote in the changelog for 5.11, anyone trying to update their schema from < 5.11 up would notice this.
2021-03-28 12:32:42 -04:00
Vladimir Veisman
56a01e8d82 Sets the charset and collation for the SQL schema to utf8mb4 (#56060)
Changes the charset and collation in the SQL schema to utf8mb4 (which is default in ubuntu 20.04 and debian 10 for MariaDB). This solves all the problems with russian or other non-latin1 characters in many cases related to the use of the database, because surprisingly the rest is already ready for such use cases.

I am not adding any SQL script to migrate from latin1 to utf8mb4, as this is an extremely destructive action. It must be performed manually with the data of all tables backed up before doing so.
However, this can be done by using the following queries, one time for database:
ALTER DATABASE databse_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
and one for each table:
ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
2021-01-10 16:58:28 -03:00
MissFox0810
c0a4df5efb Add playtime tracking to notes (#55800)
* Added playertime tracking to player notes

* Updated sql change log with revision

* Fixed typo in db_query

* And fixed another typo with query_get...

* Add recomended changes from Jordie0608

* Added missing DEFAULT NULL to sql

Co-authored-by: MissFox <github@aesir.org.uk>
2021-01-01 21:10:27 +11:00
Bobbahbrown
3035fbfc3a SQL Schema Version 5.11 / Add indices for ticket table to support Statbus operations (#53541)
* I hope you're proud of yourselves. You've driven away another customer! It's baffling, I tell you! Your deep rooted lack of self-control only fosters failure in every endeavor we undertake! I mean, it's always one step forward and two steps back! Why? Don't you see the example I try to set for you?

* thanks jordie
2020-09-29 12:07:39 +02:00
oranges
6c9d88a4cd Overhauls discord verification system (#53289)
This completely replaces the previous verification system, for one that
will interoperate with a discord redbot instance that uses the cogs
located at you github.com/optimumtact/orangescogs

This cuts out several steps in the system, but it also leaves alone the
existing notify system (which just uses a file list of discord ids) as a
record of who to notify

SQL changes required for the new database system

Version 5.10, 7 August 2020, by oranges

Changes how the discord verification process works.
Adds the discord_links table, and migrates discord id entries from
player table to the discord links table in a once off operation and then
removes the discord id on the player table

The user connects to any tg server, and uses the "Verify Discord
Account" verb, this generates a six word one time use token, with a 4
hour time validity period (defined as 4 hours from the timestamp value)
in the discord links table.

This one time token, and the ckey of the user are stored in
discord_links

At this point the entire DM side is done, this is all it does
2020-08-30 18:24:23 -07:00
jdawg1290
62676e72a8 Force LF line endings with gitattributes and convert repo (#52266)
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
2020-07-16 03:02:40 +03:00
Jordie
248a6fd50c Datum based poll creation and vote handling update (#50843)
An almost complete rework of how creating polls, their data and voting on them is handled.

Instead of repeatedly querying for poll data, running polls are loaded at runtime into poll_question and poll_option datums that stores all the needed variables for both. This datum is then used for creating, editing and accessing poll data. The database is only contacted when saving changes or votes.

Creating polls and options is now done with a html window instead of a series of popups akin to how the banning panel works. The form data is parsed and error-checked before passing to be saved.
This is done in two stages, first time a poll's details are entered and it must be initialized (created as a datum) before options can be added and all of both are saved to the database. Instructions about how this work are shown on the poll creation window.

A new field for polls has been added, subtitles, which is text only shown when a poll is opened by a player instead of on the list of polls. Intended so the actual question text can be kept to only a name and important information about a poll goes in a subtitle.
All polls can now have revoting enabled on them.
Polls can have a starting datetime specified, this can be in the past but why would you do that?
Polls and options can be edited once created, excluding the type of a poll. Doing so will by default clear all existing poll votes. Votes can also be cleared by a button.

The handling of how votes are processed has been adapted for the datum system but is on the whole not functionally that different aside from poll validation not being roughly copypasted across each poll type's vote proc

All poll tables now have a deleted column for retaining 'deleted' data.
poll_question has also gained the columns created_datetime, subtitle, allow_revoting, their function explained above, and a change of idx_pquest_time_admin to idx_pquest_time_deleted_id.

A stored procedure set_poll_deleted has been added. This is called when setting a poll as deleted to avoid needing 4 separate queries from the server or one fairly long 4-way joined 

Create Poll verb is renamed to Server Poll Management
2020-05-11 14:34:51 +12:00
Jordie
4c7dfbc655 adds recording who deleted a note (#50445)
It came up that this isn't recorded, only logged.

Technically needs syncing merge with schema change but only deleting notes would break from this and tbh that isn't done very often so I think it'd be fine to yolo.
2020-04-18 11:28:34 +12:00
Nick
c758bdd51c [Ready] Database Tickets (#48727)
* DB ticket procs

* Schema changes for DB tickets

* Schema version update

* Fixes requested by Jordie

* SQL updates

Adds a recipient column

* Still one dangling issue where this DOESN'T WORK

* Alright, this should work

* Requested SQL fixes

* Rogue changes

* less bad defaults

* utf8 for the utf8 gods

* aaaaaa

* Update tgstation_schema_prefixed.sql

* Update tgstation_schema.sql

* Update database_changelog.txt

Co-authored-by: Jordie <4343468+Jordie0608@users.noreply.github.com>
2020-01-17 05:35:16 +11:00
AnturK
27ee01cee1 Adds name and desc to achievement metadata (#48146)
* Adds name and desc to achievement metadata

* Name 64, Desc 512
2019-12-10 15:59:18 +11:00
AnturK
f28b2d60b9 Adds achievement metadata table (#48007)
* Renames hub_id to database_id
Adds achievement_metadata table.

* Fixups

* enum
2019-11-30 18:34:42 +11:00
AnturK
a31c460dc0 Moves achievements from Hub to DB. (#47617)
Drops byond hub support and adds score and top 50 browsers.

Requires DB changes and manual creation of migration script if we want to keep old achievements so no random merges please.
2019-11-26 20:35:28 +13:00
Nick
8f8dde46b8 Adds the feeedback column to admin (#45025)
* Adds the feeedback column to `admin`

* edited changelog message for clarity

* increments db minor version define like you're meant to nednerd
2019-07-08 22:20:52 +10:00
AffectedArc07
c4e75bc40b [READY] SSdiscord and Round Notifications (#44231)
* Notify System

* V2

* Adds a hint

* Stoned fixes round 1

* Use grammar wells I can

* This didnt work

* I wish you could test on TGS without committing

* Jordie fixes round 1

* oops

* This took way longer than it should have taken

* Adds in endnotify for serverops

* Spacing
2019-06-30 00:43:25 +10:00
ShizCalev
ae2854626e Removes unintentional prefixes from schema 2019-03-19 11:44:55 -04:00
MrStonedOne
0e2cb84ac6 prefix cases 2019-03-16 00:26:01 -07:00
MrStonedOne
186f6c8ddd dbstickybans: Qdeleting queries, misc fixes, Query select proc for executing mutiple queries at once... 2019-03-16 00:23:40 -07:00
MrStonedOne
2e757683ab Database backed stickybans
Supports disabling stickybans for a round, exempting a key from matching a stickyban, and it now also detects rogue stickybans before anybody currently connected even gets disconnected. (new matches trigger a 5 second sleep and abort enforcement if enough other new matches happen in that timeframe)
2019-03-16 00:23:37 -07:00
Jordie
8a66665e95 Ban system and interface update (#41176)
Spiritual successor and extension to #17798, an almost entire rebuild of the SQL ban system backend and interface.
Bantypes are removed per #8584 and #6174. All bans are now 'role bans', server bans are when a ban's role is server. Admin bans are a column, meaning it's possible to ban admins from jobs.
Bans now have only an expiry datetime, duration is calculated from this when queried.
unbanned column is removed as it's superfluous, checking unban status is now done through checking unban_datetime. unban_round_id column added. Each ip and computerid columns rearranged so ip is always first, like in other tables. Bans now permit a null ckey, ip and computerid.

Ban checking is split into two procs now is_banned_from() does a check if a ckey is banned from one or more roles and returns true or false. This effectively replaces jobban_isbanned() used in simple if() statements. If connected a client's ban cache is checked rather than querying the DB. This makes it possible for a client connected to two or more servers to ignore any bans made on one server until their ban cache is rebuilt on the others. Could be avoided with cross-server calls to update ban caches or just the removal of the ban cache but as is I've done neither since I think it's enough of an edge case to not be worth it.
The second proc is is_banned_from_with_details(), this queries the DB for a role ban on a player's ckey, ip or CID and returns the details. This replaces direct queries in IsBanned.dm and the preferences menu.

The legacy ban system is removed.

The interfaces for banning, unbanning and editing bans have been remade to require less clicking and easier simultaneous operations. The banning and jobban panel are combined. They also store player connection details when opened so a client disconnecting no longer stops a ban being placed.

New banning panel:
Key, IP and CID can all be toggled to allow excluding them from a ban.
Checking Use IP and CID from last connection lets you enter only a ckey and have the DB fill these fields in for you, if possible.
Temporary bans have a drop-menu which lets you select between seconds, minutes, hours, days, weeks, months and years so you don't need to calculate how many minutes a long ban would be. The ban is still converted into minutes on the DB however.
Checking any of the head roles will check both of the boxes for you.
The red role box indicates there is already a ban on that role for this ckey. You can apply additional role bans to stack them.

New unbanning panel:
Unbanning panel is now separate from the banning panel but otherwise functionally the same.

Ban editing panel:
Actually just a modified banning panel, all the features from it work the same here.
You can now edit almost all parameters of a ban instead of just the reason.
You can't edit severity as it's not really part of the ban.
The panels have been tested but I've not been able to get my local server to be accessible so ban functionality isn't properly confirmed. Plenty of testing will be required as I'd rather not break bans.



cl
admin: Ban interface rework. The banning and unbanning panels have received a new design which is easier to use and allows multiple role bans to be made at once.
prefix: Ban search and unbanning moved to unbanning panel, which is now a separate panel to the old banning panel.
/cl
2018-12-05 08:48:37 +13:00
CitrusGender
bb2c82375e Add Note severity and changes UI of administrative notes (#39808)
* Adds note_severity and updates dbconfig. New SQL stuff too.

* whoops please don't hack into my database >:^(

* UI change, changed how it's stored in the DB, removed some queries when it returns, changed stuff to key.

* Update sql_message_system.dm

* this was not defined

* random indent

* wait how did this get here

* okay enough web edits I promise

* just kidding I got u

* Update common.css

* Added buttons, changed UI again, standardized the inputs, added severity for appearance bans, fed the dog

* forgot about the banning panel

* added an asset cache

* corrects asset datum var name
2018-08-26 20:23:29 +10:00
Jordie
f8f1b6ca03 Some injection fixes (#39642)
Fixes a breaking error and possible injection exploit in
populate_key_2018-07-09.py caused by a key existing from when byond allowed now
blocked characters like ' in usernames e.g.
http://www.byond.com/members/immortaljrosh?format=text

Additionally fixes some unsanitized values in other queries.
2018-08-12 14:09:45 -07:00
Jordie
31f020f3cc Add expiration time for admin messages (#39502)
* add expiration time for messages

* typo

* fix

* src to usr

* allows removing expiry from existing messages

* cancel button
2018-08-12 06:31:14 +10:00
Jordie
0d7ef3ed65 Key instead of ckey for user facing logs and ui (#39009)
* converts to using key instead of ckey for user facing logs and ui

* more key_name for airlock wires

* futureproofing check for if key changes

* --onlyckeymatch script argument and fail/success counter

* fix
2018-08-11 02:15:50 +10:00