80 likes | 277 Views
alcatraz7 - specification. kober, schiester, csamay 2007-11-16 SWD 05. Kommunikationsschema. 3. Client 1. 1. Server. 4. Client 4. 2. Client 2. Client 3. Client - Server. Client - Client. Kommunikationsschema Server und 2 bis 4 Clients 1. Client 1 registriert neues Spiel am Server
E N D
alcatraz7 - specification kober, schiester, csamay 2007-11-16 SWD 05
Kommunikationsschema 3 Client 1 1 Server 4 Client 4 2 Client 2 Client 3 Client - Server Client - Client Kommunikationsschema Server und 2 bis 4 Clients 1. Client 1 registriert neues Spiel am Server 2. Client 2 tritt neuem Spiel bei 3. Client 1 startet Spiel und beginnt mit 1 Spielzug wärend Client 2 wartet 4. Client 2 ist am Spielzug wärend Client 1 wartet...
UI - Main Window Alcatraz 7 Hauptfester des Spiels mit dem ‚Game‘ Menü geöffnet. Jeder Spieler kann mit ‚Join a game...‘ einem Spiel beitreten. Der erste Spieler der ‚Join a game...‘ aufruft, legt muss Alcatraz game view Game Help Join a game... Exit
UI – Join a game (1st Player) Open a new game Start game on 192.168.1.100 Game server: Game name: Player name: Joined players in group ‚Eisbären‘: 192.168.1.100 1 - 192.168.1.11 – Anton 2 - 3 - 4 - Eisbären OK Cancel Anton OK Cancel Der Spieler der das Spiel eröffnet muß solange wartet bis mindestens 1 Spieler in der Gruppe ‚Eisbären‘ beigetreten ist. Danach kann er noch auf weitere Spieler warten oder direkt das Spiel starten.
UI - Join game Available games on 192.168.1.100 Join game Join game: Game server: Player name: 192.168.1.11 – Eisbärn 10.12.34.128 - Riders 192.168.1.100 Sigi OK Cancel OK Cancel Wait for starting game Joined players in group ‚Eisbären‘: Spieler 2 tritt dem Spiel ‚Eisbären‘ bei und wartet solange bis Spieler 1 (Spiel eröffner) started. Spieler 2 kann wärend der Wartephase den Spielbeitritt mit dem Button ‚Cancel‘ abbrechen. 1 - 192.168.1.11 – Anton 2 - 192.168.1.23 – Sigi 3 - 4 - Cancel
Common Package package alcatraz7.common; public class Client { String ip; java.net.InetAddress name; }
Interface GameServer package alcatraz7.common.server; import java.rmi.Remote; import java.rmi.RemoteException; publicinterface GameServer extends Remote { publicvoid leaveGame(Client c) throws RemoteException; public List getClients() throws RemoteException; // if returns null a new game dialog appears public StringgetGameName() throws RemoteException; publicvoid setGameName() throws RemoteException; publicvoid joinGame(Client c) throws RemoteException; publicvoid startGame(Client c) throws RemoteException; }
Interface GameClient package alcatraz7.common.client; import java.rmi.Remote; import java.rmi.RemoteException; import at.falb.games.alcatraz.Player; import at.falb.games.alcatraz.Prisoner publicinterface GameClient extends Remote { // wait timeout for confirmMove() of all clients to go farther publicvoid doMove(Player pl, Prisoner pr, int rowOrCol, int row, int col) throws RemoteException; public void confirmMove(Client c) throws RemoteException; public void gameWon() throws RemoteException; public void nextPlayer(Client c) throws RemoteException; //public Client[]getClients() throws RemoteException; public void setClients(Client[] c) throws RemoteException; publicvoid startGame() throws RemoteException; }