Skip to content

Commit

Permalink
Remove IP address and HWId from ViewVariables (#5062)
Browse files Browse the repository at this point in the history
* Remove IP address from ViewVariables

* Remove HWId from ViewVariables
  • Loading branch information
ShadowCommander authored Apr 27, 2024
1 parent 2a102f0 commit 7cd9535
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Robust.Shared/Network/NetManager.NetChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ private sealed class NetChannel : INetChannel
public bool IsConnected => _connection.Status == NetConnectionStatus.Connected;

/// <inheritdoc />
[ViewVariables]
public IPEndPoint RemoteEndPoint => _connection.RemoteEndPoint;

/// <summary>
Expand Down Expand Up @@ -100,7 +99,7 @@ public void Disconnect(string reason, bool sendBye)

public override string ToString()
{
return $"{RemoteEndPoint}/{UserId}";
return $"{ConnectionId}/{UserId}";
}
}
}
Expand Down
18 changes: 17 additions & 1 deletion Robust.Shared/Network/NetUserData.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Immutable;
using System.Text;
using Robust.Shared.ViewVariables;

namespace Robust.Shared.Network
Expand All @@ -10,17 +11,32 @@ public sealed record NetUserData
{
[ViewVariables]
public NetUserId UserId { get; }

[ViewVariables]
public string UserName { get; }

[ViewVariables]
public string? PatronTier { get; init; }
[ViewVariables]

public ImmutableArray<byte> HWId { get; init; }

public NetUserData(NetUserId userId, string userName)
{
UserId = userId;
UserName = userName;
}

public sealed override string ToString()
{
var stringBuilder = new StringBuilder();
stringBuilder.Append("NetUserData"); // type name
stringBuilder.Append(" { ");
if ((this with { HWId = default }).PrintMembers(stringBuilder))
{
stringBuilder.Append(' ');
}
stringBuilder.Append('}');
return stringBuilder.ToString();
}
}
}

0 comments on commit 7cd9535

Please sign in to comment.