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
106 lines
3.8 KiB
Plaintext
106 lines
3.8 KiB
Plaintext
|
|
|
|
//Values for antag preferences, event roles, etc. unified here
|
|
|
|
|
|
|
|
//These are synced with the Database, if you change the values of the defines
|
|
//then you MUST update the database!
|
|
<<<<<<< HEAD
|
|
#define ROLE_SYNDICATE "Syndicate"
|
|
#define ROLE_TRAITOR "traitor"
|
|
#define ROLE_OPERATIVE "operative"
|
|
#define ROLE_CHANGELING "changeling"
|
|
#define ROLE_WIZARD "wizard"
|
|
#define ROLE_MALF "malf AI"
|
|
#define ROLE_REV "revolutionary"
|
|
#define ROLE_REV_HEAD "Head Revolutionary"
|
|
#define ROLE_ALIEN "xenomorph"
|
|
#define ROLE_PAI "pAI"
|
|
#define ROLE_CULTIST "cultist"
|
|
#define ROLE_BLOB "blob"
|
|
#define ROLE_NINJA "space ninja"
|
|
#define ROLE_MONKEY "monkey"
|
|
#define ROLE_ABDUCTOR "abductor"
|
|
#define ROLE_REVENANT "revenant"
|
|
#define ROLE_DEVIL "devil"
|
|
#define ROLE_SERVANT_OF_RATVAR "servant of Ratvar"
|
|
#define ROLE_BROTHER "blood brother"
|
|
#define ROLE_VAMPIRE "vampire" // Yogs
|
|
#define ROLE_BRAINWASHED "brainwashed victim"
|
|
#define ROLE_OVERTHROW "syndicate mutineer"
|
|
#define ROLE_HIVE "hivemind host"
|
|
#define ROLE_SENTIENCE "sentience potion spawn"
|
|
#define ROLE_MIND_TRANSFER "mind transfer potion"
|
|
#define ROLE_POSIBRAIN "posibrain"
|
|
#define ROLE_DRONE "drone"
|
|
#define ROLE_DEATHSQUAD "deathsquad"
|
|
#define ROLE_LAVALAND "lavaland"
|
|
#define ROLE_SHADOWLING "shadowling" // Yogs
|
|
#define ROLE_INTERNAL_AFFAIRS "internal affairs agent"
|
|
=======
|
|
#define ROLE_SYNDICATE "Syndicate"
|
|
#define ROLE_TRAITOR "Traitor"
|
|
#define ROLE_OPERATIVE "Operative"
|
|
#define ROLE_CHANGELING "Changeling"
|
|
#define ROLE_WIZARD "Wizard"
|
|
#define ROLE_MALF "Malf AI"
|
|
#define ROLE_REV "Revolutionary"
|
|
#define ROLE_REV_HEAD "Head Revolutionary"
|
|
#define ROLE_ALIEN "Xenomorph"
|
|
#define ROLE_PAI "pAI"
|
|
#define ROLE_CULTIST "Cultist"
|
|
#define ROLE_BLOB "Blob"
|
|
#define ROLE_NINJA "Space Ninja"
|
|
#define ROLE_MONKEY "Monkey"
|
|
#define ROLE_ABDUCTOR "Abductor"
|
|
#define ROLE_REVENANT "Revenant"
|
|
#define ROLE_DEVIL "Devil"
|
|
#define ROLE_SERVANT_OF_RATVAR "Servant of Ratvar"
|
|
#define ROLE_BROTHER "Blood Brother"
|
|
#define ROLE_BRAINWASHED "Brainwashed Victim"
|
|
#define ROLE_OVERTHROW "Syndicate Mutineer"
|
|
#define ROLE_HIVE "Hivemind Host"
|
|
#define ROLE_SENTIENCE "Sentience Potion Spawn"
|
|
#define ROLE_MIND_TRANSFER "Mind Transfer Potion"
|
|
#define ROLE_POSIBRAIN "Posibrain"
|
|
#define ROLE_DRONE "Drone"
|
|
#define ROLE_DEATHSQUAD "Deathsquad"
|
|
#define ROLE_LAVALAND "Lavaland"
|
|
#define ROLE_INTERNAL_AFFAIRS "Internal Affairs Agent"
|
|
>>>>>>> 8a66665e95... Ban system and interface update (#41176)
|
|
|
|
//Missing assignment means it's not a gamemode specific role, IT'S NOT A BUG OR ERROR.
|
|
//The gamemode specific ones are just so the gamemodes can query whether a player is old enough
|
|
//(in game days played) to play that role
|
|
GLOBAL_LIST_INIT(special_roles, list(
|
|
ROLE_TRAITOR = /datum/game_mode/traitor,
|
|
ROLE_BROTHER = /datum/game_mode/traitor/bros,
|
|
ROLE_OPERATIVE = /datum/game_mode/nuclear,
|
|
ROLE_CHANGELING = /datum/game_mode/changeling,
|
|
ROLE_WIZARD = /datum/game_mode/wizard,
|
|
ROLE_MALF,
|
|
ROLE_REV = /datum/game_mode/revolution,
|
|
ROLE_ALIEN,
|
|
ROLE_PAI,
|
|
ROLE_CULTIST = /datum/game_mode/cult,
|
|
ROLE_BLOB,
|
|
ROLE_NINJA,
|
|
ROLE_MONKEY = /datum/game_mode/monkey,
|
|
ROLE_REVENANT,
|
|
ROLE_ABDUCTOR,
|
|
ROLE_DEVIL = /datum/game_mode/devil,
|
|
ROLE_SERVANT_OF_RATVAR = /datum/game_mode/clockwork_cult,
|
|
ROLE_VAMPIRE = /datum/game_mode/vampire, // Yogs
|
|
ROLE_OVERTHROW = /datum/game_mode/overthrow,
|
|
ROLE_SHADOWLING = /datum/game_mode/shadowling, //yogs
|
|
ROLE_HIVE = /datum/game_mode/hivemind,
|
|
ROLE_INTERNAL_AFFAIRS = /datum/game_mode/traitor/internal_affairs,
|
|
ROLE_SENTIENCE
|
|
))
|
|
|
|
//Job defines for what happens when you fail to qualify for any job during job selection
|
|
#define BEOVERFLOW 1
|
|
#define BERANDOMJOB 2
|
|
#define RETURNTOLOBBY 3
|