Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/.idea.Zero-K/.idea/projectSettingsUpdater.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 13 additions & 8 deletions Fixer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -431,17 +431,22 @@ private static void TestPwMatchMaker()
{
var server = new global::ZkLobbyServer.ZkLobbyServer("", new PlanetwarsEventCreator());
var mm = server.PlanetWarsMatchMaker;
mm.ChallengeTime = DateTime.Now;
mm.AttackerSideCounter = 1;
//mm.ResetAttackOptions();
mm.GenerateLobbyCommand();
mm.Challenge = mm.AttackOptions[3];
mm.Challenge.OwnerFactionID = 2;
mm.Challenge.PlanetID = 4375;
mm.GetDefendingFactions(mm.Challenge);
mm.GenerateLobbyCommand();

//mm.Challenge =
// simulate defend phase with a formed squad
if (mm.AttackOptions.Count > 3)
{
var opt = mm.AttackOptions[3];
opt.OwnerFactionID = 2;
opt.PlanetID = 4375;
mm.FormedSquads.Add(opt);
mm.Phase = PwPhase.DefendCollect;
mm.PhaseStartTime = DateTime.UtcNow;
mm.GetDefendingFactions(opt);
mm.GenerateLobbyCommand();
}

Global.Server.PlanetWarsMatchMaker.GenerateLobbyCommand();
}

Expand Down
4 changes: 2 additions & 2 deletions Shared/PlasmaShared/GlobalConst.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ static void SetMode(ModeType newMode)
public const int PostVoteHideThreshold = -6;
public const bool OnlyAdminsSeePostVoters = false;
public const int PlanetWarsMinutesToAttackIfNoOption = 2;
public const int PlanetWarsMinutesToAttack = 20;
public const int PlanetWarsMinutesToAccept = 5;
public const int PlanetWarsMinutesToAttack = 5;
public const int PlanetWarsMinutesToAccept = 10;
public const int PlanetWarsDropshipsStayForMinutes = 2*60;
public const int PlanetWarsMaxTeamsize = 4;
public const double PlanetWarsDefenderWinKillCcMultiplier = 0.2;
Expand Down
8 changes: 7 additions & 1 deletion Shared/PlasmaShared/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -537,12 +537,18 @@ public static Thread SafeThread(Action action)


public static U Get<T, U>(this IDictionary<T, U> dict, T key)
where U : class
{
U val = default(U);
if (key != null) dict.TryGetValue(key, out val);
return val;
}

public static U GetOrDefault<T, U>(this IDictionary<T, U> dict, T key, U defaultValue)
{
U val = defaultValue;
if (key != null) dict.TryGetValue(key, out val);
return val;
}


public static List<T> Shuffle<T>(this IEnumerable<T> source)
Expand Down
2 changes: 1 addition & 1 deletion ZkLobbyServer/SpringieInterface/BattleResultHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private static void ProcessPlanetWars(SpringBattleContext result, ZkLobbyServer.
if (winNum > 1) winNum = null;
}

PlanetWarsTurnHandler.EndTurn(result.LobbyStartContext.Map,
PlanetWarsTurnHandler.ProcessBattleResult(result.LobbyStartContext.Map,
result.OutputExtras,
db,
winNum,
Expand Down
Loading
Loading