Replace F extension with string interpolation

This commit is contained in:
teinarss
2021-04-24 17:46:24 +02:00
committed by reaperrr
parent 1385aca783
commit 10676be377
300 changed files with 752 additions and 799 deletions

View File

@@ -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
{