Commit Graph

41 Commits

Author SHA1 Message Date
metalgearsloth
12766fe6e3 Loadouts redux (#25715)
* Loadouts redux

* Loadout window mockup

* More workout

* rent

* validation

* Developments

* bcs

* More cleanup

* Rebuild working

* Fix model and loading

* obsession

* efcore

* We got a stew goin

* Cleanup

* Optional + SeniorEngineering fix

* Fixes

* Update science.yml

* add

add

* Automatic naming

* Update nukeops

* Coming together

* Right now

* stargate

* rejig the UI

* weh

* Loadouts tweaks

* Merge conflicts + ordering fix

* yerba mate

* chocolat

* More updates

* Add multi-selection support

* test

h

* fikss

* a

* add tech assistant and hazard suit

* huh

* Latest changes

* add medical loadouts

* and science

* finish security loadouts

* cargo

* service done

* added wildcards

* add command

* Move restrictions

* Finalising

* Fix existing work

* Localise next batch

* clothing fix

* Fix storage names

* review

* the scooping room

* Test fixes

* Xamlify

* Xamlify this too

* Update Resources/Prototypes/Loadouts/Jobs/Medical/paramedic.yml

Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>

* Update Resources/Prototypes/Loadouts/loadout_groups.yml

Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>

* Update Resources/Prototypes/Loadouts/Jobs/Civilian/clown.yml

Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>

* Update Resources/Prototypes/Loadouts/Jobs/Civilian/clown.yml

Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>

* Update Resources/Prototypes/Loadouts/loadout_groups.yml

Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>

* Update Resources/Prototypes/Loadouts/Jobs/Security/detective.yml

Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>

* Update Resources/Prototypes/Loadouts/loadout_groups.yml

Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>

* ben

* Margins

---------

Co-authored-by: Firewatch <54725557+musicmanvr@users.noreply.github.com>
Co-authored-by: Mr. 27 <koolthunder019@gmail.com>
Co-authored-by: Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>
2024-04-16 22:57:43 +10:00
Pieter-Jan Briers
d3ac3d06bb Fix database round start date issues (#26838)
How can ONE DATABASE COLUMN have so many cursed issues I don't know, but it certainly pissed off the devil in its previous life.

The start_date column on round entities in the database was added by https://github.com/space-wizards/space-station-14/pull/21153. For some reason, this PR gave the column a nonsensical default value instead of making it nullable. This default value causes the code from #25280 to break. It actually trips an assert though that's not what the original issue report ran into.

This didn't get noticed on wizden servers because we at some point backfilled the start_date column based on the stored admin logs.

So I change the database model to make this column nullable, updated the C# code to match, and made the existing migration set the invalid values to be NULL instead. Cool.

Wait how's SQLite handle in this scenario anyways? Well actually turns out the column was *completely broken* in the first place!

The code for inserting into the round table was copy pasted between SQLite and PostgreSQL, with the only difference being that the SQLite key manually assigned the primary key instead of letting SQLite AUTOINCREMENT it. And then the code to give a start_date value was only added to the PostgreSQL version (which is actually in the base class already). So for SQLite that column's been filled up with the same invalid default the whole time.

Why was the code manually assigning a PK? I checked the SQLite docs for AUTOINCREMENT[1], and the behavior seems appropriate.

I removed the SQLite-specific code path and it just seems to work regardless. The migration just sets the old values to NULL too.

BUT WAIT, THERE'S MORE!

Turns out just doing the migration on SQLite is a pain in the ass! EF Core has to create a new table to apply the nullability change, because SQLite doesn't support proper ALTER COLUMN. This causes the generated SQL commands to be weird and the UPDATE for the migration goes BEFORE the nullability change... I ended up having to make TWO migrations for SQLite. Yay.

Fixes #26800

[1]: https://www.sqlite.org/autoinc.html
2024-04-14 07:39:43 +02:00
Pieter-Jan Briers
d776c4b392 Improve admin message seen/dismiss state. (#26223)
Fixes #26211

Admin messages now have separate "seen" and "dismissed" fields. The idea is that an admin should be able to tell whether a user pressed the "dismiss for now" button. Instead of using "seen" as "show this message to players when they join", "dismissed" is now used for this.

Existing notes in the database will automatically be marked as dismissed on migration. A note cannot be dismissed without being seen (enforced via constraint in the database too, aren't I fancy).

As part of this, it has become impossible for a player to play without dismissing the message in some form. Instead of a shitty popup window, the popup is now a fullscreen overlay that blocks clicks behind it, making the game unplayable. Also, if a user somehow has multiple messages they will be combined into one popup.

Also I had enough respect for the codebase to make it look better and clean up the code somewhat. Yippee.
2024-03-21 16:15:46 +01:00
Krunklehorn
ed0f2aa221 Client customization late-join spawner priority for arrivals/cryostorage (#24586)
* Initial commit, requires server restart to take effect

* Exposes callbacks directly instead, takes effect immediately

* Cleaned up control flow, swapped cvar for client customization

* Switched to int, dictionary of callbacks, migration

* Update Content.Shared/Preferences/SpawnPriorityPreference.cs

* krunkle stan

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2024-02-01 21:12:09 +11:00
Pieter-Jan Briers
a39999fb9c Fix admin log key order. (#23052)
The keys for admin logs were set as (log_id, round_id). This made no sense because logs are usually accessed per round.
2024-01-11 01:03:25 +01:00
Pieter-Jan Briers
b4f8393f42 Log server ID in connection logs table (#21911) 2023-12-07 09:48:56 +11:00
DrSmugleaf
0e0ac5fcc5 Drop admin log entity db table (#21216) 2023-10-23 22:08:20 -07:00
DrSmugleaf
43d5c00648 Store round start date in the database (#21153) 2023-10-22 21:01:48 -07:00
Pieter-Jan Briers
7c9d7423d2 Remove autogenerated from admin log key. (#18377) 2023-07-29 16:44:28 +10:00
Pieter-Jan Briers
e0c4884995 GDPR stuff update (#18300) 2023-07-26 20:05:51 +02:00
Riggle
579913b617 Better notes and bans (#14228)
Co-authored-by: Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com>
2023-07-21 13:38:52 +02:00
Pieter-Jan Briers
c8e90e561b Server ban exemption system (#15076) 2023-04-03 10:24:55 +10:00
Visne
4cc5fa239e Implement traits system (#10693) 2022-09-10 08:40:06 -07:00
Pieter-Jan Briers
e852ada6c8 Play time tracking: Job timers 3: more titles: when the (#9978)
Co-authored-by: Veritius <veritiusgaming@gmail.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-08-07 16:00:42 +10:00
Veritius
3b7e202044 Flavor text (#8070) 2022-05-13 15:58:45 -07:00
DrSmugleaf
0502d3dec4 Make Profile.Markings db column jsonb (#7947) 2022-05-05 11:23:48 +02:00
Flipp Syder
a30cae21f6 Markings (#7072)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-05-05 10:07:42 +02:00
Pieter-Jan Briers
fc119befca Fix admin log indices. (#7920) 2022-05-04 16:18:55 +02:00
DrSmugleaf
5227d1a023 Admin notes (#7259)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2022-04-16 20:57:50 +02:00
DrSmugleaf
ca0fb3c6a2 Track rule reading in database, don't show popup locally (#7278) 2022-03-26 20:16:57 +01:00
Vera Aguilera Puerto
eb54f4b224 Adds Network Resource Uploading for admins. (#6904)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2022-03-26 12:46:37 +01:00
Julian Giebel
414d226ec5 Server names and admin log full-text search (#6327)
Co-authored-by: Julian Giebel <j.giebel@netrocks.info>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2022-03-13 18:36:48 +01:00
Pieter-Jan Briers
6b66c7db8a Fix database model migrations after role bans.
Role bans (#6703) seemed to have changes to the DB model from after the migrations were created. This means a bunch of constraints/indices changed names and this wasn't reflected in a migration yet.
2022-03-08 23:36:02 +01:00
ShadowCommander
4825142210 Role bans (#6703) 2022-02-21 23:11:39 +01:00
Pieter-Jan Briers
5091c6aa9d Revert "Revert "Log ban hits in DB. ( (#6361) 2022-02-02 22:57:11 +01:00
Pieter-Jan Briers
764010fea0 Revert "Log ban hits in DB. (#6337)" (#6357)
This reverts commit b75f005bb4.
2022-01-28 19:33:09 +01:00
Pieter-Jan Briers
b75f005bb4 Log ban hits in DB. (#6337) 2022-01-28 19:10:44 +01:00
Pieter-Jan Briers
a3aabf59ad Unify remaining DB model classes between SQLite and Postgres.
As part of this, the ban and unban table were renamed to server_* on SQLite to move them in line with Postgres. Data is preserved.
2022-01-27 18:12:09 +01:00
Moony
ca984036d6 Upstream species (#6066)
* Step 1 of porting; grabbed most of the files via patches.

* Add species field to the DB

* Appearance patches for slimes.

* Fix the db test.

* Add slime's biocompat.

* slimby

* Fixes, allow specifying if a species is playable or not.

* Update Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs

Co-authored-by: Javier Guardia Fernández <DrSmugleaf@users.noreply.github.com>

* Update Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs

Co-authored-by: Javier Guardia Fernández <DrSmugleaf@users.noreply.github.com>

* Update Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs

Co-authored-by: Javier Guardia Fernández <DrSmugleaf@users.noreply.github.com>

* Address reviews.

* Address reviews.

* make an if-case.

* Fix a goof where species wouldn't get shown in the editor correctly (it'd always default to human)

Co-authored-by: Javier Guardia Fernández <DrSmugleaf@users.noreply.github.com>
2022-01-08 19:53:14 -06:00
mirrorcult
af785f873f Optional server whitelists (#5979) 2022-01-05 00:37:06 +11:00
DrSmugleaf
c3fe5909ad THE RETURN OF THE KING
This reverts commit c18d07538a.
2021-11-22 19:08:27 +01:00
DrSmugleaf
c18d07538a Revert "Admin logs (#5419)"
This reverts commit 319aec109d.
2021-11-22 18:55:17 +01:00
Javier Guardia Fernández
319aec109d Admin logs (#5419)
* Add admin logging, models, migrations

* Add logging damage changes

* Add Log admin flag, LogFilter, Logs admin menu tab, message
Refactor admin logging API

* Change admin log get method names

* Fix the name again

* Minute amount of reorganization

* Reset Postgres db snapshot

* Reset Sqlite db snapshot

* Make AdminLog have a composite primary key of round, id

* Minute cleanup

* Change admin system to do a type check instead of index check

* Make admin logs use C# 10 interpolated string handlers

* Implement UI on its own window
Custom controls
Searching
Add admin log converters

* Implement limits into the query

* Change logs to be put into an OutputPanel instead for text wrapping

* Add log <-> player m2m relationship back

* UI improvements, make text wrap, add separators

* Remove entity prefix from damaged log

* Add explicit m2m model, fix any players filter

* Add debug command to test bulk adding logs

* Admin logs now just kinda go

* Add histogram for database update time

* Make admin log system update run every 5 seconds

* Add a cap to the log queue and a metric for how many times it has been reached

* Add metric for logs sent in a round

* Make cvars out of admin logs queue send delay and cap

* Merge fixes

* Reset some changes

* Add test for adding and getting a single log

* Add tests for bulk adding logs

* Add test for querying logs

* Add CallerArgumentExpression to LogStringHandler methods and test

* Improve UI, fix SQLite, add searching by round

* Add entities to admin logs

* Move distinct after orderby

* Add migrations

* ef core eat my ass

* Add cvar for client logs batch size

* Sort logs from newest to oldest by default

* Merge fixes

* Reorganize tests and add one for date ordering

* Add note to log types to not change their numeric values

* Add impacts to logs, better UI filtering

* Make log add callable from shared for convenience

* Get current round id directly from game ticker

* Revert namespace change for DamageableSystem
2021-11-22 18:49:26 +01:00
Pieter-Jan Briers
9dae24ad89 Add extra unique constraints to DB jobs.
1. Can only have one high-priority job now. This actually got messed up for at least 10 people in the production DB and I fixed them manually.
2. Can't have duplicate jobs with the same name on the same profile.
2021-09-15 11:37:05 +02:00
Pieter-Jan Briers
a321b4302e Use HWIDs for bans. 2021-03-22 01:32:09 +01:00
Leo
a3d0e3f6a7 OOC sent by an admin will have a different color (#3117)
* Admin OOC is sent with a different color than regular OOC

- Also adds the OOC color to the database

* Command to set the color

* Ooc -> OOC

* Change default color to Red (`#ff0000`)

* Outdated namespace
2021-02-14 15:59:56 +01:00
Swept
81730e2612 Backpack preferences. (#2864)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2021-01-03 16:22:14 +01:00
20kdc
6b5cded8c2 Clothing and pronoun fields (#2689)
* Clothing & Gender fields: Add to database [MODIFIED TO NOT DEPEND ON SAPHIRE-DB-REFACTOR]

Sorry about this, Saphire.

* Clothing & Gender fields: Add UI [FALLBACK II]

* Clothing & Gender fields: Actually apply gender

* Clothing & Gender fields: Import innerclothingskirt field from my previous attempt

Couldn't import actual prototypes because of a change to IDs

* Clothing & Gender fields: Add innerclothingskirt field to everything

* Clothing & Gender fields: Jumpskirts now work

* Clothing & Gender fields: Gender field will follow sex field if it's not different (UX improvement) [FALLBACK II]

* Clothing & Gender fields: Gender -> Pronouns to reduce confusion. Also, fix profile summary. Properly. [FALLBACK II]

* Clothing & Pronoun fields: Refactor so that profile equipment adjustments are performed in StartingGearPrototype.
2020-12-24 14:42:40 +01:00
Pieter-Jan Briers
e39ddd4802 Permissions panel. 2020-11-10 16:50:28 +01:00
Pieter-Jan Briers
ad58a056d7 ConGroups are gone. Long live admin flags in content. 2020-10-30 16:06:48 +01:00
Pieter-Jan Briers
66c8a68891 Holy crap auth works (#2099)
* Holy crap auth works

* Fix some usages of UserID instead of UserName

* Refactor preferences.

They be non-async now. Also faster.

* Rename DbContext.

* Guest username assignment.

* Fix saving of profiles.

* Don't store data for guests.

* Fix generating invalid random colors.

* Don't allow dumb garbage for char preferences.

* Bans.

* Lol forgot to fill out the command description.

* Connection log.

* Rename all the tables and columns to be snake_case.

* Re-do migrations.

* Fixing tests and warnings.

* Update submodule
2020-09-29 14:26:00 +02:00