Fix some spellings.
This commit is contained in:
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Server
|
||||
{
|
||||
public class ColorValidator : ServerTrait, IClientJoined
|
||||
{
|
||||
// The bigger the color threshold, the less permitive is the algorithm
|
||||
// The bigger the color threshold, the less permissive is the algorithm
|
||||
const int ColorThreshold = 0x70;
|
||||
const byte ColorLowerBound = 0x80;
|
||||
const byte ColorHigherBound = 0xFF;
|
||||
@@ -59,7 +59,7 @@ namespace OpenRA.Mods.Common.Server
|
||||
// Reduce vector by it's biggest value (more calculations, but more accuracy too)
|
||||
var vectorMax = vector.Max(vv => Math.Abs(vv));
|
||||
if (vectorMax == 0)
|
||||
vectorMax = 1; // Avoid divison by 0
|
||||
vectorMax = 1; // Avoid division by 0
|
||||
|
||||
vector[0] /= vectorMax;
|
||||
vector[1] /= vectorMax;
|
||||
@@ -93,7 +93,7 @@ namespace OpenRA.Mods.Common.Server
|
||||
alternativeColor[1] = forbiddenColor.G + (int)(vector[1] * weightVector[1] * ii);
|
||||
alternativeColor[2] = forbiddenColor.B + (int)(vector[2] * weightVector[2] * ii);
|
||||
|
||||
// Be sure it doesnt go out of bounds (0x33 is the lower limit for HSL picker)
|
||||
// Be sure it doesn't go out of bounds (0x33 is the lower limit for HSL picker)
|
||||
alternativeColor[0] = alternativeColor[0].Clamp(ColorLowerBound, ColorHigherBound);
|
||||
alternativeColor[1] = alternativeColor[1].Clamp(ColorLowerBound, ColorHigherBound);
|
||||
alternativeColor[2] = alternativeColor[2].Clamp(ColorLowerBound, ColorHigherBound);
|
||||
|
||||
@@ -367,7 +367,7 @@ namespace OpenRA.Mods.Common.Server
|
||||
|
||||
foreach (var c in server.LobbyInfo.Clients)
|
||||
{
|
||||
// Validate if color is allowed and get an alternative it it isn't
|
||||
// Validate if color is allowed and get an alternative it isn't
|
||||
c.Color = c.PreferredColor = ColorValidator.ValidatePlayerColorAndGetAlternative(server, c.Color, c.Index, conn);
|
||||
}
|
||||
|
||||
@@ -730,7 +730,7 @@ namespace OpenRA.Mods.Common.Server
|
||||
var kickConn = server.Conns.SingleOrDefault(c => server.GetClient(c) != null && server.GetClient(c).Index == kickClientID);
|
||||
if (kickConn == null)
|
||||
{
|
||||
server.SendOrderTo(conn, "Message", "Noone in that slot.");
|
||||
server.SendOrderTo(conn, "Message", "No-one in that slot.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -869,7 +869,7 @@ namespace OpenRA.Mods.Common.Server
|
||||
|
||||
var newHslColor = FieldLoader.GetValue<HSLColor>("(value)", parts[1]);
|
||||
|
||||
// Validate if color is allowed and get an alternative it it isn't
|
||||
// Validate if color is allowed and get an alternative it isn't
|
||||
var altHslColor = ColorValidator.ValidatePlayerColorAndGetAlternative(server, newHslColor, targetClient.Index, conn);
|
||||
|
||||
targetClient.Color = altHslColor;
|
||||
|
||||
Reference in New Issue
Block a user