diff --git a/src/net/burtleburtle/bob/rand/IsaacRandom.java b/src/net/burtleburtle/bob/rand/IsaacRandom.java index 04a98dba..c2c4a0cd 100644 --- a/src/net/burtleburtle/bob/rand/IsaacRandom.java +++ b/src/net/burtleburtle/bob/rand/IsaacRandom.java @@ -45,21 +45,6 @@ public final class IsaacRandom { */ private static int MASK = SIZE - 1 << 2; - /** - * The count through the results in the results array. - */ - private int count; - - /** - * The results given to the user. - */ - private int[] rsl; - - /** - * The internal state. - */ - private int[] mem; - /** * The accumulator. */ @@ -75,6 +60,21 @@ public final class IsaacRandom { */ private int c; + /** + * The count through the results in the results array. + */ + private int count; + + /** + * The internal state. + */ + private int[] mem; + + /** + * The results given to the user. + */ + private int[] rsl; + /** * Creates the random number generator without an initial seed. */ diff --git a/src/org/apollo/Server.java b/src/org/apollo/Server.java index 0fd4c17a..1884e01d 100644 --- a/src/org/apollo/Server.java +++ b/src/org/apollo/Server.java @@ -61,9 +61,9 @@ public final class Server { } /** - * The {@link ServerBootstrap} for the service listener. + * The server's context. */ - private final ServerBootstrap serviceBootstrap = new ServerBootstrap(); + private ServerContext context; /** * The {@link ServerBootstrap} for the HTTP listener. @@ -81,6 +81,11 @@ public final class Server { */ private final ExecutorService networkExecutor = Executors.newCachedThreadPool(); + /** + * The {@link ServerBootstrap} for the service listener. + */ + private final ServerBootstrap serviceBootstrap = new ServerBootstrap(); + /** * The service manager. */ @@ -91,11 +96,6 @@ public final class Server { */ private final Timer timer = new HashedWheelTimer(); - /** - * The server's context. - */ - private ServerContext context; - /** * Creates the Apollo server. * diff --git a/src/org/apollo/ServerContext.java b/src/org/apollo/ServerContext.java index 491f9eca..6e9a7c41 100644 --- a/src/org/apollo/ServerContext.java +++ b/src/org/apollo/ServerContext.java @@ -15,6 +15,11 @@ import org.jboss.netty.channel.group.DefaultChannelGroup; */ public final class ServerContext { + /** + * The channel group. + */ + private final ChannelGroup group = new DefaultChannelGroup(); + /** * The current release. */ @@ -25,11 +30,6 @@ public final class ServerContext { */ private final ServiceManager serviceManager; - /** - * The channel group. - */ - private final ChannelGroup group = new DefaultChannelGroup(); - /** * Creates a new server context. * diff --git a/src/org/apollo/fs/FileDescriptor.java b/src/org/apollo/fs/FileDescriptor.java index c0ac8b90..814ac12b 100644 --- a/src/org/apollo/fs/FileDescriptor.java +++ b/src/org/apollo/fs/FileDescriptor.java @@ -7,16 +7,16 @@ package org.apollo.fs; */ public final class FileDescriptor { - /** - * The file type. - */ - private final int type; - /** * The file id. */ private final int file; + /** + * The file type. + */ + private final int type; + /** * Creates the file descriptor. * diff --git a/src/org/apollo/fs/FileSystemConstants.java b/src/org/apollo/fs/FileSystemConstants.java index bc7ae9d0..3a6f1734 100644 --- a/src/org/apollo/fs/FileSystemConstants.java +++ b/src/org/apollo/fs/FileSystemConstants.java @@ -7,41 +7,40 @@ package org.apollo.fs; */ public final class FileSystemConstants { - /** - * The number of caches. - */ - public static final int CACHE_COUNT = 5; - /** * The number of archives in cache 0. */ public static final int ARCHIVE_COUNT = 9; - /** - * The size of an index. - */ - public static final int INDEX_SIZE = 6; - - /** - * The size of a header. - */ - public static final int HEADER_SIZE = 8; - /** * The size of a chunk. */ public static final int CHUNK_SIZE = 512; + /** + * The size of a header. + */ + public static final int HEADER_SIZE = 8; + /** * The size of a block. */ public static final int BLOCK_SIZE = HEADER_SIZE + CHUNK_SIZE; + /** + * The number of caches. + */ + public static final int CACHE_COUNT = 5; + + /** + * The size of an index. + */ + public static final int INDEX_SIZE = 6; + /** * Default private constructor to prevent instantiation. */ private FileSystemConstants() { - } -} +} \ No newline at end of file diff --git a/src/org/apollo/fs/Index.java b/src/org/apollo/fs/Index.java index aa94ac67..6ab78587 100644 --- a/src/org/apollo/fs/Index.java +++ b/src/org/apollo/fs/Index.java @@ -25,16 +25,16 @@ public final class Index { return new Index(size, block); } - /** - * The size of the file. - */ - private final int size; - /** * The first block of the file. */ private final int block; + /** + * The size of the file. + */ + private final int size; + /** * Creates the index. * diff --git a/src/org/apollo/fs/IndexedFileSystem.java b/src/org/apollo/fs/IndexedFileSystem.java index 3f444738..7c834965 100644 --- a/src/org/apollo/fs/IndexedFileSystem.java +++ b/src/org/apollo/fs/IndexedFileSystem.java @@ -17,14 +17,9 @@ import java.util.zip.CRC32; public final class IndexedFileSystem implements Closeable { /** - * Read only flag. + * The cached CRC table. */ - private final boolean readOnly; - - /** - * The index files. - */ - private RandomAccessFile[] indices = new RandomAccessFile[256]; + private ByteBuffer crcTable; /** * The data file. @@ -32,9 +27,14 @@ public final class IndexedFileSystem implements Closeable { private RandomAccessFile data; /** - * The cached CRC table. + * The index files. */ - private ByteBuffer crcTable; + private RandomAccessFile[] indices = new RandomAccessFile[256]; + + /** + * Read only flag. + */ + private final boolean readOnly; /** * Creates the file system with the specified base directory. diff --git a/src/org/apollo/fs/archive/ArchiveEntry.java b/src/org/apollo/fs/archive/ArchiveEntry.java index 65d7cc5e..56c51875 100644 --- a/src/org/apollo/fs/archive/ArchiveEntry.java +++ b/src/org/apollo/fs/archive/ArchiveEntry.java @@ -9,16 +9,16 @@ import java.nio.ByteBuffer; */ public final class ArchiveEntry { - /** - * The identifier of this entry. - */ - private final int identifier; - /** * The buffer of this entry. */ private final ByteBuffer buffer; + /** + * The identifier of this entry. + */ + private final int identifier; + /** * Creates a new archive entry. * diff --git a/src/org/apollo/game/GameConstants.java b/src/org/apollo/game/GameConstants.java index f49dff44..fdb16010 100644 --- a/src/org/apollo/game/GameConstants.java +++ b/src/org/apollo/game/GameConstants.java @@ -7,16 +7,16 @@ package org.apollo.game; */ public final class GameConstants { - /** - * The delay between consecutive pulses, in milliseconds. - */ - public static final int PULSE_DELAY = 600; - /** * The maximum events per pulse per session. */ public static final int EVENTS_PER_PULSE = 10; + /** + * The delay between consecutive pulses, in milliseconds. + */ + public static final int PULSE_DELAY = 600; + /** * Default private constructor to prevent instantiation by other classes. */ diff --git a/src/org/apollo/game/GameService.java b/src/org/apollo/game/GameService.java index 3fce234d..23540626 100644 --- a/src/org/apollo/game/GameService.java +++ b/src/org/apollo/game/GameService.java @@ -35,10 +35,9 @@ public final class GameService extends Service { private static final int UNREGISTERS_PER_CYCLE = 50; /** - * The scheduled executor service. + * The {@link EventHandlerChainGroup}. */ - private final ScheduledExecutorService scheduledExecutor = Executors - .newSingleThreadScheduledExecutor(new NamedThreadFactory("GameService")); + private EventHandlerChainGroup chainGroup; /** * A queue of players to remove. @@ -46,9 +45,10 @@ public final class GameService extends Service { private final Queue oldPlayers = new ConcurrentLinkedQueue(); /** - * The {@link EventHandlerChainGroup}. + * The scheduled executor service. */ - private EventHandlerChainGroup chainGroup; + private final ScheduledExecutorService scheduledExecutor = Executors + .newSingleThreadScheduledExecutor(new NamedThreadFactory("GameService")); /** * The {@link ClientSynchronizer}. diff --git a/src/org/apollo/game/action/DistancedAction.java b/src/org/apollo/game/action/DistancedAction.java index d679f583..7107bc82 100644 --- a/src/org/apollo/game/action/DistancedAction.java +++ b/src/org/apollo/game/action/DistancedAction.java @@ -12,25 +12,25 @@ import org.apollo.game.model.Position; public abstract class DistancedAction extends Action { /** - * The position to distance check with. + * The delay once the threshold is reached. */ - private final Position position; + private final int delay; /** * The minimum distance before the action fires. */ private final int distance; - /** - * The delay once the threshold is reached. - */ - private final int delay; - /** * A flag indicating if this action fires immediately after the threshold is reached. */ private final boolean immediate; + /** + * The position to distance check with. + */ + private final Position position; + /** * A flag indicating if the distance has been reached yet. */ diff --git a/src/org/apollo/game/command/Command.java b/src/org/apollo/game/command/Command.java index ff08496b..5ddfa33a 100644 --- a/src/org/apollo/game/command/Command.java +++ b/src/org/apollo/game/command/Command.java @@ -7,16 +7,16 @@ package org.apollo.game.command; */ public final class Command { - /** - * The name of the command. - */ - private final String name; - /** * The command's arguments. */ private final String[] arguments; + /** + * The name of the command. + */ + private final String name; + /** * Creates the command. * diff --git a/src/org/apollo/game/event/impl/ChatEvent.java b/src/org/apollo/game/event/impl/ChatEvent.java index 3a7f55a1..d7be2ee7 100644 --- a/src/org/apollo/game/event/impl/ChatEvent.java +++ b/src/org/apollo/game/event/impl/ChatEvent.java @@ -10,25 +10,25 @@ import org.apollo.game.event.Event; public final class ChatEvent extends Event { /** - * The message. + * The text color. */ - private final String message; + private final int color; /** * The compressed message. */ private final byte[] compressedMessage; - /** - * The text color. - */ - private final int color; - /** * The text effects. */ private final int effects; + /** + * The message. + */ + private final String message; + /** * Creates a new chat event. * diff --git a/src/org/apollo/game/event/impl/FifthItemOptionEvent.java b/src/org/apollo/game/event/impl/FifthItemOptionEvent.java index 70d46c8b..981b3f67 100644 --- a/src/org/apollo/game/event/impl/FifthItemOptionEvent.java +++ b/src/org/apollo/game/event/impl/FifthItemOptionEvent.java @@ -2,12 +2,14 @@ package org.apollo.game.event.impl; /** * The fifth {@link ItemOptionEvent}, used mainly for dropping items. + * * @author Chris Fletcher */ public final class FifthItemOptionEvent extends ItemOptionEvent { /** * Creates the fifth item option event. + * * @param interfaceId The interface id. * @param id The id. * @param slot The slot. diff --git a/src/org/apollo/game/event/impl/FirstItemOptionEvent.java b/src/org/apollo/game/event/impl/FirstItemOptionEvent.java index 76d514cb..e80e301c 100644 --- a/src/org/apollo/game/event/impl/FirstItemOptionEvent.java +++ b/src/org/apollo/game/event/impl/FirstItemOptionEvent.java @@ -2,12 +2,14 @@ package org.apollo.game.event.impl; /** * The first {@link ItemOptionEvent}, used for eating food or identifying herbs (amongst others). + * * @author Chris Fletcher */ public final class FirstItemOptionEvent extends ItemOptionEvent { /** * Creates the first item option event. + * * @param interfaceId The interface id. * @param id The id. * @param slot The slot. diff --git a/src/org/apollo/game/event/impl/FourthItemOptionEvent.java b/src/org/apollo/game/event/impl/FourthItemOptionEvent.java index 847e7cfb..fbc1fd87 100644 --- a/src/org/apollo/game/event/impl/FourthItemOptionEvent.java +++ b/src/org/apollo/game/event/impl/FourthItemOptionEvent.java @@ -2,12 +2,14 @@ package org.apollo.game.event.impl; /** * The fourth {@link ItemOptionEvent}. + * * @author Chris Fletcher */ public final class FourthItemOptionEvent extends ItemOptionEvent { /** * Creates the fourth item option event. + * * @param interfaceId The interface id. * @param id The id. * @param slot The slot. diff --git a/src/org/apollo/game/event/impl/InventoryItemEvent.java b/src/org/apollo/game/event/impl/InventoryItemEvent.java index a8fccb2b..285ca54b 100644 --- a/src/org/apollo/game/event/impl/InventoryItemEvent.java +++ b/src/org/apollo/game/event/impl/InventoryItemEvent.java @@ -11,9 +11,9 @@ import org.apollo.game.event.Event; public abstract class InventoryItemEvent extends Event { /** - * The option number (1-5). + * The item id. */ - private final int option; + private final int id; /** * The interface id. @@ -21,9 +21,9 @@ public abstract class InventoryItemEvent extends Event { private final int interfaceId; /** - * The item id. + * The option number (1-5). */ - private final int id; + private final int option; /** * The item's slot. @@ -46,12 +46,12 @@ public abstract class InventoryItemEvent extends Event { } /** - * Gets the option number. + * Gets the item id. * - * @return The option number. + * @return The item id. */ - public final int getOption() { - return option; + public final int getId() { + return id; } /** @@ -64,12 +64,12 @@ public abstract class InventoryItemEvent extends Event { } /** - * Gets the item id. + * Gets the option number. * - * @return The item id. + * @return The option number. */ - public final int getId() { - return id; + public final int getOption() { + return option; } /** diff --git a/src/org/apollo/game/event/impl/ItemOptionEvent.java b/src/org/apollo/game/event/impl/ItemOptionEvent.java index e455cce8..8bdc1503 100644 --- a/src/org/apollo/game/event/impl/ItemOptionEvent.java +++ b/src/org/apollo/game/event/impl/ItemOptionEvent.java @@ -1,8 +1,9 @@ package org.apollo.game.event.impl; /** - * An {@link InventoryItemEvent} which is sent by the client when an item's option is clicked (e.g. equip, - * eat, drink, etc). + * An {@link InventoryItemEvent} which is sent by the client when an item's option is clicked (e.g. equip, eat, drink, + * etc). + * * @author Chris Fletcher */ public abstract class ItemOptionEvent extends InventoryItemEvent { diff --git a/src/org/apollo/game/event/impl/NpcSynchronizationEvent.java b/src/org/apollo/game/event/impl/NpcSynchronizationEvent.java index ae6eaa32..6fa255db 100644 --- a/src/org/apollo/game/event/impl/NpcSynchronizationEvent.java +++ b/src/org/apollo/game/event/impl/NpcSynchronizationEvent.java @@ -14,6 +14,11 @@ import org.apollo.game.sync.seg.SynchronizationSegment; */ public class NpcSynchronizationEvent extends Event { + /** + * The amount of local npcs. + */ + private final int localNpcs; + /** * The npc's position. */ @@ -24,11 +29,6 @@ public class NpcSynchronizationEvent extends Event { */ private final List segments; - /** - * The amount of local npcs. - */ - private final int localNpcs; - /** * Creates a new {@link NpcSynchronizationEvent}. * diff --git a/src/org/apollo/game/event/impl/ObjectActionEvent.java b/src/org/apollo/game/event/impl/ObjectActionEvent.java index c77d5c43..eb9cfa97 100644 --- a/src/org/apollo/game/event/impl/ObjectActionEvent.java +++ b/src/org/apollo/game/event/impl/ObjectActionEvent.java @@ -10,16 +10,16 @@ import org.apollo.game.model.Position; */ public abstract class ObjectActionEvent extends Event { - /** - * The option number (1-3). - */ - private final int option; - /** * The object's id. */ private final int id; + /** + * The option number (1-3). + */ + private final int option; + /** * The object's position. */ diff --git a/src/org/apollo/game/event/impl/PlayerSynchronizationEvent.java b/src/org/apollo/game/event/impl/PlayerSynchronizationEvent.java index 73d611ee..406ee9ca 100644 --- a/src/org/apollo/game/event/impl/PlayerSynchronizationEvent.java +++ b/src/org/apollo/game/event/impl/PlayerSynchronizationEvent.java @@ -18,6 +18,11 @@ public final class PlayerSynchronizationEvent extends Event { */ private final Position lastKnownRegion; + /** + * The number of local players. + */ + private final int localPlayers; + /** * The player's position. */ @@ -33,11 +38,6 @@ public final class PlayerSynchronizationEvent extends Event { */ private final SynchronizationSegment segment; - /** - * The number of local players. - */ - private final int localPlayers; - /** * A list of segments. */ diff --git a/src/org/apollo/game/event/impl/SecondItemOptionEvent.java b/src/org/apollo/game/event/impl/SecondItemOptionEvent.java index 353a96cd..c9d16ae3 100644 --- a/src/org/apollo/game/event/impl/SecondItemOptionEvent.java +++ b/src/org/apollo/game/event/impl/SecondItemOptionEvent.java @@ -2,12 +2,14 @@ package org.apollo.game.event.impl; /** * The second {@link ItemOptionEvent}, used for equipping an item (amongst others?). + * * @author Chris Fletcher */ public final class SecondItemOptionEvent extends ItemOptionEvent { /** * Creates the second item option event. + * * @param interfaceId The interface id. * @param id The id. * @param slot The slot. diff --git a/src/org/apollo/game/event/impl/SwitchItemEvent.java b/src/org/apollo/game/event/impl/SwitchItemEvent.java index ed93fd4f..46120137 100644 --- a/src/org/apollo/game/event/impl/SwitchItemEvent.java +++ b/src/org/apollo/game/event/impl/SwitchItemEvent.java @@ -9,26 +9,26 @@ import org.apollo.game.event.Event; */ public final class SwitchItemEvent extends Event { - /** - * The interface id. - */ - private final int interfaceId; - /** * A flag indicating if insertion mode is enabled. */ private final boolean inserting; /** - * The old slot. + * The interface id. */ - private final int oldSlot; + private final int interfaceId; /** * The new slot. */ private final int newSlot; + /** + * The old slot. + */ + private final int oldSlot; + /** * Creates a new switch item event. * diff --git a/src/org/apollo/game/event/impl/SwitchTabInterfaceEvent.java b/src/org/apollo/game/event/impl/SwitchTabInterfaceEvent.java index 0716bead..bd765100 100644 --- a/src/org/apollo/game/event/impl/SwitchTabInterfaceEvent.java +++ b/src/org/apollo/game/event/impl/SwitchTabInterfaceEvent.java @@ -9,16 +9,16 @@ import org.apollo.game.event.Event; */ public final class SwitchTabInterfaceEvent extends Event { - /** - * The tab id. - */ - private final int tab; - /** * The interface id. */ private final int interfaceId; + /** + * The tab id. + */ + private final int tab; + /** * Creates the switch interface event. * diff --git a/src/org/apollo/game/event/impl/ThirdItemOptionEvent.java b/src/org/apollo/game/event/impl/ThirdItemOptionEvent.java index 6d21d338..28b110d8 100644 --- a/src/org/apollo/game/event/impl/ThirdItemOptionEvent.java +++ b/src/org/apollo/game/event/impl/ThirdItemOptionEvent.java @@ -2,12 +2,14 @@ package org.apollo.game.event.impl; /** * The third {@link ItemOptionEvent}. + * * @author Chris Fletcher */ public final class ThirdItemOptionEvent extends ItemOptionEvent { /** * Creates the third item option event. + * * @param interfaceId The interface id. * @param id The id. * @param slot The slot. diff --git a/src/org/apollo/game/event/impl/WalkEvent.java b/src/org/apollo/game/event/impl/WalkEvent.java index b1540ee1..9a772a7d 100644 --- a/src/org/apollo/game/event/impl/WalkEvent.java +++ b/src/org/apollo/game/event/impl/WalkEvent.java @@ -10,16 +10,16 @@ import org.apollo.game.model.Position; */ public final class WalkEvent extends Event { - /** - * The steps. - */ - private final Position[] steps; - /** * The running flag. */ private boolean run; + /** + * The steps. + */ + private final Position[] steps; + /** * Creates the event. * diff --git a/src/org/apollo/game/model/Animation.java b/src/org/apollo/game/model/Animation.java index 0e367e45..70221014 100644 --- a/src/org/apollo/game/model/Animation.java +++ b/src/org/apollo/game/model/Animation.java @@ -7,141 +7,61 @@ package org.apollo.game.model; */ public final class Animation { - /** - * A special animation which stops the current animation. - */ - public static final Animation STOP_ANIMATION = new Animation(-1); - - /** - * The yes animation. - */ - public static final Animation YES = new Animation(855); - - /** - * The no animation. - */ - public static final Animation NO = new Animation(856); - - /** - * The thinking animation. - */ - public static final Animation THINKING = new Animation(857); - - /** - * The bow animation. - */ - public static final Animation BOW = new Animation(858); - /** * The angry animation. */ public static final Animation ANGRY = new Animation(859); - /** - * The cry animation. - */ - public static final Animation CRY = new Animation(860); - - /** - * The laugh animation. - */ - public static final Animation LAUGH = new Animation(861); - - /** - * The cheer animation. - */ - public static final Animation CHEER = new Animation(862); - - /** - * The wave animation. - */ - public static final Animation WAVE = new Animation(863); - /** * The beckon animation. */ public static final Animation BECKON = new Animation(864); - /** - * The clap animation. - */ - public static final Animation CLAP = new Animation(865); - - /** - * The dance animation. - */ - public static final Animation DANCE = new Animation(866); - - /** - * The panic animation. - */ - public static final Animation PANIC = new Animation(2105); - - /** - * The jig animation. - */ - public static final Animation JIG = new Animation(2106); - - /** - * The spin animation. - */ - public static final Animation SPIN = new Animation(2107); - - /** - * The head bang animation. - */ - public static final Animation HEAD_BANG = new Animation(2108); - - /** - * The joy jump animation. - */ - public static final Animation JOY_JUMP = new Animation(2109); - - /** - * The raspberry animation. - */ - public static final Animation RASPBERRY = new Animation(2110); - - /** - * The yawn animation. - */ - public static final Animation YAWN = new Animation(2111); - - /** - * The salute animation. - */ - public static final Animation SALUTE = new Animation(2112); - - /** - * The shrug animation. - */ - public static final Animation SHRUG = new Animation(2113); - /** * The blow kiss animation. */ public static final Animation BLOW_KISS = new Animation(1368); /** - * The glass wall animation. + * The bow animation. */ - public static final Animation GLASS_WALL = new Animation(1128); + public static final Animation BOW = new Animation(858); /** - * The lean animation. + * The cheer animation. */ - public static final Animation LEAN = new Animation(1129); + public static final Animation CHEER = new Animation(862); + + /** + * The clap animation. + */ + public static final Animation CLAP = new Animation(865); /** * The climb rope animation. */ public static final Animation CLIMB_ROPE = new Animation(1130); + /** + * The cry animation. + */ + public static final Animation CRY = new Animation(860); + + /** + * The dance animation. + */ + public static final Animation DANCE = new Animation(866); + /** * The glass box animation. */ public static final Animation GLASS_BOX = new Animation(1131); + /** + * The glass wall animation. + */ + public static final Animation GLASS_WALL = new Animation(1128); + /** * The goblin bow animation. */ @@ -153,15 +73,95 @@ public final class Animation { public static final Animation GOBLIN_DANCE = new Animation(2128); /** - * The id. + * The head bang animation. */ - private final int id; + public static final Animation HEAD_BANG = new Animation(2108); + + /** + * The jig animation. + */ + public static final Animation JIG = new Animation(2106); + + /** + * The joy jump animation. + */ + public static final Animation JOY_JUMP = new Animation(2109); + + /** + * The laugh animation. + */ + public static final Animation LAUGH = new Animation(861); + + /** + * The lean animation. + */ + public static final Animation LEAN = new Animation(1129); + + /** + * The no animation. + */ + public static final Animation NO = new Animation(856); + + /** + * The panic animation. + */ + public static final Animation PANIC = new Animation(2105); + + /** + * The raspberry animation. + */ + public static final Animation RASPBERRY = new Animation(2110); + + /** + * The salute animation. + */ + public static final Animation SALUTE = new Animation(2112); + + /** + * The shrug animation. + */ + public static final Animation SHRUG = new Animation(2113); + + /** + * The spin animation. + */ + public static final Animation SPIN = new Animation(2107); + + /** + * A special animation which stops the current animation. + */ + public static final Animation STOP_ANIMATION = new Animation(-1); + + /** + * The thinking animation. + */ + public static final Animation THINKING = new Animation(857); + + /** + * The wave animation. + */ + public static final Animation WAVE = new Animation(863); + + /** + * The yawn animation. + */ + public static final Animation YAWN = new Animation(2111); + + /** + * The yes animation. + */ + public static final Animation YES = new Animation(855); /** * The delay. */ private final int delay; + /** + * The id. + */ + private final int id; + /** * Creates a new animation with no delay. * diff --git a/src/org/apollo/game/model/Appearance.java b/src/org/apollo/game/model/Appearance.java index fd550cb8..7afbbf73 100644 --- a/src/org/apollo/game/model/Appearance.java +++ b/src/org/apollo/game/model/Appearance.java @@ -13,6 +13,11 @@ public final class Appearance { public static final Appearance DEFAULT_APPEARANCE = new Appearance(Gender.MALE, new int[] { 0, 10, 18, 26, 33, 36, 42 }, new int[5]); + /** + * The array of clothing/skin colours. + */ + private final int[] colors; + /** * The player's gender. */ @@ -23,11 +28,6 @@ public final class Appearance { */ private final int[] style; - /** - * The array of clothing/skin colours. - */ - private final int[] colors; - /** * Creates the appearance with the specified gender, style and colors. * diff --git a/src/org/apollo/game/model/Direction.java b/src/org/apollo/game/model/Direction.java index 0b744a91..6bdd62b0 100644 --- a/src/org/apollo/game/model/Direction.java +++ b/src/org/apollo/game/model/Direction.java @@ -7,6 +7,16 @@ package org.apollo.game.model; */ public enum Direction { + /** + * East movement. + */ + EAST(4), + + /** + * No movement. + */ + NONE(-1), + /** * North movement. */ @@ -18,20 +28,20 @@ public enum Direction { NORTH_EAST(2), /** - * East movement. + * North west movement. */ - EAST(4), - - /** - * South east movement. - */ - SOUTH_EAST(7), + NORTH_WEST(0), /** * South movement. */ SOUTH(6), + /** + * South east movement. + */ + SOUTH_EAST(7), + /** * South west movement. */ @@ -40,17 +50,7 @@ public enum Direction { /** * West movement. */ - WEST(3), - - /** - * North west movement. - */ - NORTH_WEST(0), - - /** - * No movement. - */ - NONE(-1); + WEST(3); /** * An empty direction array. diff --git a/src/org/apollo/game/model/EquipmentConstants.java b/src/org/apollo/game/model/EquipmentConstants.java index b5a8ab3b..21cdc35f 100644 --- a/src/org/apollo/game/model/EquipmentConstants.java +++ b/src/org/apollo/game/model/EquipmentConstants.java @@ -8,59 +8,59 @@ package org.apollo.game.model; public final class EquipmentConstants { /** - * The hat slot. + * The amulet slot. */ - public static final int HAT = 0; + public static final int AMULET = 2; + + /** + * The arrows slot. + */ + public static final int ARROWS = 13; /** * The cape slot. */ public static final int CAPE = 1; - /** - * The amulet slot. - */ - public static final int AMULET = 2; - - /** - * The weapon slot. - */ - public static final int WEAPON = 3; - /** * The chest slot. */ public static final int CHEST = 4; - /** - * The shield slot. - */ - public static final int SHIELD = 5; - - /** - * The legs slot. - */ - public static final int LEGS = 7; - - /** - * The hands slot. - */ - public static final int HANDS = 9; - /** * The feet slot. */ public static final int FEET = 10; + /** + * The hands slot. + */ + public static final int HANDS = 9; + + /** + * The hat slot. + */ + public static final int HAT = 0; + + /** + * The legs slot. + */ + public static final int LEGS = 7; + /** * The ring slot. */ public static final int RING = 12; /** - * The arrows slot. + * The shield slot. */ - public static final int ARROWS = 13; + public static final int SHIELD = 5; + + /** + * The weapon slot. + */ + public static final int WEAPON = 3; /** * Default private constructor to prevent instantiation; diff --git a/src/org/apollo/game/model/Gender.java b/src/org/apollo/game/model/Gender.java index da4b648e..63141c98 100644 --- a/src/org/apollo/game/model/Gender.java +++ b/src/org/apollo/game/model/Gender.java @@ -7,15 +7,15 @@ package org.apollo.game.model; */ public enum Gender { - /** - * The male gender. - */ - MALE(0), - /** * The female gender. */ - FEMALE(1); + FEMALE(1), + + /** + * The male gender. + */ + MALE(0); /** * An integer representation used by the client. diff --git a/src/org/apollo/game/model/Graphic.java b/src/org/apollo/game/model/Graphic.java index b217140f..c0a16b65 100644 --- a/src/org/apollo/game/model/Graphic.java +++ b/src/org/apollo/game/model/Graphic.java @@ -12,11 +12,6 @@ public final class Graphic { */ public static final Graphic STOP_GRAPHIC = new Graphic(-1); - /** - * The id. - */ - private final int id; - /** * The delay. */ @@ -27,6 +22,11 @@ public final class Graphic { */ private final int height; + /** + * The id. + */ + private final int id; + /** * Creates a new graphic with no delay and a height of zero. * diff --git a/src/org/apollo/game/model/InterfaceSet.java b/src/org/apollo/game/model/InterfaceSet.java index aa3f13b4..54e8f01f 100644 --- a/src/org/apollo/game/model/InterfaceSet.java +++ b/src/org/apollo/game/model/InterfaceSet.java @@ -32,9 +32,9 @@ import org.apollo.game.model.inter.InterfaceListener; public final class InterfaceSet { /** - * The player whose interfaces are being managed. + * The current enter amount listener. */ - private final Player player; // TODO: maybe switch to a listener system like the inventory? + private EnterAmountListener amountListener; // TODO: maybe store the current inventory tab ids here?? /** @@ -48,9 +48,9 @@ public final class InterfaceSet { private InterfaceListener listener; /** - * The current enter amount listener. + * The player whose interfaces are being managed. */ - private EnterAmountListener amountListener; + private final Player player; // TODO: maybe switch to a listener system like the inventory? /** * Creates an interface set. diff --git a/src/org/apollo/game/model/InterfaceType.java b/src/org/apollo/game/model/InterfaceType.java index bf5d9852..5b70eac1 100644 --- a/src/org/apollo/game/model/InterfaceType.java +++ b/src/org/apollo/game/model/InterfaceType.java @@ -8,9 +8,19 @@ package org.apollo.game.model; public enum InterfaceType { /** - * A window is an interface which occupies the game screen. + * A dialogue is an interface which appears in the chat box. */ - WINDOW, + DIALOGUE, + + /** + * An interface which is shown behind a fullscreen window. + */ + FULLSCREEN_BACKGROUND, + + /** + * An interface which is shown in full screen mode. + */ + FULLSCREEN_WINDOW, /** * An overlay is an interface which occupies the game screen like a window, however, you can walk around and perform @@ -18,24 +28,14 @@ public enum InterfaceType { */ OVERLAY, - /** - * A dialogue is an interface which appears in the chat box. - */ - DIALOGUE, - /** * An interface which displays over the inventory area. */ SIDEBAR, /** - * An interface which is shown in full screen mode. + * A window is an interface which occupies the game screen. */ - FULLSCREEN_WINDOW, - - /** - * An interface which is shown behind a fullscreen window. - */ - FULLSCREEN_BACKGROUND; + WINDOW; } diff --git a/src/org/apollo/game/model/Inventory.java b/src/org/apollo/game/model/Inventory.java index 1a19acbe..314cc881 100644 --- a/src/org/apollo/game/model/Inventory.java +++ b/src/org/apollo/game/model/Inventory.java @@ -26,34 +26,39 @@ public final class Inventory implements Cloneable { */ STACK_ALWAYS, + /** + * When in {@link #STACK_NEVER} mode, an {@link Inventory} will never stack items. + */ + STACK_NEVER, + /** * When in {@link #STACK_STACKABLE_ITEMS} mode, an {@link Inventory} will stack items depending on their * settings. */ - STACK_STACKABLE_ITEMS, - - /** - * When in {@link #STACK_NEVER} mode, an {@link Inventory} will never stack items. - */ - STACK_NEVER; + STACK_STACKABLE_ITEMS; } - /** - * A list of inventory listeners. - */ - private final List listeners = new ArrayList(); - /** * The capacity of this inventory. */ private final int capacity; + /** + * A flag indicating if events are being fired. + */ + private boolean firingEvents = true; // TODO: make this reentrant + /** * The items in this inventory. */ private Item[] items; + /** + * A list of inventory listeners. + */ + private final List listeners = new ArrayList(); + /** * The stacking mode. */ @@ -64,11 +69,6 @@ public final class Inventory implements Cloneable { */ private int size = 0; - /** - * A flag indicating if events are being fired. - */ - private boolean firingEvents = true; // TODO: make this reentrant - /** * Creates an inventory. * diff --git a/src/org/apollo/game/model/InventoryConstants.java b/src/org/apollo/game/model/InventoryConstants.java index 095ad347..90db16a7 100644 --- a/src/org/apollo/game/model/InventoryConstants.java +++ b/src/org/apollo/game/model/InventoryConstants.java @@ -12,16 +12,16 @@ public final class InventoryConstants { */ public static final int BANK_CAPACITY = 352; - /** - * The capacity of the inventory. - */ - public static final int INVENTORY_CAPACITY = 28; - /** * The capacity of the equipment inventory. */ public static final int EQUIPMENT_CAPACITY = 14; + /** + * The capacity of the inventory. + */ + public static final int INVENTORY_CAPACITY = 28; + /** * Default private constructor to prevent instantiation. */ diff --git a/src/org/apollo/game/model/Item.java b/src/org/apollo/game/model/Item.java index 5ce0162a..3274bfd3 100644 --- a/src/org/apollo/game/model/Item.java +++ b/src/org/apollo/game/model/Item.java @@ -9,16 +9,16 @@ import org.apollo.game.model.def.ItemDefinition; */ public final class Item { - /** - * The item's id. - */ - private final int id; - /** * The amount of items in the stack. */ private final int amount; + /** + * The item's id. + */ + private final int id; + /** * Creates an item with an amount of {@code 1}. * diff --git a/src/org/apollo/game/model/Position.java b/src/org/apollo/game/model/Position.java index 190a7fe9..da237834 100644 --- a/src/org/apollo/game/model/Position.java +++ b/src/org/apollo/game/model/Position.java @@ -17,6 +17,11 @@ public final class Position { */ public static final int MAX_DISTANCE = 15; + /** + * The height level. + */ + private final int height; + /** * The x coordinate. */ @@ -27,11 +32,6 @@ public final class Position { */ private final int y; - /** - * The height level. - */ - private final int height; - /** * Creates a position at the default height. * diff --git a/src/org/apollo/game/model/Skill.java b/src/org/apollo/game/model/Skill.java index f866af1d..a8930300 100644 --- a/src/org/apollo/game/model/Skill.java +++ b/src/org/apollo/game/model/Skill.java @@ -7,60 +7,35 @@ package org.apollo.game.model; */ public final class Skill { + /** + * The agility id. + */ + public static final int AGILITY = 16; + /** * The attack id. */ public static final int ATTACK = 0; - /** - * The defence id. - */ - public static final int DEFENCE = 1; - - /** - * The strength id. - */ - public static final int STRENGTH = 2; - - /** - * The hitpoints id. - */ - public static final int HITPOINTS = 3; - - /** - * The ranged id. - */ - public static final int RANGED = 4; - - /** - * The prayer id. - */ - public static final int PRAYER = 5; - - /** - * The magic id. - */ - public static final int MAGIC = 6; - /** * The cooking id. */ public static final int COOKING = 7; /** - * The woodcutting id. + * The crafting id. */ - public static final int WOODCUTTING = 8; + public static final int CRAFTING = 12; /** - * The fletching id. + * The defence id. */ - public static final int FLETCHING = 9; + public static final int DEFENCE = 1; /** - * The fishing id. + * The farming id. */ - public static final int FISHING = 10; + public static final int FARMING = 19; /** * The firemaking id. @@ -68,19 +43,14 @@ public final class Skill { public static final int FIREMAKING = 11; /** - * The crafting id. + * The fishing id. */ - public static final int CRAFTING = 12; + public static final int FISHING = 10; /** - * The smithing id. + * The fletching id. */ - public static final int SMITHING = 13; - - /** - * The mining id.rivate - */ - public static final int MINING = 14; + public static final int FLETCHING = 9; /** * The herblore id. @@ -88,24 +58,29 @@ public final class Skill { public static final int HERBLORE = 15; /** - * The agility id. + * The hitpoints id. */ - public static final int AGILITY = 16; + public static final int HITPOINTS = 3; /** - * The thieving id. + * The magic id. */ - public static final int THIEVING = 17; + public static final int MAGIC = 6; /** - * The slayer id. + * The mining id.rivate */ - public static final int SLAYER = 18; + public static final int MINING = 14; /** - * The farming id. + * The prayer id. */ - public static final int FARMING = 19; + public static final int PRAYER = 5; + + /** + * The ranged id. + */ + public static final int RANGED = 4; /** * The runecrafting id. @@ -119,6 +94,31 @@ public final class Skill { "Magic", "Cooking", "Woodcutting", "Fletching", "Fishing", "Firemaking", "Crafting", "Smithing", "Mining", "Herblore", "Agility", "Thieving", "Slayer", "Farming", "Runecraft" }; + /** + * The slayer id. + */ + public static final int SLAYER = 18; + + /** + * The smithing id. + */ + public static final int SMITHING = 13; + + /** + * The strength id. + */ + public static final int STRENGTH = 2; + + /** + * The thieving id. + */ + public static final int THIEVING = 17; + + /** + * The woodcutting id. + */ + public static final int WOODCUTTING = 8; + /** * Gets the name of a skill. * @@ -129,16 +129,16 @@ public final class Skill { return SKILL_NAMES[id]; } - /** - * The experience. - */ - private final double experience; - /** * The current level. */ private final int currentLevel; + /** + * The experience. + */ + private final double experience; + /** * The maximum level. */ diff --git a/src/org/apollo/game/model/SkillSet.java b/src/org/apollo/game/model/SkillSet.java index 24c8e44e..1d291b30 100644 --- a/src/org/apollo/game/model/SkillSet.java +++ b/src/org/apollo/game/model/SkillSet.java @@ -12,16 +12,16 @@ import org.apollo.game.model.skill.SkillListener; */ public final class SkillSet { - /** - * The number of skills. - */ - private static final int SKILL_COUNT = 21; - /** * The maximum allowed experience. */ public static final double MAXIMUM_EXP = 200000000; + /** + * The number of skills. + */ + private static final int SKILL_COUNT = 21; + /** * Gets the minimum experience required for the specified level. * @@ -60,6 +60,11 @@ public final class SkillSet { return 99; } + /** + * A flag indicating if events are being fired. + */ + private boolean firingEvents = true; + /** * A list of skill listeners. */ @@ -70,11 +75,6 @@ public final class SkillSet { */ private final Skill[] skills = new Skill[SKILL_COUNT]; - /** - * A flag indicating if events are being fired. - */ - private boolean firingEvents = true; - /** * Creates the skill set. */ diff --git a/src/org/apollo/game/model/SlottedItem.java b/src/org/apollo/game/model/SlottedItem.java index ce81e56a..731dcd40 100644 --- a/src/org/apollo/game/model/SlottedItem.java +++ b/src/org/apollo/game/model/SlottedItem.java @@ -7,16 +7,16 @@ package org.apollo.game.model; */ public final class SlottedItem { - /** - * The slot. - */ - private final int slot; - /** * The item. */ private final Item item; + /** + * The slot. + */ + private final int slot; + /** * Creates a new slotted item. * diff --git a/src/org/apollo/game/model/WalkingQueue.java b/src/org/apollo/game/model/WalkingQueue.java index 059412ec..eda82fb4 100644 --- a/src/org/apollo/game/model/WalkingQueue.java +++ b/src/org/apollo/game/model/WalkingQueue.java @@ -18,16 +18,16 @@ public final class WalkingQueue { */ private static final class Point { - /** - * The point's position. - */ - private final Position position; - /** * The direction to walk to this point. */ private final Direction direction; + /** + * The point's position. + */ + private final Position position; + /** * Creates a point. * @@ -56,16 +56,16 @@ public final class WalkingQueue { */ private Character character; - /** - * The queue of directions. - */ - private Deque points = new ArrayDeque(); - /** * The old queue of directions. */ private Deque oldPoints = new ArrayDeque(); + /** + * The queue of directions. + */ + private Deque points = new ArrayDeque(); + /** * Flag indicating if this queue (only) should be ran. */ diff --git a/src/org/apollo/game/model/inter/bank/BankConstants.java b/src/org/apollo/game/model/inter/bank/BankConstants.java index ebc6058c..443c51c5 100644 --- a/src/org/apollo/game/model/inter/bank/BankConstants.java +++ b/src/org/apollo/game/model/inter/bank/BankConstants.java @@ -7,6 +7,11 @@ package org.apollo.game.model.inter.bank; */ public final class BankConstants { + /** + * The bank inventory id. + */ + public static final int BANK_INVENTORY_ID = 5382; + /** * The bank window id. */ @@ -17,11 +22,6 @@ public final class BankConstants { */ public static final int SIDEBAR_ID = 2005; - /** - * The bank inventory id. - */ - public static final int BANK_INVENTORY_ID = 5382; - /** * The sidebar inventory id. */ diff --git a/src/org/apollo/game/model/inter/bank/BankDepositEnterAmountListener.java b/src/org/apollo/game/model/inter/bank/BankDepositEnterAmountListener.java index fc116157..6f79b44a 100644 --- a/src/org/apollo/game/model/inter/bank/BankDepositEnterAmountListener.java +++ b/src/org/apollo/game/model/inter/bank/BankDepositEnterAmountListener.java @@ -10,6 +10,11 @@ import org.apollo.game.model.inter.EnterAmountListener; */ public final class BankDepositEnterAmountListener implements EnterAmountListener { + /** + * The item id. + */ + private final int id; + /** * The player. */ @@ -20,11 +25,6 @@ public final class BankDepositEnterAmountListener implements EnterAmountListener */ private final int slot; - /** - * The item id. - */ - private final int id; - /** * Creates the bank deposit amount listener. * diff --git a/src/org/apollo/game/model/inter/bank/BankInterfaceListener.java b/src/org/apollo/game/model/inter/bank/BankInterfaceListener.java index d1e5a2c2..6bcaf737 100644 --- a/src/org/apollo/game/model/inter/bank/BankInterfaceListener.java +++ b/src/org/apollo/game/model/inter/bank/BankInterfaceListener.java @@ -12,9 +12,9 @@ import org.apollo.game.model.inv.InventoryListener; public final class BankInterfaceListener implements InterfaceListener { /** - * The player. + * The bank listener. */ - private final Player player; + private final InventoryListener bankListener; /** * The inventory listener. @@ -22,9 +22,9 @@ public final class BankInterfaceListener implements InterfaceListener { private final InventoryListener invListener; /** - * The bank listener. + * The player. */ - private final InventoryListener bankListener; + private final Player player; /** * Creates the bank interface listener. diff --git a/src/org/apollo/game/model/inter/bank/BankWithdrawEnterAmountListener.java b/src/org/apollo/game/model/inter/bank/BankWithdrawEnterAmountListener.java index 10c6e1aa..5365567d 100644 --- a/src/org/apollo/game/model/inter/bank/BankWithdrawEnterAmountListener.java +++ b/src/org/apollo/game/model/inter/bank/BankWithdrawEnterAmountListener.java @@ -10,6 +10,11 @@ import org.apollo.game.model.inter.EnterAmountListener; */ public final class BankWithdrawEnterAmountListener implements EnterAmountListener { + /** + * The item id. + */ + private final int id; + /** * The player. */ @@ -20,11 +25,6 @@ public final class BankWithdrawEnterAmountListener implements EnterAmountListene */ private final int slot; - /** - * The item id. - */ - private final int id; - /** * Creates the bank withdraw amount listener. * diff --git a/src/org/apollo/game/model/inv/FullInventoryListener.java b/src/org/apollo/game/model/inv/FullInventoryListener.java index 5d5732a6..08961d98 100644 --- a/src/org/apollo/game/model/inv/FullInventoryListener.java +++ b/src/org/apollo/game/model/inv/FullInventoryListener.java @@ -12,11 +12,6 @@ import org.apollo.game.model.Player; */ public final class FullInventoryListener extends InventoryAdapter { - /** - * The inventory full message. - */ - public static final String FULL_INVENTORY_MESSAGE = "Not enough inventory space."; - /** * The bank full message. */ @@ -28,15 +23,20 @@ public final class FullInventoryListener extends InventoryAdapter { public static final String FULL_EQUIPMENT_MESSAGE = "Not enough equipment space."; // TODO confirm if possible /** - * The player. + * The inventory full message. */ - private final Player player; + public static final String FULL_INVENTORY_MESSAGE = "Not enough inventory space."; /** * The event to send when the capacity has been exceeded. */ private final Event event; + /** + * The player. + */ + private final Player player; + /** * Creates the empty inventory listener. * diff --git a/src/org/apollo/game/model/inv/SynchronizationInventoryListener.java b/src/org/apollo/game/model/inv/SynchronizationInventoryListener.java index 94a1a156..cb648b86 100644 --- a/src/org/apollo/game/model/inv/SynchronizationInventoryListener.java +++ b/src/org/apollo/game/model/inv/SynchronizationInventoryListener.java @@ -14,26 +14,26 @@ import org.apollo.game.model.SlottedItem; */ public final class SynchronizationInventoryListener extends InventoryAdapter { - /** - * The inventory interface id. - */ - public static final int INVENTORY_ID = 3214; - /** * The equipment interface id. */ public static final int EQUIPMENT_ID = 1688; /** - * The player. + * The inventory interface id. */ - private final Player player; + public static final int INVENTORY_ID = 3214; /** * The interface id. */ private final int interfaceId; + /** + * The player. + */ + private final Player player; + /** * Creates the syncrhonization inventory listener. * diff --git a/src/org/apollo/game/model/obj/StaticObject.java b/src/org/apollo/game/model/obj/StaticObject.java index 6dca6663..f07cb2cc 100644 --- a/src/org/apollo/game/model/obj/StaticObject.java +++ b/src/org/apollo/game/model/obj/StaticObject.java @@ -18,31 +18,31 @@ public final class StaticObject { public static void init(StaticObject[] objects) { } - /** - * The object's id. - */ - private final short id; - /** * The object's definition. */ private final ObjectDefinition definition; + /** + * The object's id. + */ + private final short id; + /** * The object's position. */ private final Position position; - /** - * The object type. - */ - private final byte type; - /** * The object's rotation. */ private final byte rotation; + /** + * The object type. + */ + private final byte type; + /** * Creates a new static object. * diff --git a/src/org/apollo/game/scheduling/ScheduledTask.java b/src/org/apollo/game/scheduling/ScheduledTask.java index 762bd1de..e0cd04fe 100644 --- a/src/org/apollo/game/scheduling/ScheduledTask.java +++ b/src/org/apollo/game/scheduling/ScheduledTask.java @@ -7,11 +7,6 @@ package org.apollo.game.scheduling; */ public abstract class ScheduledTask { - /** - * A flag indicating if the task is running. - */ - private boolean running = true; - /** * The delay between executions of the task, in pulses. */ @@ -22,6 +17,11 @@ public abstract class ScheduledTask { */ private int pulses; + /** + * A flag indicating if the task is running. + */ + private boolean running = true; + /** * Creates a new scheduled task. * diff --git a/src/org/apollo/game/sync/block/AppearanceBlock.java b/src/org/apollo/game/sync/block/AppearanceBlock.java index bf5a25ef..042d8229 100644 --- a/src/org/apollo/game/sync/block/AppearanceBlock.java +++ b/src/org/apollo/game/sync/block/AppearanceBlock.java @@ -10,11 +10,6 @@ import org.apollo.game.model.Inventory; */ public final class AppearanceBlock extends SynchronizationBlock { - /** - * The player's name. - */ - private final long name; - /** * The player's appearance. */ @@ -25,31 +20,36 @@ public final class AppearanceBlock extends SynchronizationBlock { */ private final int combat; - /** - * The player's total skill level (or 0). - */ - private final int skill; - /** * The player's equipment. */ private final Inventory equipment; - /** - * The player's prayer icon. - */ - private final int prayerIcon; - /** * The player's head icon. */ private final int headIcon; + /** + * The player's name. + */ + private final long name; + /** * The npc id this player is appearing as, if any. */ private final int npcId; + /** + * The player's prayer icon. + */ + private final int prayerIcon; + + /** + * The player's total skill level (or 0). + */ + private final int skill; + /** * Creates the appearance block. * diff --git a/src/org/apollo/game/sync/block/ChatBlock.java b/src/org/apollo/game/sync/block/ChatBlock.java index 18aadfe1..9247c088 100644 --- a/src/org/apollo/game/sync/block/ChatBlock.java +++ b/src/org/apollo/game/sync/block/ChatBlock.java @@ -10,16 +10,16 @@ import org.apollo.game.model.Player.PrivilegeLevel; */ public final class ChatBlock extends SynchronizationBlock { - /** - * The privilege level. - */ - private final PrivilegeLevel privilegeLevel; - /** * The chat event. */ private final ChatEvent chatEvent; + /** + * The privilege level. + */ + private final PrivilegeLevel privilegeLevel; + /** * Creates the chat block. */ diff --git a/src/org/apollo/game/sync/block/ForceMovementBlock.java b/src/org/apollo/game/sync/block/ForceMovementBlock.java index b07cb077..77c4ff3c 100644 --- a/src/org/apollo/game/sync/block/ForceMovementBlock.java +++ b/src/org/apollo/game/sync/block/ForceMovementBlock.java @@ -15,15 +15,20 @@ import org.apollo.game.model.Position; public class ForceMovementBlock extends SynchronizationBlock { /** - * The initial {@link Position} of the player. + * The direction the player is moving. */ - private final Position initialPosition; + private final Direction direction; /** * The {@link Position} the player is being moved to. */ private final Position finalPosition; + /** + * The initial {@link Position} of the player. + */ + private final Position initialPosition; + /** * The length of time (in game ticks) the player's movement along the X axis will last. */ @@ -34,11 +39,6 @@ public class ForceMovementBlock extends SynchronizationBlock { */ private final int travelDurationY; - /** - * The direction the player is moving. - */ - private final Direction direction; - /** * Creates a new Force Movement block. * diff --git a/src/org/apollo/game/sync/block/HitUpdateBlock.java b/src/org/apollo/game/sync/block/HitUpdateBlock.java index 3fee143c..c2e49ceb 100644 --- a/src/org/apollo/game/sync/block/HitUpdateBlock.java +++ b/src/org/apollo/game/sync/block/HitUpdateBlock.java @@ -8,26 +8,26 @@ package org.apollo.game.sync.block; */ public class HitUpdateBlock extends SynchronizationBlock { - /** - * The amount of damage the hit will do. - */ - private final int damage; - - /** - * The type of hit (e.g. normal, poison). - */ - private final int type; - /** * The {@link org.apollo.game.model.Character}'s current health. */ private final int currentHealth; + /** + * The amount of damage the hit will do. + */ + private final int damage; + /** * The {@link org.apollo.game.model.Character}'s maximum health. */ private final int maximumHealth; + /** + * The type of hit (e.g. normal, poison). + */ + private final int type; + /** * Creates a new Hit Update block. * diff --git a/src/org/apollo/game/sync/block/SecondHitUpdateBlock.java b/src/org/apollo/game/sync/block/SecondHitUpdateBlock.java index ea4cc4ea..931b2e59 100644 --- a/src/org/apollo/game/sync/block/SecondHitUpdateBlock.java +++ b/src/org/apollo/game/sync/block/SecondHitUpdateBlock.java @@ -9,26 +9,26 @@ package org.apollo.game.sync.block; */ public class SecondHitUpdateBlock extends SynchronizationBlock { - /** - * The amount of damage the hit will do. - */ - private final int damage; - - /** - * The type of hit (e.g. normal, poison). - */ - private final int type; - /** * The character's current health. */ private final int currentHealth; + /** + * The amount of damage the hit will do. + */ + private final int damage; + /** * The character's maximum health. */ private final int maximumHealth; + /** + * The type of hit (e.g. normal, poison). + */ + private final int type; + /** * Creates a new Second Hit Update block. * diff --git a/src/org/apollo/game/sync/seg/AddNpcSegment.java b/src/org/apollo/game/sync/seg/AddNpcSegment.java index d88c0c27..6a792579 100644 --- a/src/org/apollo/game/sync/seg/AddNpcSegment.java +++ b/src/org/apollo/game/sync/seg/AddNpcSegment.java @@ -15,16 +15,16 @@ public final class AddNpcSegment extends SynchronizationSegment { */ private final int index; - /** - * The position. - */ - private final Position position; - /** * The id of the npc. */ private final int npcId; + /** + * The position. + */ + private final Position position; + /** * Creates the add npc segment. * diff --git a/src/org/apollo/game/sync/seg/SegmentType.java b/src/org/apollo/game/sync/seg/SegmentType.java index 5884074b..3db29293 100644 --- a/src/org/apollo/game/sync/seg/SegmentType.java +++ b/src/org/apollo/game/sync/seg/SegmentType.java @@ -7,15 +7,20 @@ package org.apollo.game.sync.seg; */ public enum SegmentType { + /** + * A segment where the character is added. + */ + ADD_CHARACTER, + /** * A segment without any movement. */ NO_MOVEMENT, /** - * A segment with movement in a single direction. + * A segment where the character is removed. */ - WALK, + REMOVE_CHARACTER, /** * A segment with movement in two directions. @@ -28,13 +33,8 @@ public enum SegmentType { TELEPORT, /** - * A segment where the character is added. + * A segment with movement in a single direction. */ - ADD_CHARACTER, - - /** - * A segment where the character is removed. - */ - REMOVE_CHARACTER; + WALK; } diff --git a/src/org/apollo/io/EventHandlerChainParser.java b/src/org/apollo/io/EventHandlerChainParser.java index b5ee756d..24373f78 100644 --- a/src/org/apollo/io/EventHandlerChainParser.java +++ b/src/org/apollo/io/EventHandlerChainParser.java @@ -22,16 +22,16 @@ import org.xml.sax.SAXException; */ public final class EventHandlerChainParser { - /** - * The {@link XmlParser} instance. - */ - private final XmlParser parser; - /** * The source {@link InputStream}. */ private final InputStream is; + /** + * The {@link XmlParser} instance. + */ + private final XmlParser parser; + /** * Creates the event chain parser. * diff --git a/src/org/apollo/io/PluginMetaDataParser.java b/src/org/apollo/io/PluginMetaDataParser.java index 48807812..b4e59fe6 100644 --- a/src/org/apollo/io/PluginMetaDataParser.java +++ b/src/org/apollo/io/PluginMetaDataParser.java @@ -20,16 +20,16 @@ public final class PluginMetaDataParser { */ private static final XmlNode[] EMPTY_NODE_ARRAY = new XmlNode[0]; - /** - * The XML parser. - */ - private final XmlParser parser; - /** * The input stream. */ private final InputStream is; + /** + * The XML parser. + */ + private final XmlParser parser; + /** * Creates the plugin meta data parser. * diff --git a/src/org/apollo/io/player/PlayerLoaderResponse.java b/src/org/apollo/io/player/PlayerLoaderResponse.java index 51fe3e84..2006c24b 100644 --- a/src/org/apollo/io/player/PlayerLoaderResponse.java +++ b/src/org/apollo/io/player/PlayerLoaderResponse.java @@ -10,16 +10,16 @@ import org.apollo.net.codec.login.LoginConstants; */ public final class PlayerLoaderResponse { - /** - * The status code. - */ - private final int status; - /** * The player. */ private final Player player; + /** + * The status code. + */ + private final int status; + /** * Creates a {@link PlayerLoaderResponse} with only a status code. * diff --git a/src/org/apollo/login/PlayerLoaderWorker.java b/src/org/apollo/login/PlayerLoaderWorker.java index b09931f5..1dc4e706 100644 --- a/src/org/apollo/login/PlayerLoaderWorker.java +++ b/src/org/apollo/login/PlayerLoaderWorker.java @@ -26,16 +26,16 @@ public final class PlayerLoaderWorker implements Runnable { */ private final PlayerLoader loader; - /** - * The session that submitted the request. - */ - private final LoginSession session; - /** * The request. */ private final LoginRequest request; + /** + * The session that submitted the request. + */ + private final LoginSession session; + /** * Creates a {@link PlayerLoaderWorker} which will do the work for a single player load request. * diff --git a/src/org/apollo/login/PlayerSaverWorker.java b/src/org/apollo/login/PlayerSaverWorker.java index cf30473b..c4c1069d 100644 --- a/src/org/apollo/login/PlayerSaverWorker.java +++ b/src/org/apollo/login/PlayerSaverWorker.java @@ -19,6 +19,11 @@ public final class PlayerSaverWorker implements Runnable { */ private static final Logger logger = Logger.getLogger(PlayerSaverWorker.class.getName()); + /** + * The player to save. + */ + private final Player player; + /** * The player saver. */ @@ -29,11 +34,6 @@ public final class PlayerSaverWorker implements Runnable { */ private final GameSession session; - /** - * The player to save. - */ - private final Player player; - /** * Creates the player saver worker. * diff --git a/src/org/apollo/net/JagGrabPipelineFactory.java b/src/org/apollo/net/JagGrabPipelineFactory.java index 1ee715b6..e2435809 100644 --- a/src/org/apollo/net/JagGrabPipelineFactory.java +++ b/src/org/apollo/net/JagGrabPipelineFactory.java @@ -22,9 +22,9 @@ import org.jboss.netty.util.Timer; public final class JagGrabPipelineFactory implements ChannelPipelineFactory { /** - * The maximum length of a request, in bytes. + * A buffer with two line feed (LF) characters in it. */ - private static final int MAX_REQUEST_LENGTH = 8192; + private static final ChannelBuffer DOUBLE_LINE_FEED_DELIMITER = ChannelBuffers.buffer(2); /** * The character set used in the request. @@ -32,9 +32,9 @@ public final class JagGrabPipelineFactory implements ChannelPipelineFactory { private static final Charset JAGGRAB_CHARSET = Charset.forName("US-ASCII"); /** - * A buffer with two line feed (LF) characters in it. + * The maximum length of a request, in bytes. */ - private static final ChannelBuffer DOUBLE_LINE_FEED_DELIMITER = ChannelBuffers.buffer(2); + private static final int MAX_REQUEST_LENGTH = 8192; /** * Populates the double line feed buffer. diff --git a/src/org/apollo/net/NetworkConstants.java b/src/org/apollo/net/NetworkConstants.java index 81f9399e..6f32e758 100644 --- a/src/org/apollo/net/NetworkConstants.java +++ b/src/org/apollo/net/NetworkConstants.java @@ -8,9 +8,14 @@ package org.apollo.net; public final class NetworkConstants { /** - * The service port. + * The HTTP port. */ - public static final int SERVICE_PORT = 43594; + public static final int HTTP_PORT = 80; + + /** + * The number of seconds before a connection becomes idle. + */ + public static final int IDLE_TIME = 15; /** * The JAGGRAB port. @@ -18,20 +23,15 @@ public final class NetworkConstants { public static final int JAGGRAB_PORT = 43595; /** - * The HTTP port. + * The service port. */ - public static final int HTTP_PORT = 80; + public static final int SERVICE_PORT = 43594; /** * The terminator of a string. */ public static final int STRING_TERMINATOR = 10; - /** - * The number of seconds before a connection becomes idle. - */ - public static final int IDLE_TIME = 15; - /** * Default private constructor to prevent instantiation by other classes. */ diff --git a/src/org/apollo/net/codec/game/AccessMode.java b/src/org/apollo/net/codec/game/AccessMode.java index 6ce74ddf..f0979143 100644 --- a/src/org/apollo/net/codec/game/AccessMode.java +++ b/src/org/apollo/net/codec/game/AccessMode.java @@ -7,14 +7,14 @@ package org.apollo.net.codec.game; */ public enum AccessMode { - /** - * When in byte access modes, bytes are written directly to the buffer. - */ - BYTE_ACCESS, - /** * When in bit access mode, bits can be written and packed into bytes. */ - BIT_ACCESS; + BIT_ACCESS, + + /** + * When in byte access modes, bytes are written directly to the buffer. + */ + BYTE_ACCESS; } diff --git a/src/org/apollo/net/codec/game/DataOrder.java b/src/org/apollo/net/codec/game/DataOrder.java index 3bee8e7f..d5ad95b2 100644 --- a/src/org/apollo/net/codec/game/DataOrder.java +++ b/src/org/apollo/net/codec/game/DataOrder.java @@ -8,14 +8,9 @@ package org.apollo.net.codec.game; public enum DataOrder { /** - * Least significant byte to most significant byte. + * Most significant byte to least significant byte. */ - LITTLE, - - /** - * Also known as the V1 order. - */ - MIDDLE, + BIG, /** * Also known as the V2 order. @@ -23,8 +18,13 @@ public enum DataOrder { INVERSED_MIDDLE, /** - * Most significant byte to least significant byte. + * Least significant byte to most significant byte. */ - BIG; + LITTLE, + + /** + * Also known as the V1 order. + */ + MIDDLE; } diff --git a/src/org/apollo/net/codec/game/DataTransformation.java b/src/org/apollo/net/codec/game/DataTransformation.java index bcbaee0a..18ab1230 100644 --- a/src/org/apollo/net/codec/game/DataTransformation.java +++ b/src/org/apollo/net/codec/game/DataTransformation.java @@ -7,11 +7,6 @@ package org.apollo.net.codec.game; */ public enum DataTransformation { - /** - * No transformation is done. - */ - NONE, - /** * Adds 128 to the value when it is written, takes 128 from the value when it is read (also known as type-A). */ @@ -22,6 +17,11 @@ public enum DataTransformation { */ NEGATE, + /** + * No transformation is done. + */ + NONE, + /** * Subtracts the value from 128 (also known as type-S). */ diff --git a/src/org/apollo/net/codec/game/DataType.java b/src/org/apollo/net/codec/game/DataType.java index d5a96102..c5132fd8 100644 --- a/src/org/apollo/net/codec/game/DataType.java +++ b/src/org/apollo/net/codec/game/DataType.java @@ -12,16 +12,6 @@ public enum DataType { */ BYTE(1), - /** - * A short. - */ - SHORT(2), - - /** - * A 'tri byte' - a group of three bytes. - */ - TRI_BYTE(3), - /** * An integer. */ @@ -30,7 +20,17 @@ public enum DataType { /** * A long. */ - LONG(8); + LONG(8), + + /** + * A short. + */ + SHORT(2), + + /** + * A 'tri byte' - a group of three bytes. + */ + TRI_BYTE(3); /** * The number of bytes this type occupies. diff --git a/src/org/apollo/net/codec/game/GameDecoderState.java b/src/org/apollo/net/codec/game/GameDecoderState.java index 89b8912d..d4144c80 100644 --- a/src/org/apollo/net/codec/game/GameDecoderState.java +++ b/src/org/apollo/net/codec/game/GameDecoderState.java @@ -7,18 +7,18 @@ package org.apollo.net.codec.game; */ public enum GameDecoderState { - /** - * The game opcode state waits for an encrypted opcode. It decrypts it, and will either set the next state to the - * length (if the packet is variably- sized) or the payload (if it is not variably-sized) state. - */ - GAME_OPCODE, - /** * The game length state waits for the packet length. Once it has been received, it sets the state to the payload * state. */ GAME_LENGTH, + /** + * The game opcode state waits for an encrypted opcode. It decrypts it, and will either set the next state to the + * length (if the packet is variably- sized) or the payload (if it is not variably-sized) state. + */ + GAME_OPCODE, + /** * The payload state will wait for the whole packet to be received. Then, it will pass a {@link GamePacket} object * to Netty and reset the state back to the game opcode state, ready for the next packet. diff --git a/src/org/apollo/net/codec/game/GamePacket.java b/src/org/apollo/net/codec/game/GamePacket.java index e438a386..5d3b5ed6 100644 --- a/src/org/apollo/net/codec/game/GamePacket.java +++ b/src/org/apollo/net/codec/game/GamePacket.java @@ -10,26 +10,26 @@ import org.jboss.netty.buffer.ChannelBuffer; */ public final class GamePacket { - /** - * The opcode. - */ - private final int opcode; - - /** - * The packet type. - */ - private final PacketType type; - /** * The length. */ private final int length; + /** + * The opcode. + */ + private final int opcode; + /** * The payload. */ private final ChannelBuffer payload; + /** + * The packet type. + */ + private final PacketType type; + /** * Creates the game packet. * diff --git a/src/org/apollo/net/codec/game/GamePacketBuilder.java b/src/org/apollo/net/codec/game/GamePacketBuilder.java index 7ab5e19a..c61bcba8 100644 --- a/src/org/apollo/net/codec/game/GamePacketBuilder.java +++ b/src/org/apollo/net/codec/game/GamePacketBuilder.java @@ -13,14 +13,9 @@ import org.jboss.netty.buffer.ChannelBuffers; public final class GamePacketBuilder { /** - * The opcode. + * The current bit index. */ - private final int opcode; - - /** - * The {@link PacketType}. - */ - private final PacketType type; + private int bitIndex; /** * The buffer. @@ -33,9 +28,14 @@ public final class GamePacketBuilder { private AccessMode mode = AccessMode.BYTE_ACCESS; /** - * The current bit index. + * The opcode. */ - private int bitIndex; + private final int opcode; + + /** + * The {@link PacketType}. + */ + private final PacketType type; /** * Creates a raw {@link GamePacketBuilder}. diff --git a/src/org/apollo/net/codec/game/GamePacketDecoder.java b/src/org/apollo/net/codec/game/GamePacketDecoder.java index b825fb00..6f0b462d 100644 --- a/src/org/apollo/net/codec/game/GamePacketDecoder.java +++ b/src/org/apollo/net/codec/game/GamePacketDecoder.java @@ -19,30 +19,30 @@ import org.jboss.netty.channel.ChannelHandlerContext; public final class GamePacketDecoder extends StatefulFrameDecoder { /** - * The current release. + * The current length. */ - private final Release release; - - /** - * The random number generator. - */ - private final IsaacRandom random; + private int length; /** * The current opcode. */ private int opcode; + /** + * The random number generator. + */ + private final IsaacRandom random; + + /** + * The current release. + */ + private final Release release; + /** * The packet type. */ private PacketType type; - /** - * The current length. - */ - private int length; - /** * Creates the {@link GamePacketDecoder}. * diff --git a/src/org/apollo/net/codec/game/GamePacketReader.java b/src/org/apollo/net/codec/game/GamePacketReader.java index 9de59729..ac7f8f22 100644 --- a/src/org/apollo/net/codec/game/GamePacketReader.java +++ b/src/org/apollo/net/codec/game/GamePacketReader.java @@ -10,6 +10,11 @@ import org.jboss.netty.buffer.ChannelBuffer; */ public final class GamePacketReader { + /** + * The current bit index. + */ + private int bitIndex; + /** * The buffer. */ @@ -20,11 +25,6 @@ public final class GamePacketReader { */ private AccessMode mode = AccessMode.BYTE_ACCESS; - /** - * The current bit index. - */ - private int bitIndex; - /** * Creates the reader. * diff --git a/src/org/apollo/net/codec/login/LoginConstants.java b/src/org/apollo/net/codec/login/LoginConstants.java index 049e0786..8bc7dcf8 100644 --- a/src/org/apollo/net/codec/login/LoginConstants.java +++ b/src/org/apollo/net/codec/login/LoginConstants.java @@ -7,36 +7,6 @@ package org.apollo.net.codec.login; */ public final class LoginConstants { - /** - * Standard login type id. - */ - public static final int TYPE_STANDARD = 16; - - /** - * Reconnection login type id. - */ - public static final int TYPE_RECONNECTION = 18; - - /** - * Exchange data login status. - */ - public static final int STATUS_EXCHANGE_DATA = 0; - - /** - * Delay for 2 seconds login status. - */ - public static final int STATUS_DELAY = 1; - - /** - * OK login status. - */ - public static final int STATUS_OK = 2; - - /** - * Invalid credentials login status. - */ - public static final int STATUS_INVALID_CREDENTIALS = 3; - /** * Account disabled login status. */ @@ -47,31 +17,51 @@ public final class LoginConstants { */ public static final int STATUS_ACCOUNT_ONLINE = 5; + /** + * Bad session id login status. + */ + public static final int STATUS_BAD_SESSION_ID = 10; + + /** + * Could not complete login status. + */ + public static final int STATUS_COULD_NOT_COMPLETE = 13; + + /** + * Delay for 2 seconds login status. + */ + public static final int STATUS_DELAY = 1; + + /** + * Exchange data login status. + */ + public static final int STATUS_EXCHANGE_DATA = 0; + /** * Game updated login status. */ public static final int STATUS_GAME_UPDATED = 6; /** - * Server full login status. + * Standing in members area on free world status. */ - public static final int STATUS_SERVER_FULL = 7; + public static final int STATUS_IN_MEMBERS_AREA = 17; + + /** + * Invalid credentials login status. + */ + public static final int STATUS_INVALID_CREDENTIALS = 3; + + /** + * Invalid login server status. + */ + public static final int STATUS_INVALID_LOGIN_SERVER = 20; /** * Login server offline login status. */ public static final int STATUS_LOGIN_SERVER_OFFLINE = 8; - /** - * Too many connections login status. - */ - public static final int STATUS_TOO_MANY_CONNECTIONS = 9; - - /** - * Bad session id login status. - */ - public static final int STATUS_BAD_SESSION_ID = 10; - /** * Login server rejected session login status. */ @@ -83,39 +73,49 @@ public final class LoginConstants { public static final int STATUS_MEMBERS_ACCOUNT_REQUIRED = 12; /** - * Could not complete login status. + * OK login status. */ - public static final int STATUS_COULD_NOT_COMPLETE = 13; + public static final int STATUS_OK = 2; /** - * Server updating login status. + * Profile transfer login status. */ - public static final int STATUS_UPDATING = 14; + public static final int STATUS_PROFILE_TRANSFER = 21; /** * Reconnection OK login status. */ public static final int STATUS_RECONNECTION_OK = 15; + /** + * Server full login status. + */ + public static final int STATUS_SERVER_FULL = 7; + + /** + * Too many connections login status. + */ + public static final int STATUS_TOO_MANY_CONNECTIONS = 9; + /** * Too many login attempts login status. */ public static final int STATUS_TOO_MANY_LOGINS = 16; /** - * Standing in members area on free world status. + * Server updating login status. */ - public static final int STATUS_IN_MEMBERS_AREA = 17; + public static final int STATUS_UPDATING = 14; /** - * Invalid login server status. + * Reconnection login type id. */ - public static final int STATUS_INVALID_LOGIN_SERVER = 20; + public static final int TYPE_RECONNECTION = 18; /** - * Profile transfer login status. + * Standard login type id. */ - public static final int STATUS_PROFILE_TRANSFER = 21; + public static final int TYPE_STANDARD = 16; /** * Default private constructor to prevent instantiation. diff --git a/src/org/apollo/net/codec/login/LoginDecoder.java b/src/org/apollo/net/codec/login/LoginDecoder.java index dae124e3..fd4068d2 100644 --- a/src/org/apollo/net/codec/login/LoginDecoder.java +++ b/src/org/apollo/net/codec/login/LoginDecoder.java @@ -27,14 +27,9 @@ public final class LoginDecoder extends StatefulFrameDecoder private static final SecureRandom random = new SecureRandom(); /** - * The username hash. + * The login packet length. */ - private int usernameHash; - - /** - * The server-side session key. - */ - private long serverSeed; + private int loginLength; /** * The reconnecting flag. @@ -42,9 +37,14 @@ public final class LoginDecoder extends StatefulFrameDecoder private boolean reconnecting; /** - * The login packet length. + * The server-side session key. */ - private int loginLength; + private long serverSeed; + + /** + * The username hash. + */ + private int usernameHash; /** * Creates the login decoder with the default initial state. diff --git a/src/org/apollo/net/codec/login/LoginRequest.java b/src/org/apollo/net/codec/login/LoginRequest.java index f6059583..0aa300ca 100644 --- a/src/org/apollo/net/codec/login/LoginRequest.java +++ b/src/org/apollo/net/codec/login/LoginRequest.java @@ -10,21 +10,26 @@ import org.apollo.security.PlayerCredentials; */ public final class LoginRequest { + /** + * The archive CRCs. + */ + private final int[] archiveCrcs; + /** * The player's credentials. */ private final PlayerCredentials credentials; - /** - * The pair of random number generators. - */ - private final IsaacRandomPair randomPair; - /** * The low memory flag. */ private final boolean lowMemory; + /** + * The pair of random number generators. + */ + private final IsaacRandomPair randomPair; + /** * The reconnecting flag. */ @@ -35,11 +40,6 @@ public final class LoginRequest { */ private final int releaseNumber; - /** - * The archive CRCs. - */ - private final int[] archiveCrcs; - /** * Creates a login request. * diff --git a/src/org/apollo/net/codec/login/LoginResponse.java b/src/org/apollo/net/codec/login/LoginResponse.java index b057930e..5fe7577f 100644 --- a/src/org/apollo/net/codec/login/LoginResponse.java +++ b/src/org/apollo/net/codec/login/LoginResponse.java @@ -7,11 +7,6 @@ package org.apollo.net.codec.login; */ public final class LoginResponse { - /** - * The login status. - */ - private final int status; - /** * The flagged flag. */ @@ -22,6 +17,11 @@ public final class LoginResponse { */ private final int rights; + /** + * The login status. + */ + private final int status; + /** * Creates the login response. * diff --git a/src/org/apollo/net/codec/update/OnDemandRequest.java b/src/org/apollo/net/codec/update/OnDemandRequest.java index f6fe0201..50f3de6d 100644 --- a/src/org/apollo/net/codec/update/OnDemandRequest.java +++ b/src/org/apollo/net/codec/update/OnDemandRequest.java @@ -21,16 +21,16 @@ public final class OnDemandRequest implements Comparable { */ HIGH(0), - /** - * Medium priority - used while loading the 'bare minimum' required to run the game. - */ - MEDIUM(1), - /** * Low priority - used when a file is not required urgently. The client login screen says * "loading extra files.." when low priority loading is being performed. */ - LOW(2); + LOW(2), + + /** + * Medium priority - used while loading the 'bare minimum' required to run the game. + */ + MEDIUM(1); /** * Converts the integer value to a priority. diff --git a/src/org/apollo/net/codec/update/OnDemandResponse.java b/src/org/apollo/net/codec/update/OnDemandResponse.java index 5a96f02b..b05caf92 100644 --- a/src/org/apollo/net/codec/update/OnDemandResponse.java +++ b/src/org/apollo/net/codec/update/OnDemandResponse.java @@ -10,6 +10,16 @@ import org.jboss.netty.buffer.ChannelBuffer; */ public final class OnDemandResponse { + /** + * The chunk data. + */ + private final ChannelBuffer chunkData; + + /** + * The chunk id. + */ + private final int chunkId; + /** * The file descriptor. */ @@ -20,16 +30,6 @@ public final class OnDemandResponse { */ private final int fileSize; - /** - * The chunk id. - */ - private final int chunkId; - - /** - * The chunk data. - */ - private final ChannelBuffer chunkData; - /** * Creates the 'on-demand' response. * diff --git a/src/org/apollo/net/meta/PacketMetaData.java b/src/org/apollo/net/meta/PacketMetaData.java index 52f568b6..42210d0d 100644 --- a/src/org/apollo/net/meta/PacketMetaData.java +++ b/src/org/apollo/net/meta/PacketMetaData.java @@ -39,16 +39,16 @@ public final class PacketMetaData { return new PacketMetaData(PacketType.VARIABLE_SHORT, 0); } - /** - * The type of packet. - */ - private final PacketType type; - /** * The length of this packet. */ private final int length; + /** + * The type of packet. + */ + private final PacketType type; + /** * Creates the packet meta data object. This should not be called directy. Use the {@link #createFixed(int)}, * {@link #createVariableByte()} and {@link #createVariableShort()} methods instead! diff --git a/src/org/apollo/net/meta/PacketType.java b/src/org/apollo/net/meta/PacketType.java index 539b2aaa..013bf0f6 100644 --- a/src/org/apollo/net/meta/PacketType.java +++ b/src/org/apollo/net/meta/PacketType.java @@ -7,16 +7,16 @@ package org.apollo.net.meta; */ public enum PacketType { - /** - * A packet with no header. - */ - RAW, - /** * A packet where the length is known by both the client and server already. */ FIXED, + /** + * A packet with no header. + */ + RAW, + /** * A packet where the length is sent to its destination with it as a byte. */ diff --git a/src/org/apollo/net/release/Release.java b/src/org/apollo/net/release/Release.java index 289d275e..03ac52b1 100644 --- a/src/org/apollo/net/release/Release.java +++ b/src/org/apollo/net/release/Release.java @@ -14,11 +14,6 @@ import org.apollo.net.meta.PacketMetaDataGroup; */ public abstract class Release { - /** - * The release number, e.g. {@code 317}. - */ - private final int releaseNumber; - /** * The decoders. */ @@ -34,6 +29,11 @@ public abstract class Release { */ private final PacketMetaDataGroup incomingPacketMetaData; + /** + * The release number, e.g. {@code 317}. + */ + private final int releaseNumber; + /** * Creates the release. * diff --git a/src/org/apollo/net/release/r317/FifthItemOptionEventDecoder.java b/src/org/apollo/net/release/r317/FifthItemOptionEventDecoder.java index 0d2b875f..b214049c 100644 --- a/src/org/apollo/net/release/r317/FifthItemOptionEventDecoder.java +++ b/src/org/apollo/net/release/r317/FifthItemOptionEventDecoder.java @@ -9,6 +9,7 @@ import org.apollo.net.release.EventDecoder; /** * An {@link EventDecoder} for the {@link FifthItemOptionEvent}. + * * @author Chris Fletcher */ final class FifthItemOptionEventDecoder extends EventDecoder { diff --git a/src/org/apollo/net/release/r317/FirstItemOptionEventDecoder.java b/src/org/apollo/net/release/r317/FirstItemOptionEventDecoder.java index 45a0ac1f..be1399ba 100644 --- a/src/org/apollo/net/release/r317/FirstItemOptionEventDecoder.java +++ b/src/org/apollo/net/release/r317/FirstItemOptionEventDecoder.java @@ -1,11 +1,16 @@ package org.apollo.net.release.r317; import org.apollo.game.event.impl.FirstItemOptionEvent; -import org.apollo.net.codec.game.*; +import org.apollo.net.codec.game.DataOrder; +import org.apollo.net.codec.game.DataTransformation; +import org.apollo.net.codec.game.DataType; +import org.apollo.net.codec.game.GamePacket; +import org.apollo.net.codec.game.GamePacketReader; import org.apollo.net.release.EventDecoder; /** * An {@link EventDecoder} for the {@link FirstItemOptionEvent}. + * * @author Graham */ final class FirstItemOptionEventDecoder extends EventDecoder { diff --git a/src/org/apollo/net/release/r317/FourthItemOptionEventDecoder.java b/src/org/apollo/net/release/r317/FourthItemOptionEventDecoder.java index a9134518..ff4e9fde 100644 --- a/src/org/apollo/net/release/r317/FourthItemOptionEventDecoder.java +++ b/src/org/apollo/net/release/r317/FourthItemOptionEventDecoder.java @@ -1,11 +1,16 @@ package org.apollo.net.release.r317; import org.apollo.game.event.impl.FourthItemOptionEvent; -import org.apollo.net.codec.game.*; +import org.apollo.net.codec.game.DataOrder; +import org.apollo.net.codec.game.DataTransformation; +import org.apollo.net.codec.game.DataType; +import org.apollo.net.codec.game.GamePacket; +import org.apollo.net.codec.game.GamePacketReader; import org.apollo.net.release.EventDecoder; /** * An {@link EventDecoder} for the {@link FourthItemOptionEvent}. + * * @author Chris Fletcher */ final class FourthItemOptionEventDecoder extends EventDecoder { diff --git a/src/org/apollo/net/release/r317/SecondItemOptionEventDecoder.java b/src/org/apollo/net/release/r317/SecondItemOptionEventDecoder.java index 2c54717f..be70729f 100644 --- a/src/org/apollo/net/release/r317/SecondItemOptionEventDecoder.java +++ b/src/org/apollo/net/release/r317/SecondItemOptionEventDecoder.java @@ -9,6 +9,7 @@ import org.apollo.net.release.EventDecoder; /** * An {@link EventDecoder} for the {@link SecondItemOptionEvent}. + * * @author Graham */ final class SecondItemOptionEventDecoder extends EventDecoder { diff --git a/src/org/apollo/net/release/r317/ThirdItemOptionEventDecoder.java b/src/org/apollo/net/release/r317/ThirdItemOptionEventDecoder.java index 7a89c35f..cadf96ea 100644 --- a/src/org/apollo/net/release/r317/ThirdItemOptionEventDecoder.java +++ b/src/org/apollo/net/release/r317/ThirdItemOptionEventDecoder.java @@ -1,11 +1,16 @@ package org.apollo.net.release.r317; import org.apollo.game.event.impl.ThirdItemOptionEvent; -import org.apollo.net.codec.game.*; +import org.apollo.net.codec.game.DataOrder; +import org.apollo.net.codec.game.DataTransformation; +import org.apollo.net.codec.game.DataType; +import org.apollo.net.codec.game.GamePacket; +import org.apollo.net.codec.game.GamePacketReader; import org.apollo.net.release.EventDecoder; /** * An {@link EventDecoder} for the {@link ThirdItemOptionEvent}. + * * @author Chris Fletcher */ final class ThirdItemOptionEventDecoder extends EventDecoder { diff --git a/src/org/apollo/net/release/r377/FifthItemOptionEventDecoder.java b/src/org/apollo/net/release/r377/FifthItemOptionEventDecoder.java index d30b9b5c..04afc215 100644 --- a/src/org/apollo/net/release/r377/FifthItemOptionEventDecoder.java +++ b/src/org/apollo/net/release/r377/FifthItemOptionEventDecoder.java @@ -1,11 +1,16 @@ package org.apollo.net.release.r377; import org.apollo.game.event.impl.FifthItemOptionEvent; -import org.apollo.net.codec.game.*; +import org.apollo.net.codec.game.DataOrder; +import org.apollo.net.codec.game.DataTransformation; +import org.apollo.net.codec.game.DataType; +import org.apollo.net.codec.game.GamePacket; +import org.apollo.net.codec.game.GamePacketReader; import org.apollo.net.release.EventDecoder; /** * An {@link EventDecoder} for the {@link FifthItemOptionEvent}. + * * @author Chris Fletcher */ final class FifthItemOptionEventDecoder extends EventDecoder { diff --git a/src/org/apollo/net/release/r377/FirstItemOptionEventDecoder.java b/src/org/apollo/net/release/r377/FirstItemOptionEventDecoder.java index 99cd1577..939bb013 100644 --- a/src/org/apollo/net/release/r377/FirstItemOptionEventDecoder.java +++ b/src/org/apollo/net/release/r377/FirstItemOptionEventDecoder.java @@ -1,11 +1,16 @@ package org.apollo.net.release.r377; import org.apollo.game.event.impl.FirstItemOptionEvent; -import org.apollo.net.codec.game.*; +import org.apollo.net.codec.game.DataOrder; +import org.apollo.net.codec.game.DataTransformation; +import org.apollo.net.codec.game.DataType; +import org.apollo.net.codec.game.GamePacket; +import org.apollo.net.codec.game.GamePacketReader; import org.apollo.net.release.EventDecoder; /** * An {@link EventDecoder} for the {@link FirstItemOptionEvent}. + * * @author Chris Fletcher */ final class FirstItemOptionEventDecoder extends EventDecoder { diff --git a/src/org/apollo/net/release/r377/FourthItemOptionEventDecoder.java b/src/org/apollo/net/release/r377/FourthItemOptionEventDecoder.java index 99935ae8..ede3ef6c 100644 --- a/src/org/apollo/net/release/r377/FourthItemOptionEventDecoder.java +++ b/src/org/apollo/net/release/r377/FourthItemOptionEventDecoder.java @@ -1,11 +1,16 @@ package org.apollo.net.release.r377; import org.apollo.game.event.impl.FourthItemOptionEvent; -import org.apollo.net.codec.game.*; +import org.apollo.net.codec.game.DataOrder; +import org.apollo.net.codec.game.DataTransformation; +import org.apollo.net.codec.game.DataType; +import org.apollo.net.codec.game.GamePacket; +import org.apollo.net.codec.game.GamePacketReader; import org.apollo.net.release.EventDecoder; /** * An {@link EventDecoder} for the {@link FourthItemOptionEvent}. + * * @author Chris Fletcher */ final class FourthItemOptionEventDecoder extends EventDecoder { diff --git a/src/org/apollo/net/release/r377/SecondItemOptionEventDecoder.java b/src/org/apollo/net/release/r377/SecondItemOptionEventDecoder.java index af2ae574..738b1db7 100644 --- a/src/org/apollo/net/release/r377/SecondItemOptionEventDecoder.java +++ b/src/org/apollo/net/release/r377/SecondItemOptionEventDecoder.java @@ -1,11 +1,16 @@ package org.apollo.net.release.r377; import org.apollo.game.event.impl.SecondItemOptionEvent; -import org.apollo.net.codec.game.*; +import org.apollo.net.codec.game.DataOrder; +import org.apollo.net.codec.game.DataTransformation; +import org.apollo.net.codec.game.DataType; +import org.apollo.net.codec.game.GamePacket; +import org.apollo.net.codec.game.GamePacketReader; import org.apollo.net.release.EventDecoder; /** * An {@link EventDecoder} for the {@link SecondItemOptionEvent}. + * * @author Graham */ final class SecondItemOptionEventDecoder extends EventDecoder { diff --git a/src/org/apollo/net/release/r377/ThirdItemOptionEventDecoder.java b/src/org/apollo/net/release/r377/ThirdItemOptionEventDecoder.java index b1b22559..f106c779 100644 --- a/src/org/apollo/net/release/r377/ThirdItemOptionEventDecoder.java +++ b/src/org/apollo/net/release/r377/ThirdItemOptionEventDecoder.java @@ -1,11 +1,16 @@ package org.apollo.net.release.r377; import org.apollo.game.event.impl.ThirdItemOptionEvent; -import org.apollo.net.codec.game.*; +import org.apollo.net.codec.game.DataOrder; +import org.apollo.net.codec.game.DataTransformation; +import org.apollo.net.codec.game.DataType; +import org.apollo.net.codec.game.GamePacket; +import org.apollo.net.codec.game.GamePacketReader; import org.apollo.net.release.EventDecoder; /** * An {@link EventDecoder} for the {@link ThirdItemOptionEvent}. + * * @author Chris Fletcher */ final class ThirdItemOptionEventDecoder extends EventDecoder { diff --git a/src/org/apollo/security/IsaacRandomPair.java b/src/org/apollo/security/IsaacRandomPair.java index 88ac7486..f98430df 100644 --- a/src/org/apollo/security/IsaacRandomPair.java +++ b/src/org/apollo/security/IsaacRandomPair.java @@ -10,16 +10,16 @@ import net.burtleburtle.bob.rand.IsaacRandom; */ public final class IsaacRandomPair { - /** - * The random number generator used to encode data. - */ - private final IsaacRandom encodingRandom; - /** * The random number generator used to decode data. */ private final IsaacRandom decodingRandom; + /** + * The random number generator used to encode data. + */ + private final IsaacRandom encodingRandom; + /** * Creates the pair of random number generators. * diff --git a/src/org/apollo/security/PlayerCredentials.java b/src/org/apollo/security/PlayerCredentials.java index 2608ed55..b5208167 100644 --- a/src/org/apollo/security/PlayerCredentials.java +++ b/src/org/apollo/security/PlayerCredentials.java @@ -9,11 +9,6 @@ import org.apollo.util.NameUtil; */ public final class PlayerCredentials { - /** - * The player's username. - */ - private final String username; - /** * The player's username encoded as a long. */ @@ -24,16 +19,21 @@ public final class PlayerCredentials { */ private final String password; - /** - * The hash of the player's username. - */ - private final int usernameHash; - /** * The computer's unique identifier. */ private final int uid; + /** + * The player's username. + */ + private final String username; + + /** + * The hash of the player's username. + */ + private final int usernameHash; + /** * Creates a new {@link PlayerCredentials} object with the specified name, password and uid. * diff --git a/src/org/apollo/tools/EquipmentConstants.java b/src/org/apollo/tools/EquipmentConstants.java index 7efba9ee..b021b4a7 100644 --- a/src/org/apollo/tools/EquipmentConstants.java +++ b/src/org/apollo/tools/EquipmentConstants.java @@ -8,33 +8,6 @@ package org.apollo.tools; */ public final class EquipmentConstants { - /** - * Capes. - */ - public static final String[] CAPES = { "cape", "Cape" }; - - /** - * Hats. - */ - public static final String[] HATS = { "helm", "hood", "coif", "Coif", "hat", "partyhat", "Hat", "full helm (t)", - "full helm (g)", "hat (t)", "hat (g)", "cav", "boater", "helmet", "mask", "Helm of neitiznot" }; - - /** - * Boots. - */ - public static final String[] BOOTS = { "boots", "Boots" }; - - /** - * Gloves. - */ - public static final String[] GLOVES = { "gloves", "gauntlets", "Gloves", "vambraces", "vamb", "bracers" }; - - /** - * Shields. - */ - public static final String[] SHIELDS = { "kiteshield", "sq shield", "Toktz-ket", "books", "book", "kiteshield (t)", - "kiteshield (g)", "kiteshield(h)", "defender", "shield" }; - /** * Amulets. */ @@ -46,11 +19,6 @@ public final class EquipmentConstants { public static final String[] ARROWS = { "arrow", "arrows", "arrow(p)", "arrow(+)", "arrow(s)", "bolt", "Bolt rack", "Opal bolts", "Dragon bolts" }; - /** - * Rings. - */ - public static final String[] RINGS = { "ring", "Ring of" }; - /** * Bodies. */ @@ -59,20 +27,14 @@ public final class EquipmentConstants { "torso", "shirt" }; /** - * Legs. + * Boots. */ - public static final String[] LEGS = { "platelegs", "plateskirt", "skirt", "bottoms", "chaps", "platelegs (t)", - "platelegs (g)", "bottom", "skirt", "skirt (g)", "skirt (t)", "chaps (g)", "chaps (t)", "tassets", "legs", - "Flared trousers" }; + public static final String[] BOOTS = { "boots", "Boots" }; /** - * Weapons. + * Capes. */ - public static final String[] WEAPONS = { "scimitar", "longsword", "sword", "longbow", "shortbow", "dagger", "mace", - "halberd", "spear", "Abyssal whip", "axe", "flail", "crossbow", "Torags hammers", "dagger(p)", "dagger(+)", - "dagger(s)", "spear(p)", "spear(+)", "spear(s)", "spear(kp)", "maul", "dart", "dart(p)", "javelin", - "javelin(p)", "knife", "knife(p)", "Longbow", "Shortbow", "Crossbow", "Toktz-xil", "Toktz-mej", - "Tzhaar-ket", "staff", "Staff", "godsword", "c'bow", "Crystal bow", "Dark bow", "Magic butterfly net" }; + public static final String[] CAPES = { "cape", "Cape" }; /** * Full bodies. @@ -92,6 +54,44 @@ public final class EquipmentConstants { public static final String[] FULL_MASKS = { "full helm", "mask", "Veracs helm", "Guthans helm", "Torags helm", "Karils coif", "full helm (t)", "full helm (g)", "mask" }; + /** + * Gloves. + */ + public static final String[] GLOVES = { "gloves", "gauntlets", "Gloves", "vambraces", "vamb", "bracers" }; + + /** + * Hats. + */ + public static final String[] HATS = { "helm", "hood", "coif", "Coif", "hat", "partyhat", "Hat", "full helm (t)", + "full helm (g)", "hat (t)", "hat (g)", "cav", "boater", "helmet", "mask", "Helm of neitiznot" }; + + /** + * Legs. + */ + public static final String[] LEGS = { "platelegs", "plateskirt", "skirt", "bottoms", "chaps", "platelegs (t)", + "platelegs (g)", "bottom", "skirt", "skirt (g)", "skirt (t)", "chaps (g)", "chaps (t)", "tassets", "legs", + "Flared trousers" }; + + /** + * Rings. + */ + public static final String[] RINGS = { "ring", "Ring of" }; + + /** + * Shields. + */ + public static final String[] SHIELDS = { "kiteshield", "sq shield", "Toktz-ket", "books", "book", "kiteshield (t)", + "kiteshield (g)", "kiteshield(h)", "defender", "shield" }; + + /** + * Weapons. + */ + public static final String[] WEAPONS = { "scimitar", "longsword", "sword", "longbow", "shortbow", "dagger", "mace", + "halberd", "spear", "Abyssal whip", "axe", "flail", "crossbow", "Torags hammers", "dagger(p)", "dagger(+)", + "dagger(s)", "spear(p)", "spear(+)", "spear(s)", "spear(kp)", "maul", "dart", "dart(p)", "javelin", + "javelin(p)", "knife", "knife(p)", "Longbow", "Shortbow", "Crossbow", "Toktz-xil", "Toktz-mej", + "Tzhaar-ket", "staff", "Staff", "godsword", "c'bow", "Crystal bow", "Dark bow", "Magic butterfly net" }; + /** * Default private construcotr to prevent instantiation. */ diff --git a/src/org/apollo/update/HttpRequestWorker.java b/src/org/apollo/update/HttpRequestWorker.java index 6d21f415..50815e0f 100644 --- a/src/org/apollo/update/HttpRequestWorker.java +++ b/src/org/apollo/update/HttpRequestWorker.java @@ -27,6 +27,11 @@ import org.jboss.netty.handler.codec.http.HttpResponseStatus; */ public final class HttpRequestWorker extends RequestWorker { + /** + * The default character set. + */ + private static final Charset CHARACTER_SET = Charset.forName("ISO-8859-1"); + /** * The value of the server header. */ @@ -37,11 +42,6 @@ public final class HttpRequestWorker extends RequestWorker implements Runnable { - /** - * The resource provider. - */ - private final P provider; - /** * The update dispatcher. */ private final UpdateDispatcher dispatcher; + /** + * The resource provider. + */ + private final P provider; + /** * A flag indicating if the worker should be running. */ diff --git a/src/org/apollo/update/UpdateDispatcher.java b/src/org/apollo/update/UpdateDispatcher.java index ec93b065..4a2b0ebd 100644 --- a/src/org/apollo/update/UpdateDispatcher.java +++ b/src/org/apollo/update/UpdateDispatcher.java @@ -22,9 +22,9 @@ public final class UpdateDispatcher { private static final int MAXIMUM_QUEUE_SIZE = 1024; /** - * A queue for pending 'on-demand' requests. + * A queue for pending HTTP requests. */ - private final BlockingQueue> onDemandQueue = new PriorityBlockingQueue>(); + private final BlockingQueue> httpQueue = new LinkedBlockingQueue>(); /** * A queue for pending JAGGRAB requests. @@ -32,9 +32,9 @@ public final class UpdateDispatcher { private final BlockingQueue> jagGrabQueue = new LinkedBlockingQueue>(); /** - * A queue for pending HTTP requests. + * A queue for pending 'on-demand' requests. */ - private final BlockingQueue> httpQueue = new LinkedBlockingQueue>(); + private final BlockingQueue> onDemandQueue = new PriorityBlockingQueue>(); /** * Dispatches a HTTP request. diff --git a/src/org/apollo/update/UpdateService.java b/src/org/apollo/update/UpdateService.java index eb40a684..38403d6f 100644 --- a/src/org/apollo/update/UpdateService.java +++ b/src/org/apollo/update/UpdateService.java @@ -16,15 +16,20 @@ import org.apollo.fs.IndexedFileSystem; */ public final class UpdateService extends Service { + /** + * The number of request types. + */ + private static final int REQUEST_TYPES = 3; + /** * The number of threads per request type. */ private static final int THREADS_PER_REQUEST_TYPE = Runtime.getRuntime().availableProcessors(); /** - * The number of request types. + * The update dispatcher. */ - private static final int REQUEST_TYPES = 3; + private final UpdateDispatcher dispatcher = new UpdateDispatcher(); /** * The executor service. @@ -36,11 +41,6 @@ public final class UpdateService extends Service { */ private final List> workers = new ArrayList>(); - /** - * The update dispatcher. - */ - private final UpdateDispatcher dispatcher = new UpdateDispatcher(); - /** * Creates the update service. */ diff --git a/src/org/apollo/util/CharacterRepository.java b/src/org/apollo/util/CharacterRepository.java index 70f6a9d3..697e649c 100644 --- a/src/org/apollo/util/CharacterRepository.java +++ b/src/org/apollo/util/CharacterRepository.java @@ -20,16 +20,16 @@ public final class CharacterRepository implements Iterable< */ private final class CharacterRepositoryIterator implements Iterator { - /** - * The previous index of this iterator. - */ - private int previousIndex = -1; - /** * The current index of this iterator. */ private int index = 0; + /** + * The previous index of this iterator. + */ + private int previousIndex = -1; + @Override public boolean hasNext() { for (int i = index; i < characters.length; i++) { @@ -77,16 +77,16 @@ public final class CharacterRepository implements Iterable< */ private final Character[] characters; - /** - * The current size of this repository. - */ - private int size = 0; - /** * The position of the next free index. */ private int pointer = 0; + /** + * The current size of this repository. + */ + private int size = 0; + /** * Creates a new character repository with the specified capacity. * diff --git a/src/org/apollo/util/NamedThreadFactory.java b/src/org/apollo/util/NamedThreadFactory.java index cf861deb..f83bb259 100644 --- a/src/org/apollo/util/NamedThreadFactory.java +++ b/src/org/apollo/util/NamedThreadFactory.java @@ -14,16 +14,16 @@ import java.util.concurrent.atomic.AtomicInteger; */ public final class NamedThreadFactory implements ThreadFactory { - /** - * The unique name. - */ - private final String name; - /** * The next id. */ private AtomicInteger id = new AtomicInteger(0); + /** + * The unique name. + */ + private final String name; + /** * Creates the named thread factory. * diff --git a/src/org/apollo/util/plugin/PluginManager.java b/src/org/apollo/util/plugin/PluginManager.java index 6b1a0764..e3eb8e56 100644 --- a/src/org/apollo/util/plugin/PluginManager.java +++ b/src/org/apollo/util/plugin/PluginManager.java @@ -25,16 +25,16 @@ import org.xml.sax.SAXException; */ public final class PluginManager { - /** - * The plugin context. - */ - private final PluginContext context; - /** * A set of all author names. */ private SortedSet authors = new TreeSet(); + /** + * The plugin context. + */ + private final PluginContext context; + /** * Creates the plugin manager. * diff --git a/src/org/apollo/util/plugin/PluginMetaData.java b/src/org/apollo/util/plugin/PluginMetaData.java index 7389fb5c..f60e7a2f 100644 --- a/src/org/apollo/util/plugin/PluginMetaData.java +++ b/src/org/apollo/util/plugin/PluginMetaData.java @@ -7,6 +7,21 @@ package org.apollo.util.plugin; */ public final class PluginMetaData { + /** + * The plugin's authors. + */ + private final String[] authors; + + /** + * The plugin's dependencies. + */ + private final String[] dependencies; + + /** + * The plugin's description. + */ + private final String description; + /** * The plugin's id. */ @@ -17,26 +32,11 @@ public final class PluginMetaData { */ private final String name; - /** - * The plugin's description. - */ - private final String description; - - /** - * The plugin's authors. - */ - private final String[] authors; - /** * The plugin's scripts. */ private final String[] scripts; - /** - * The plugin's dependencies. - */ - private final String[] dependencies; - /** * The plugin's version. */ diff --git a/src/org/apollo/util/xml/XmlNode.java b/src/org/apollo/util/xml/XmlNode.java index 8f5a3bd2..47c01935 100644 --- a/src/org/apollo/util/xml/XmlNode.java +++ b/src/org/apollo/util/xml/XmlNode.java @@ -17,16 +17,6 @@ import java.util.Set; */ public final class XmlNode implements Iterable { - /** - * The name of this node. - */ - private String name; - - /** - * The value of this node, or {@code null} if it has no value. - */ - private String value; - /** * The attribute map. */ @@ -37,6 +27,16 @@ public final class XmlNode implements Iterable { */ private final List children = new ArrayList(); + /** + * The name of this node. + */ + private String name; + + /** + * The value of this node, or {@code null} if it has no value. + */ + private String value; + /** * Creates a new {@link XmlNode} with the specified name. * diff --git a/src/org/apollo/util/xml/XmlParser.java b/src/org/apollo/util/xml/XmlParser.java index 8bc0ca3b..05f109c5 100644 --- a/src/org/apollo/util/xml/XmlParser.java +++ b/src/org/apollo/util/xml/XmlParser.java @@ -62,29 +62,29 @@ public final class XmlParser { } /** - * The {@link XMLReader} backing this {@link XmlParser}. + * The current node. */ - private final XMLReader xmlReader; + private XmlNode currentNode; /** * The SAX event handler. */ private final XmlHandler eventHandler; + /** + * The stack of nodes, which is used when traversing the document and going through child nodes. + */ + private Stack nodeStack = new Stack(); + /** * The current root node. */ private XmlNode rootNode; /** - * The current node. + * The {@link XMLReader} backing this {@link XmlParser}. */ - private XmlNode currentNode; - - /** - * The stack of nodes, which is used when traversing the document and going through child nodes. - */ - private Stack nodeStack = new Stack(); + private final XMLReader xmlReader; /** * Creates a new xml parser.