Add system to kick people if they connect to multiple servers at once. (#34563)
This commit is contained in:
committed by
GitHub
parent
1031d2a6c1
commit
71c9dfc9ea
@@ -350,6 +350,15 @@ namespace Content.Server.Database
|
||||
/// <param name="notification">The notification to trigger</param>
|
||||
void InjectTestNotification(DatabaseNotification notification);
|
||||
|
||||
/// <summary>
|
||||
/// Send a notification to all other servers connected to the same database.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The local server will receive the sent notification itself again.
|
||||
/// </remarks>
|
||||
/// <param name="notification">The notification to send.</param>
|
||||
Task SendNotification(DatabaseNotification notification);
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -1045,6 +1054,12 @@ namespace Content.Server.Database
|
||||
HandleDatabaseNotification(notification);
|
||||
}
|
||||
|
||||
public Task SendNotification(DatabaseNotification notification)
|
||||
{
|
||||
DbWriteOpsMetric.Inc();
|
||||
return RunDbCommand(() => _db.SendNotification(notification));
|
||||
}
|
||||
|
||||
private async void HandleDatabaseNotification(DatabaseNotification notification)
|
||||
{
|
||||
lock (_notificationHandlers)
|
||||
|
||||
Reference in New Issue
Block a user