110 Commits

Author SHA1 Message Date
Molti
25b96d8a52 Adds mentor help database collection (#22266)
* Adds mentor help database collection

* fix

* string

* no string

* sql changes

* ; moment

* numbers

* remove
2024-07-30 20:19:48 -05:00
John Willard
936e03e67c Adds EZDB (#21047)
* Ports EZDB

* updates python stuff to tg

* moves tools down to requirements

* Fix
2023-12-09 13:36:24 -06:00
alexkar598
37a65cbc4b Echelon system (#18860)
* Murders the old prefixed SQL template

* This no longer needs to exist

* A little refactoring before we do some trollign

* Echelon subsystem

* In hindsight, this shouldn't be here because global variables dont perssist

* Missed a constraint

* Simplifies flag checking logic

* Missed my bloody comma

* Updates outdated comment in config

* Removes the id column and sets ip as the new primary key

* This is embarassing

* Fixes alignment

* Adds round id to ban message

* baby proofs the code

* Oops, can't use it after deleting it

* Changes the ban message so that bans on abusive ISPs make more sense
2023-05-14 22:37:44 +01:00
Jamie D
5ececc0e95 Revert "Revert "[admin] Record player living playtime in notes (#18519)" (#18647)" (#18648)
This reverts commit 1127b18573.
2023-04-24 19:28:45 -05:00
Jamie D
1127b18573 Revert "[admin] Record player living playtime in notes (#18519)" (#18647)
This reverts commit b6c3e38535.
2023-04-24 18:33:22 +01:00
adamsong
b6c3e38535 [admin] Record player living playtime in notes (#18519)
* Record player living playtime in notes

* Updated to be trigger

* Fixed error in schema, oops

* Create trigger after the table it references like a smart person

* I'm a massive dunce

* Case
2023-04-24 18:11:46 +01:00
Mqiib
caf9257395 Sidewinder Again: Now With Sprites! (#18007)
* AND WE'RE BACK

* SO MUCH SIMPLER

* better facing

* Update mecha.dm

* SPACES?

* e

* construction time

hopefully

* haha oops

* e

* SPRITED

* Gets rid of useless thing

* Update all_nodes.dm
2023-02-23 23:26:36 +00:00
adamsong
1e1bd3b3b9 Add comment to bound credentials (#17286)
* Add comment to bound credentials

* Bump version
2023-01-03 16:38:41 -05:00
alexkar598
5a0ec0a676 [s] [admin] Adds credential binding (#14178)
* Adds credential binding

* Removes auto increment

* qdel 1

* qdel 2

Co-authored-by: alexkar598 <>
2022-05-21 14:53:32 +01:00
adamsong
3aa551b20d Fix for being unable to refresh MFA logins due to duplicate primary keys (#12734) 2021-11-23 23:44:23 +00:00
adamsong
35277083be Admin ticket table (#12531)
* Actually saves data to the admin tickets table

* Fix SQL syntax

* Fixes small bugs
2021-10-31 13:20:21 +00:00
adamsong
d940c3ebc7 Adds TOTP MFA for admins. (#12363)
* Adds discord based MFA for admins.

* Fixes error caused by the yogstation folder, other small errors

* Fixed SQL error, I hope

* Converts to TOTP

* Got 2FA working, as well as the backup codes

* Didn't mean to commit this

* Added QR code for scanning in the TOTP seed, removed debug statement, added reset to the permissions panel. Locked the permissions panel behind 2FA.

* Catches error messages from rust_g

* Update rust_g

* Adds 30 day expiry to sessions, also re-disables SQL and MFA in private_default

* Make persisting the session opt-in

* Adds a way for a user to clear their saved logins

* Update rust_g.dll now that the other PR was merged

* Refactor 2FA off the admin datum

* Removed extra check on the 2FA reset button

* Update database_changelog.txt
2021-10-24 15:09:57 +01:00
alexkar598
266cc701e3 Adds an index on erro_connection_log for yogbot review command (#12065)
* Adds an index on erro_connection_log for yogbot review command

* r

* Comma

* Wrong comma

* Update database_changelog.txt
2021-08-26 00:10:19 +01:00
Jamie D
0b601e5a5d Adds Custom Mentor role, can Add Wiki and Stuff now (#12014)
* Adds Custom Mentor role, can Add Wiki and Stuff now

* HAPPY ALEX?

* BugFix One

* FUCKING OOPS

* Should Fix

* e

* e

* Reeee

* e

* e

* ee

* godsake
2021-08-21 13:29:13 +01:00
Ashleigh Carr
1b0d9fe966 Changes to accommodate new webmin donation system. (#11271)
* Update world.dm to include new valid check on donations

* Update mobs.dm

* Adds new donor columns to erro free schema

* Adds new donor colums to SS13 schema

* Update tgstation_schema.sql

* Update tgstation_schema_prefixed.sql

Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>
2021-04-02 14:21:24 +01:00
alexkar598
939956e20c Fixes adding mentors not adding an admin log entry properly because whoever coded mentors does not know how to database (#10736) 2020-12-31 10:57:00 +00:00
alexkar598
ffd380f69e Updates schema pt 2 2020-10-18 22:43:33 -04:00
alexkar598
3c32ea9a85 New schema pt 1 2020-10-18 22:41:45 -04:00
TheGamerdk
ba9454f3b4 [admin] Semi-Automatic Antag Token System (#8566)
* Antag tokens

* space

* Automatic Redemption

* Bold

* Update topic.dm

* Update antag_token.dm

* Update antag_token.dm

* Update game_mode.dm

* Update antag_token.dm

* Update antag_token.dm

* Update antag_token.dm

* Update antag_token.dm

* Update antag_token.dm

* Update code/game/gamemodes/game_mode.dm

Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>

* Update game_mode.dm

Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>
2020-05-29 16:31:21 -04:00
Nichlas Pihl
eb8bdf83e9 Adds the cargoking and ducatduke achievements (#7305)
* Adds the cargoking achievement

* lol

* Update achievements.dm

* Update achievements.dm

* fixes shit?

* woops

* Update achievements.dm

* adds the ducat duke achievement

Co-authored-by: Ashleigh Carr <ashcorr20@gmail.com>
Co-authored-by: AsV9 <andreaslv99@hotmail.com>
2019-12-24 10:59:33 -05:00
Nichlas Pihl
89e590fb6c Update tgstation_schema_prefixed.sql 2019-11-20 12:42:16 +00:00
Nichlas Pihl
85edddd49b Update tgstation_schema.sql 2019-11-20 12:42:00 +00:00
Ashleigh Carr
5a800d0935 adds desc to the database as well 2019-11-15 19:00:14 +00:00
Ashleigh Carr
79c0b6eaa8 changes ckey to name 2019-11-15 18:45:01 +00:00
Ashleigh Carr
e6faaef8d9 forgot semicolons 2019-11-15 18:36:30 +00:00
Ashleigh Carr
bff20c5be5 possibly creates the schemas? 2019-11-15 18:29:23 +00:00
TheGamerdk
00f5fbc056 Adds Discord Account linking 2019-08-21 20:55:43 +02:00
ShizCalev
bd65a43a55 Removes unintentional prefixes from schema 2019-03-21 16:23:48 +01:00
oranges
d8ab6375c0 Database backed stickybans. 2019-03-17 14:27:34 +01:00
Jordie
a28de54405 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-04 20:48:17 +01:00
Joe Schmoe
ffdd72a10a modular 2018-08-29 00:03:44 +02:00
CitrusGender
42a8db55b0 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 12:40:19 +01:00
Jordie
fadacd2162 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 22:09:15 +01:00
Jordie
a54f635fb4 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 14:18:10 +02:00
Jordie
7e94c282a4 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-10 20:33:24 +01:00
Jordan Brown
a727a1b3ef Adds SQL to travis. Other travis optimizations (#38325)
* Adds SQL to travis

* See if we can get this working

* :dab:

* Try dis

* wew

* Try this?

* Should do it

* DL the biatch

* oof

* bruh

* json in 10.2

* Fix schemas

* Actually separate tools and byond builds

* Dedent the ting

* Needs more include

* Fix script logic

* Caching and fixups

* Jesus neer

* Fix this

* And this

* Fix things

* Oh that's why she did it here

* Fuck a duck

* yadayadayada

* Cache cargo in the right build

* Idiot.commit

* *sighs*

* Tools build doesn't need BYOND cache

* Create a database with the prefixed schema as well

* Fix prefixed trigger names
2018-06-11 18:09:01 +01:00
Jordie
74140e7c2a Splits up round table initialize, start, end and shutdown (#37665)
For planned change to how TGS initializes server instances ahead of time so rounds aren't tracked as being far longer than they really would be. Similarly end time split for a more accurate round duration.
2018-05-15 08:11:44 +01:00
Jordie
ee0b47bee3 Adds role time log table and triggers (#37763)
* adds role time log table and triggers

* typo

* whoops also typo here
2018-05-09 08:55:01 +01:00
Jordie
c3e1c0de2c some dbadmin fixes (#37623) 2018-05-04 11:14:42 +01:00
oranges
90779c633c Merge pull request #37267 from Jordie0608/iwasgoingtolaughatcitrusfordoingthisbutthenimadethesamemistake
Adds log and management tabs to permissions panel
2018-04-28 09:48:33 +01:00
Jordie
23a45889ed Modernizes SQL admin loading (#35264)
* updates sqladmins with excluded flags and tempminning

* rank, editing and permission protections; json backup

* fixes

* reverted the wrong file

* fix slidecolor cascading and disabled switches not being sent in form

* removes debug uncommenting

* whoops this too

* commas fix + versions for changelog entry headers since 3.0

* actually account for can_edit_flags and use of @ with - or *

* fixes and rearrangement of admin > localhost > autoadmin precedence

* in case you want to not have autologin autoadmins
2018-03-02 13:38:26 +13:00
Jordie0608
b6124b77b6 adds note to exception regarding round id 2017-11-24 01:07:21 +11:00
Jordie0608
c6b45dcbd9 adds note and warning prompt about mariadb 2017-11-24 00:00:31 +11:00
Jordie
8b19b490d1 JSON feedback (#32188)
* wip

* wip2

* makes code actually compile on 511 + fixes

* versioning

* s

* adds python conversion script, schema change and removes 'force ' from item_used_for_combat

* fix to compile

* forgot to actually commit this
2017-11-17 02:43:12 -05:00
MrStonedOne
ca33ca2e05 Note fading and persistent messages
Player Notes can now fade out over time so admins don't accidentally ban players for 4 year old notes
Deleted messages now remain in the database and are instead just hidden from view.

Two things relating to messages I've been meaning to do for ever.
2017-08-30 22:10:56 -07:00
Jordie0608
b7341a93ae adds more round id tracking 2017-08-25 22:05:32 +10:00
Jordan Brown
08a1c4bb5c Add logging of deathgasp last words and suicide stats to the death table (#29953)
* Add logging of deathgasp last words

* Column size -> 255

* comment

* Adds suicide tracking to stats death table

* Commas

* Merge the changes
2017-08-21 12:41:34 +12:00
Jordie
f2e5ccee3b moves playtime tracking change entry below header 2017-08-20 21:06:30 +10:00
Shadowlight213
e458845453 Adds tracking amount of time spent playing departments 2: The fall of the Assistants. (#29105)
* Ports Paradise Job exp system

* changed to use json_decode and json_encode as recommended by oranges

* updates changelog

* Reee cyberboss

* Changes to use a seperate table

* Updates database changelog
Changes to use mediumint

* Back to wip we go.
Changes sql stuff to how mso suggested
Attempts the changes requested in the other pr.

* work on stuff.

* work on stuff.

* Renamed proc for time remaining.
Fixed updating time amounts.
Added delay to fix firing at roundstart

* exp is now stored in a global list, and only updated to the db at round end.

* some stuff

* Added button to toggle exempt status on a player.
Still need to make it update the db

* REEE Jordie.
Undoes delaying exp updating to round end.
Adds the updating filtering to the update_exp_client proc which is used again

* Lowers a bunch of the times needed.

* Makes tracking per job instead of per department.
Department time is now calculated from job time.

* Whoops forgot to update master first. Lemme save this

Reverb should play cheeki breeki to people

* I think I did this right.
Too tired to test atm.
Busy rewatching twintails ni narimasu

* Removes var from proc arguments
Fixes database stuff

* Does some requested changes.
Makes special_role be tracked instead of bundled under special.

* Done, but need to refactor how it handles ghost roles.

* Less false data wew

* Changes

* Updates db version
More changes

* More changes

* More changes

* revision fix

* OOPS

* fix schemas

* Makes SQL error logging handled by Execute
Gang role tracking now strips out the gang name and is generic.
2017-08-20 23:01:08 +12:00
Jordie0608
7e6ed58148 change versioning check to use insert 2017-07-25 17:56:48 +10:00