Fixing Concurrency problem in chat.

This commit is contained in:
marcins78@gmail.com
2011-09-14 23:58:15 +00:00
parent 5a25dedfbe
commit 9d9c2bf92a
3 changed files with 6 additions and 5 deletions

View File

@@ -39,7 +39,8 @@ public class ChatRoomMediator {
public synchronized void cleanup() {
long currentTime = System.currentTimeMillis();
for (Map.Entry<String, GatheringChatRoomListener> playerListener : _listeners.entrySet()) {
Map<String, GatheringChatRoomListener> copy = new HashMap<String, GatheringChatRoomListener>(_listeners);
for (Map.Entry<String, GatheringChatRoomListener> playerListener : copy.entrySet()) {
String playerId = playerListener.getKey();
GatheringChatRoomListener listener = playerListener.getValue();
if (currentTime > listener.getLastConsumed().getTime() + _channelInactivityTimeoutPeriod) {

View File

@@ -106,6 +106,7 @@ var GempLotrGameUI = Class.extend({
this.gameStateElem.append("<br>");
this.gameStateElem.append("<div class='twilightPool'>0</div>");
this.gameStateElem.append("<b>Phases:</b><br>");
this.gameStateElem.append("<div class='phase' id='FELLOWSHIP'>Fellowship</div>");
this.gameStateElem.append("<div class='phase' id='SHADOW'>Shadow</div>");
@@ -115,8 +116,6 @@ var GempLotrGameUI = Class.extend({
this.gameStateElem.append("<div class='phase' id='SKIRMISH'>Skirmish</div>");
this.gameStateElem.append("<div class='phase' id='REGROUP'>Regroup</div>");
this.gameStateElem.append("<div class='twilightPool'>0</div>");
$("#main").append(this.gameStateElem);
this.alert = $("<div class='ui-widget-content'></div>");
@@ -252,7 +251,7 @@ var GempLotrGameUI = Class.extend({
var advPathWidth = Math.min(150, width * 0.1);
var specialUiWidth = 150;
var alertHeight = 120;
var alertHeight = 80;
var chatHeight = 200;

View File

@@ -3,13 +3,14 @@ TO DO:
18. Add display of site where player is on adventure path.
16. Add an option to view an ongoing game.
20. Display clock.
13. Add dead/discard pile displays.
14. Add hand/deck card count displays.
19. Add filtering cards to deck-builder.
4. Modify the Blueprint hierarchy to return possible return objects (PlayEventAction), TriggeredAction, etc. Use
final methods were possible to avoid implementation errors on new cards added.
10. Add active/all cards switch to the user interface.
20.
21.
DONE:
1. Introduce AbstractPermanent into Blueprint hierarchy.