Skip to content

Commit da34e51

Browse files
committed
Revert "Timeout feature"
This reverts commit 05b2986.
1 parent 05b2986 commit da34e51

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

engine/src/main/battlecode/common/GameConstants.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,8 @@ public class GameConstants {
8585
/** The percent of the map which a team needs to paint to win. */
8686
public static final int PAINT_PERCENT_TO_WIN = 70;
8787

88-
/** The maximum number of towers that a team can have. */
89-
public static final int MAX_NUMBER_OF_TOWERS = 25;
90-
91-
/**
92-
* The maximum execution time that can be spent on a team in one match. If the total time spent executing a team's bots
93-
* exceeds this limit, the team will immediately lose the game. Execution time is measured in ns.
94-
*/
95-
// public static final long MAX_TEAM_EXECUTION_TIME = 1200000000000L;
96-
97-
public static final long MAX_TEAM_EXECUTION_TIME = 5000000000L;
88+
/** The maximum number of towers that a team can have. */
89+
public static final int MAX_NUMBER_OF_TOWERS = 25;
9890

9991
// *********************************
10092
// ****** GAME MECHANICS ***********

engine/src/main/battlecode/world/control/PlayerControlProvider.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package battlecode.world.control;
22

3-
import battlecode.common.GameConstants;
43
import battlecode.common.Team;
54
import battlecode.instrumenter.InstrumentationException;
65
import battlecode.instrumenter.TeamClassLoaderFactory;
@@ -71,11 +70,6 @@ public class PlayerControlProvider implements RobotControlProvider {
7170
*/
7271
private int matchId = -1;
7372

74-
/**
75-
* The total time the player's bots have spent executing, measured in ns
76-
*/
77-
private long totalPlayerTime = 0;
78-
7973
/**
8074
* Create a new PlayerControlProvider.
8175
*
@@ -122,7 +116,6 @@ public void matchEnded() {
122116

123117
this.sandboxes.clear();
124118
this.gameWorld = null;
125-
this.totalPlayerTime = 0;
126119
}
127120

128121
@Override
@@ -180,12 +173,7 @@ public void runRobot(InternalRobot robot) {
180173

181174
if (player != null) {
182175
player.setBytecodeLimit(robot.getBytecodeLimit());
183-
long timeBefore = System.nanoTime();
184176
player.step();
185-
totalPlayerTime += (System.nanoTime() - timeBefore);
186-
if(totalPlayerTime > GameConstants.MAX_TEAM_EXECUTION_TIME) {
187-
robot.getController().resign();
188-
}
189177
}
190178
}
191179

0 commit comments

Comments
 (0)