use of games.strategy.engine.chat.IChatPanel in project triplea by triplea-game.
the class HeadlessGameServer method remoteGetChatLog.
public String remoteGetChatLog(final String hashedPassword, final String salt) {
final String password = System.getProperty(LOBBY_GAME_SUPPORT_PASSWORD, "");
if (password.equals(GameRunner.NO_REMOTE_REQUESTS_ALLOWED)) {
return "Host not accepting remote requests!";
}
final String localPassword = System.getProperty(LOBBY_GAME_SUPPORT_PASSWORD, "");
if (hashPassword(localPassword, salt).equals(hashedPassword)) {
final IChatPanel chat = getServerModel().getChatPanel();
if (chat == null || chat.getAllText() == null) {
return "Empty or null chat";
}
return chat.getAllText();
}
System.out.println("Attempted remote get chat log with invalid password.");
return "Invalid password!";
}
use of games.strategy.engine.chat.IChatPanel in project triplea by triplea-game.
the class MainPanel method addChat.
private void addChat() {
remove(mainPanel);
remove(chatSplit);
chatPanelHolder.removeAll();
final IChatPanel chat = gameTypePanelModel.getPanel().getChatPanel();
if (chat != null && !chat.isHeadless()) {
chatPanelHolder = new JPanel();
chatPanelHolder.setLayout(new BorderLayout());
chatPanelHolder.setPreferredSize(new Dimension(chatPanelHolder.getPreferredSize().width, 62));
chatPanelHolder.add((Component) chat, BorderLayout.CENTER);
chatSplit.setTopComponent(mainPanel);
chatSplit.setBottomComponent(chatPanelHolder);
add(chatSplit, BorderLayout.CENTER);
} else {
add(mainPanel, BorderLayout.CENTER);
}
isChatShowing = chat != null;
}
Aggregations