|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.common.config.Wyvern
This class provides static information about the environment the game is running in. It differs from wyvern.world.SystemProps in that SystemProps is server-side only; this class provides common initialization for both client and server.
Its primary purpose is to provide path information for various directories in the game server's file tree. All directories are returned in a canonical form, with drive letter removed, and slashes as "/" instead of "\". For example, getAdminDir() might return "/games/wyvern/admin".
Field Summary | |
static java.lang.String |
GAME_ROOT
|
static java.lang.String |
IMAGE_EXTENSION
|
static java.lang.String |
ROOT_DIR
|
Constructor Summary | |
Wyvern()
|
Method Summary | |
static java.lang.String |
getAdminDir()
Returns the administrative directory containing configuration files, banishment lists, etc. |
static java.applet.Applet |
getApplet()
Returns the Applet for the system, if we're running as an Applet. |
static java.lang.String |
getArchRoot()
Gets the directory where the standard archetypes are stored. |
static java.lang.String |
getArtDir()
Returns the top-level art directory. |
static java.lang.String |
getArtRoot()
Returns the root directory of the game artwork. |
static java.lang.String |
getBanishmentFile()
Returns the full path to the text file containing banished players. |
static java.lang.String |
getDocDir()
Returns the top-level documentation directory. |
static java.lang.String |
getEmailDir()
Returns the administrative directory containing email message bodies for sending to users. |
static java.lang.String |
getGameRoot()
Returns the directory where the wyvern/ tree is stored. |
static java.lang.String |
getHelpDir()
Returns the directory where help files are stored. |
static java.lang.String |
getListDir()
Returns the top-level treasure-lists directory, usually root + "world/lists/". |
static java.lang.String |
getLogDir()
Returns the administrative directory containing logfiles. |
static java.lang.String |
getMailDir()
Returns the player mail directory ("world/mail/") |
static java.lang.String |
getMapEditorDir()
Returns directory where the map editor main class is kept. |
static java.lang.String |
getMapRoot()
Returns the root directory where the main game maps are stored. |
static java.lang.String |
getMusicDir()
Returns the directory where the music is kept. |
static java.lang.String |
getPlayerRoot()
Returns the directory where the player files are stored. |
static java.lang.String |
getPythonDir()
Returns the wyvern python module and script directory. |
static java.lang.String |
getRelativeArtRoot()
Returns art root suitable for loading from jar file. |
static java.lang.String |
getRelativeRoot()
Returns the relative root directory, suitable for looking up images not in the standard art/game directory (e.g. |
static java.io.InputStream |
getResourceAsStream(java.lang.String name)
Returns an InputStream to a resource from the disk, or jar file (if we're running from a jar). |
static java.lang.String |
getRootDir()
Returns the directory under which the game is installed, e.g. |
static java.lang.String |
getSkillsDir()
Returns the top-level spells directory. |
static java.lang.String |
getSkinsDir()
Returns the default Skins directory. |
static java.lang.String |
getSpellsDir()
Returns the top-level spells directory. |
static java.lang.String |
getStatueDir()
Returns the directory where statues (petrified monsters) are kept. |
static java.lang.String |
getTalkDir()
Returns the directory where NPC talk-files are kept. |
static java.lang.String |
getTempDir()
Returns the temporary directory to use on this system. |
static java.lang.String |
getToolsDir()
Returns the top-level tools directory. |
static java.lang.String |
getVaultDir()
Returns the directory where player vaults are kept. |
static java.lang.String |
getVisitorRoot()
Returns the directory where visiting player files are stored. |
static java.lang.String |
getWebStartRoot()
Returns the directory where Java WebStart starts the application - usually some long path on Windows. |
static java.lang.String |
getWizDir()
Returns the Wizards directory. |
static boolean |
isApplet()
Returns true if the game (client or server) is currently running as an Applet. |
static boolean |
isWebStart()
Returns true if we've been passed a "webstart" argument. |
static java.awt.Image |
loadImage(java.lang.String name)
Loads an image from the JAR file or local filesystem. |
static void |
main(java.lang.String[] args)
Test. |
static void |
markAsApplet()
Marks the application as running as an Applet. |
static void |
setApplet(java.applet.Applet applet)
Sets the Applet for the system. |
static void |
setWebStart()
Tells the system we're operating in Java WebStart mode, so resources should be loaded from the jar file. |
static void |
waitForImage(java.awt.Image img)
Waits for specified image. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.lang.String ROOT_DIR
public static java.lang.String IMAGE_EXTENSION
public static final java.lang.String GAME_ROOT
Constructor Detail |
public Wyvern()
Method Detail |
public static java.lang.String getRootDir()
public static java.lang.String getGameRoot()
public static java.lang.String getArtRoot()
public static java.lang.String getRelativeArtRoot()
public static java.lang.String getRelativeRoot()
public static java.lang.String getArtDir()
public static java.lang.String getArchRoot()
public static java.lang.String getMapRoot()
public static java.lang.String getMailDir()
public static java.lang.String getPlayerRoot()
public static java.lang.String getVisitorRoot()
public static java.lang.String getAdminDir()
public static java.lang.String getEmailDir()
public static java.lang.String getLogDir()
public static java.lang.String getMusicDir()
public static java.lang.String getTalkDir()
public static java.lang.String getWizDir()
public static java.lang.String getToolsDir()
public static java.lang.String getMapEditorDir()
public static java.lang.String getSpellsDir()
public static java.lang.String getSkillsDir()
public static java.lang.String getStatueDir()
public static java.lang.String getDocDir()
public static java.lang.String getBanishmentFile()
public static java.lang.String getListDir()
public static java.lang.String getPythonDir()
public static java.lang.String getVaultDir()
public static java.lang.String getSkinsDir()
public static java.lang.String getHelpDir()
public static boolean isApplet()
public static java.applet.Applet getApplet()
public static void markAsApplet()
public static void setApplet(java.applet.Applet applet)
applet
- the Appletpublic static void setWebStart()
public static boolean isWebStart()
public static java.lang.String getWebStartRoot()
public static java.lang.String getTempDir()
public static java.awt.Image loadImage(java.lang.String name)
name
- the path to the image, relative to the
system classpath. Example: "wyvern/art/game/foo/bar".
If it's a GIF file, the ".gif" (case matters) extension
is optional. For other file formats, extension is
required.
public static java.io.InputStream getResourceAsStream(java.lang.String name)
name
- the resource path, such as
"wyvern/art/game/monsters/goblin/goblin.S.gif".
If we're running from a jar file, this method prepends "/",
since that appears to be required by Class.getResourceAsStream().
If we're running from a filesystem, we want it not to start
with a "/", since it turns into a package path by converting
"/" with "." Unfortunately, most of the code in the code base has no idea if it's running from a jar or not, so this method will actually try both - filesystem first, then the jar. This is appropriate for WebStart, since it pulls some images into a filesystem cache, if they're newer than the ones packaged in the jar.
public static void waitForImage(java.awt.Image img)
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |