ban event round id + ban id (#60)
This commit is contained in:
@@ -1,9 +1,13 @@
|
|||||||
using Content.Server.Administration.Managers;
|
using Content.Server.Administration.Managers;
|
||||||
|
using System.Net;
|
||||||
|
using System.Net.Sockets;
|
||||||
|
using System.Text;
|
||||||
|
using Content.Server.Database;
|
||||||
|
using Content.Server.GameTicking;
|
||||||
using Content.Server.UtkaIntegration;
|
using Content.Server.UtkaIntegration;
|
||||||
using Content.Shared.Administration;
|
using Content.Shared.Administration;
|
||||||
using Content.Shared.CCVar;
|
using Content.Shared.CCVar;
|
||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
using Robust.Server.Player;
|
|
||||||
using Robust.Shared.Configuration;
|
using Robust.Shared.Configuration;
|
||||||
using Robust.Shared.Console;
|
using Robust.Shared.Console;
|
||||||
|
|
||||||
@@ -108,6 +112,10 @@ public sealed class BanCommand : LocalizedCommands
|
|||||||
_bans.CreateServerBan(targetUid, target, player?.UserId, null, targetHWid, minutes, severity, reason, isGlobalBan);
|
_bans.CreateServerBan(targetUid, target, player?.UserId, null, targetHWid, minutes, severity, reason, isGlobalBan);
|
||||||
|
|
||||||
//WD start
|
//WD start
|
||||||
|
var dbMan = IoCManager.Resolve<IServerDbManager>();
|
||||||
|
var banlist = await dbMan.GetServerBansAsync(null, targetUid, null);
|
||||||
|
var banId = banlist[^1].Id;
|
||||||
|
|
||||||
var utkaBanned = new UtkaBannedEvent()
|
var utkaBanned = new UtkaBannedEvent()
|
||||||
{
|
{
|
||||||
Ckey = target,
|
Ckey = target,
|
||||||
@@ -115,7 +123,9 @@ public sealed class BanCommand : LocalizedCommands
|
|||||||
Bantype = "server",
|
Bantype = "server",
|
||||||
Duration = minutes,
|
Duration = minutes,
|
||||||
Global = isGlobalBan,
|
Global = isGlobalBan,
|
||||||
Reason = reason
|
Reason = reason,
|
||||||
|
Rid = EntitySystem.Get<GameTicker>().RoundId,
|
||||||
|
BanId = banId
|
||||||
};
|
};
|
||||||
_utkaSockets.SendMessageToAll(utkaBanned);
|
_utkaSockets.SendMessageToAll(utkaBanned);
|
||||||
//WD end
|
//WD end
|
||||||
|
|||||||
@@ -318,7 +318,9 @@ public sealed class RoleBanManager
|
|||||||
Duration = duration,
|
Duration = duration,
|
||||||
Bantype = job,
|
Bantype = job,
|
||||||
Global = global,
|
Global = global,
|
||||||
Reason = reason
|
Reason = reason,
|
||||||
|
Rid = EntitySystem.Get<GameTicker>().RoundId,
|
||||||
|
BanId = banId
|
||||||
};
|
};
|
||||||
|
|
||||||
_utkaSockets.SendMessageToAll(utkaBanned);
|
_utkaSockets.SendMessageToAll(utkaBanned);
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ namespace Content.Server.UtkaIntegration;
|
|||||||
public sealed class UtkaBanCommand : IUtkaCommand
|
public sealed class UtkaBanCommand : IUtkaCommand
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
|
||||||
[Dependency] private UtkaTCPWrapper _utkaSocketWrapper = default!;
|
[Dependency] private UtkaTCPWrapper _utkaSocketWrapper = default!;
|
||||||
|
|
||||||
private const ILocalizationManager LocalizationManager = default!;
|
private const ILocalizationManager LocalizationManager = default!;
|
||||||
@@ -125,7 +124,9 @@ public sealed class UtkaBanCommand : IUtkaCommand
|
|||||||
Bantype = "server",
|
Bantype = "server",
|
||||||
Duration = message.Duration,
|
Duration = message.Duration,
|
||||||
Global = message.Global,
|
Global = message.Global,
|
||||||
Reason = message.Reason
|
Reason = message.Reason,
|
||||||
|
Rid = EntitySystem.Get<GameTicker>().RoundId,
|
||||||
|
BanId = banId
|
||||||
};
|
};
|
||||||
_utkaSocketWrapper.SendMessageToAll(utkaBanned);
|
_utkaSocketWrapper.SendMessageToAll(utkaBanned);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -217,6 +217,12 @@ public sealed class UtkaBannedEvent : UtkaBaseMessage
|
|||||||
|
|
||||||
[JsonPropertyName("reason")]
|
[JsonPropertyName("reason")]
|
||||||
public string? Reason { get; set; }
|
public string? Reason { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("rid")]
|
||||||
|
public int? Rid { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("ban_id")]
|
||||||
|
public int? BanId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed class UtkaBanRequest : UtkaBaseMessage
|
public sealed class UtkaBanRequest : UtkaBaseMessage
|
||||||
|
|||||||
Reference in New Issue
Block a user