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 = 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>() {
|
roundControl.getEndOfRoundEvent().add(new IListener1<Score>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handle(Score roundScore) {
|
public void handle(Score roundScore) {
|
||||||
endOfRound(roundScore);
|
endOfRound(roundScore);
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package jrummikub.control.network;
|
package jrummikub.control.network;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
import jrummikub.control.RoundControl;
|
import jrummikub.control.RoundControl;
|
||||||
import jrummikub.control.turn.ITurnControl;
|
import jrummikub.control.turn.ITurnControl;
|
||||||
import jrummikub.model.IRoundState;
|
import jrummikub.model.IRoundState;
|
||||||
|
@ -32,12 +34,14 @@ public class NetworkRoundControl extends RoundControl {
|
||||||
connections.add(connectionControl.getTurnStartEvent().add(new IListener() {
|
connections.add(connectionControl.getTurnStartEvent().add(new IListener() {
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
|
System.err.println(new Date() + ": Received startTurn");
|
||||||
startTurn();
|
startTurn();
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
connections.add(connectionControl.getNextPlayerEvent().add(new IListener() {
|
connections.add(connectionControl.getNextPlayerEvent().add(new IListener() {
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
|
System.err.println(new Date() + ": Received nextPlayer");
|
||||||
NetworkRoundControl.super.nextPlayer();
|
NetworkRoundControl.super.nextPlayer();
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
@ -64,6 +68,9 @@ public class NetworkRoundControl extends RoundControl {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
System.err.println("Creating a " + (currentlyActive ? "normal" : "network")
|
||||||
|
+ " turn control for a " + type);
|
||||||
|
|
||||||
if (!currentlyActive) {
|
if (!currentlyActive) {
|
||||||
return new NetworkTurnControl(connectionControl);
|
return new NetworkTurnControl(connectionControl);
|
||||||
}
|
}
|
||||||
|
@ -73,13 +80,12 @@ public class NetworkRoundControl extends RoundControl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void prepareTurn() {
|
protected void prepareTurn() {
|
||||||
boolean wasActive = currentlyActive;
|
if (currentlyActive) {
|
||||||
|
System.err.println(new Date() + ": Sending startTurn");
|
||||||
doPrepareTurn();
|
|
||||||
|
|
||||||
if (wasActive) {
|
|
||||||
connectionControl.startTurn();
|
connectionControl.startTurn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
doPrepareTurn();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -94,6 +100,7 @@ public class NetworkRoundControl extends RoundControl {
|
||||||
@Override
|
@Override
|
||||||
protected void nextPlayer() {
|
protected void nextPlayer() {
|
||||||
if (currentlyActive) {
|
if (currentlyActive) {
|
||||||
|
System.err.println(new Date() + ": Sending nextPlayer");
|
||||||
connectionControl.nextPlayer();
|
connectionControl.nextPlayer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -101,6 +108,7 @@ public class NetworkRoundControl extends RoundControl {
|
||||||
@Override
|
@Override
|
||||||
protected void endOfTurn(InvalidTurnInfo invalidTurnInfo) {
|
protected void endOfTurn(InvalidTurnInfo invalidTurnInfo) {
|
||||||
if (currentlyActive) {
|
if (currentlyActive) {
|
||||||
|
System.err.println(new Date() + ": Sending endTurn");
|
||||||
connectionControl.endTurn(roundState, invalidTurnInfo);
|
connectionControl.endTurn(roundState, invalidTurnInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package jrummikub.control.network;
|
package jrummikub.control.network;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
import jrummikub.control.RoundControl.InvalidTurnInfo;
|
import jrummikub.control.RoundControl.InvalidTurnInfo;
|
||||||
import jrummikub.control.turn.AbstractTurnControl;
|
import jrummikub.control.turn.AbstractTurnControl;
|
||||||
import jrummikub.model.IRoundState;
|
import jrummikub.model.IRoundState;
|
||||||
|
@ -33,8 +35,9 @@ public class NetworkTurnControl extends AbstractTurnControl {
|
||||||
connections.add(connectionControl.getTurnEndEvent().add(
|
connections.add(connectionControl.getTurnEndEvent().add(
|
||||||
new IListener2<IRoundState, InvalidTurnInfo>() {
|
new IListener2<IRoundState, InvalidTurnInfo>() {
|
||||||
@Override
|
@Override
|
||||||
public void handle(IRoundState state,
|
public void handle(IRoundState state, InvalidTurnInfo invalidTurnInfo) {
|
||||||
InvalidTurnInfo invalidTurnInfo) {
|
System.err.println(new Date() + ": Received endTurn");
|
||||||
|
|
||||||
NetworkControl.fixGameSettings(state.getGameSettings(),
|
NetworkControl.fixGameSettings(state.getGameSettings(),
|
||||||
connectionControl.getNickname());
|
connectionControl.getNickname());
|
||||||
|
|
||||||
|
|
Reference in a new issue