mirror of
https://github.com/corvax-team/ss14-wl.git
synced 2026-02-14 19:29:57 +01:00
Merge remote-tracking branch 'refs/remotes/upstream/master' into upstream-sync
# Conflicts: # Resources/Prototypes/Accents/word_replacements.yml # Resources/Prototypes/Entities/Clothing/Shoes/boots.yml # Resources/Prototypes/Loadouts/loadout_groups.yml # Resources/Prototypes/Roles/Jobs/Security/detective.yml # Resources/Prototypes/Species/human.yml # Resources/ServerInfo/Guidebook/Antagonist/Traitors.xml # Resources/Textures/Clothing/Head/Helmets/security.rsi/equipped-HELMET.png # Resources/Textures/Clothing/Head/Helmets/security.rsi/icon.png # Resources/Textures/Clothing/Head/Helmets/security.rsi/inhand-left.png # Resources/Textures/Clothing/Head/Helmets/security.rsi/inhand-right.png # Resources/Textures/Structures/Wallmounts/signs.rsi/meta.json
This commit is contained in:
1913
Content.Server.Database/Migrations/Postgres/20240606121555_ban_notify_trigger.Designer.cs
generated
Normal file
1913
Content.Server.Database/Migrations/Postgres/20240606121555_ban_notify_trigger.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,44 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Content.Server.Database.Migrations.Postgres
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class ban_notify_trigger : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql("""
|
||||
create or replace function send_server_ban_notification()
|
||||
returns trigger as $$
|
||||
declare
|
||||
x_server_id integer;
|
||||
begin
|
||||
select round.server_id into x_server_id from round where round.round_id = NEW.round_id;
|
||||
|
||||
perform pg_notify('ban_notification', json_build_object('ban_id', NEW.server_ban_id, 'server_id', x_server_id)::text);
|
||||
return NEW;
|
||||
end;
|
||||
$$ LANGUAGE plpgsql;
|
||||
""");
|
||||
|
||||
migrationBuilder.Sql("""
|
||||
create or replace trigger notify_on_server_ban_insert
|
||||
after insert on server_ban
|
||||
for each row
|
||||
execute function send_server_ban_notification();
|
||||
""");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql("""
|
||||
drop trigger notify_on_server_ban_insert on server_ban;
|
||||
drop function send_server_ban_notification;
|
||||
""");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -706,6 +706,11 @@ namespace Content.Server.Database
|
||||
/// Intended for use with residential IP ranges that are often used maliciously.
|
||||
/// </remarks>
|
||||
BlacklistedRange = 1 << 2,
|
||||
|
||||
/// <summary>
|
||||
/// Represents having all possible exemption flags.
|
||||
/// </summary>
|
||||
All = int.MaxValue,
|
||||
// @formatter:on
|
||||
}
|
||||
|
||||
@@ -904,7 +909,7 @@ namespace Content.Server.Database
|
||||
Panic = 3,
|
||||
/*
|
||||
* TODO: Remove baby jail code once a more mature gateway process is established. This code is only being issued as a stopgap to help with potential tiding in the immediate future.
|
||||
*
|
||||
*
|
||||
* If baby jail is removed, please reserve this value for as long as can reasonably be done to prevent causing ambiguity in connection denial reasons.
|
||||
* Reservation by commenting out the value is likely sufficient for this purpose, but may impact projects which depend on SS14 like SS14.Admin.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user