diff 0.1.0/AboutPopup.java 0.2.0/AboutPopup.java 2d1 < diff 0.1.0/Board.java 0.2.0/Board.java 157a158,160 > public void draw() > { forceWin=5; > } 528,529c531,535 < }else r+= < "Game over, "+colorGen(whoWon())+" has won the game!"; --- > }else > { int w=whoWon(); > if(w==5)r="Game drawn."; > else r="Game over, "+colorGen(w)+" has won the game!"; > } diff 0.1.0/Client.java 0.2.0/Client.java 3a4 > import java.util.ArrayList; 17a19,20 > ArrayList confirmDialogs; > //DebugWindow debug; 36c39,40 < { String h="",initialSeeks,initialPlayers; --- > { //debug=new DebugWindow("Client Debugging"); > String h="",initialSeeks,initialPlayers; 44a49 > confirmDialogs=new ArrayList(); 77,78c82 < "Your opponent has quit during the game," < +" and it has been aborted."); --- > "Game aborted."); 80c84,87 < }else if(s.equals("Takeback Request")) --- > }else if(s.equals("Game Drawn")) > { gameWindow.draw(); > } > else if(s.equals("Takeback Request")) 87c94,102 < }else if(s.equals("Resign")) --- > }else if(s.equals("Draw Offer")) > { int allow=JOptionPane.showConfirmDialog(null, > "Your opponent has offered a draw." > +"\nDo you accept?", > "Accept Draw Offer?",JOptionPane.YES_NO_OPTION); > if(allow==JOptionPane.YES_OPTION) > sendString("Draw Accepted"); > } > else if(s.equals("Resign")) 94a110,128 > }else if(s.equals("You Added A Seek")) > { int n=getInt(); > String gt=getString(),mp; > mp=getString(); > boolean r=getBoolean(); > confirmDialogs.add(new ConfirmDialog(this,n,gt,mp,r)); > }else if(s.equals("Seek Declined")) > { String p=getString(),g,m; > g=getString(); > m=getString(); > popup(p+" declined to play you in ("+g+" "+m+")."); > } > else if(s.equals("Player Accepted")) > { int numb=getInt(); > String accName=getString(); > for(int j=0;j { ConfirmDialog g=confirmDialogs.get(j); > if(g.number==numb)g.challenger(accName); > } 122a157,164 > public void chat(String s) > { sendString("Chat"); > sendString(s); > } > public void gameChat(String s) > { sendString("Game Chat"); > sendString(s); > } 130a173,175 > public void offerDraw() > { sendString("Draw Offer"); > } 133a179,202 > public void sendSeek(String n,String m,boolean r) > { sendString("Seek"); > sendString(n); > sendString(m); > sendBoolean(r); > } > public void accpetSeek(int n) > { sendString("Accept Seek"); > sendInt(n); > } > public void withdrawSeek(int n) > { sendString("Withdraw Seek"); > sendInt(n); > } > public void seekConfirmed(int n,String p) > { sendString("Seek Confirmed"); > sendInt(n); > sendString(p); > } > public void seekDeclined(int n,String p) > { sendString("Seek Declined"); > sendInt(n); > sendString(p); > } 136c205,206 < { output.writeUTF(s); --- > { //debug.addOutput(s); > output.writeUTF(s); 143c213,214 < { output.writeInt(i); --- > { //debug.addOutput(i+""); > output.writeInt(i); 150c221,222 < { output.writeBoolean(b); --- > { //debug.addOutput(b+""); > output.writeBoolean(b); 157c229,231 < { return input.readUTF(); --- > { String i=input.readUTF(); > //debug.addInput(i); > return i; 165c239,241 < { return input.readInt(); --- > { int i=input.readInt(); > //debug.addInput(i+""); > return i; 173c249,251 < { return input.readBoolean(); --- > { boolean b=input.readBoolean(); > //debug.addInput(b+""); > return b; diff 0.1.0/Console.java 0.2.0/Console.java 38,39c38 < client.sendString("Chat"); < client.sendString(s); --- > client.chat(s); diff 0.1.0/Game.java 0.2.0/Game.java 6a7 > private Server server; 13a15 > server=s; 67a70 > server.removeGame(this); 71a75 > server.removeGame(this); 86,90c90,98 < { if(b.players==2) < { for(int i=0;i { for(int i=0;i { Player d=players[i]; > if(!d.equals(p))d.sendString("Takeback Request"); > } > } > public synchronized void drawOffer(Player p) > { for(int i=0;i { Player d=players[i]; > if(!d.equals(p))d.sendString("Draw Offer"); 94,100c102,105 < { if(b.players==2) < { int ammt=1; < String cur=players[currentPlayer-1].getPlayerName(); < if(!cur.equals(p.getPlayerName())) < { ammt=2; < b=log.takeBackMove().returnClone(); < } --- > { int ammt=1; > String cur=players[currentPlayer-1].getPlayerName(); > if(!cur.equals(p.getPlayerName())) > { ammt=2; 102,104d106 < currentPlayer=b.turn; < for(int i=0;i b=log.takeBackMove().returnClone(); > currentPlayer=b.turn; > for(int i=0;i players[i].takeBackMove(ammt); > } > public synchronized void drawAccepted() > { b.draw();log.addMove(b); > for(int i=0;i players[i].sendString("Game Drawn"); > endGame(); diff 0.1.0/GameWindow.java 0.2.0/GameWindow.java 17c17 < JButton resignButton,undoButton; --- > JButton resignButton,undoButton,offerDrawButton; 44,45c44 < client.sendString("Game Chat"); < client.sendString(s); --- > client.gameChat(s); 52c51,52 < { client.takeBackMoveRequest(); --- > { if(!board.gameOver()) > client.takeBackMoveRequest(); 58c58,66 < { client.resign(); --- > { if(!board.gameOver()) > client.resign(); > } > }); > offerDrawButton=new JButton("Offer a Draw"); > offerDrawButton.addActionListener(new ActionListener() > { public void actionPerformed(ActionEvent e) > { if(!board.gameOver()) > client.offerDraw(); 67a76 > buttons.add(offerDrawButton); 169,172c178,185 < { Board c=board.returnClone(); < c.resign(i); < board=c; < log.addMove(c); --- > { board.resign(i); > log.addMove(board); > boardPanel.selected=false; > boardPanel.repaint(); > } > public void draw() > { board.draw(); > log.addMove(board); Common subdirectories: 0.1.0/Images and 0.2.0/Images diff 0.1.0/NewGameMenu.java 0.2.0/NewGameMenu.java 89,94c89 < { if(anyBoard()) < { client.sendString("Seek"); < client.sendString(gameName()); < client.sendString(gameMap()); < client.sendBoolean(randomized()); < } --- > { client.sendSeek(gameName(),gameMap(),randomized()); diff 0.1.0/Player.java 0.2.0/Player.java 68a69,72 > }else if(s.equals("Draw Offer")) > { if(hasAGame) > { game.drawOffer(this); > }else sendString(notYet); 73c77,82 < }else if(s.equals("Seek")) --- > }else if(s.equals("Draw Accepted")) > { if(hasAGame) > { game.drawAccepted(); > }else sendString(notYet); > } > else if(s.equals("Seek")) 83a93,104 > }else if(s.equals("Seek Confirmed")) > { if(!hasAGame) > { int number=getInt(); > String p=getString(); > if(server.seekExists(number)&& > server.playerExists(p)&& > !name.equals(p)) > { Seek seek=server.getSeek(number); > Player other=server.getPlayer(p); > server.addAGame(seek,other); > }else sendString("Seek confirmation error."); > }else sendString(already); 88,91c109,110 < { Seek seek=server.getSeek(number); < if(seek.playerName()!=name) < server.addAGame(seek,this); < else sendString("You cant accpet your own seek!"); --- > { server.getSeek(number). > getPlayer().playerAccepted(name,number); 93a113,122 > }else if(s.equals("Seek Declined")) > { int n=getInt(); > String p=getString(); > Seek k=server.getSeek(n); > server.getPlayer(p). > seekDeclined(name,k.getGameType(), > k.getBoardType(),k.getRandomized()); > } > else if(s.equals("Withdraw Seek")) > { server.removeSeek(getInt()); 122a152,155 > public void chat(String s) > { sendString("Chat"); > sendString(s); > } 153a187,207 > public synchronized void playerAccepted(String n,int i) > { sendString("Player Accepted"); > sendInt(i); > sendString(n); > } > public synchronized void youAddedSeek( > int number,String gameType,String map,boolean rand) > { sendString("You Added A Seek"); > sendInt(number); > sendString(gameType); > sendString(map); > sendBoolean(rand); > } > public synchronized void seekDeclined(String p,String g,String m,boolean r) > { String sendM=m; > if(r)m+="(r)"; > sendString("Seek Declined"); > sendString(p); > sendString(g); > sendString(sendM); > } 156c210,211 < { output.writeUTF(s); --- > { server.debugOutput(name,s); > output.writeUTF(s); 163c218,219 < { output.writeInt(i); --- > { server.debugOutput(name,i+""); > output.writeInt(i); 170c226,227 < { output.writeBoolean(b); --- > { server.debugOutput(name,b+""); > output.writeBoolean(b); 177c234,236 < { return input.readUTF(); --- > { String i=input.readUTF(); > server.debugInput(name,i); > return i; 185c244,246 < { return input.readInt(); --- > { int i=input.readInt(); > server.debugInput(name,i+""); > return i; 193c254,256 < { return input.readBoolean(); --- > { boolean b=input.readBoolean(); > server.debugInput(name,b+""); > return b; diff 0.1.0/SeekList.java 0.2.0/SeekList.java 15a16 > String lastUpdate; 49,50c50 < console.client.sendString("Accept Seek"); < console.client.sendInt(seekNum); --- > console.client.accpetSeek(seekNum); 91c91,92 < { Scanner scan=new Scanner(s); --- > { lastUpdate=s; > Scanner scan=new Scanner(s); 173a175,177 > public void reUpdate() > { update(lastUpdate); > } diff 0.1.0/Server.java 0.2.0/Server.java 13a14 > private DebugWindow debug; 18a20 > debug=new DebugWindow("Server Debug"); 56c58 < seeks.remove(s); --- > removeSeek(s); 65,67c67 < { seeks.remove(s); < seeksUpdated(); < } --- > removeSeek(s); 79a80,87 > public synchronized void removeSeek(int n) > { if(seekExists(n)) > removeSeek(getSeek(n)); > } > public synchronized void removeSeek(Seek s) > { seeks.remove(s); > seeksUpdated(); > } 85a94 > p.youAddedSeek(seekNum,g,b,r); 110,111c119,120 < { for(int i=0;i { for(int i=0;i if(players.get(i).getPlayerName().equals(name)) 129c138 < if(players.get(i).getPlayerName()==name) --- > if(players.get(i).getPlayerName().equals(name)) 147,148c156 < { players.get(i).sendString("Chat"); < players.get(i).sendString(s); --- > { players.get(i).chat(s); 160a169,174 > public synchronized void debugInput(String p,String s) > { debug.addInput(p+":"+s); > } > public synchronized void debugOutput(String p,String s) > { debug.addOutput(p+":"+s); > } Only in 0.2.0/: DebugWindow$1.class Only in 0.2.0/: DebugWindow.class Only in 0.2.0/: DebugWindow.java Only in 0.2.0/: ConfirmDialog$1.class Only in 0.2.0/: ConfirmDialog$2.class Only in 0.2.0/: ConfirmDialog$3.class Only in 0.2.0/: ConfirmDialog.class Only in 0.2.0/: ConfirmDialog.java Only in 0.2.0/: GameWindow$12.class