Skip to content

Commit a0db9fb

Browse files
authored
Safety for number formatting (#2203)
To make sure the numbers that end up ingame use the correct decimal separator.
1 parent f8f8e8d commit a0db9fb

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

ZkLobbyServer/SpringieInterface/StartSetup.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Data.Entity;
44
using System.Diagnostics;
5+
using System.Globalization;
56
using System.Linq;
67
using System.Text;
78
using PlasmaShared;
@@ -86,14 +87,14 @@ public static LobbyHostingContext GetDedicatedServerStartSetup(LobbyHostingConte
8687
ret.ModOptions["planet"] = planet.Name;
8788
ret.ModOptions["pw_galaxyTurn"] = galaxy.Turn.ToString();
8889

89-
ret.ModOptions["pw_baseIP"] = GlobalConst.BaseInfluencePerBattle.ToString();
90-
ret.ModOptions["pw_dropshipIP"] = planet.GetEffectiveShipIpBonus(attacker).ToString();
91-
ret.ModOptions["pw_defenseIP"] = planet.GetEffectiveIpDefense().ToString();
92-
ret.ModOptions["pw_attackerIP"] = (planet.PlanetFactions.FirstOrDefault(x => x.FactionID == attacker.FactionID)?.Influence ?? 0).ToString();
93-
ret.ModOptions["pw_maxIP"] = GlobalConst.PlanetWarsMaximumIP.ToString();
94-
ret.ModOptions["pw_neededIP"] = GlobalConst.InfluenceToCapturePlanet.ToString();
95-
ret.ModOptions["pw_attackerWinLoseCC"] = GlobalConst.PlanetWarsAttackerWinLoseCcMultiplier.ToString();
96-
ret.ModOptions["pw_defenderWinKillCC"] = GlobalConst.PlanetWarsDefenderWinKillCcMultiplier.ToString();
90+
ret.ModOptions["pw_baseIP"] = GlobalConst.BaseInfluencePerBattle.ToString(CultureInfo.InvariantCulture);
91+
ret.ModOptions["pw_dropshipIP"] = planet.GetEffectiveShipIpBonus(attacker).ToString(CultureInfo.InvariantCulture);
92+
ret.ModOptions["pw_defenseIP"] = planet.GetEffectiveIpDefense().ToString(CultureInfo.InvariantCulture);
93+
ret.ModOptions["pw_attackerIP"] = (planet.PlanetFactions.FirstOrDefault(x => x.FactionID == attacker.FactionID)?.Influence ?? 0).ToString(CultureInfo.InvariantCulture);
94+
ret.ModOptions["pw_maxIP"] = GlobalConst.PlanetWarsMaximumIP.ToString(CultureInfo.InvariantCulture);
95+
ret.ModOptions["pw_neededIP"] = GlobalConst.InfluenceToCapturePlanet.ToString(CultureInfo.InvariantCulture);
96+
ret.ModOptions["pw_attackerWinLoseCC"] = GlobalConst.PlanetWarsAttackerWinLoseCcMultiplier.ToString(CultureInfo.InvariantCulture);
97+
ret.ModOptions["pw_defenderWinKillCC"] = GlobalConst.PlanetWarsDefenderWinKillCcMultiplier.ToString(CultureInfo.InvariantCulture);
9798
}
9899

99100
// write player custom keys (level, elo, is muted, etc.)

0 commit comments

Comments
 (0)