mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
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
81 lines
2.7 KiB
Plaintext
81 lines
2.7 KiB
Plaintext
|
|
/client
|
|
//////////////////////
|
|
//BLACK MAGIC THINGS//
|
|
//////////////////////
|
|
parent_type = /datum
|
|
////////////////
|
|
//ADMIN THINGS//
|
|
////////////////
|
|
var/datum/admins/holder = null
|
|
var/datum/click_intercept = null // Needs to implement InterceptClickOn(user,params,atom) proc
|
|
var/AI_Interact = 0
|
|
|
|
var/ban_cache = null //Used to cache this client's bans to save on DB queries
|
|
var/last_message = "" //Contains the last message sent by this client - used to protect against copy-paste spamming.
|
|
var/last_message_count = 0 //contins a number of how many times a message identical to last_message was sent.
|
|
var/ircreplyamount = 0
|
|
|
|
/////////
|
|
//OTHER//
|
|
/////////
|
|
var/datum/preferences/prefs = null
|
|
var/last_turn = 0
|
|
var/move_delay = 0
|
|
var/area = null
|
|
|
|
///////////////
|
|
//SOUND STUFF//
|
|
///////////////
|
|
var/ambience_playing= null
|
|
var/played = 0
|
|
////////////
|
|
//SECURITY//
|
|
////////////
|
|
// comment out the line below when debugging locally to enable the options & messages menu
|
|
control_freak = 1
|
|
|
|
////////////////////////////////////
|
|
//things that require the database//
|
|
////////////////////////////////////
|
|
var/player_age = -1 //Used to determine how old the account is - in days.
|
|
var/player_join_date = null //Date that this account was first seen in the server
|
|
var/related_accounts_ip = "Requires database" //So admins know why it isn't working - Used to determine what other accounts previously logged in from this ip
|
|
var/related_accounts_cid = "Requires database" //So admins know why it isn't working - Used to determine what other accounts previously logged in from this computer id
|
|
var/account_join_date = null //Date of byond account creation in ISO 8601 format
|
|
var/account_age = -1 //Age of byond account in days
|
|
|
|
preload_rsc = PRELOAD_RSC
|
|
|
|
var/obj/screen/click_catcher/void
|
|
|
|
//These two vars are used to make a special mouse cursor, with a unique icon for clicking
|
|
var/mouse_up_icon = null
|
|
var/mouse_down_icon = null
|
|
|
|
var/ip_intel = "Disabled"
|
|
|
|
//datum that controls the displaying and hiding of tooltips
|
|
var/datum/tooltip/tooltips
|
|
|
|
var/lastping = 0
|
|
var/avgping = 0
|
|
var/connection_time //world.time they connected
|
|
var/connection_realtime //world.realtime they connected
|
|
var/connection_timeofday //world.timeofday they connected
|
|
|
|
var/inprefs = FALSE
|
|
var/list/topiclimiter
|
|
var/list/clicklimiter
|
|
|
|
var/datum/chatOutput/chatOutput
|
|
|
|
var/list/credits //lazy list of all credit object bound to this client
|
|
|
|
var/datum/player_details/player_details //these persist between logins/logouts during the same round.
|
|
<<<<<<< HEAD
|
|
|
|
var/encoding = "1252" // yogs - LibVG
|
|
=======
|
|
>>>>>>> 8a66665e95... Ban system and interface update (#41176)
|