mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
switch expressions are not supported in unity 2020 (#3178)
This commit is contained in:
parent
d48d59cc08
commit
4b40dea700
@ -70,17 +70,17 @@ static KcpChannel ToKcpChannel(int channel) =>
|
||||
|
||||
TransportError ToTransportError(ErrorCode error)
|
||||
{
|
||||
return error switch
|
||||
switch(error)
|
||||
{
|
||||
ErrorCode.DnsResolve => TransportError.DnsResolve,
|
||||
ErrorCode.Timeout => TransportError.Timeout,
|
||||
ErrorCode.Congestion => TransportError.Congestion,
|
||||
ErrorCode.InvalidReceive => TransportError.InvalidReceive,
|
||||
ErrorCode.InvalidSend => TransportError.InvalidSend,
|
||||
ErrorCode.ConnectionClosed => TransportError.ConnectionClosed,
|
||||
ErrorCode.Unexpected => TransportError.Unexpected,
|
||||
_ => throw new InvalidCastException($"KCP: missing error translation for {error}")
|
||||
};
|
||||
case ErrorCode.DnsResolve: return TransportError.DnsResolve;
|
||||
case ErrorCode.Timeout: return TransportError.Timeout;
|
||||
case ErrorCode.Congestion: return TransportError.Congestion;
|
||||
case ErrorCode.InvalidReceive: return TransportError.InvalidReceive;
|
||||
case ErrorCode.InvalidSend: return TransportError.InvalidSend;
|
||||
case ErrorCode.ConnectionClosed: return TransportError.ConnectionClosed;
|
||||
case ErrorCode.Unexpected: return TransportError.Unexpected;
|
||||
default: return throw new InvalidCastException($"KCP: missing error translation for {error}");
|
||||
}
|
||||
}
|
||||
|
||||
void Awake()
|
||||
|
Loading…
Reference in New Issue
Block a user