Crossfire JXClient, Trunk
JXClient.java
Go to the documentation of this file.
1 /*
2  * This file is part of JXClient, the Fullscreen Java Crossfire Client.
3  *
4  * JXClient is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * JXClient is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with JXClient; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * Copyright (C) 2005-2008 Yann Chachkoff
19  * Copyright (C) 2006-2017,2019-2023 Andreas Kirschbaum
20  * Copyright (C) 2010-2012,2014-2018,2020-2023 Nicolas Weeger
21  */
22 
23 package com.realtime.crossfire.jxclient.main;
24 
112 import java.io.FileOutputStream;
113 import java.io.IOException;
114 import java.io.OutputStreamWriter;
115 import java.io.Writer;
116 import java.lang.reflect.InvocationTargetException;
117 import java.nio.charset.StandardCharsets;
118 import java.nio.file.Path;
119 import java.util.MissingResourceException;
120 import java.util.ResourceBundle;
121 import java.util.concurrent.atomic.AtomicReference;
122 import javax.swing.SwingUtilities;
123 import org.jetbrains.annotations.NotNull;
124 import org.jetbrains.annotations.Nullable;
125 
135 public class JXClient {
136 
140  @NotNull
141  private static final String @NotNull [] METASERVER_URLS = { //
142  "http://crossfire.real-time.com/metaserver2/meta_client.php", //
143  "http://metaserver.eu.cross-fire.org/meta_client.php", //
144  "http://metaserver.us.cross-fire.org/meta_client.php", //
145  };
146 
151  public static void main(@NotNull final String @NotNull [] args) {
152  Thread.currentThread().setName("JXClient:Main");
153  final String buildNumber = getBuildNumber();
154  System.out.println("JXClient "+buildNumber+" - Crossfire Java Client");
155  System.out.println("Copyright (C) 2005-2008 Yann \"Lauwenmark\" Chachkoff");
156  System.out.println("Copyright (C) 2006-2017,2019-2023 Andreas Kirschbaum");
157  System.out.println("Copyright (C) 2010-2012,2014-2018,2020-2023 Nicolas Weeger");
158  System.out.println("This software is placed under the GPL License");
159  final Options options = new Options();
160  options.parse(args);
161  //noinspection InstantiationOfUtilityClass
162  new JXClient(options, buildNumber);
163  }
164 
169  @NotNull
170  private static String getBuildNumber() {
171  try {
172  return ResourceBundle.getBundle("build").getString("build.number");
173  } catch (final MissingResourceException ignored) {
174  return "unknown";
175  }
176  }
177 
182  @NotNull
183  private static String getSoundsCredits() {
184  try {
185  return ResourceBundle.getBundle("build").getString("sounds.credits");
186  } catch (final MissingResourceException ignored) {
187  return "unknown";
188  }
189  }
190 
197  private JXClient(@NotNull final Options options, @NotNull final String buildNumber) {
198  try {
199  try (Writer debugProtocolOutputStreamWriter = openDebugStream(options.getDebugProtocolFilename())) {
200  try (Writer debugKeyboardOutputStreamWriter = openDebugStream(options.getDebugKeyboardFilename())) {
201  try (Writer debugMouseOutputStreamWriter = openDebugStream(options.getDebugMouseFilename())) {
202  try (Writer debugScreenOutputStreamWriter = openDebugStream(options.getDebugScreenFilename())) {
203  try (Writer debugSoundOutputStreamWriter = openDebugStream(options.getDebugSoundFilename())) {
204  final Settings settings = new Settings(Filenames.getSettingsFile());
205  settings.remove("resolution"); // delete obsolete entry
206  settings.remove("width"); // delete obsolete entry
207  settings.remove("height"); // delete obsolete entry
208  settings.remove("skin"); // delete obsolete entry
209  final OptionManager optionManager = new OptionManager(settings);
210  final MetaserverModel metaserverModel = new MetaserverModel();
211  final CharacterModel characterModel = new CharacterModel();
212  final Model model = new Model(new SwingGuiStateManager());
213  final CrossfireServerConnection server = new DefaultCrossfireServerConnection(model, debugProtocolOutputStreamWriter == null ? null : new DebugWriter(debugProtocolOutputStreamWriter), "JXClient "+buildNumber);
214  server.start();
215  try {
216  final AskfaceFaceQueue askfaceFaceQueue = new AskfaceFaceQueue(server);
218  final FacesManager facesManager = new DefaultFacesManager(model.getFaceCache(), facesQueue);
219  new ItemsManager(facesManager, model.getStats(), model.getSkillSet(), model.getGuiStateManager(), model.getItemSet(), server);
220  final InventoryView inventoryView = new InventoryView(model.getItemSet(), new InventoryComparator());
221  final FloorView floorView = new FloorView(model.getItemSet());
222  final MetaserverProcessor metaserverProcessor = new MetaserverProcessor(model.getGuiStateManager(), Filenames.getMetaserverCacheFile(), metaserverModel);
223  for (final String metaserverUrl : METASERVER_URLS) {
224  metaserverProcessor.addMetaserver(new DefaultMetaserver(metaserverUrl));
225  }
226  metaserverProcessor.start();
227  final SoundManager soundManager = new SoundManager(model.getGuiStateManager(), debugSoundOutputStreamWriter == null ? null : new DebugWriter(debugSoundOutputStreamWriter));
228  soundManager.start();
229  try {
230  optionManager.addOption("sound_music_enabled", "Whether background music is enabled.", new SoundMusicCheckBoxOption(soundManager));
231  } catch (final OptionException ex) {
232  throw new AssertionError(ex);
233  }
234  try {
235  optionManager.addOption("sound_effects_enabled", "Whether sound effects are enabled.", new SoundEffectsCheckBoxOption(soundManager));
236  } catch (final OptionException ex) {
237  throw new AssertionError(ex);
238  }
239 
240  new MusicWatcher(server, soundManager);
241  new SoundWatcher(server, soundManager);
242  new PoisonWatcher(model.getStats(), server);
243  new StarvingWatcher(model.getStats());
244  new ActiveSkillWatcher(model.getStats(), server);
245  new MarkedItemWatcher(model.getItemSet(), server);
246  final Macros macros = new Macros(server);
247  final CfAnimations cfAnimations = new CfAnimations(model.getItemSet(), facesManager, model.getAnimations());
248  final MapUpdaterState mapUpdaterState = new MapUpdaterState(facesManager, model.getAnimations(), cfAnimations);
249  new CfMapUpdater(mapUpdaterState, server, facesManager, model.getGuiStateManager());
250  final SpellsView spellsView = new SpellsView(model.getSpellsManager(), facesManager);
251  final SpellSkillView spellSkillsView = new SpellSkillView(model.getSpellsManager(), facesManager);
252  final QuestsView questsView = new QuestsView(model.getQuestsManager(), facesManager);
253  final KnowledgeView knowledgeView = new KnowledgeView(facesManager, model.getKnowledgeManager());
254  final KnowledgeTypeView knowledgeTypesView = new KnowledgeTypeView(facesManager, model.getKnowledgeManager());
255  final PendingDirections pendingDirections = new PendingDirections();
256  final CommandQueue commandQueue = new CommandQueue(server, model.getGuiStateManager(), pendingDirections);
257  final ScriptManager scriptManager = new ScriptManager(commandQueue, server, model.getStats(), floorView, model.getItemSet(), model.getSpellsManager(), mapUpdaterState, model.getSkillSet());
258  final Commands commands = new Commands();
259  final CommandExecutor commandExecutor = new CommandExecutorImpl(commandQueue, commands);
260  final Shortcuts shortcuts = new Shortcuts(model.getSpellsManager());
261  final Logger logger = new Logger(server, null, settings.getBoolean(SettingsEntries.MESSAGE_LOG_SETTINGS_ENTRY));
262 
263  final Exiter exiter = new Exiter();
264  final AtomicReference<JXCWindow> window = new AtomicReference<>();
265  final Path keybindingsFileVersion2;
266  try {
267  keybindingsFileVersion2 = Filenames.getKeybindingsFileVersion2(null, null);
268  } catch (final IOException ex) {
269  System.err.println("Cannot read keybindings file: "+ex.getMessage());
270  exiter.terminate();
271  return;
272  }
273  final Path keybindingsFileVersion1;
274  try {
275  keybindingsFileVersion1 = Filenames.getKeybindingsFileVersion1(null, null);
276  } catch (final IOException ex) {
277  System.err.println("Cannot read keybindings file: "+ex.getMessage());
278  exiter.terminate();
279  return;
280  }
281  SwingUtilities.invokeAndWait(() -> {
282  final Pickup characterPickup;
283  try {
284  characterPickup = new Pickup(commandQueue, optionManager);
285  } catch (final OptionException ex) {
286  throw new AssertionError(ex);
287  }
288  final TooltipManagerImpl tooltipManager = new TooltipManagerImpl();
289  final GuiManagerCommandCallback commandCallback = new GuiManagerCommandCallback(exiter, server);
290  final GUICommandFactory guiCommandFactory = new GUICommandFactoryImpl(commandCallback, commandExecutor, macros);
291  final GuiFactory guiFactory = new GuiFactory(guiCommandFactory);
292  final MouseTracker mouseTracker = new MouseTracker(options.isDebugGui(), debugMouseOutputStreamWriter, guiFactory);
293  final JXCWindowRenderer windowRenderer = new JXCWindowRenderer(mouseTracker, server, debugScreenOutputStreamWriter);
294  final KeybindingsManager keybindingsManager = new KeybindingsManager(keybindingsFileVersion2, keybindingsFileVersion1, guiCommandFactory);
295  final JXCConnection connection = new JXCConnection(keybindingsManager, shortcuts, settings, characterPickup, server, model.getGuiStateManager(), logger);
296  final GuiManager guiManager = new GuiManager(model.getGuiStateManager(), tooltipManager, settings, server, windowRenderer, guiFactory, keybindingsManager, connection);
297  commandCallback.init(guiManager);
298  final CommandHistoryFactory commandHistoryFactory = new CommandHistoryFactory();
299  new SoundStatsWatcher(model.getStats(), windowRenderer, server, soundManager);
300  commands.addCommand(new BindCommand(server, commandCallback, guiCommandFactory));
301  commands.addCommand(new UnbindCommand(commandCallback, server));
302  commands.addCommand(new ScreenshotCommand(windowRenderer, server, new ScreenshotFiles()));
303  commands.addCommand(new ScriptCommand(scriptManager, server));
304  commands.addCommand(new ScriptkillCommand(scriptManager, server));
305  commands.addCommand(new ScriptkillallCommand(scriptManager, server));
306  commands.addCommand(new ScriptsCommand(scriptManager, server));
307  commands.addCommand(new ScripttellCommand(scriptManager, server));
308  commands.addCommand(new ExecCommand(commandCallback, server));
309  commands.addCommand(new SetCommand(server, optionManager));
310  commands.addCommand(new ClearCommand(windowRenderer, server));
311  commands.addCommand(new DebugMessagesCommand(server));
312  commands.addCommand(new AgainCommand(server, commandExecutor, commandHistoryFactory.getCommandHistory("command")));
313  commands.addCommand(new HelpCommand(server, commandQueue, commands));
314  commands.addCommand(new ShortcutCommand(shortcuts, server));
315  commands.addCommand(new BindingsCommand(server, keybindingsManager));
316  final TranslucentDialogsCheckBoxOption translucentDialogsCheckBoxOption = new TranslucentDialogsCheckBoxOption(guiManager);
317  try {
318  optionManager.addOption("translucent_dialogs_enabled", "Whether translucent dialog backgrounds are enabled.", translucentDialogsCheckBoxOption);
319  } catch (final OptionException ex) {
320  throw new AssertionError(ex);
321  }
322  final ShowTimestampMessagesCheckBoxOption showTimestampMessagesCheckBoxOption = new ShowTimestampMessagesCheckBoxOption(guiManager);
323  try {
324  optionManager.addOption("show_timestamp_messages_enabled", "Whether timestamps in the message window are enabled.", showTimestampMessagesCheckBoxOption);
325  } catch (final OptionException ex) {
326  throw new AssertionError(ex);
327  }
328  final ShowSentCommandsCheckBoxOption showSentCommandsCheckBoxOption = new ShowSentCommandsCheckBoxOption(guiManager);
329  try {
330  optionManager.addOption("show_sent_commands_enabled", "Whether commands sent to the server are shown in the messages dialog.", showSentCommandsCheckBoxOption);
331  } catch (final OptionException ex) {
332  throw new AssertionError(ex);
333  }
334  final KeyBindings defaultKeyBindings = new KeyBindings(null, null, guiCommandFactory);
335  final JXCSkinLoader jxcSkinLoader = new JXCSkinLoader(model, inventoryView, floorView, spellsView, spellSkillsView, facesManager, mapUpdaterState, defaultKeyBindings, optionManager, options.getTileSize(), keybindingsManager, questsView, commandHistoryFactory, knowledgeView, knowledgeTypesView, options.isAvoidCopyArea(), guiManager, guiFactory, pendingDirections, getSoundsCredits(), options.getFontScaleFactor());
336  final SkinLoader skinLoader = new SkinLoader(commandCallback, metaserverModel, options.getResolution(), macros, windowRenderer, server, model.getGuiStateManager(), tooltipManager, commandQueue, jxcSkinLoader, commandExecutor, shortcuts, characterModel, model.getSmoothFaces(), guiFactory);
337  new FacesTracker(model.getGuiStateManager(), facesManager);
338  new PlayerNameTracker(model.getGuiStateManager(), connection, model.getItemSet());
339  new OutputCountTracker(model.getGuiStateManager(), server, commandQueue);
340  final DefaultKeyHandler defaultKeyHandler = new DefaultKeyHandler(exiter, guiManager, server, model.getGuiStateManager());
341  final KeyHandler keyHandler = new KeyHandler(debugKeyboardOutputStreamWriter, keybindingsManager, commandQueue, windowRenderer, defaultKeyHandler);
342 
343  final String skinName = options.getSkin();
344  JXCSkin skin;
345  try {
346  skin = skinLoader.loadSkin(skinName);
347  } catch (final JXCSkinException ex) {
348  if (skinName.equals(Options.DEFAULT_SKIN)) {
349  System.err.println("cannot load skin "+skinName+": "+ex.getMessage());
350  System.exit(1);
351  }
352 
353  System.err.println("cannot load skin "+skinName+": "+ex.getMessage()+", trying default skin");
354  try {
355  skin = skinLoader.loadSkin(Options.DEFAULT_SKIN);
356  } catch (final
357  JXCSkinException ex2) {
358  System.err.println("cannot load default skin "+Options.DEFAULT_SKIN+": "+ex2.getMessage());
359  System.exit(1);
360  throw new AssertionError(ex2);
361  }
362  }
363 
364  window.set(new JXCWindow(exiter, server, optionManager, model.getGuiStateManager(), windowRenderer, commandQueue, guiManager, keyHandler, characterModel, connection, options.getResolution(), options.isFullScreen(), skin));
365  keybindingsManager.loadGlobalKeybindings();
366  final String serverInfo = options.getServer();
367  if (serverInfo == null) {
369  } else {
370  model.getGuiStateManager().connect(serverInfo);
371  }
372  });
373  exiter.waitForTermination();
374  SwingUtilities.invokeAndWait(window.get()::term);
375  soundManager.shutdown();
376  } finally {
377  server.stop();
378  }
379  }
380  }
381  }
382  }
383  }
384  } catch (final InterruptedException|InvocationTargetException|
385  IOException ex) {
386  //noinspection CallToPrintStackTrace
387  ex.printStackTrace();
388  System.exit(1);
389  throw new AssertionError(ex);
390  }
391 
392  System.exit(0);
393  }
394 
400  @Nullable
401  private static Writer openDebugStream(@Nullable final String filename) {
402  if (filename == null) {
403  return null;
404  }
405 
406  Writer writer = null;
407  try {
408  final FileOutputStream outputStream = new FileOutputStream(filename);
409  try {
410  //noinspection IOResourceOpenedButNotSafelyClosed
411  writer = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8);
412  } finally {
413  if (writer == null) {
414  outputStream.close();
415  }
416  }
417  } catch (final IOException ex) {
418  System.err.println(filename+": cannot create output file: "+ex.getMessage());
419  return null;
420  }
421  return writer;
422  }
423 
424 }
com.realtime.crossfire.jxclient.commands.AgainCommand
Implements the "again" command.
Definition: AgainCommand.java:34
com.realtime.crossfire.jxclient.commands.UnbindCommand
Implements the "unbind" command.
Definition: UnbindCommand.java:33
com.realtime.crossfire.jxclient.main.JXClient.METASERVER_URLS
static final String[] METASERVER_URLS
The metaserver URLs.
Definition: JXClient.java:141
com.realtime.crossfire.jxclient
com.realtime.crossfire.jxclient.skin.skin
Definition: DefaultJXCSkin.java:23
com.realtime.crossfire.jxclient.faces.FacesManager
Maintains a mapping of face numbers to face data.
Definition: FacesManager.java:40
com.realtime.crossfire.jxclient.settings.Filenames.getSettingsFile
static Path getSettingsFile()
Returns the main settings file.
Definition: Filenames.java:96
com.realtime.crossfire.jxclient.main.PlayerNameTracker
Tracks a GuiStateManager and updates a JXCConnection's character name.
Definition: PlayerNameTracker.java:40
com.realtime.crossfire.jxclient.guistate.GuiStateManager.connect
void connect(@NotNull final String serverInfo)
Connects to a Crossfire server.
Definition: GuiStateManager.java:180
com.realtime.crossfire.jxclient.main.SkinLoader.loadSkin
JXCSkin loadSkin(@NotNull final String skinName)
Loads a skin file.
Definition: SkinLoader.java:194
com.realtime.crossfire.jxclient.main.Options
Command line argument parser.
Definition: Options.java:34
com.realtime.crossfire.jxclient.commands.ClearCommand
Implements the command "clear".
Definition: ClearCommand.java:34
com.realtime.crossfire.jxclient.main.JXCWindow
The main window.
Definition: JXCWindow.java:67
com.realtime.crossfire.jxclient.settings.SettingsEntries
All defined entries in the settings file.
Definition: SettingsEntries.java:32
com.realtime.crossfire.jxclient.server
com.realtime.crossfire.jxclient.item
Definition: ItemsManager.java:23
com.realtime.crossfire.jxclient.window.JXCConnection
Definition: JXCConnection.java:41
com.realtime.crossfire.jxclient.faces.FacesQueue
The main FaceQueue for loading faces.
Definition: FacesQueue.java:33
com.realtime.crossfire.jxclient.settings.Filenames.getKeybindingsFileVersion2
static Path getKeybindingsFileVersion2(@Nullable final CharSequence hostname, @Nullable final CharSequence character)
Returns the keybindings file.
Definition: Filenames.java:124
com.realtime.crossfire.jxclient.commands.BindingsCommand
Implements the "bindings" command, listing currently active keybindings (for both a character and the...
Definition: BindingsCommand.java:36
com.realtime.crossfire.jxclient.stats.MarkedItemWatcher
Helper class to track the currently marked item.
Definition: MarkedItemWatcher.java:39
com.realtime.crossfire.jxclient.faces.DefaultFacesManager
Retrieves Face information by face ID.
Definition: DefaultFacesManager.java:40
com.realtime.crossfire.jxclient.main.JXClient
This is the entry point for JXClient.
Definition: JXClient.java:135
com.realtime.crossfire.jxclient.map
Implements the map model which is shown in the map and magic map views.
Definition: CfMap.java:23
com.realtime.crossfire.jxclient.window
Definition: DialogStateParser.java:23
com.realtime.crossfire.jxclient.server.crossfire.Model.getQuestsManager
QuestsManager getQuestsManager()
Definition: Model.java:127
com.realtime.crossfire.jxclient.main.JXClient.JXClient
JXClient(@NotNull final Options options, @NotNull final String buildNumber)
The constructor of the class.
Definition: JXClient.java:197
com.realtime.crossfire.jxclient.window.KeyHandler
Handles keyboard input processing.
Definition: KeyHandler.java:45
com.realtime.crossfire.jxclient.skin
com.realtime.crossfire.jxclient.server.crossfire.Model.getSkillSet
SkillSet getSkillSet()
Definition: Model.java:102
com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
Definition: CrossfireServerConnection.java:37
com.realtime.crossfire.jxclient.settings.Settings.remove
void remove(@NotNull final String key)
Removes a key.
Definition: Settings.java:177
com.realtime.crossfire.jxclient.commands.ShortcutCommand
Implements the "shortcut" command.
Definition: ShortcutCommand.java:38
com.realtime.crossfire.jxclient.settings.Settings.getBoolean
boolean getBoolean(@NotNull final SettingsEntry< Boolean > key)
Returns the boolean associated with the specified key at a node or.
Definition: Settings.java:95
com.realtime.crossfire.jxclient.metaserver
Definition: DefaultMetaserver.java:23
com.realtime.crossfire.jxclient.settings.options.OptionManager.addOption
void addOption(@NotNull final String optionName, @NotNull final String documentation, @NotNull final Option option)
Adds a new option.
Definition: OptionManager.java:65
com.realtime.crossfire.jxclient.window.GuiManager
Maintains the application's main GUI state.
Definition: GuiManager.java:63
com.realtime.crossfire.jxclient.guistate.SwingGuiStateManager
Runs the action using SwingUtilities2#invokeAndWait(Runnable).
Definition: SwingGuiStateManager.java:9
com.realtime.crossfire.jxclient.main.OutputCountTracker
Tracks received Crossfire messages and resets the "output-count" setting whenever a player logs in.
Definition: OutputCountTracker.java:38
com.realtime.crossfire.jxclient.gui.label
Definition: AbstractLabel.java:23
com.realtime.crossfire.jxclient.main.Exiter
Allows to exit the application.
Definition: Exiter.java:31
com.realtime.crossfire.jxclient.gui.commands.ScreenshotFiles
Helper class for creating file names for screenshot files.
Definition: ScreenshotFiles.java:34
com.realtime.crossfire.jxclient.items.SpellsView
Provides a view of all spells a character knows.
Definition: SpellsView.java:37
com.realtime.crossfire.jxclient.gui.textinput
Definition: ActivateCommandInputCommand.java:23
com.realtime.crossfire.jxclient.gui.commandlist
Definition: CommandList.java:23
com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl
Manages the tooltip display.
Definition: TooltipManagerImpl.java:38
com.realtime.crossfire.jxclient.guistate.GuiState.METASERVER
METASERVER
Display the server selection screen.
Definition: GuiState.java:39
com.realtime.crossfire.jxclient.sound.SoundMusicCheckBoxOption
A CheckBoxOption that enables/disables background music.
Definition: SoundMusicCheckBoxOption.java:32
com.realtime.crossfire.jxclient.gui.textinput.GUICommandFactoryImpl
Factory for creating GUICommand instances from string representation.
Definition: GUICommandFactoryImpl.java:37
com.realtime.crossfire.jxclient.faces
Manages image information ("faces") needed to display the map view, items, and spell icons.
Definition: AbstractFaceQueue.java:23
com.realtime.crossfire.jxclient.main.Exiter.terminate
void terminate()
Terminates the application.
Definition: Exiter.java:42
com.realtime.crossfire.jxclient.gui.keybindings
Definition: InvalidKeyBindingException.java:23
com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.start
void start()
Starts operation.
com.realtime.crossfire.jxclient.items.InventoryComparator
A Comparator that compares CfItem instances in inventory view order.
Definition: InventoryComparator.java:33
com.realtime.crossfire.jxclient.main.SkinLoader
Loader for JXCSkins and attaching them to the client.
Definition: SkinLoader.java:59
com.realtime.crossfire.jxclient.skin.skin.JXCSkinException
Exception thrown if a skin related problem occurs.
Definition: JXCSkinException.java:31
com.realtime.crossfire.jxclient.gui.gui.TranslucentDialogsCheckBoxOption
A CheckBoxOption that enables/disables translucent dialog backgrounds.
Definition: TranslucentDialogsCheckBoxOption.java:34
com.realtime.crossfire.jxclient.sound.SoundManager.start
void start()
Activates this instance.
Definition: SoundManager.java:149
com.realtime.crossfire.jxclient.settings
Definition: CommandHistory.java:23
com.realtime.crossfire.jxclient.gui.log
Definition: Buffer.java:23
com.realtime.crossfire.jxclient.commands.BindCommand
Implements the "bind" command.
Definition: BindCommand.java:37
com.realtime.crossfire.jxclient.account.CharacterModel
Maintains the character list for an account.
Definition: CharacterModel.java:40
com.realtime.crossfire.jxclient.server.crossfire.Model.getFaceCache
FaceCache getFaceCache()
Definition: Model.java:137
com.realtime.crossfire.jxclient.gui.keybindings.KeyBindings
Manages a set of key bindings.
Definition: KeyBindings.java:47
com.realtime.crossfire.jxclient.scripts
Definition: AbstractScriptProcess.java:23
com.realtime.crossfire.jxclient.guistate
Definition: ClientSocketState.java:23
com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader
Parser for loading JXCSkin instances from JXCSkinSources.
Definition: JXCSkinLoader.java:182
com.realtime.crossfire.jxclient.gui.log.ShowSentCommandsCheckBoxOption
A CheckBoxOption that enables/disables showing commands sent to the server in the messages dialog.
Definition: ShowSentCommandsCheckBoxOption.java:34
com.realtime.crossfire.jxclient.guistate.GuiState.START
START
Display the start screen.
Definition: GuiState.java:34
com.realtime.crossfire.jxclient.main.GuiManagerCommandCallback
A CommandCallback that delegates to a GuiManager.
Definition: GuiManagerCommandCallback.java:37
com.realtime.crossfire.jxclient.commands.Commands
Parses and executes client-side commands.
Definition: Commands.java:37
com.realtime.crossfire.jxclient.server.crossfire.Model.getKnowledgeManager
KnowledgeManager getKnowledgeManager()
Definition: Model.java:132
com.realtime.crossfire.jxclient.faces.FileCache
A disk based cache for image files.
Definition: FileCache.java:40
com.realtime.crossfire.jxclient.stats.StarvingWatcher
Helper class to generate Stats#C_STAT_STARVING value from the Stats#CS_STAT_FOOD value.
Definition: StarvingWatcher.java:33
com.realtime.crossfire.jxclient.main.GuiManagerCommandCallback.init
void init(@NotNull final GuiManager guiManager)
Creates a new instance.
Definition: GuiManagerCommandCallback.java:79
com.realtime.crossfire.jxclient.sound.SoundEffectsCheckBoxOption
A CheckBoxOption that enables/disables sound effects.
Definition: SoundEffectsCheckBoxOption.java:32
com.realtime.crossfire.jxclient.settings.Filenames.getMagicMapImageCacheDir
static Path getMagicMapImageCacheDir()
Returns the image cache directory for magic map sized images.
Definition: Filenames.java:80
com.realtime.crossfire.jxclient.window.Logger
Logs received messages to a file.
Definition: Logger.java:43
com.realtime.crossfire.jxclient.settings.Filenames
Utility class to return references to settings files.
Definition: Filenames.java:37
com.realtime.crossfire.jxclient.items.KnowledgeTypeView
Definition: KnowledgeTypeView.java:13
com.realtime.crossfire.jxclient.items.InventoryView
Provides a view of all items in the current player's inventory.
Definition: InventoryView.java:38
com.realtime.crossfire.jxclient.map.PendingDirections
Maintains pending movements of the character.
Definition: PendingDirections.java:40
com.realtime.crossfire.jxclient.sound
Definition: AudioFileLoader.java:23
com.realtime.crossfire.jxclient.settings.CommandHistoryFactory.getCommandHistory
CommandHistory getCommandHistory(@NotNull final String ident)
Returns a CommandHistory instance by name.
Definition: CommandHistoryFactory.java:49
com.realtime.crossfire.jxclient.settings.Macros
Manages macro expansion in command strings.
Definition: Macros.java:38
com.realtime.crossfire.jxclient.scripts.ScriptManager
Maintains currently running script processes.
Definition: ScriptManager.java:46
com.realtime.crossfire.jxclient.guistate.GuiState
Possible gui states.
Definition: GuiState.java:29
com.realtime.crossfire.jxclient.settings.options.OptionManager
Maintains a set of named options.
Definition: OptionManager.java:36
com.realtime.crossfire.jxclient.items.SpellSkillView
A list to display spell skills.
Definition: SpellSkillView.java:37
com.realtime.crossfire.jxclient.commands.CommandExecutorImpl
Executes Commands.
Definition: CommandExecutorImpl.java:33
com.realtime.crossfire.jxclient.settings.Filenames.getScaledImageCacheDir
static Path getScaledImageCacheDir()
Returns the image cache directory for double size images.
Definition: Filenames.java:65
com.realtime.crossfire.jxclient.server.crossfire.Model.getItemSet
ItemSet getItemSet()
Definition: Model.java:147
com.realtime.crossfire.jxclient.gui
com.realtime.crossfire.jxclient.skin.io
Definition: Args.java:23
com.realtime.crossfire.jxclient.commands.ScripttellCommand
Implements the "scripttell" command.
Definition: ScripttellCommand.java:36
com.realtime.crossfire.jxclient.main.Options.parse
void parse(@NotNull final String @NotNull[] args)
Parse command line arguments.
Definition: Options.java:130
com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer
Renders a Gui instance into a Frame.
Definition: JXCWindowRenderer.java:87
com.realtime.crossfire.jxclient.settings.options.Pickup
Defines constants for pickup mode.
Definition: Pickup.java:34
com.realtime.crossfire.jxclient.guistate.GuiStateManager.changeGUI
void changeGUI(@NotNull final GuiState guiState)
Sets a new GuiState.
Definition: GuiStateManager.java:64
com.realtime.crossfire.jxclient.main.JXClient.getBuildNumber
static String getBuildNumber()
Returns the build number as a string.
Definition: JXClient.java:170
com.realtime.crossfire.jxclient.commands.ScriptCommand
Implements the "script" command.
Definition: ScriptCommand.java:33
com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager
Manages key bindings.
Definition: KeybindingsManager.java:40
com.realtime.crossfire.jxclient.settings.Settings
Maintains a set of key/value pairs.
Definition: Settings.java:45
com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection
Default implementation of CrossfireServerConnection.
Definition: DefaultCrossfireServerConnection.java:69
com.realtime.crossfire.jxclient.gui.textinput.CommandExecutor
Executes commands.
Definition: CommandExecutor.java:31
com.realtime.crossfire.jxclient.map.CfAnimations
Manages a set of animated faces.
Definition: CfAnimations.java:47
com.realtime.crossfire.jxclient.metaserver.MetaserverProcessor.addMetaserver
void addMetaserver(@NotNull final Metaserver metaserver)
Adds a metaserver to track.
Definition: MetaserverProcessor.java:205
com.realtime.crossfire.jxclient.metaserver.MetaserverModel
Maintains the metaserver information.
Definition: MetaserverModel.java:40
com.realtime.crossfire.jxclient.util
Definition: Codec.java:23
com.realtime.crossfire.jxclient.mapupdater.CfMapUpdater
Utility class to update a CfMap model from protocol commands.
Definition: CfMapUpdater.java:38
com.realtime.crossfire.jxclient.server.crossfire
Definition: AbstractCrossfireServerConnection.java:23
com.realtime.crossfire.jxclient.server.crossfire.Model.getSmoothFaces
SmoothFaces getSmoothFaces()
Definition: Model.java:142
com.realtime.crossfire.jxclient.main.JXClient.getSoundsCredits
static String getSoundsCredits()
Returns the sounds credits.
Definition: JXClient.java:183
com.realtime.crossfire.jxclient.main.JXCWindow.DISABLE_START_GUI
static final boolean DISABLE_START_GUI
TODO: Remove when more options are implemented in the start screen gui.
Definition: JXCWindow.java:72
com.realtime.crossfire.jxclient.sound.SoundWatcher
Monitors sound and sound2 commands received from the server to generate sound effects.
Definition: SoundWatcher.java:34
com.realtime.crossfire.jxclient.account
Definition: CharacterInformation.java:23
com.realtime.crossfire.jxclient.server.crossfire.Model.getStats
Stats getStats()
Definition: Model.java:107
com.realtime.crossfire.jxclient.commands.ScriptkillCommand
Implements the "scriptkill" command.
Definition: ScriptkillCommand.java:32
com.realtime.crossfire.jxclient.server.crossfire.Model.getGuiStateManager
GuiStateManager getGuiStateManager()
Definition: Model.java:117
com.realtime.crossfire.jxclient.commands.ScriptsCommand
Implements the "scripts" command.
Definition: ScriptsCommand.java:36
com.realtime.crossfire.jxclient.shortcuts
Definition: Shortcut.java:23
com.realtime.crossfire.jxclient.skin.skin.GuiFactory
Factory for creating Gui instances.
Definition: GuiFactory.java:41
com.realtime.crossfire.jxclient.items.QuestsView
Provides a view of all quests a character is doing.
Definition: QuestsView.java:38
com.realtime.crossfire.jxclient.settings.SettingsEntries.MESSAGE_LOG_SETTINGS_ENTRY
static final SettingsEntry< Boolean > MESSAGE_LOG_SETTINGS_ENTRY
Whether to record of all text messages received from the server.
Definition: SettingsEntries.java:44
com.realtime.crossfire.jxclient.gui.gui
Definition: AbstractGUIElement.java:23
com.realtime.crossfire.jxclient.server.crossfire.Model.getAnimations
Animations getAnimations()
Returns the Animations instance.
Definition: Model.java:165
com.realtime.crossfire.jxclient.queue
Definition: CommandQueue.java:23
com.realtime.crossfire.jxclient.commands.ScreenshotCommand
Implements the "screenshot" command.
Definition: ScreenshotCommand.java:42
com.realtime.crossfire
com.realtime.crossfire.jxclient.settings.options
Definition: CheckBoxOption.java:23
com.realtime.crossfire.jxclient.faces.AskfaceFaceQueue
A FaceQueue requesting faces by "askface" commands sent to the Crossfire server.
Definition: AskfaceFaceQueue.java:37
com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.stop
void stop()
Stops operation.
com.realtime.crossfire.jxclient.main.DefaultKeyHandler
A KeyHandlerListener which updates the state of a GuiManager.
Definition: DefaultKeyHandler.java:40
com.realtime
com.realtime.crossfire.jxclient.commands
Definition: AbstractCommand.java:23
com.realtime.crossfire.jxclient.skin.skin.JXCSkin
Defines a JXClient skin consisting of a main Gui and zero or more dialog Guis.
Definition: JXCSkin.java:42
com
com.realtime.crossfire.jxclient.util.DebugWriter
Writer debug information to a log file.
Definition: DebugWriter.java:36
com.realtime.crossfire.jxclient.commands.SetCommand
Implements the command "set".
Definition: SetCommand.java:37
com.realtime.crossfire.jxclient.settings.CommandHistoryFactory
Factory for creating CommandHistory instances by name.
Definition: CommandHistoryFactory.java:33
com.realtime.crossfire.jxclient.settings.Filenames.getOriginalImageCacheDir
static Path getOriginalImageCacheDir()
Returns the image cache directory.
Definition: Filenames.java:50
com.realtime.crossfire.jxclient.commands.HelpCommand
Implements the command "help".
Definition: HelpCommand.java:33
com.realtime.crossfire.jxclient.items
Definition: AbstractItemView.java:23
com.realtime.crossfire.jxclient.metaserver.MetaserverProcessor.start
void start()
Starts querying the added metaservers.
Definition: MetaserverProcessor.java:214
com.realtime.crossfire.jxclient.commands.Commands.addCommand
void addCommand(@NotNull final Command command)
Adds an executable Command.
Definition: Commands.java:49
com.realtime.crossfire.jxclient.settings.Filenames.getKeybindingsFileVersion1
static Path getKeybindingsFileVersion1(@Nullable final CharSequence hostname, @Nullable final CharSequence character)
Returns the fallback keybindings file.
Definition: Filenames.java:138
com.realtime.crossfire.jxclient.items.KnowledgeView
Displays knowledge items the player knows.
Definition: KnowledgeView.java:15
com.realtime.crossfire.jxclient.metaserver.DefaultMetaserver
Default Metaserver implementation: queries data from an URL.
Definition: DefaultMetaserver.java:41
com.realtime.crossfire.jxclient.commands.DebugMessagesCommand
Implements the "debug_messages" command.
Definition: DebugMessagesCommand.java:35
com.realtime.crossfire.jxclient.shortcuts.Shortcuts
Manages a list of Shortcuts.
Definition: Shortcuts.java:43
com.realtime.crossfire.jxclient.items.FloorView
Provides a view to all items comprising the current floor view.
Definition: FloorView.java:36
com.realtime.crossfire.jxclient.map.MapUpdaterState
Update a CfMap model from protocol commands.
Definition: MapUpdaterState.java:49
com.realtime.crossfire.jxclient.gui.commandlist.GUICommandFactory
Factory for creating GUICommand instances from string representation.
Definition: GUICommandFactory.java:32
com.realtime.crossfire.jxclient.stats.ActiveSkillWatcher
Helper class to synthesize an "active skill" stat value.
Definition: ActiveSkillWatcher.java:36
com.realtime.crossfire.jxclient.gui.commands
Definition: AccountCreateCharacterCommand.java:23
com.realtime.crossfire.jxclient.gui.misc
Definition: GUICheckBox.java:23
com.realtime.crossfire.jxclient.commands.ExecCommand
Implements the "exec" command.
Definition: ExecCommand.java:35
com.realtime.crossfire.jxclient.server.crossfire.Model.getSpellsManager
SpellsManager getSpellsManager()
Definition: Model.java:122
com.realtime.crossfire.jxclient.sound.SoundManager
Manages all sounds.
Definition: SoundManager.java:40
com.realtime.crossfire.jxclient.stats.PoisonWatcher
Helper class to listen on Stats#CF_POISONED.
Definition: PoisonWatcher.java:36
com.realtime.crossfire.jxclient.settings.Filenames.getMetaserverCacheFile
static Path getMetaserverCacheFile()
Returns the metaserver cache file.
Definition: Filenames.java:148
com.realtime.crossfire.jxclient.queue.CommandQueue
Maintains the pending (ncom) commands sent to the server.
Definition: CommandQueue.java:38
com.realtime.crossfire.jxclient.sound.MusicWatcher
Monitors music commands and generates appropriate sound effects.
Definition: MusicWatcher.java:32
com.realtime.crossfire.jxclient.sound.SoundStatsWatcher
Monitors stat changes and generates appropriate sound effects.
Definition: SoundStatsWatcher.java:38
com.realtime.crossfire.jxclient.commands.ScriptkillallCommand
Implements the "scriptkillall" command.
Definition: ScriptkillallCommand.java:35
com.realtime.crossfire.jxclient.main.Options.DEFAULT_SKIN
static final String DEFAULT_SKIN
The default skin name.
Definition: Options.java:118
com.realtime.crossfire.jxclient.item.ItemsManager
Manages items known to the character.
Definition: ItemsManager.java:45
com.realtime.crossfire.jxclient.gui.log.ShowTimestampMessagesCheckBoxOption
A CheckBoxOption that enables/disables timestamps in the messages window.
Definition: ShowTimestampMessagesCheckBoxOption.java:34
com.realtime.crossfire.jxclient.sound.SoundManager.shutdown
void shutdown()
Terminates all sounds and free resources.
Definition: SoundManager.java:240
com.realtime.crossfire.jxclient.main.JXClient.openDebugStream
static Writer openDebugStream(@Nullable final String filename)
Opens a debug output stream.
Definition: JXClient.java:401
com.realtime.crossfire.jxclient.server.crossfire.Model
Combines all model classes that are updated.
Definition: Model.java:43
com.realtime.crossfire.jxclient.mapupdater
Definition: CfMapUpdater.java:23
com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.loadGlobalKeybindings
void loadGlobalKeybindings()
Loads the global key bindings from the backing file.
Definition: KeybindingsManager.java:208
com.realtime.crossfire.jxclient.stats
Definition: ActiveSkillWatcher.java:23
com.realtime.crossfire.jxclient.main.JXClient.main
static void main(@NotNull final String @NotNull[] args)
The program entry point.
Definition: JXClient.java:151
com.realtime.crossfire.jxclient.main.FacesTracker
Tracks a GuiStateManager and resets known faces whenever a new server connection has been established...
Definition: FacesTracker.java:36
com.realtime.crossfire.jxclient.settings.options.OptionException
Indicates about an incorrect option.
Definition: OptionException.java:31
com.realtime.crossfire.jxclient.metaserver.MetaserverProcessor
Asynchronously queries the metaserver and updates a MetaserverModel instance.
Definition: MetaserverProcessor.java:42
com.realtime.crossfire.jxclient.main.Exiter.waitForTermination
void waitForTermination()
Waits until the window has been disposed.
Definition: Exiter.java:53
com.realtime.crossfire.jxclient.gui.misc.MouseTracker
Tracks mouse actions and delivers mouse events to affected GUIElement.
Definition: MouseTracker.java:55