diff --git a/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/HallRequestHandler.java b/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/HallRequestHandler.java
index f631abdfc..4bc5c9121 100644
--- a/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/HallRequestHandler.java
+++ b/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/handler/HallRequestHandler.java
@@ -539,6 +539,13 @@ public class HallRequestHandler extends LotroServerRequestHandler implements Uri
_hall.setAttribute("channelNumber", String.valueOf(channelNumber));
}
+ @Override
+ public void newPlayerGame(String gameId) {
+ Element newGame = _doc.createElement("newGame");
+ newGame.setAttribute("id", gameId);
+ _hall.appendChild(newGame);
+ }
+
@Override
public void serverTime(String serverTime) {
_hall.setAttribute("serverTime", serverTime);
@@ -632,17 +639,5 @@ public class HallRequestHandler extends LotroServerRequestHandler implements Uri
table.setAttribute("id", tableId);
_hall.appendChild(table);
}
-
- @Override
- public void runningPlayerGame(String gameId) {
- Element runningGame = _doc.createElement("game");
- runningGame.setAttribute("id", gameId);
- _hall.appendChild(runningGame);
- }
-
- @Override
- public void playerBusy(boolean busy) {
- _hall.setAttribute("busy", String.valueOf(busy));
- }
}
}
diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/css/gemp-001/hall.css b/gemp-lotr/gemp-lotr-async/src/main/web/css/gemp-001/hall.css
index 6c42685eb..fdbd593f2 100644
--- a/gemp-lotr/gemp-lotr-async/src/main/web/css/gemp-001/hall.css
+++ b/gemp-lotr/gemp-lotr-async/src/main/web/css/gemp-001/hall.css
@@ -168,3 +168,7 @@ table.tables td, table.tables th {
.userList {
border-left: 1px solid #FFFFFF;
}
+
+tr.played {
+ background-color: #990000;
+}
\ No newline at end of file
diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-015/hallUi.js b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-015/hallUi.js
index e68a9cbc7..c33b2b866 100644
--- a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-015/hallUi.js
+++ b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-015/hallUi.js
@@ -42,14 +42,14 @@ var GempLotrHallUI = Class.extend({
var hallSettingsStr = $.cookie("hallSettings");
if (hallSettingsStr == null)
- hallSettingsStr="0|0|1|1|0";
+ hallSettingsStr = "0|0|1|1|0";
var hallSettings = hallSettingsStr.split("|");
- this.addQueuesTable(hallSettings[0]=="1");
- this.addTournamentsTable(hallSettings[1]=="1");
- this.addWaitingTablesTable(hallSettings[2]=="1");
- this.addPlayingTablesTable(hallSettings[3]=="1");
- this.addFinishedTablesTable(hallSettings[4]=="1");
+ this.addQueuesTable(hallSettings[0] == "1");
+ this.addTournamentsTable(hallSettings[1] == "1");
+ this.addWaitingTablesTable(hallSettings[2] == "1");
+ this.addPlayingTablesTable(hallSettings[3] == "1");
+ this.addFinishedTablesTable(hallSettings[4] == "1");
this.div.append(this.tablesDiv);
@@ -122,14 +122,14 @@ var GempLotrHallUI = Class.extend({
});
var that = this;
- var toggle =function() {
- if (toggleContent.button("option", "icons")["primary"] == "ui-icon-circlesmall-minus")
- toggleContent.button("option", "icons", {primary: "ui-icon-circlesmall-plus"});
- else
- toggleContent.button("option", "icons", {primary: "ui-icon-circlesmall-minus"});
- content.toggle("blind", {}, 200);
- that.updateHallSettings();
- };
+ var toggle = function() {
+ if (toggleContent.button("option", "icons")["primary"] == "ui-icon-circlesmall-minus")
+ toggleContent.button("option", "icons", {primary: "ui-icon-circlesmall-plus"});
+ else
+ toggleContent.button("option", "icons", {primary: "ui-icon-circlesmall-minus"});
+ content.toggle("blind", {}, 200);
+ that.updateHallSettings();
+ };
toggleContent.css({width: "13px", height: "15px"});
toggleContent.click(toggle);
@@ -163,14 +163,14 @@ var GempLotrHallUI = Class.extend({
});
var that = this;
- var toggle=function() {
- if (toggleContent.button("option", "icons")["primary"] == "ui-icon-circlesmall-minus")
- toggleContent.button("option", "icons", {primary: "ui-icon-circlesmall-plus"});
- else
- toggleContent.button("option", "icons", {primary: "ui-icon-circlesmall-minus"});
- content.toggle("blind", {}, 200);
+ var toggle = function() {
+ if (toggleContent.button("option", "icons")["primary"] == "ui-icon-circlesmall-minus")
+ toggleContent.button("option", "icons", {primary: "ui-icon-circlesmall-plus"});
+ else
+ toggleContent.button("option", "icons", {primary: "ui-icon-circlesmall-minus"});
+ content.toggle("blind", {}, 200);
that.updateHallSettings();
- };
+ };
toggleContent.css({width: "13px", height: "15px"});
toggleContent.click(toggle);
header.append(toggleContent);
@@ -203,14 +203,14 @@ var GempLotrHallUI = Class.extend({
});
var that = this;
- var toggle=function() {
- if (toggleContent.button("option", "icons")["primary"] == "ui-icon-circlesmall-minus")
- toggleContent.button("option", "icons", {primary: "ui-icon-circlesmall-plus"});
- else
- toggleContent.button("option", "icons", {primary: "ui-icon-circlesmall-minus"});
- content.toggle("blind", {}, 200);
- that.updateHallSettings();
- };
+ var toggle = function() {
+ if (toggleContent.button("option", "icons")["primary"] == "ui-icon-circlesmall-minus")
+ toggleContent.button("option", "icons", {primary: "ui-icon-circlesmall-plus"});
+ else
+ toggleContent.button("option", "icons", {primary: "ui-icon-circlesmall-minus"});
+ content.toggle("blind", {}, 200);
+ that.updateHallSettings();
+ };
toggleContent.css({width: "13px", height: "15px"});
toggleContent.click(toggle);
header.append(toggleContent);
@@ -243,14 +243,14 @@ var GempLotrHallUI = Class.extend({
});
var that = this;
- var toggle=function() {
- if (toggleContent.button("option", "icons")["primary"] == "ui-icon-circlesmall-minus")
- toggleContent.button("option", "icons", {primary: "ui-icon-circlesmall-plus"});
- else
- toggleContent.button("option", "icons", {primary: "ui-icon-circlesmall-minus"});
- content.toggle("blind", {}, 200);
+ var toggle = function() {
+ if (toggleContent.button("option", "icons")["primary"] == "ui-icon-circlesmall-minus")
+ toggleContent.button("option", "icons", {primary: "ui-icon-circlesmall-plus"});
+ else
+ toggleContent.button("option", "icons", {primary: "ui-icon-circlesmall-minus"});
+ content.toggle("blind", {}, 200);
that.updateHallSettings();
- };
+ };
toggleContent.css({width: "13px", height: "15px"});
toggleContent.click(toggle);
header.append(toggleContent);
@@ -283,14 +283,14 @@ var GempLotrHallUI = Class.extend({
});
var that = this;
- var toggle=function() {
- if (toggleContent.button("option", "icons")["primary"] == "ui-icon-circlesmall-minus")
- toggleContent.button("option", "icons", {primary: "ui-icon-circlesmall-plus"});
- else
- toggleContent.button("option", "icons", {primary: "ui-icon-circlesmall-minus"});
- content.toggle("blind", {}, 200);
+ var toggle = function() {
+ if (toggleContent.button("option", "icons")["primary"] == "ui-icon-circlesmall-minus")
+ toggleContent.button("option", "icons", {primary: "ui-icon-circlesmall-plus"});
+ else
+ toggleContent.button("option", "icons", {primary: "ui-icon-circlesmall-minus"});
+ content.toggle("blind", {}, 200);
that.updateHallSettings();
- };
+ };
toggleContent.css({width: "13px", height: "15px"});
toggleContent.click(toggle);
header.append(toggleContent);
@@ -312,12 +312,12 @@ var GempLotrHallUI = Class.extend({
updateHallSettings: function() {
var icons = $(".ui-button-icon-primary", this.tablesDiv);
- var getSettingValue=
+ var getSettingValue =
function(index) {
- return $(icons[index]).hasClass("ui-icon-circlesmall-minus")?"1":"0";
+ return $(icons[index]).hasClass("ui-icon-circlesmall-minus") ? "1" : "0";
};
- var newHallSettings = getSettingValue(0)+"|"+getSettingValue(1)+"|"+getSettingValue(2)+"|"+getSettingValue(3)+"|"+getSettingValue(4);
+ var newHallSettings = getSettingValue(0) + "|" + getSettingValue(1) + "|" + getSettingValue(2) + "|" + getSettingValue(3) + "|" + getSettingValue(4);
$.cookie("hallSettings", newHallSettings, { expires:365 });
},
@@ -444,8 +444,6 @@ var GempLotrHallUI = Class.extend({
if (serverTime != null)
$(".serverTime").text("Server time: " + serverTime);
- var busy = root.getAttribute("busy") == "true";
-
var queues = root.getElementsByTagName("queue");
for (var i = 0; i < queues.length; i++) {
var queue = queues[i];
@@ -571,6 +569,7 @@ var GempLotrHallUI = Class.extend({
var players = new Array();
if (playersAttr.length > 0)
players = playersAttr.split(",");
+ var playing = table.getAttribute("playing");
var winner = table.getAttribute("winner");
var row = $("
");
@@ -588,7 +587,7 @@ var GempLotrHallUI = Class.extend({
row.append("" + playersStr + " | ");
var lastField = $(" | ");
- if (status == "WAITING" && !busy) {
+ if (status == "WAITING") {
var that = this;
var but = $("");
@@ -605,7 +604,14 @@ var GempLotrHallUI = Class.extend({
lastField.append(but);
}
- if (status == "PLAYING" && watchable == "true") {
+ if (playing == "true") {
+ var participantId = getUrlParam("participantId");
+ var participantIdAppend = "";
+ if (participantId != null)
+ participantIdAppend = "&participantId=" + participantId;
+
+ lastField.append("Play the game");
+ } else if (status == "PLAYING" && watchable == "true") {
var participantId = getUrlParam("participantId");
var participantIdAppend = "";
if (participantId != null)
@@ -659,6 +665,8 @@ var GempLotrHallUI = Class.extend({
}
this.animateRowUpdate(".table" + id);
+ if (playing)
+ row.addClass("played");
}
} else if (action == "remove") {
$(".table" + id, this.tablesDiv).remove();
@@ -671,8 +679,7 @@ var GempLotrHallUI = Class.extend({
$(".count", $(".eventHeader.playingTables")).html("(" + ($("tr", $("table.playingTables")).length - 1) + ")");
$(".count", $(".eventHeader.finishedTables")).html("(" + ($("tr", $("table.finishedTables")).length - 1) + ")");
- var skipReload = false;
- var games = root.getElementsByTagName("game");
+ var games = root.getElementsByTagName("newGame");
if (games.length > 0) {
var waitingGameId = games[0].getAttribute("id");
var participantId = getUrlParam("participantId");
@@ -680,8 +687,7 @@ var GempLotrHallUI = Class.extend({
if (participantId != null)
participantIdAppend = "&participantId=" + participantId;
this.tablesDiv.append("