Replace F extension with string interpolation
This commit is contained in:
@@ -156,7 +156,7 @@ namespace OpenRA.Network
|
||||
this.target = target;
|
||||
new Thread(NetworkConnectionConnect)
|
||||
{
|
||||
Name = "{0} (connect to {1})".F(GetType().Name, target),
|
||||
Name = $"{GetType().Name} (connect to {target})",
|
||||
IsBackground = true
|
||||
}.Start();
|
||||
}
|
||||
@@ -189,11 +189,11 @@ namespace OpenRA.Network
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorMessage = "Failed to connect";
|
||||
Log.Write("client", "Failed to connect to {0}: {1}".F(endpoint, ex.Message));
|
||||
Log.Write("client", $"Failed to connect to {endpoint}: {ex.Message}");
|
||||
}
|
||||
})
|
||||
{
|
||||
Name = "{0} (connect to {1})".F(GetType().Name, endpoint),
|
||||
Name = $"{GetType().Name} (connect to {endpoint})",
|
||||
IsBackground = true
|
||||
}.Start();
|
||||
}
|
||||
@@ -212,7 +212,7 @@ namespace OpenRA.Network
|
||||
|
||||
new Thread(NetworkConnectionReceive)
|
||||
{
|
||||
Name = "{0} (receive from {1})".F(GetType().Name, tcp.Client.RemoteEndPoint),
|
||||
Name = $"{GetType().Name} (receive from {tcp.Client.RemoteEndPoint})",
|
||||
IsBackground = true
|
||||
}.Start();
|
||||
}
|
||||
@@ -235,9 +235,7 @@ namespace OpenRA.Network
|
||||
var handshakeProtocol = reader.ReadInt32();
|
||||
|
||||
if (handshakeProtocol != ProtocolVersion.Handshake)
|
||||
throw new InvalidOperationException(
|
||||
"Handshake protocol version mismatch. Server={0} Client={1}"
|
||||
.F(handshakeProtocol, ProtocolVersion.Handshake));
|
||||
throw new InvalidOperationException($"Handshake protocol version mismatch. Server={handshakeProtocol} Client={ProtocolVersion.Handshake}");
|
||||
|
||||
clientId = reader.ReadInt32();
|
||||
connectionState = ConnectionState.Connected;
|
||||
@@ -255,7 +253,7 @@ namespace OpenRA.Network
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorMessage = "Connection failed";
|
||||
Log.Write("client", "Connection to {0} failed: {1}".F(endpoint, ex.Message));
|
||||
Log.Write("client", $"Connection to {endpoint} failed: {ex.Message}");
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user