public static final boolean hideStepCounter = true;
public static final boolean hideControlProposition = true;
public static final boolean showCurrentState = false;
public static void main(String[] args) throws InterruptedException {
final Game theGame = GameRepository.getDefaultRepository().getGame("nineBoardTicTacToe");
final Match theMatch = new Match("simpleGameSim." + Match.getRandomString(5), -1, 0, 0, theGame);
try {
// Load a sample set of cryptographic keys. These sample keys are not secure,
// since they're checked into the public GGP Base SVN repository. They are provided
// merely to illustrate how the crypto key API in Match works. If you want to prove
// that you ran a match, you need to generate your own pair of cryptographic keys,
// keep them secure and hidden, and pass them to "setCryptographicKeys" in Match.
// The match will then be signed using those keys. Do not use the sample keys if you
// want to actually prove anything.
theMatch.setCryptographicKeys(new EncodedKeyPair(FileUtils.readFileAsString(new File("src/org/ggp/base/apps/utilities/SampleKeys.json"))));
} catch (JSONException e) {
System.err.println("Could not load sample cryptograhic keys: " + e);
}
// Set up fake players to pretend to play the game
List<String> fakeHosts = new ArrayList<String>();
List<Integer> fakePorts = new ArrayList<Integer>();
for (int i = 0; i < Role.computeRoles(theGame.getRules()).size(); i++) {
fakeHosts.add("SamplePlayer" + i);
fakePorts.add(9147+i);
}
// Set up a game server to play through the game, with all players playing randomly.