Obsolete refactor - ConnectedClient to Channel (#24409)
This commit is contained in:
@@ -267,7 +267,7 @@ namespace Content.Server.Administration.Managers
|
||||
|
||||
msg.AvailableCommands = commands.ToArray();
|
||||
|
||||
_netMgr.ServerSendMessage(msg, session.ConnectedClient);
|
||||
_netMgr.ServerSendMessage(msg, session.Channel);
|
||||
}
|
||||
|
||||
private void PlayerStatusChanged(object? sender, SessionStatusEventArgs e)
|
||||
@@ -389,7 +389,7 @@ namespace Content.Server.Administration.Managers
|
||||
|
||||
private static bool IsLocal(ICommonSession player)
|
||||
{
|
||||
var ep = player.ConnectedClient.RemoteEndPoint;
|
||||
var ep = player.Channel.RemoteEndPoint;
|
||||
var addr = ep.Address;
|
||||
if (addr.IsIPv4MappedToIPv6)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ public sealed class BanManager : IBanManager, IPostInjectInit
|
||||
if (e.NewStatus != SessionStatus.Connected || _cachedRoleBans.ContainsKey(e.Session.UserId))
|
||||
return;
|
||||
|
||||
var netChannel = e.Session.ConnectedClient;
|
||||
var netChannel = e.Session.Channel;
|
||||
ImmutableArray<byte>? hwId = netChannel.UserData.HWId.Length == 0 ? null : netChannel.UserData.HWId;
|
||||
await CacheDbRoleBans(e.Session.UserId, netChannel.RemoteEndPoint.Address, hwId);
|
||||
|
||||
@@ -175,7 +175,7 @@ public sealed class BanManager : IBanManager, IPostInjectInit
|
||||
return;
|
||||
// If they are, kick them
|
||||
var message = banDef.FormatBanMessage(_cfg, _localizationManager);
|
||||
targetPlayer.ConnectedClient.Disconnect(message);
|
||||
targetPlayer.Channel.Disconnect(message);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -293,7 +293,7 @@ public sealed class BanManager : IBanManager, IPostInjectInit
|
||||
};
|
||||
|
||||
_sawmill.Debug($"Sent rolebans to {pSession.Name}");
|
||||
_netManager.ServerSendMessage(bans, pSession.ConnectedClient);
|
||||
_netManager.ServerSendMessage(bans, pSession.Channel);
|
||||
}
|
||||
|
||||
public void PostInject()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Immutable;
|
||||
using System.Collections.Immutable;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
@@ -67,8 +67,8 @@ namespace Content.Server.Administration
|
||||
if (_playerManager.TryGetSessionByUsername(playerName, out var session))
|
||||
{
|
||||
var userId = session.UserId;
|
||||
var address = session.ConnectedClient.RemoteEndPoint.Address;
|
||||
var hwId = session.ConnectedClient.UserData.HWId;
|
||||
var address = session.Channel.RemoteEndPoint.Address;
|
||||
var hwId = session.Channel.UserData.HWId;
|
||||
return new LocatedPlayerData(userId, address, hwId, session.Name);
|
||||
}
|
||||
|
||||
@@ -107,8 +107,8 @@ namespace Content.Server.Administration
|
||||
// Check people currently on the server, the easiest case.
|
||||
if (_playerManager.TryGetSessionById(userId, out var session))
|
||||
{
|
||||
var address = session.ConnectedClient.RemoteEndPoint.Address;
|
||||
var hwId = session.ConnectedClient.UserData.HWId;
|
||||
var address = session.Channel.RemoteEndPoint.Address;
|
||||
var hwId = session.Channel.UserData.HWId;
|
||||
return new LocatedPlayerData(userId, address, hwId, session.Name);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Administration;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
@@ -33,7 +33,7 @@ public sealed partial class QuickDialogSystem
|
||||
okAction.Invoke(v1);
|
||||
else
|
||||
{
|
||||
session.ConnectedClient.Disconnect("Replied with invalid quick dialog data.");
|
||||
session.Channel.Disconnect("Replied with invalid quick dialog data.");
|
||||
cancelAction?.Invoke();
|
||||
}
|
||||
}),
|
||||
@@ -74,7 +74,7 @@ public sealed partial class QuickDialogSystem
|
||||
okAction.Invoke(v1, v2);
|
||||
else
|
||||
{
|
||||
session.ConnectedClient.Disconnect("Replied with invalid quick dialog data.");
|
||||
session.Channel.Disconnect("Replied with invalid quick dialog data.");
|
||||
cancelAction?.Invoke();
|
||||
}
|
||||
}),
|
||||
@@ -118,7 +118,7 @@ public sealed partial class QuickDialogSystem
|
||||
okAction.Invoke(v1, v2, v3);
|
||||
else
|
||||
{
|
||||
session.ConnectedClient.Disconnect("Replied with invalid quick dialog data.");
|
||||
session.Channel.Disconnect("Replied with invalid quick dialog data.");
|
||||
cancelAction?.Invoke();
|
||||
}
|
||||
}),
|
||||
@@ -166,7 +166,7 @@ public sealed partial class QuickDialogSystem
|
||||
okAction.Invoke(v1, v2, v3, v4);
|
||||
else
|
||||
{
|
||||
session.ConnectedClient.Disconnect("Replied with invalid quick dialog data.");
|
||||
session.Channel.Disconnect("Replied with invalid quick dialog data.");
|
||||
cancelAction?.Invoke();
|
||||
}
|
||||
}),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Enums;
|
||||
@@ -40,7 +40,7 @@ public sealed partial class QuickDialogSystem : EntitySystem
|
||||
{
|
||||
if (!_openDialogs.ContainsKey(msg.DialogId) || !_openDialogsByUser[args.SenderSession.UserId].Contains(msg.DialogId))
|
||||
{
|
||||
args.SenderSession.ConnectedClient.Disconnect($"Replied with invalid quick dialog data with id {msg.DialogId}.");
|
||||
args.SenderSession.Channel.Disconnect($"Replied with invalid quick dialog data with id {msg.DialogId}.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace Content.Server.Administration.Systems
|
||||
|
||||
foreach (var admin in _adminManager.ActiveAdmins)
|
||||
{
|
||||
RaiseNetworkEvent(updateEv, admin.ConnectedClient);
|
||||
RaiseNetworkEvent(updateEv, admin.Channel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace Content.Server.Administration.Systems
|
||||
|
||||
foreach (var admin in _adminManager.ActiveAdmins)
|
||||
{
|
||||
RaiseNetworkEvent(playerInfoChangedEvent, admin.ConnectedClient);
|
||||
RaiseNetworkEvent(playerInfoChangedEvent, admin.Channel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ namespace Content.Server.Administration.Systems
|
||||
|
||||
if (!obj.IsAdmin)
|
||||
{
|
||||
RaiseNetworkEvent(new FullPlayerListEvent(), obj.Player.ConnectedClient);
|
||||
RaiseNetworkEvent(new FullPlayerListEvent(), obj.Player.Channel);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ namespace Content.Server.Administration.Systems
|
||||
|
||||
ev.PlayersInfo = _playerList.Values.ToList();
|
||||
|
||||
RaiseNetworkEvent(ev, playerSession.ConnectedClient);
|
||||
RaiseNetworkEvent(ev, playerSession.Channel);
|
||||
}
|
||||
|
||||
private PlayerInfo GetPlayerInfo(SessionData data, ICommonSession? session)
|
||||
|
||||
@@ -500,7 +500,7 @@ public sealed partial class AdminVerbSystem
|
||||
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/gavel.svg.192dpi.png")),
|
||||
Act = () =>
|
||||
{
|
||||
_ghostKickManager.DoDisconnect(actorComponent.PlayerSession.ConnectedClient, "Smitten.");
|
||||
_ghostKickManager.DoDisconnect(actorComponent.PlayerSession.Channel, "Smitten.");
|
||||
},
|
||||
Impact = LogImpact.Extreme,
|
||||
Message = Loc.GetString("admin-smite-ghostkick-description")
|
||||
|
||||
@@ -431,7 +431,7 @@ namespace Content.Server.Administration.Systems
|
||||
// Notify player
|
||||
if (_playerManager.TryGetSessionById(message.UserId, out var session))
|
||||
{
|
||||
if (!admins.Contains(session.ConnectedClient))
|
||||
if (!admins.Contains(session.Channel))
|
||||
{
|
||||
// If _overrideClientName is set, we generate a new message with the override name. The admins name will still be the original name for the webhooks.
|
||||
if (_overrideClientName != string.Empty)
|
||||
@@ -451,10 +451,10 @@ namespace Content.Server.Administration.Systems
|
||||
overrideMsgText = $"{senderSession.Name}: {escapedText}"; // Not an admin, name is not overridden.
|
||||
}
|
||||
|
||||
RaiseNetworkEvent(new BwoinkTextMessage(message.UserId, senderSession.UserId, overrideMsgText), session.ConnectedClient);
|
||||
RaiseNetworkEvent(new BwoinkTextMessage(message.UserId, senderSession.UserId, overrideMsgText), session.Channel);
|
||||
}
|
||||
else
|
||||
RaiseNetworkEvent(msg, session.ConnectedClient);
|
||||
RaiseNetworkEvent(msg, session.Channel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -480,7 +480,7 @@ namespace Content.Server.Administration.Systems
|
||||
// No admin online, let the player know
|
||||
var systemText = Loc.GetString("bwoink-system-starmute-message-no-other-users");
|
||||
var starMuteMsg = new BwoinkTextMessage(message.UserId, SystemUserId, systemText);
|
||||
RaiseNetworkEvent(starMuteMsg, senderSession.ConnectedClient);
|
||||
RaiseNetworkEvent(starMuteMsg, senderSession.Channel);
|
||||
}
|
||||
|
||||
// Returns all online admins with AHelp access
|
||||
@@ -488,7 +488,7 @@ namespace Content.Server.Administration.Systems
|
||||
{
|
||||
return _adminManager.ActiveAdmins
|
||||
.Where(p => _adminManager.GetAdminData(p)?.HasFlag(AdminFlags.Adminhelp) ?? false)
|
||||
.Select(p => p.ConnectedClient)
|
||||
.Select(p => p.Channel)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user