Added massive amounts of debug messages
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@529 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
2a31f0d9a6
commit
5cf7db2a86
3 changed files with 25 additions and 8 deletions
|
@ -156,8 +156,14 @@ public class GameControl {
|
|||
}
|
||||
|
||||
roundControl = createRoundControl(roundState);
|
||||
roundControl.getRoundStateUpdateEvent().add(new IListener1<IRoundState>() {
|
||||
@Override
|
||||
public void handle(IRoundState newState) {
|
||||
gameState = newState.getGameState();
|
||||
gameSettings = newState.getGameSettings();
|
||||
}
|
||||
});
|
||||
roundControl.getEndOfRoundEvent().add(new IListener1<Score>() {
|
||||
|
||||
@Override
|
||||
public void handle(Score roundScore) {
|
||||
endOfRound(roundScore);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package jrummikub.control.network;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import jrummikub.control.RoundControl;
|
||||
import jrummikub.control.turn.ITurnControl;
|
||||
import jrummikub.model.IRoundState;
|
||||
|
@ -32,12 +34,14 @@ public class NetworkRoundControl extends RoundControl {
|
|||
connections.add(connectionControl.getTurnStartEvent().add(new IListener() {
|
||||
@Override
|
||||
public void handle() {
|
||||
System.err.println(new Date() + ": Received startTurn");
|
||||
startTurn();
|
||||
}
|
||||
}));
|
||||
connections.add(connectionControl.getNextPlayerEvent().add(new IListener() {
|
||||
@Override
|
||||
public void handle() {
|
||||
System.err.println(new Date() + ": Received nextPlayer");
|
||||
NetworkRoundControl.super.nextPlayer();
|
||||
}
|
||||
}));
|
||||
|
@ -64,6 +68,9 @@ public class NetworkRoundControl extends RoundControl {
|
|||
break;
|
||||
}
|
||||
|
||||
System.err.println("Creating a " + (currentlyActive ? "normal" : "network")
|
||||
+ " turn control for a " + type);
|
||||
|
||||
if (!currentlyActive) {
|
||||
return new NetworkTurnControl(connectionControl);
|
||||
}
|
||||
|
@ -73,13 +80,12 @@ public class NetworkRoundControl extends RoundControl {
|
|||
|
||||
@Override
|
||||
protected void prepareTurn() {
|
||||
boolean wasActive = currentlyActive;
|
||||
|
||||
doPrepareTurn();
|
||||
|
||||
if (wasActive) {
|
||||
if (currentlyActive) {
|
||||
System.err.println(new Date() + ": Sending startTurn");
|
||||
connectionControl.startTurn();
|
||||
}
|
||||
|
||||
doPrepareTurn();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -94,6 +100,7 @@ public class NetworkRoundControl extends RoundControl {
|
|||
@Override
|
||||
protected void nextPlayer() {
|
||||
if (currentlyActive) {
|
||||
System.err.println(new Date() + ": Sending nextPlayer");
|
||||
connectionControl.nextPlayer();
|
||||
}
|
||||
}
|
||||
|
@ -101,6 +108,7 @@ public class NetworkRoundControl extends RoundControl {
|
|||
@Override
|
||||
protected void endOfTurn(InvalidTurnInfo invalidTurnInfo) {
|
||||
if (currentlyActive) {
|
||||
System.err.println(new Date() + ": Sending endTurn");
|
||||
connectionControl.endTurn(roundState, invalidTurnInfo);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package jrummikub.control.network;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import jrummikub.control.RoundControl.InvalidTurnInfo;
|
||||
import jrummikub.control.turn.AbstractTurnControl;
|
||||
import jrummikub.model.IRoundState;
|
||||
|
@ -33,8 +35,9 @@ public class NetworkTurnControl extends AbstractTurnControl {
|
|||
connections.add(connectionControl.getTurnEndEvent().add(
|
||||
new IListener2<IRoundState, InvalidTurnInfo>() {
|
||||
@Override
|
||||
public void handle(IRoundState state,
|
||||
InvalidTurnInfo invalidTurnInfo) {
|
||||
public void handle(IRoundState state, InvalidTurnInfo invalidTurnInfo) {
|
||||
System.err.println(new Date() + ": Received endTurn");
|
||||
|
||||
NetworkControl.fixGameSettings(state.getGameSettings(),
|
||||
connectionControl.getNickname());
|
||||
|
||||
|
|
Reference in a new issue