1
2
3
4
5 package spellcast.ui;
6
7 /***
8 * This is an interface to allow the GUI to request networking services.
9 * All methods are asynchronous. When the network controller has
10 * completed the appropriate request the GUI will be notified accordingly.
11 *
12 * @author Barrie Treloar
13 */
14 public interface NetworkController
15 {
16 /***
17 * Requests the network controller to start or stop sending
18 * server status requests.
19 */
20 public void serverStatus( boolean start );
21
22 /***
23 * Request the network controller to connect to the
24 * specified address and port.
25 *
26 * @param serverAddress a server string of the form host[:port]
27 * @param wizardName the name of the client's wizard
28 * @param gender the gender of the client's wizard
29 */
30 public void connect( String serverAddress,
31 String wizardName,
32 String gender );
33
34 /***
35 * Request the network controller to disconnect from
36 * the existing connection.
37 */
38 public void disconnect();
39
40 /***
41 * Request the network controller to start a server
42 * on the specified bindaddress and port.
43 *
44 * @param bindaddress a server string of the form host[:port]
45 */
46 public void startServer( String bindaddress );
47
48 /***
49 * Request the network controller to stop the existing
50 * server.
51 */
52 public void stopServer();
53 }
54