Commit Graph

74 Commits

Author SHA1 Message Date
Chief-Engineer 0c17e4e764 Add debug logs to baby jail and fix playtime logic (#30158)
* add debug logs

* Update Model.cs

* fix playtime logic for null playtime

* remove unnecessary condition

* either me or the compiler is having a C# skill issue
2024-08-09 17:52:21 +01:00
Chief-Engineer 366cea3352 Fix baby jail (#29896)
* Revert "Revert Baby Jail (#29891)"

This reverts commit 24a2866747e6de37ab2c4395bee9ea44c9211c6f.

* the fix
2024-08-09 17:39:18 +01:00
Vasilis b0edb5ccf0 Revert Baby Jail (#29891)
* Revert "SS14-28662 Add Baby Jail: a Jail for Babies (inverse panic bunker) (#28763)"

This reverts commit 3ceb92a0c43d3815d65c8124cd6bea3be5140455.

* Revert configs

* Oops
2024-08-09 17:38:45 +01:00
Pieter-Jan Briers c75fd41cd3
Ban template system (#29365)
To help out admins, so they can easily fill out datacenter bans and stuff. Supports ban exemption flags and everything.

This is for use with SS14.Admin so it's just DB models here.
2024-07-25 01:44:27 +02:00
Pieter-Jan Briers 5c5cbdee02
Add time index to connection log (#29281)
* Add time index to connection log

Queries go nyoom.

* Don't let me code shit at 5 AM
2024-07-25 00:41:18 +02:00
nikthechampiongr 7f6d04b7d3
Implement BlacklistedRange exempt flag (#29258)
* Implement a new kind of ip range ban that only applies to new players

* Put determining whether a player record exists to its own function

* Make BlacklistedRange bans get bypassed by any ban exemption

* Stop trying to get another DbGuard while already having one

This does break with convention on the functions in that area but
considering the use of this function it's probably fine?
I could alternatively just move the place it's called from.

Also I was suppossed to wait for tests to finish locally just to be
sure, but nah. I am pushing this now
2024-07-25 00:40:24 +02:00
Hannah Giovanna Dawson 1cee444776
SS14-28662 Add Baby Jail: a Jail for Babies (inverse panic bunker) (#28763) 2024-07-05 20:23:37 +02:00
DrSmugleaf eed9c58386
Add job whitelist system (#28085)
* Add job whitelist system

* Address reviews

* Fix name

* Apply suggestions from code review

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>

* cancinium

---------

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
2024-06-01 18:02:43 +02:00
NullWanderer 74002a1c4e
Merge remote-tracking branch 'refs/remotes/upstream/master' into 2024/04/21-loadouts
# Conflicts:
#	Content.Server/IoC/ServerContentIoC.cs
#	Resources/Prototypes/Roles/Jobs/Medical/chemist.yml
2024-04-22 19:41:29 +02:00
metalgearsloth d49eabc1a5
Partial cherry-pick: Loadouts redux (#25715)
Signed-off-by: NullWanderer <56081759+NullWanderer@users.noreply.github.com>
2024-04-22 03:28:58 +02:00
Pieter-Jan Briers 2563eb6f50
Re-add IAdminRemarksCommon to DB model for SS14.Admin (#27028)
This was removed in #25280 as the relevant DB entities didn't go outside the DB layer anymore. SS14.Admin however still uses them directly (as it only supports Postgres), so the interface is still useful there.

(cherry picked from commit bbf0505fdc0f49a40a66473296f912cb4d580cb9)
2024-04-21 22:03:38 +02:00
Pieter-Jan Briers 8e8a4cf1b6
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

(cherry picked from commit d3ac3d06bb6eddd9c2076a586974aabf514a5c86)
2024-04-21 21:57:13 +02:00
Pieter-Jan Briers 16c7c2882d
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.

(cherry picked from commit d776c4b392a082dba7539d77cfa20fc904ed4091)
2024-03-24 00:08:01 +01:00
Pieter-Jan Briers 837272c745
Fix admin notes and database time nonsense. (#25280)
God bloody christ. There's like three layers of shit here.

So firstly, apparently we were still using Npgsql.EnableLegacyTimestampBehavior. This means that time values (which are stored UTC in the database) were converted to local time when read out. This meant they were passed around as kind Local to clients (instead of UTC in the case of SQLite). That's easy enough to fix just turn off the flag and fix the couple spots we're passing a local DateTime ez.

Oh but it turns out there's a DIFFERENT problem with SQLite: See SQLite we definitely store the DateTimes as UTC, but when Microsoft.Data.Sqlite reads them it reads them as Kind Unspecified instead of Utc.

Why are these so bad? Because the admin notes system passes DateTime instances from EF Core straight to the rest of the game code. And that means it's a PAIN IN THE ASS to run the necessary conversions to fix the DateTime instances. GOD DAMNIT now I have to make a whole new set of "Record" entities so we avoid leaking the EF Core model entities. WAAAAAAA.

Fixes #19897

(cherry picked from commit 2e6eaa45c57c7f5ba561d1fb1ef6712d2432a8fa)
2024-02-21 04:03:44 +01:00
Krunklehorn 922407e2e8
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>

(cherry picked from commit ed0f2aa2213cc47b817476206a2dd0b4e7c176b1)
2024-02-08 12:16:20 +01:00
Pieter-Jan Briers 1c54b75da5
Dependency update / fixes / skrungle bungle (#23745)
* Give .props files 2-space indents.

* Move to Central Package Management.

Allows us to store NuGet package versions all in one place. Yay!

* Update NuGet packages and fix code for changes.

Notable:

Changes to ILVerify.
Npgsql doesn't need hacks for inet anymore, now we need hacks to make the old code work with this new reality.
NUnit's analyzers are already complaining and I didn't even update it to 4.x yet.
TerraFX changed to GetLastSystemError so error handling had to be changed.
Buncha APIs have more NRT annotations.

* Remove dotnet-eng NuGet package source.

I genuinely don't know what this was for, and Central Package Management starts throwing warnings about it, so YEET.

* Remove Robust.Physics project.

Never used.

* Remove erroneous NVorbis reference.

Should be VorbisPizza and otherwise wasn't used.

* Sandbox fixes

* Remove unused unit test package references.

Castle.Core and NUnit.ConsoleRunner.

* Update NUnit to 4.0.1

This requires replacing all the old assertion methods because they removed them 🥲

* Oh so that's what dotnet-eng was used for. Yeah ok that makes sense.

* Add Robust.Analyzers.Test

* Update submodule

* commit to re-run CI

(cherry picked from commit a6c9c36b688a1ba78ff4c12502e81661cf607b6c)
2024-01-26 22:33:46 +01:00
Pieter-Jan Briers fdfd718f60
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.

(cherry picked from commit a39999fb9c9f00fc3da17a63d9a0a26706f3720e)
2024-01-26 22:26:15 +01:00
Pieter-Jan Briers f648007c8c Log server ID in connection logs table (#21911) 2023-12-16 19:27:08 +01:00
DrSmugleaf 98bde9eaa8 Drop admin log entity db table (#21216) 2023-10-24 18:03:52 +02:00
DrSmugleaf a20b27ca80 Stop all reads/writes to the admin_log_entity table (#21186) 2023-10-23 23:54:01 +02:00
DrSmugleaf 734118a7ef Store round start date in the database (#21153) 2023-10-23 23:54:01 +02: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
Chief-Engineer 5eba1d230a
Add IP ban exemption flag (#15815) 2023-04-27 11:59:18 -07:00
Pieter-Jan Briers c8e90e561b
Server ban exemption system (#15076) 2023-04-03 10:24:55 +10:00
Pieter-Jan Briers 360a507688
Shared interfaces for server and role ban entities (#14730) 2023-03-18 20:44:14 +01: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
Moony 8e90bf46e9
Implements panic bunkering. (#9315)
* Implements panic bunkering.
Helps with raid management, esp with unknown accounts.

* adds an enable/disable command.
2022-07-01 22:46:37 +02:00
Veritius 3b7e202044
Flavor text (#8070) 2022-05-13 15:58:45 -07:00
Julian Giebel 288f66d8c4
Implement count estimate query for postgresdb (#7956) 2022-05-06 16:04:33 +02: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
ShadowCommander b99b1f4008
Fix RoleUnban referring to the wrong ban type (#6885) 2022-02-24 15:59:38 -08:00
ShadowCommander 4a68718050
Role ban improvements (#6855) 2022-02-21 22:00:55 -07:00
ShadowCommander 4825142210
Role bans (#6703) 2022-02-21 23:11:39 +01:00
Pieter-Jan Briers 4da56becab Fix DbContext configuration nightmares.
Thanks to julian figuring out IDesignTimeDbContextFactory exists in #6327.

All this DbContext configuration and options setup stuff is insane. Microsoft should be absolutely ashamed for coming up with this load of garbage.
2022-02-03 03:13:34 +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
Pieter-Jan Briers 64861ff034
Add Content.Shared.Database (#5588) 2021-11-28 14:56:53 +01:00