Files
sbox-public/engine/Sandbox.Engine/Systems/Networking/Transports/EmptyConnection.cs
Matt Stevens ceaf03d2a7 Connection name fixes (#4950)
* Servers get the player's name through handshake again, clients resolve using Steam
* Connection.Name formalized and no longer a mismatch of virtual overrides
* Connection.DisplayName now filters text using Steam settings
* Local instances set random name outside of networking code
* Used Connection.Name instead of Connection.DisplayName where it makes sense throughout the engine
* Join / leave messages are pushed to chat at a platform level
* Removed some overly verbose connection logs
2026-05-28 14:39:37 +00:00

22 lines
676 B
C#

namespace Sandbox.Network;
/// <summary>
/// An empty connection that can be used for testing and optimizing processing.
/// Messages can not actually be sent to it, and it won't receive any either. Other clients
/// will be unaware of it.
/// </summary>
internal class EmptyConnection : Connection
{
public override string Address => "empty";
public override bool IsHost => false;
internal override void InternalClose( int closeCode, string closeReason ) { }
internal override void InternalRecv( NetworkSystem.MessageHandler handler ) { }
internal override void InternalSend( byte[] data, NetFlags flags ) { }
public EmptyConnection( Guid id )
{
Id = id;
}
}