Fix IDE0061
This commit is contained in:
committed by
Pavel Penev
parent
4f6095c3d4
commit
837c70f857
@@ -121,6 +121,9 @@ dotnet_style_predefined_type_for_member_access = true
|
|||||||
# IDE0049, IDE-only counterpart of StyleCopAnalyzers - SA1121: UseBuiltInTypeAlias.
|
# IDE0049, IDE-only counterpart of StyleCopAnalyzers - SA1121: UseBuiltInTypeAlias.
|
||||||
dotnet_style_predefined_type_for_locals_parameters_members = true
|
dotnet_style_predefined_type_for_locals_parameters_members = true
|
||||||
|
|
||||||
|
# Use expression body if a local function is a single line.
|
||||||
|
csharp_style_expression_bodied_local_functions = when_on_single_line
|
||||||
|
|
||||||
## Others:
|
## Others:
|
||||||
|
|
||||||
# Show an IDE warning when default access modifiers are explicitly specified.
|
# Show an IDE warning when default access modifiers are explicitly specified.
|
||||||
@@ -192,6 +195,9 @@ dotnet_diagnostic.IDE0059.severity = warning
|
|||||||
# Unused parameter.
|
# Unused parameter.
|
||||||
dotnet_diagnostic.IDE0060.severity = warning
|
dotnet_diagnostic.IDE0060.severity = warning
|
||||||
|
|
||||||
|
# Use expression body for local functions.
|
||||||
|
dotnet_diagnostic.IDE0061.severity = warning
|
||||||
|
|
||||||
# Naming rule violation.
|
# Naming rule violation.
|
||||||
dotnet_diagnostic.IDE1006.severity = warning
|
dotnet_diagnostic.IDE1006.severity = warning
|
||||||
|
|
||||||
|
|||||||
@@ -47,10 +47,7 @@ namespace OpenRA.Server
|
|||||||
var tracker = messageTracker[conn.PlayerIndex];
|
var tracker = messageTracker[conn.PlayerIndex];
|
||||||
tracker.RemoveAll(t => t + settings.FloodLimitInterval < time);
|
tracker.RemoveAll(t => t + settings.FloodLimitInterval < time);
|
||||||
|
|
||||||
long CalculateRemaining(long cooldown)
|
long CalculateRemaining(long cooldown) => (cooldown - time + 999) / 1000;
|
||||||
{
|
|
||||||
return (cooldown - time + 999) / 1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Block messages until join cooldown times out
|
// Block messages until join cooldown times out
|
||||||
if (!isAdmin && time < settings.FloodLimitJoinCooldown)
|
if (!isAdmin && time < settings.FloodLimitJoinCooldown)
|
||||||
|
|||||||
Reference in New Issue
Block a user