TU/e 2IO23 Project
When we create a game:
// starts a game
InitServer server = new InitServer();
// get the list of clients
List<PeerInfo> clients = server.getClients();
// start the game, and hand control to the token ring
server.start();
When we join a game:
Client client = new Client();
// find servers (BLOCKS! MAYBE FOR SEVERAL SECONDS!)
List<PeerInfo> servers = client.findServers();
// set the TokenChangeListener, this should receive the token, change it, and return the changed token
client.setTokenChangeListener(listener);
// connect to a server, and start the token ring
client.connect(PeerInfo server);