diff --git a/src/main/java/net/socialgamer/cah/Constants.java b/src/main/java/net/socialgamer/cah/Constants.java index 1657077..f362271 100644 --- a/src/main/java/net/socialgamer/cah/Constants.java +++ b/src/main/java/net/socialgamer/cah/Constants.java @@ -308,7 +308,9 @@ public class Constants { @GoDataType("int64") SERVER_STARTED("SS"), @GoDataType("[]int") - WHITE_CARDS("wc"); + WHITE_CARDS("wc"), + @GoDataType("bool") + GLOBAL_CHAT_ENABLED("gce"); private final String field; diff --git a/src/main/java/net/socialgamer/cah/handlers/FirstLoadHandler.java b/src/main/java/net/socialgamer/cah/handlers/FirstLoadHandler.java index 98affa0..9c6d96f 100644 --- a/src/main/java/net/socialgamer/cah/handlers/FirstLoadHandler.java +++ b/src/main/java/net/socialgamer/cah/handlers/FirstLoadHandler.java @@ -32,6 +32,7 @@ import java.util.Set; import javax.servlet.http.HttpSession; +import net.socialgamer.cah.CahModule; import org.apache.log4j.Logger; import org.hibernate.Session; import org.hibernate.Transaction; @@ -68,15 +69,18 @@ public class FirstLoadHandler extends Handler { private final Set banList; private final Session hibernateSession; private final Provider includeInactiveCardsetsProvider; + private final boolean globalChatEnabled; private final Date serverStarted; @Inject public FirstLoadHandler(final Session hibernateSession, @BanList final Set banList, @IncludeInactiveCardsets final Provider includeInactiveCardsetsProvider, + @CahModule.GlobalChatEnabled final boolean globalChatEnabled, @ServerStarted final Date serverStarted) { this.banList = banList; this.hibernateSession = hibernateSession; this.includeInactiveCardsetsProvider = includeInactiveCardsetsProvider; + this.globalChatEnabled = globalChatEnabled; this.serverStarted = serverStarted; } @@ -84,6 +88,7 @@ public class FirstLoadHandler extends Handler { public Map handle(final RequestWrapper request, final HttpSession session) { final HashMap ret = new HashMap(); + ret.put(AjaxResponse.GLOBAL_CHAT_ENABLED, globalChatEnabled); if (banList.contains(request.getRemoteAddr())) { LOG.info(String.format("Rejecting user from %s because they are banned.",