Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 717 Bytes

README.md

File metadata and controls

38 lines (26 loc) · 717 Bytes

tue-2io23

TU/e 2IO23 Project

Server API

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();

Client API

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);