mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 00:38:21 +00:00
Strict whitespace format, make private fields final that can be immutable
This commit is contained in:
@@ -177,16 +177,15 @@ def on_message(args, proc)
|
||||
numbers = [ 'first', 'second', 'third', 'fourth', 'fifth' ]
|
||||
message = args[0]; option = 0
|
||||
|
||||
# TODO
|
||||
# numbers.each_index do |index|
|
||||
# number = numbers[index]
|
||||
#
|
||||
# if message.to_s.start_with?(number)
|
||||
# option = index + 1
|
||||
# message = message[number.length + 1, message.length].to_sym
|
||||
# break
|
||||
# end
|
||||
# end
|
||||
numbers.each_index do |index|
|
||||
number = numbers[index]
|
||||
|
||||
if message.to_s.start_with?(number)
|
||||
option = index + 1
|
||||
message = message[number.length + 1, message.length].to_sym
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
class_name = message.to_s.camelize.concat('Message')
|
||||
|
||||
@@ -5,7 +5,7 @@ package net.burtleburtle.bob.rand;
|
||||
* An implementation of the <a href="http://www.burtleburtle.net/bob/rand/isaacafa.html">ISAAC</a> psuedorandom number
|
||||
* generator.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* ------------------------------------------------------------------------------
|
||||
* Rand.java: By Bob Jenkins. My random number generator, ISAAC.
|
||||
@@ -20,7 +20,7 @@ package net.burtleburtle.bob.rand;
|
||||
* <p>
|
||||
* This class has been changed to be more conformant to Java and javadoc conventions.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @author Bob Jenkins
|
||||
*/
|
||||
public final class IsaacRandom {
|
||||
@@ -68,12 +68,12 @@ public final class IsaacRandom {
|
||||
/**
|
||||
* The internal state.
|
||||
*/
|
||||
private int[] mem;
|
||||
private final int[] mem;
|
||||
|
||||
/**
|
||||
* The results given to the user.
|
||||
*/
|
||||
private int[] rsl;
|
||||
private final int[] rsl;
|
||||
|
||||
/**
|
||||
* Creates the random number generator without an initial seed.
|
||||
@@ -86,7 +86,7 @@ public final class IsaacRandom {
|
||||
|
||||
/**
|
||||
* Creates the random number generator with the specified seed.
|
||||
*
|
||||
*
|
||||
* @param seed The seed.
|
||||
*/
|
||||
public IsaacRandom(int[] seed) {
|
||||
@@ -100,7 +100,7 @@ public final class IsaacRandom {
|
||||
|
||||
/**
|
||||
* Initialises this random number generator.
|
||||
*
|
||||
*
|
||||
* @param hasSeed Set to {@code true} if a seed was passed to the constructor.
|
||||
*/
|
||||
private void init(boolean hasSeed) {
|
||||
@@ -291,7 +291,7 @@ public final class IsaacRandom {
|
||||
|
||||
/**
|
||||
* Gets the next random value.
|
||||
*
|
||||
*
|
||||
* @return The next random value.
|
||||
*/
|
||||
public int nextInt() {
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.apollo.util.plugin.PluginManager;
|
||||
|
||||
/**
|
||||
* The core class of the Apollo server.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class Server {
|
||||
@@ -39,7 +39,7 @@ public final class Server {
|
||||
|
||||
/**
|
||||
* The entry point of the Apollo server application.
|
||||
*
|
||||
*
|
||||
* @param args The command-line arguments passed to the application.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
@@ -81,7 +81,7 @@ public final class Server {
|
||||
|
||||
/**
|
||||
* Creates the Apollo server.
|
||||
*
|
||||
*
|
||||
* @throws Exception If an error occurs whilst creating services.
|
||||
*/
|
||||
public Server() throws Exception {
|
||||
@@ -90,7 +90,7 @@ public final class Server {
|
||||
|
||||
/**
|
||||
* Binds the server to the specified address.
|
||||
*
|
||||
*
|
||||
* @param serviceAddress The service address to bind to.
|
||||
* @param httpAddress The HTTP address to bind to.
|
||||
* @param jagGrabAddress The JAGGRAB address to bind to.
|
||||
@@ -115,7 +115,7 @@ public final class Server {
|
||||
|
||||
/**
|
||||
* Initialises the server.
|
||||
*
|
||||
*
|
||||
* @param releaseClassName The class name of the current active {@link Release}.
|
||||
* @throws Exception If an error occurs.
|
||||
*/
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.apollo.net.release.Release;
|
||||
* A {@link ServerContext} is created along with the {@link Server} object. The primary difference is that a reference
|
||||
* to the current context should be passed around within the server. The {@link Server} should not be as it allows
|
||||
* access to some methods such as {@link Server#bind} which user scripts/code should not be able to access.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class ServerContext {
|
||||
@@ -23,7 +23,7 @@ public final class ServerContext {
|
||||
|
||||
/**
|
||||
* Creates a new server context.
|
||||
*
|
||||
*
|
||||
* @param release The current release.
|
||||
* @param serviceManager The service manager.
|
||||
*/
|
||||
@@ -35,7 +35,7 @@ public final class ServerContext {
|
||||
|
||||
/**
|
||||
* Gets the current release.
|
||||
*
|
||||
*
|
||||
* @return The current release.
|
||||
*/
|
||||
public Release getRelease() {
|
||||
@@ -44,7 +44,7 @@ public final class ServerContext {
|
||||
|
||||
/**
|
||||
* Gets a service. This method is shorthand for {@code getServiceManager().getService(...)}.
|
||||
*
|
||||
*
|
||||
* @param clazz The service class.
|
||||
* @return The service, or {@code null} if it could not be found.
|
||||
*/
|
||||
@@ -54,7 +54,7 @@ public final class ServerContext {
|
||||
|
||||
/**
|
||||
* Gets the service manager.
|
||||
*
|
||||
*
|
||||
* @return The service manager.
|
||||
*/
|
||||
public ServiceManager getServiceManager() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.apollo.game.model.World;
|
||||
|
||||
/**
|
||||
* Represents a service that the server provides for a {@link World}.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public abstract class Service {
|
||||
@@ -30,7 +30,7 @@ public abstract class Service {
|
||||
|
||||
/**
|
||||
* Gets the {@link ServerContext}.
|
||||
*
|
||||
*
|
||||
* @return The context.
|
||||
*/
|
||||
public final ServerContext getContext() {
|
||||
@@ -39,7 +39,7 @@ public abstract class Service {
|
||||
|
||||
/**
|
||||
* Sets the {@link ServerContext}.
|
||||
*
|
||||
*
|
||||
* @param context The context.
|
||||
*/
|
||||
public final void setContext(ServerContext context) {
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* A class which manages {@link Service}s.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class ServiceManager {
|
||||
@@ -27,11 +27,11 @@ public final class ServiceManager {
|
||||
/**
|
||||
* The service map.
|
||||
*/
|
||||
private Map<Class<? extends Service>, Service> services = new HashMap<>();
|
||||
private final Map<Class<? extends Service>, Service> services = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Creates and initializes the {@link ServiceManager}.
|
||||
*
|
||||
*
|
||||
* @param world The {@link World} to create the {@link Service}s for.
|
||||
* @throws IOException If there is an error reading from the xml file.
|
||||
* @throws SAXException If there is an error parsing the xml file.
|
||||
@@ -43,7 +43,7 @@ public final class ServiceManager {
|
||||
|
||||
/**
|
||||
* Gets a service.
|
||||
*
|
||||
*
|
||||
* @param clazz The service class.
|
||||
* @return The service.
|
||||
*/
|
||||
@@ -54,7 +54,7 @@ public final class ServiceManager {
|
||||
|
||||
/**
|
||||
* Initializes this service manager.
|
||||
*
|
||||
*
|
||||
* @param world The {@link World} to create the {@link Service}s for.
|
||||
* @throws SAXException If the service XML file could not be parsed.
|
||||
* @throws IOException If the file could not be accessed.
|
||||
@@ -91,7 +91,7 @@ public final class ServiceManager {
|
||||
|
||||
/**
|
||||
* Registers a service.
|
||||
*
|
||||
*
|
||||
* @param clazz The service's class.
|
||||
* @param service The service.
|
||||
*/
|
||||
@@ -102,7 +102,7 @@ public final class ServiceManager {
|
||||
|
||||
/**
|
||||
* Sets the context of all services.
|
||||
*
|
||||
*
|
||||
* @param ctx The server context.
|
||||
*/
|
||||
public void setContext(ServerContext ctx) {
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.apollo.fs;
|
||||
|
||||
/**
|
||||
* A class which points to a file in the cache.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class FileDescriptor {
|
||||
@@ -19,7 +19,7 @@ public final class FileDescriptor {
|
||||
|
||||
/**
|
||||
* Creates the file descriptor.
|
||||
*
|
||||
*
|
||||
* @param type The file type.
|
||||
* @param file The file id.
|
||||
*/
|
||||
@@ -30,7 +30,7 @@ public final class FileDescriptor {
|
||||
|
||||
/**
|
||||
* Gets the file id.
|
||||
*
|
||||
*
|
||||
* @return The file id.
|
||||
*/
|
||||
public int getFile() {
|
||||
@@ -39,7 +39,7 @@ public final class FileDescriptor {
|
||||
|
||||
/**
|
||||
* Gets the file type.
|
||||
*
|
||||
*
|
||||
* @return The file type.
|
||||
*/
|
||||
public int getType() {
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.apollo.fs;
|
||||
|
||||
/**
|
||||
* Holds file system related constants.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class FileSystemConstants {
|
||||
|
||||
@@ -4,14 +4,14 @@ import com.google.common.base.Preconditions;
|
||||
|
||||
/**
|
||||
* An {@link Index} points to a file in the {@code main_file_cache.dat} file.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class Index {
|
||||
|
||||
/**
|
||||
* Decodes a buffer into an index.
|
||||
*
|
||||
*
|
||||
* @param buffer The buffer.
|
||||
* @return The decoded {@link Index}.
|
||||
* @throws IllegalArgumentException If the buffer length is invalid.
|
||||
@@ -37,7 +37,7 @@ public final class Index {
|
||||
|
||||
/**
|
||||
* Creates the index.
|
||||
*
|
||||
*
|
||||
* @param size The size of the file.
|
||||
* @param block The first block of the file.
|
||||
*/
|
||||
@@ -48,7 +48,7 @@ public final class Index {
|
||||
|
||||
/**
|
||||
* Gets the first block of the file.
|
||||
*
|
||||
*
|
||||
* @return The first block of the file.
|
||||
*/
|
||||
public int getBlock() {
|
||||
@@ -57,7 +57,7 @@ public final class Index {
|
||||
|
||||
/**
|
||||
* Gets the size of the file.
|
||||
*
|
||||
*
|
||||
* @return The size of the file.
|
||||
*/
|
||||
public int getSize() {
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.google.common.base.Preconditions;
|
||||
/**
|
||||
* A file system based on top of the operating system's file system. It consists of a data file and index files. Index
|
||||
* files point to blocks in the data file, which contains the actual data.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class IndexedFileSystem implements Closeable {
|
||||
@@ -32,7 +32,7 @@ public final class IndexedFileSystem implements Closeable {
|
||||
/**
|
||||
* The index files.
|
||||
*/
|
||||
private RandomAccessFile[] indices = new RandomAccessFile[256];
|
||||
private final RandomAccessFile[] indices = new RandomAccessFile[256];
|
||||
|
||||
/**
|
||||
* Read only flag.
|
||||
@@ -41,7 +41,7 @@ public final class IndexedFileSystem implements Closeable {
|
||||
|
||||
/**
|
||||
* Creates the file system with the specified base directory.
|
||||
*
|
||||
*
|
||||
* @param base The base directory.
|
||||
* @param readOnly Indicates whether the file system will be read only or not.
|
||||
* @throws FileNotFoundException If the data files could not be found.
|
||||
@@ -70,7 +70,7 @@ public final class IndexedFileSystem implements Closeable {
|
||||
|
||||
/**
|
||||
* Automatically detect the layout of the specified directory.
|
||||
*
|
||||
*
|
||||
* @param base The base directory.
|
||||
* @throws FileNotFoundException If the data files could not be found.
|
||||
*/
|
||||
@@ -97,7 +97,7 @@ public final class IndexedFileSystem implements Closeable {
|
||||
|
||||
/**
|
||||
* Gets the CRC table.
|
||||
*
|
||||
*
|
||||
* @return The CRC table.
|
||||
* @throws IOException If there is an error accessing files to create the table.
|
||||
* @throws IllegalStateException If this file system is not read-only.
|
||||
@@ -145,7 +145,7 @@ public final class IndexedFileSystem implements Closeable {
|
||||
|
||||
/**
|
||||
* Gets a file.
|
||||
*
|
||||
*
|
||||
* @param descriptor The {@link FileDescriptor} pointing to the file.
|
||||
* @return A {@link ByteBuffer} containing the contents of the file.
|
||||
* @throws IOException If there is an error decoding the file.
|
||||
@@ -211,7 +211,7 @@ public final class IndexedFileSystem implements Closeable {
|
||||
|
||||
/**
|
||||
* Gets a file.
|
||||
*
|
||||
*
|
||||
* @param type The file type.
|
||||
* @param file The file id.
|
||||
* @return A {@link ByteBuffer} which contains the contents of the file.
|
||||
@@ -223,7 +223,7 @@ public final class IndexedFileSystem implements Closeable {
|
||||
|
||||
/**
|
||||
* Gets the number of files with the specified type.
|
||||
*
|
||||
*
|
||||
* @param type The type.
|
||||
* @return The number of files.
|
||||
* @throws IOException If there is an error getting the length of the specified index file.
|
||||
@@ -241,7 +241,7 @@ public final class IndexedFileSystem implements Closeable {
|
||||
|
||||
/**
|
||||
* Gets the index of a file.
|
||||
*
|
||||
*
|
||||
* @param descriptor The {@link FileDescriptor} which points to the file.
|
||||
* @return The {@link Index}.
|
||||
* @throws IOException If there is an error reading from the index file.
|
||||
@@ -269,7 +269,7 @@ public final class IndexedFileSystem implements Closeable {
|
||||
|
||||
/**
|
||||
* Checks if this {@link IndexedFileSystem} is read only.
|
||||
*
|
||||
*
|
||||
* @return {@code true} if so, {@code false} if not.
|
||||
*/
|
||||
public boolean isReadOnly() {
|
||||
|
||||
@@ -9,14 +9,14 @@ import org.apollo.util.CompressionUtil;
|
||||
|
||||
/**
|
||||
* Represents an archive.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class Archive {
|
||||
|
||||
/**
|
||||
* Decodes the archive in the specified buffer.
|
||||
*
|
||||
*
|
||||
* @param buffer The buffer.
|
||||
* @return The archive.
|
||||
* @throws IOException If there is an error decompressing the archive.
|
||||
@@ -72,7 +72,7 @@ public final class Archive {
|
||||
|
||||
/**
|
||||
* Creates a new archive.
|
||||
*
|
||||
*
|
||||
* @param entries The entries in this archive.
|
||||
*/
|
||||
public Archive(ArchiveEntry[] entries) {
|
||||
@@ -81,7 +81,7 @@ public final class Archive {
|
||||
|
||||
/**
|
||||
* Gets an {@link ArchiveEntry} by its name.
|
||||
*
|
||||
*
|
||||
* @param name The name.
|
||||
* @return The entry.
|
||||
* @throws FileNotFoundException If the entry could not be found.
|
||||
@@ -99,7 +99,7 @@ public final class Archive {
|
||||
|
||||
/**
|
||||
* Hashes the specified string into an integer used to identify an {@link ArchiveEntry}.
|
||||
*
|
||||
*
|
||||
* @param name The name of the entry.
|
||||
* @return The hash.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.nio.ByteBuffer;
|
||||
|
||||
/**
|
||||
* Represents a single entry in an {@link Archive}.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class ArchiveEntry {
|
||||
@@ -21,7 +21,7 @@ public final class ArchiveEntry {
|
||||
|
||||
/**
|
||||
* Creates a new archive entry.
|
||||
*
|
||||
*
|
||||
* @param identifier The identifier.
|
||||
* @param buffer The buffer.
|
||||
*/
|
||||
@@ -32,7 +32,7 @@ public final class ArchiveEntry {
|
||||
|
||||
/**
|
||||
* Gets the buffer of this entry.
|
||||
*
|
||||
*
|
||||
* @return This buffer of this entry.
|
||||
*/
|
||||
public ByteBuffer getBuffer() {
|
||||
@@ -41,7 +41,7 @@ public final class ArchiveEntry {
|
||||
|
||||
/**
|
||||
* Gets the identifier of this entry.
|
||||
*
|
||||
*
|
||||
* @return The identifier of this entry.
|
||||
*/
|
||||
public int getIdentifier() {
|
||||
|
||||
@@ -26,7 +26,7 @@ import com.google.common.collect.Iterables;
|
||||
|
||||
/**
|
||||
* Parses static object definitions, which include map tiles and landscapes.
|
||||
*
|
||||
*
|
||||
* @author Ryley
|
||||
* @author Major
|
||||
*/
|
||||
@@ -59,7 +59,7 @@ public final class GameObjectDecoder {
|
||||
|
||||
/**
|
||||
* Creates the GameObjectDecoder.
|
||||
*
|
||||
*
|
||||
* @param fs The {@link IndexedFileSystem}.
|
||||
* @param regions The {@link RegionRepository}.
|
||||
*/
|
||||
@@ -70,7 +70,7 @@ public final class GameObjectDecoder {
|
||||
|
||||
/**
|
||||
* Decodes the GameObjects from their MapDefinitions.
|
||||
*
|
||||
*
|
||||
* @param world The {@link World} containing the StaticGameObjects.
|
||||
* @return The decoded objects.
|
||||
* @throws IOException If there is an error decoding the {@link MapDefinition}s.
|
||||
@@ -99,7 +99,7 @@ public final class GameObjectDecoder {
|
||||
|
||||
/**
|
||||
* Blocks tiles covered by a GameObject, if applicable.
|
||||
*
|
||||
*
|
||||
* @param object The {@link GameObject}.
|
||||
* @param position The position of the GameObject.
|
||||
*/
|
||||
@@ -133,7 +133,7 @@ public final class GameObjectDecoder {
|
||||
if (block) {
|
||||
for (int dx = 0; dx < definition.getWidth(); dx++) {
|
||||
for (int dy = 0; dy < definition.getLength(); dy++) {
|
||||
int localX = (x % Region.SIZE) + dx, localY = (y % Region.SIZE) + dy;
|
||||
int localX = x % Region.SIZE + dx, localY = y % Region.SIZE + dy;
|
||||
|
||||
if (localX > 7 || localY > 7) {
|
||||
int nextLocalX = localX > 7 ? x + localX - 7 : x + localX;
|
||||
@@ -141,11 +141,13 @@ public final class GameObjectDecoder {
|
||||
Position nextPosition = new Position(nextLocalX, nextLocalY);
|
||||
Region next = regions.fromPosition(nextPosition);
|
||||
|
||||
int nextX = (nextPosition.getX() % Region.SIZE) + dx, nextY = (nextPosition.getY() % Region.SIZE) + dy;
|
||||
if (nextX > 7)
|
||||
int nextX = nextPosition.getX() % Region.SIZE + dx, nextY = nextPosition.getY() % Region.SIZE + dy;
|
||||
if (nextX > 7) {
|
||||
nextX -= 7;
|
||||
if (nextY > 7)
|
||||
}
|
||||
if (nextY > 7) {
|
||||
nextY -= 7;
|
||||
}
|
||||
|
||||
next.getMatrix(height).block(nextX, nextY);
|
||||
continue;
|
||||
@@ -159,7 +161,7 @@ public final class GameObjectDecoder {
|
||||
|
||||
/**
|
||||
* Decodes the attributes of a terrain file, blocking the tile if necessary.
|
||||
*
|
||||
*
|
||||
* @param attributes The terrain attributes.
|
||||
* @param position The {@link Position} of the tile whose attributes are being decoded.
|
||||
*/
|
||||
@@ -181,14 +183,14 @@ public final class GameObjectDecoder {
|
||||
}
|
||||
|
||||
if (block) {
|
||||
int localX = (x % Region.SIZE), localY = (y % Region.SIZE);
|
||||
int localX = x % Region.SIZE, localY = y % Region.SIZE;
|
||||
current.block(localX, localY);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes object data stored in the specified {@link ByteBuffer}.
|
||||
*
|
||||
*
|
||||
* @param world The {@link World} containing the StaticGameObjects.
|
||||
* @param buffer The ByteBuffer.
|
||||
* @param x The x coordinate of the top left tile of the map file.
|
||||
@@ -209,7 +211,7 @@ public final class GameObjectDecoder {
|
||||
|
||||
int localY = packed & 0x3F;
|
||||
int localX = packed >> 6 & 0x3F;
|
||||
int height = (packed >> 12) & 0x3;
|
||||
int height = packed >> 12 & 0x3;
|
||||
|
||||
int attributes = buffer.get() & 0xFF;
|
||||
int type = attributes >> 2;
|
||||
@@ -229,7 +231,7 @@ public final class GameObjectDecoder {
|
||||
|
||||
/**
|
||||
* Decodes terrain data stored in the specified {@link ByteBuffer}.
|
||||
*
|
||||
*
|
||||
* @param buffer The ByteBuffer.
|
||||
* @param x The x coordinate of the top left tile of the map file.
|
||||
* @param y The y coordinate of the top left tile of the map file.
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.apollo.util.BufferUtil;
|
||||
|
||||
/**
|
||||
* Decodes item data from the {@code obj.dat} file into {@link ItemDefinition}s.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class ItemDefinitionDecoder {
|
||||
@@ -22,7 +22,7 @@ public final class ItemDefinitionDecoder {
|
||||
|
||||
/**
|
||||
* Creates the item definition decoder.
|
||||
*
|
||||
*
|
||||
* @param fs The indexed file system.
|
||||
*/
|
||||
public ItemDefinitionDecoder(IndexedFileSystem fs) {
|
||||
@@ -31,7 +31,7 @@ public final class ItemDefinitionDecoder {
|
||||
|
||||
/**
|
||||
* Decodes the item definitions.
|
||||
*
|
||||
*
|
||||
* @return The item definitions.
|
||||
* @throws IOException If an I/O error occurs.
|
||||
*/
|
||||
@@ -58,7 +58,7 @@ public final class ItemDefinitionDecoder {
|
||||
|
||||
/**
|
||||
* Decodes a single definition.
|
||||
*
|
||||
*
|
||||
* @param id The item's id.
|
||||
* @param buffer The buffer.
|
||||
* @return The {@link ItemDefinition}.
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.apollo.game.model.area.Region;
|
||||
|
||||
/**
|
||||
* Decodes {@link MapDefinition}s from the {@link IndexedFileSystem}.
|
||||
*
|
||||
*
|
||||
* @author Ryley
|
||||
* @author Major
|
||||
*/
|
||||
@@ -82,7 +82,7 @@ public final class MapFileDecoder {
|
||||
|
||||
/**
|
||||
* Creates the {@link MapDefinition}.
|
||||
*
|
||||
*
|
||||
* @param packedCoordinates The packed coordinates.
|
||||
* @param terrain The terrain file id.
|
||||
* @param objects The object file id.
|
||||
@@ -97,7 +97,7 @@ public final class MapFileDecoder {
|
||||
|
||||
/**
|
||||
* Gets the packed coordinates.
|
||||
*
|
||||
*
|
||||
* @return The packed coordinates.
|
||||
*/
|
||||
public int getPackedCoordinates() {
|
||||
@@ -106,7 +106,7 @@ public final class MapFileDecoder {
|
||||
|
||||
/**
|
||||
* Gets the id of the file containing the terrain data.
|
||||
*
|
||||
*
|
||||
* @return The file id.
|
||||
*/
|
||||
public int getTerrainFile() {
|
||||
@@ -115,7 +115,7 @@ public final class MapFileDecoder {
|
||||
|
||||
/**
|
||||
* Gets the id of the file containing the object data.
|
||||
*
|
||||
*
|
||||
* @return The file id.
|
||||
*/
|
||||
public int getObjectFile() {
|
||||
@@ -124,7 +124,7 @@ public final class MapFileDecoder {
|
||||
|
||||
/**
|
||||
* Returns whether or not this MapDefinition is for a members-only area of the world.
|
||||
*
|
||||
*
|
||||
* @return {@code true} if this MapDefinition is for a members-only area, {@code false} if not.
|
||||
*/
|
||||
public boolean isMembersOnly() {
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.apollo.util.BufferUtil;
|
||||
|
||||
/**
|
||||
* Decodes npc data from the {@code npc.dat} file into {@link NpcDefinition}s.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class NpcDefinitionDecoder {
|
||||
@@ -23,7 +23,7 @@ public final class NpcDefinitionDecoder {
|
||||
|
||||
/**
|
||||
* Creates the npc definition decoder.
|
||||
*
|
||||
*
|
||||
* @param fs The indexed file system.
|
||||
*/
|
||||
public NpcDefinitionDecoder(IndexedFileSystem fs) {
|
||||
@@ -32,7 +32,7 @@ public final class NpcDefinitionDecoder {
|
||||
|
||||
/**
|
||||
* Decodes the npc definitions.
|
||||
*
|
||||
*
|
||||
* @return An array of all parsed npc definitions.
|
||||
* @throws IOException If an I/O error occurs.
|
||||
*/
|
||||
@@ -59,7 +59,7 @@ public final class NpcDefinitionDecoder {
|
||||
|
||||
/**
|
||||
* Decodes a single definition.
|
||||
*
|
||||
*
|
||||
* @param id The npc's id.
|
||||
* @param buffer The buffer.
|
||||
* @return The {@link NpcDefinition}.
|
||||
@@ -121,24 +121,20 @@ public final class NpcDefinitionDecoder {
|
||||
} else if (opcode == 102 || opcode == 103) {
|
||||
buffer.getShort();
|
||||
} else if (opcode == 106) {
|
||||
@SuppressWarnings("unused")
|
||||
int morphVariableBitsIndex = wrap(buffer.getShort());
|
||||
@SuppressWarnings("unused")
|
||||
int morphismCount = wrap(buffer.getShort());
|
||||
wrap(buffer.getShort());
|
||||
wrap(buffer.getShort());
|
||||
|
||||
int count = buffer.get() & 0xFF;
|
||||
int[] morphisms = new int[count + 1];
|
||||
Arrays.setAll(morphisms, index -> wrap(buffer.getShort()));
|
||||
} else if (opcode == 107) {
|
||||
@SuppressWarnings("unused")
|
||||
boolean clickable = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wraps a morphism value around, returning -1 if the specified value is 65,535.
|
||||
*
|
||||
*
|
||||
* @param value The value.
|
||||
* @return -1 if {@code value} is 65,535, otherwise {@code value}.
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.apollo.util.BufferUtil;
|
||||
|
||||
/**
|
||||
* Decodes object data from the {@code loc.dat} file into {@link ObjectDefinition}s.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class ObjectDefinitionDecoder {
|
||||
@@ -22,7 +22,7 @@ public final class ObjectDefinitionDecoder {
|
||||
|
||||
/**
|
||||
* Creates the decoder.
|
||||
*
|
||||
*
|
||||
* @param fs The {@link IndexedFileSystem}.
|
||||
*/
|
||||
public ObjectDefinitionDecoder(IndexedFileSystem fs) {
|
||||
@@ -31,7 +31,7 @@ public final class ObjectDefinitionDecoder {
|
||||
|
||||
/**
|
||||
* Decodes all of the data into {@link ObjectDefinition}s.
|
||||
*
|
||||
*
|
||||
* @return The definitions.
|
||||
* @throws IOException If an error occurs when decoding the archive or finding an entry.
|
||||
*/
|
||||
@@ -57,7 +57,7 @@ public final class ObjectDefinitionDecoder {
|
||||
|
||||
/**
|
||||
* Decodes data from the cache into an {@link ObjectDefinition}.
|
||||
*
|
||||
*
|
||||
* @param id The id of the object.
|
||||
* @param data The {@link ByteBuffer} containing the data.
|
||||
* @return The object definition.
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.apollo.game;
|
||||
|
||||
/**
|
||||
* Contains game-related constants.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class GameConstants {
|
||||
|
||||
@@ -5,7 +5,7 @@ import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* A class which handles the logic for each pulse of the {@link GameService}.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class GamePulseHandler implements Runnable {
|
||||
@@ -22,7 +22,7 @@ public final class GamePulseHandler implements Runnable {
|
||||
|
||||
/**
|
||||
* Creates the game pulse handler object.
|
||||
*
|
||||
*
|
||||
* @param service The {@link GameService}.
|
||||
*/
|
||||
protected GamePulseHandler(GameService service) {
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
|
||||
/**
|
||||
* The {@link GameService} class schedules and manages the execution of the {@link GamePulseHandler} class.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class GameService extends Service {
|
||||
@@ -61,7 +61,7 @@ public final class GameService extends Service {
|
||||
|
||||
/**
|
||||
* Creates the GameService.
|
||||
*
|
||||
*
|
||||
* @param world The {@link World} the GameService is for.
|
||||
* @throws Exception If an error occurs during initialization.
|
||||
*/
|
||||
@@ -72,7 +72,7 @@ public final class GameService extends Service {
|
||||
|
||||
/**
|
||||
* Finalizes the unregistration of a player.
|
||||
*
|
||||
*
|
||||
* @param player The player.
|
||||
*/
|
||||
public void finalizePlayerUnregistration(Player player) {
|
||||
@@ -83,7 +83,7 @@ public final class GameService extends Service {
|
||||
|
||||
/**
|
||||
* Gets the MessageHandlerChainSet
|
||||
*
|
||||
*
|
||||
* @return The set of MessageHandlerChain's.
|
||||
*/
|
||||
public MessageHandlerChainSet getMessageHandlerChainSet() {
|
||||
@@ -112,7 +112,7 @@ public final class GameService extends Service {
|
||||
|
||||
/**
|
||||
* Registers a {@link Player} (may block!).
|
||||
*
|
||||
*
|
||||
* @param player The Player.
|
||||
* @param session The {@link GameSession} of the Player.
|
||||
* @return A {@link RegistrationStatus}.
|
||||
@@ -133,7 +133,7 @@ public final class GameService extends Service {
|
||||
|
||||
/**
|
||||
* Shuts down this game service.
|
||||
*
|
||||
*
|
||||
* @param natural Whether or not the shutdown was expected.
|
||||
*/
|
||||
public void shutdown(boolean natural) {
|
||||
@@ -148,7 +148,7 @@ public final class GameService extends Service {
|
||||
|
||||
/**
|
||||
* Unregisters a player. Returns immediately. The player is unregistered at the start of the next cycle.
|
||||
*
|
||||
*
|
||||
* @param player The player.
|
||||
*/
|
||||
public void unregisterPlayer(Player player) {
|
||||
@@ -173,7 +173,7 @@ public final class GameService extends Service {
|
||||
|
||||
/**
|
||||
* Initializes the game service.
|
||||
*
|
||||
*
|
||||
* @throws IOException If there is an error accessing the file.
|
||||
* @throws SAXException If there is an error parsing the file.
|
||||
* @throws ReflectiveOperationException If a MessageHandler could not be created.
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.apollo.game.scheduling.ScheduledTask;
|
||||
* <strong>ALL</strong> actions <strong>MUST</strong> implement the {@link #equals(Object)} method. This is to check if
|
||||
* two actions are identical: if they are, then the new action does not replace the old one (so spam/accidental clicking
|
||||
* won't cancel your action, and start another from scratch).
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
* @param <T> The type of mob.
|
||||
*/
|
||||
@@ -27,7 +27,7 @@ public abstract class Action<T extends Mob> extends ScheduledTask {
|
||||
|
||||
/**
|
||||
* Creates a new action.
|
||||
*
|
||||
*
|
||||
* @param delay The delay in pulses.
|
||||
* @param immediate A flag indicating if the action should happen immediately.
|
||||
* @param mob The mob performing the action.
|
||||
@@ -39,7 +39,7 @@ public abstract class Action<T extends Mob> extends ScheduledTask {
|
||||
|
||||
/**
|
||||
* Gets the mob which performed the action.
|
||||
*
|
||||
*
|
||||
* @return The mob.
|
||||
*/
|
||||
public final T getMob() {
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.apollo.game.model.entity.Mob;
|
||||
|
||||
/**
|
||||
* An @{link Action} which fires when a distance requirement is met.
|
||||
*
|
||||
*
|
||||
* @author Blake
|
||||
* @author Graham
|
||||
* @param <T> The type of {@link Mob}.
|
||||
@@ -39,7 +39,7 @@ public abstract class DistancedAction<T extends Mob> extends Action<T> {
|
||||
|
||||
/**
|
||||
* Creates a new DistancedAction.
|
||||
*
|
||||
*
|
||||
* @param delay The delay between executions once the distance threshold is reached.
|
||||
* @param immediate Whether or not this action fires immediately after the distance threshold is reached.
|
||||
* @param mob The mob.
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.apollo.game.command;
|
||||
|
||||
/**
|
||||
* Represents a command.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class Command {
|
||||
@@ -19,7 +19,7 @@ public final class Command {
|
||||
|
||||
/**
|
||||
* Creates the command.
|
||||
*
|
||||
*
|
||||
* @param name The name of the command.
|
||||
* @param arguments The command's arguments.
|
||||
*/
|
||||
@@ -30,7 +30,7 @@ public final class Command {
|
||||
|
||||
/**
|
||||
* Gets the command's arguments.
|
||||
*
|
||||
*
|
||||
* @return The command's arguments.
|
||||
*/
|
||||
public String[] getArguments() {
|
||||
@@ -39,7 +39,7 @@ public final class Command {
|
||||
|
||||
/**
|
||||
* Gets the name of the command.
|
||||
*
|
||||
*
|
||||
* @return The name of the command.
|
||||
*/
|
||||
public String getName() {
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.apollo.game.model.entity.Player;
|
||||
|
||||
/**
|
||||
* A class that dispatches {@link Command}s to {@link CommandListener}s.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class CommandDispatcher {
|
||||
@@ -20,7 +20,7 @@ public final class CommandDispatcher {
|
||||
|
||||
/**
|
||||
* Initialises this CommandDispatcher.
|
||||
*
|
||||
*
|
||||
* @param authors The {@link Set} of plugin authors.
|
||||
*/
|
||||
public void init(Set<String> authors) {
|
||||
@@ -29,7 +29,7 @@ public final class CommandDispatcher {
|
||||
|
||||
/**
|
||||
* Dispatches a command to the appropriate listener.
|
||||
*
|
||||
*
|
||||
* @param player The player.
|
||||
* @param command The command.
|
||||
*/
|
||||
@@ -42,7 +42,7 @@ public final class CommandDispatcher {
|
||||
|
||||
/**
|
||||
* Registers a listener with the dispatcher.
|
||||
*
|
||||
*
|
||||
* @param command The command's name.
|
||||
* @param listener The listener.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.apollo.game.model.entity.setting.PrivilegeLevel;
|
||||
|
||||
/**
|
||||
* An interface which should be implemented to listen to {@link Command}s.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
* @author Major
|
||||
*/
|
||||
@@ -25,7 +25,7 @@ public abstract class CommandListener {
|
||||
|
||||
/**
|
||||
* Creates a new command listener.
|
||||
*
|
||||
*
|
||||
* @param level The required {@link PrivilegeLevel}.
|
||||
*/
|
||||
public CommandListener(PrivilegeLevel level) {
|
||||
@@ -34,7 +34,7 @@ public abstract class CommandListener {
|
||||
|
||||
/**
|
||||
* Executes the action for this command.
|
||||
*
|
||||
*
|
||||
* @param player The player.
|
||||
* @param command The command.
|
||||
*/
|
||||
@@ -42,7 +42,7 @@ public abstract class CommandListener {
|
||||
|
||||
/**
|
||||
* Executes a privileged command.
|
||||
*
|
||||
*
|
||||
* @param player The player.
|
||||
* @param command The command.
|
||||
*/
|
||||
|
||||
@@ -10,16 +10,16 @@ import com.google.common.collect.ImmutableSet;
|
||||
|
||||
/**
|
||||
* Implements a {@code ::credits} command that lists the authors of all plugins used in the server.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class CreditsCommandListener extends CommandListener {
|
||||
|
||||
|
||||
/**
|
||||
* The Set of authors.
|
||||
*/
|
||||
private final Set<String> authors;
|
||||
|
||||
|
||||
/**
|
||||
* Creates the CreditsCommandListener.
|
||||
*
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.apollo.game.message;
|
||||
|
||||
/**
|
||||
* A message sent by the client that can be intercepted.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
* @author Major
|
||||
*/
|
||||
@@ -22,7 +22,7 @@ public abstract class Message {
|
||||
|
||||
/**
|
||||
* Returns whether or not the Message chain has been terminated.
|
||||
*
|
||||
*
|
||||
* @return {@code true} if the Message chain has been terminated, otherwise {@code false}.
|
||||
*/
|
||||
public final boolean terminated() {
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.apollo.game.model.entity.Player;
|
||||
|
||||
/**
|
||||
* Listens for {@link Message}s received from the client.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
* @author Ryley
|
||||
* @param <M> The type of Message this class is listening for.
|
||||
@@ -28,7 +28,7 @@ public abstract class MessageHandler<M extends Message> {
|
||||
|
||||
/**
|
||||
* Handles the Message that was received.
|
||||
*
|
||||
*
|
||||
* @param player The player to handle the Message for.
|
||||
* @param message The Message.
|
||||
*/
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.google.common.base.MoreObjects;
|
||||
|
||||
/**
|
||||
* A chain of {@link MessageHandler}s
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
* @author Ryley
|
||||
* @param <M> The Message type this chain represents.
|
||||
@@ -28,7 +28,7 @@ public final class MessageHandlerChain<M extends Message> {
|
||||
|
||||
/**
|
||||
* Constructs a new {@link MessageHandlerChain}.
|
||||
*
|
||||
*
|
||||
* @param type The Class type of this chain.
|
||||
*/
|
||||
public MessageHandlerChain(Class<M> type) {
|
||||
@@ -37,7 +37,7 @@ public final class MessageHandlerChain<M extends Message> {
|
||||
|
||||
/**
|
||||
* Adds the specified {@link MessageHandler} to this chain.
|
||||
*
|
||||
*
|
||||
* @param handler The MessageHandler.
|
||||
*/
|
||||
public void addHandler(MessageHandler<M> handler) {
|
||||
@@ -46,7 +46,7 @@ public final class MessageHandlerChain<M extends Message> {
|
||||
|
||||
/**
|
||||
* Notifies each {@link MessageHandler} in this chain that a {@link Message} has been received.
|
||||
*
|
||||
*
|
||||
* @param player The Player to handle this message for.
|
||||
* @param message The Message.
|
||||
* @return {@code true} if and only if the Message propagated down the chain without being terminated, otherwise
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.apollo.game.model.entity.Player;
|
||||
|
||||
/**
|
||||
* A group of {@link MessageHandlerChain}s classified by the {@link Message} type.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
* @author Ryley
|
||||
* @author Major
|
||||
@@ -21,7 +21,7 @@ public final class MessageHandlerChainSet {
|
||||
|
||||
/**
|
||||
* Notifies the appropriate {@link MessageHandlerChain} that a {@link Message} has been received.
|
||||
*
|
||||
*
|
||||
* @param message The Message.
|
||||
* @return {@code true} if the Message propagated down the chain without being terminated or if the chain for the
|
||||
* Message was not found, otherwise {@code false}.
|
||||
@@ -29,12 +29,12 @@ public final class MessageHandlerChainSet {
|
||||
public <M extends Message> boolean notify(Player player, M message) {
|
||||
@SuppressWarnings("unchecked")
|
||||
MessageHandlerChain<M> chain = (MessageHandlerChain<M>) chains.get(message.getClass());
|
||||
return (chain == null) || chain.notify(player, message);
|
||||
return chain == null || chain.notify(player, message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Places the {@link MessageHandlerChain} into this set.
|
||||
*
|
||||
*
|
||||
* @param clazz The {@link Class} to associate the MessageHandlerChain with.
|
||||
* @param handler The MessageHandlerChain.
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.apollo.game.model.entity.Player;
|
||||
|
||||
/**
|
||||
* A {@link MessageHandler} that responds to {@link ButtonMessage}s for withdrawing items as notes.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class BankButtonMessageHandler extends MessageHandler<ButtonMessage> {
|
||||
|
||||
@@ -12,14 +12,14 @@ import org.apollo.game.model.inter.bank.BankWithdrawEnterAmountListener;
|
||||
|
||||
/**
|
||||
* A {@link MessageHandler} that handles withdrawing and depositing items from/to a player's bank.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class BankMessageHandler extends MessageHandler<ItemActionMessage> {
|
||||
|
||||
/**
|
||||
* Converts an option to an amount.
|
||||
*
|
||||
*
|
||||
* @param option The option.
|
||||
* @return The amount.
|
||||
* @throws IllegalArgumentException If the option is invalid.
|
||||
@@ -63,7 +63,7 @@ public final class BankMessageHandler extends MessageHandler<ItemActionMessage>
|
||||
|
||||
/**
|
||||
* Handles a deposit action.
|
||||
*
|
||||
*
|
||||
* @param player The player.
|
||||
* @param message The message.
|
||||
*/
|
||||
@@ -80,7 +80,7 @@ public final class BankMessageHandler extends MessageHandler<ItemActionMessage>
|
||||
|
||||
/**
|
||||
* Handles a withdraw action.
|
||||
*
|
||||
*
|
||||
* @param player The player.
|
||||
* @param message The message.
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.apollo.game.sync.block.SynchronizationBlock;
|
||||
|
||||
/**
|
||||
* A {@link MessageHandler} that broadcasts public chat messages.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class ChatMessageHandler extends MessageHandler<ChatMessage> {
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.apollo.game.model.entity.Player;
|
||||
|
||||
/**
|
||||
* A {@link MessageHandler} that verifies {@link ChatMessage}s.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class ChatVerificationHandler extends MessageHandler<ChatMessage> {
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.apollo.game.model.entity.Player;
|
||||
|
||||
/**
|
||||
* A {@link MessageHandler} for the {@link ClosedInterfaceMessage}.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class ClosedInterfaceMessageHandler extends MessageHandler<ClosedInterfaceMessage> {
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.apollo.game.model.entity.Player;
|
||||
|
||||
/**
|
||||
* A {@link MessageHandler} that dispatches {@link CommandMessage}s.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class CommandMessageHandler extends MessageHandler<CommandMessage> {
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.apollo.game.model.inter.InterfaceType;
|
||||
/**
|
||||
* A {@link MessageHandler} which intercepts button clicks on dialogues, and forwards the message to the current
|
||||
* listener.
|
||||
*
|
||||
*
|
||||
* @author Chris Fletcher
|
||||
*/
|
||||
public final class DialogueButtonHandler extends MessageHandler<ButtonMessage> {
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.apollo.game.model.inter.InterfaceType;
|
||||
|
||||
/**
|
||||
* A {@link MessageHandler} for the {@link DialogueContinueMessage}.
|
||||
*
|
||||
*
|
||||
* @author Chris Fletcher
|
||||
*/
|
||||
public final class DialogueContinueMessageHandler extends MessageHandler<DialogueContinueMessage> {
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.apollo.game.model.entity.Player;
|
||||
|
||||
/**
|
||||
* A {@link MessageHandler} for the {@link EnteredAmountMessage}.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class EnteredAmountMessageHandler extends MessageHandler<EnteredAmountMessage> {
|
||||
|
||||
@@ -14,13 +14,13 @@ import org.apollo.util.LanguageUtil;
|
||||
|
||||
/**
|
||||
* A {@link MessageHandler} that equips items.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
* @author Graham
|
||||
* @author Ryley
|
||||
*/
|
||||
public final class EquipItemHandler extends MessageHandler<ItemOptionMessage> {
|
||||
|
||||
|
||||
/**
|
||||
* The option used when equipping an item.
|
||||
*/
|
||||
@@ -98,8 +98,7 @@ public final class EquipItemHandler extends MessageHandler<ItemOptionMessage> {
|
||||
return;
|
||||
}
|
||||
|
||||
if (definition.getSlot() == EquipmentConstants.SHIELD && weapon != null
|
||||
&& EquipmentDefinition.lookup(weapon.getId()).isTwoHanded()) {
|
||||
if (definition.getSlot() == EquipmentConstants.SHIELD && weapon != null && EquipmentDefinition.lookup(weapon.getId()).isTwoHanded()) {
|
||||
equipment.set(EquipmentConstants.SHIELD, inventory.reset(inventorySlot));
|
||||
inventory.add(equipment.reset(EquipmentConstants.WEAPON));
|
||||
return;
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.apollo.game.model.inv.SynchronizationInventoryListener;
|
||||
|
||||
/**
|
||||
* A {@link MessageHandler} that verifies the target item in {@link ItemOnItemMessage}s.
|
||||
*
|
||||
*
|
||||
* @author Chris Fletcher
|
||||
*/
|
||||
public final class ItemOnItemVerificationHandler extends MessageHandler<ItemOnItemMessage> {
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.apollo.game.model.inv.SynchronizationInventoryListener;
|
||||
|
||||
/**
|
||||
* A {@link MessageHandler} that verifies {@link ItemOnObjectMessage}s.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class ItemOnObjectVerificationHandler extends MessageHandler<ItemOnObjectMessage> {
|
||||
@@ -27,8 +27,7 @@ public final class ItemOnObjectVerificationHandler extends MessageHandler<ItemOn
|
||||
|
||||
@Override
|
||||
public void handle(Player player, ItemOnObjectMessage message) {
|
||||
if (message.getInterfaceId() != SynchronizationInventoryListener.INVENTORY_ID
|
||||
&& message.getInterfaceId() != BankConstants.SIDEBAR_INVENTORY_ID) {
|
||||
if (message.getInterfaceId() != SynchronizationInventoryListener.INVENTORY_ID && message.getInterfaceId() != BankConstants.SIDEBAR_INVENTORY_ID) {
|
||||
message.terminate();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.apollo.game.model.inv.SynchronizationInventoryListener;
|
||||
|
||||
/**
|
||||
* A {@link MessageHandler} that verifies {@link InventoryItemMessage}s.
|
||||
*
|
||||
*
|
||||
* @author Chris Fletcher
|
||||
* @author Major
|
||||
*/
|
||||
@@ -31,7 +31,7 @@ public final class ItemVerificationHandler extends MessageHandler<InventoryItemM
|
||||
|
||||
/**
|
||||
* A supplier for an {@link Inventory}.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
@FunctionalInterface
|
||||
@@ -39,7 +39,7 @@ public final class ItemVerificationHandler extends MessageHandler<InventoryItemM
|
||||
|
||||
/**
|
||||
* Gets the appropriate {@link Inventory}.
|
||||
*
|
||||
*
|
||||
* @param player The {@link Player} who prompted the verification call.
|
||||
* @return The inventory. Must not be {@code null}.
|
||||
*/
|
||||
@@ -62,7 +62,7 @@ public final class ItemVerificationHandler extends MessageHandler<InventoryItemM
|
||||
/**
|
||||
* Adds an {@link Inventory} with the specified interface id to the {@link Map} of supported ones,
|
||||
* <strong>iff</strong> the specified id does <strong>not</strong> already have a mapping.
|
||||
*
|
||||
*
|
||||
* @param id The id of the interface.
|
||||
* @param supplier The {@link InventorySupplier}.
|
||||
*/
|
||||
|
||||
@@ -15,14 +15,14 @@ import org.apollo.game.model.entity.obj.GameObject;
|
||||
|
||||
/**
|
||||
* A verification {@link MessageHandler} for the {@link ObjectActionMessage}.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class ObjectActionVerificationHandler extends MessageHandler<ObjectActionMessage> {
|
||||
|
||||
/**
|
||||
* Indicates whether or not the {@link List} of {@link GameObject}s contains the object with the specified id.
|
||||
*
|
||||
*
|
||||
* @param id The id of the object.
|
||||
* @param objects The list of objects.
|
||||
* @return {@code true} if the list does contain the object with the specified id, otherwise {@code false}.
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.apollo.util.MobRepository;
|
||||
|
||||
/**
|
||||
* A verification {@link MessageHandler} for the {@link PlayerActionMessage}.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class PlayerActionVerificationHandler extends MessageHandler<PlayerActionMessage> {
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.apollo.game.model.entity.Player;
|
||||
|
||||
/**
|
||||
* A {@link MessageHandler} that handles {@link PlayerDesignMessage}s.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class PlayerDesignMessageHandler extends MessageHandler<PlayerDesignMessage> {
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.apollo.game.model.entity.setting.Gender;
|
||||
|
||||
/**
|
||||
* A {@link MessageHandler} that verifies {@link PlayerDesignMessage}s.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class PlayerDesignVerificationHandler extends MessageHandler<PlayerDesignMessage> {
|
||||
@@ -32,7 +32,7 @@ public final class PlayerDesignVerificationHandler extends MessageHandler<Player
|
||||
|
||||
/**
|
||||
* Checks if an appearance combination is valid.
|
||||
*
|
||||
*
|
||||
* @param appearance The appearance combination.
|
||||
* @return {@code true} if so, {@code false} if not.
|
||||
*/
|
||||
@@ -58,7 +58,7 @@ public final class PlayerDesignVerificationHandler extends MessageHandler<Player
|
||||
|
||||
/**
|
||||
* Checks if a {@link Gender#FEMALE} style combination is valid.
|
||||
*
|
||||
*
|
||||
* @param appearance The appearance combination.
|
||||
* @return {@code true} if so, {@code false} if not.
|
||||
*/
|
||||
@@ -78,7 +78,7 @@ public final class PlayerDesignVerificationHandler extends MessageHandler<Player
|
||||
|
||||
/**
|
||||
* Checks if a {@link Gender#MALE} style combination is valid.
|
||||
*
|
||||
*
|
||||
* @param appearance The appearance combination.
|
||||
* @return {@code true} if so, {@code false} if not.
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.apollo.game.model.inv.SynchronizationInventoryListener;
|
||||
|
||||
/**
|
||||
* A {@link MessageHandler} that removes equipped items.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
* @author Major
|
||||
*/
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.apollo.game.model.inv.SynchronizationInventoryListener;
|
||||
/**
|
||||
* A {@link MessageHandler} which updates an {@link Inventory} when the client sends a {@link SwitchItemMessage} to the
|
||||
* server.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class SwitchItemMessageHandler extends MessageHandler<SwitchItemMessage> {
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.apollo.game.model.entity.WalkingQueue;
|
||||
|
||||
/**
|
||||
* A {@link MessageHandler} that handles {@link WalkMessage}s.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class WalkMessageHandler extends MessageHandler<WalkMessage> {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.apollo.game.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent by the client when a player adds someone to their friends list.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class AddFriendMessage extends Message {
|
||||
@@ -16,7 +16,7 @@ public final class AddFriendMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates a new befriend user message.
|
||||
*
|
||||
*
|
||||
* @param username The befriended player's username.
|
||||
*/
|
||||
public AddFriendMessage(String username) {
|
||||
@@ -25,7 +25,7 @@ public final class AddFriendMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the username of the befriended player.
|
||||
*
|
||||
*
|
||||
* @return The username.
|
||||
*/
|
||||
public String getUsername() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.apollo.game.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent by the client when a player adds someone to their ignore list.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class AddIgnoreMessage extends Message {
|
||||
@@ -16,7 +16,7 @@ public final class AddIgnoreMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates a new ignore player message.
|
||||
*
|
||||
*
|
||||
* @param username The ignored player's username.
|
||||
*/
|
||||
public AddIgnoreMessage(String username) {
|
||||
@@ -25,7 +25,7 @@ public final class AddIgnoreMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the username of the ignored player.
|
||||
*
|
||||
*
|
||||
* @return The username.
|
||||
*/
|
||||
public String getUsername() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.apollo.game.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent by the client when the user has pressed an arrow key.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class ArrowKeyMessage extends Message {
|
||||
@@ -21,7 +21,7 @@ public final class ArrowKeyMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates a new arrow key message.
|
||||
*
|
||||
*
|
||||
* @param roll The camera roll.
|
||||
* @param yaw The camera yaw.
|
||||
*/
|
||||
@@ -32,7 +32,7 @@ public final class ArrowKeyMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the roll of the camera.
|
||||
*
|
||||
*
|
||||
* @return The roll.
|
||||
*/
|
||||
public int getRoll() {
|
||||
@@ -41,7 +41,7 @@ public final class ArrowKeyMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the yaw of the camera.
|
||||
*
|
||||
*
|
||||
* @return The yaw.
|
||||
*/
|
||||
public int getYaw() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.apollo.game.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent by the client when a player clicks a button.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class ButtonMessage extends Message {
|
||||
@@ -16,7 +16,7 @@ public final class ButtonMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates the button message.
|
||||
*
|
||||
*
|
||||
* @param widgetId The widget id.
|
||||
*/
|
||||
public ButtonMessage(int widgetId) {
|
||||
@@ -25,7 +25,7 @@ public final class ButtonMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the widget id.
|
||||
*
|
||||
*
|
||||
* @return The widget id.
|
||||
*/
|
||||
public int getWidgetId() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.apollo.game.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent by the client to send a public chat message to other players.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class ChatMessage extends Message {
|
||||
@@ -31,7 +31,7 @@ public final class ChatMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates a new chat message.
|
||||
*
|
||||
*
|
||||
* @param message The message.
|
||||
* @param compressedMessage The compressed message.
|
||||
* @param color The text color.
|
||||
@@ -46,7 +46,7 @@ public final class ChatMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the compressed message.
|
||||
*
|
||||
*
|
||||
* @return The compressed message.
|
||||
*/
|
||||
public byte[] getCompressedMessage() {
|
||||
@@ -55,7 +55,7 @@ public final class ChatMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the message.
|
||||
*
|
||||
*
|
||||
* @return The message.
|
||||
*/
|
||||
public String getMessage() {
|
||||
@@ -64,7 +64,7 @@ public final class ChatMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the text color.
|
||||
*
|
||||
*
|
||||
* @return The text color.
|
||||
*/
|
||||
public int getTextColor() {
|
||||
@@ -73,7 +73,7 @@ public final class ChatMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the text effects.
|
||||
*
|
||||
*
|
||||
* @return The text effects.
|
||||
*/
|
||||
public int getTextEffects() {
|
||||
|
||||
@@ -23,7 +23,7 @@ public final class ClearRegionMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates the ClearRegionMessage.
|
||||
*
|
||||
*
|
||||
* @param player The {@link Position} of the Player this {@link Message} is being sent to.
|
||||
* @param region The {@link RegionCoordinates} of the Region being cleared.
|
||||
*/
|
||||
@@ -34,7 +34,7 @@ public final class ClearRegionMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the {@link Position} of the Player this {@link Message} is being sent to..
|
||||
*
|
||||
*
|
||||
* @return The Position.
|
||||
*/
|
||||
public Position getPlayerPosition() {
|
||||
@@ -43,7 +43,7 @@ public final class ClearRegionMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the {@link Position} of the Region being cleared.
|
||||
*
|
||||
*
|
||||
* @return The Position.
|
||||
*/
|
||||
public Position getRegionPosition() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.apollo.game.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent to the client that closes the open interface.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class CloseInterfaceMessage extends Message {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.apollo.game.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent by the client when the current interface is closed.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class ClosedInterfaceMessage extends Message {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.apollo.game.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent by the client to send a {@code ::} command.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class CommandMessage extends Message {
|
||||
@@ -16,7 +16,7 @@ public final class CommandMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates the command message.
|
||||
*
|
||||
*
|
||||
* @param command The command.
|
||||
*/
|
||||
public CommandMessage(String command) {
|
||||
@@ -25,7 +25,7 @@ public final class CommandMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the command.
|
||||
*
|
||||
*
|
||||
* @return The command.
|
||||
*/
|
||||
public String getCommand() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.apollo.game.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent to the client to adjust a certain config or attribute setting.
|
||||
*
|
||||
*
|
||||
* @author Chris Fletcher
|
||||
*/
|
||||
public final class ConfigMessage extends Message {
|
||||
@@ -21,7 +21,7 @@ public final class ConfigMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates a new config message.
|
||||
*
|
||||
*
|
||||
* @param id The config's identifier.
|
||||
* @param value The value.
|
||||
*/
|
||||
@@ -32,7 +32,7 @@ public final class ConfigMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the config's identifier.
|
||||
*
|
||||
*
|
||||
* @return The config id.
|
||||
*/
|
||||
public int getId() {
|
||||
@@ -41,7 +41,7 @@ public final class ConfigMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the config's value.
|
||||
*
|
||||
*
|
||||
* @return The config value.
|
||||
*/
|
||||
public int getValue() {
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.apollo.game.message.Message;
|
||||
/**
|
||||
* A {@link Message} sent by the client when the player clicks the "Click here to continue" button on a dialogue
|
||||
* interface.
|
||||
*
|
||||
*
|
||||
* @author Chris Fletcher
|
||||
*/
|
||||
public final class DialogueContinueMessage extends Message {
|
||||
@@ -17,7 +17,7 @@ public final class DialogueContinueMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates a new dialogue continue message.
|
||||
*
|
||||
*
|
||||
* @param interfaceId The interface id.
|
||||
*/
|
||||
public DialogueContinueMessage(int interfaceId) {
|
||||
@@ -26,7 +26,7 @@ public final class DialogueContinueMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the interface id of the button.
|
||||
*
|
||||
*
|
||||
* @return The interface id.
|
||||
*/
|
||||
public int getInterfaceId() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.apollo.game.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent to the client to display crossbones when the player enters a multi-combat zone.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class DisplayCrossbonesMessage extends Message {
|
||||
@@ -16,7 +16,7 @@ public final class DisplayCrossbonesMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates a display crossbones message.
|
||||
*
|
||||
*
|
||||
* @param display Whether or not the crossbones should be displayed.
|
||||
*/
|
||||
public DisplayCrossbonesMessage(boolean display) {
|
||||
@@ -25,7 +25,7 @@ public final class DisplayCrossbonesMessage extends Message {
|
||||
|
||||
/**
|
||||
* Indicates whether the crossbones will be displayed.
|
||||
*
|
||||
*
|
||||
* @return {@code true} if the crossbones will be displayed, otherwise {@code false}.
|
||||
*/
|
||||
public boolean isDisplayed() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.apollo.game.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent to the client to change the currently displayed tab interface.
|
||||
*
|
||||
*
|
||||
* @author Chris Fletcher
|
||||
*/
|
||||
public final class DisplayTabInterfaceMessage extends Message {
|
||||
@@ -16,7 +16,7 @@ public final class DisplayTabInterfaceMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates a new display tab interface message.
|
||||
*
|
||||
*
|
||||
* @param tab The index of the tab to display.
|
||||
*/
|
||||
public DisplayTabInterfaceMessage(int tab) {
|
||||
@@ -25,7 +25,7 @@ public final class DisplayTabInterfaceMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the index of the tab to display.
|
||||
*
|
||||
*
|
||||
* @return The tab index.
|
||||
*/
|
||||
public int getTab() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.apollo.game.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent to the client to open up the enter amount interface.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class EnterAmountMessage extends Message {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.apollo.game.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent by the client when the player has entered an amount.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class EnteredAmountMessage extends Message {
|
||||
@@ -16,7 +16,7 @@ public final class EnteredAmountMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates the entered amount message.
|
||||
*
|
||||
*
|
||||
* @param amount The amount.
|
||||
*/
|
||||
public EnteredAmountMessage(int amount) {
|
||||
@@ -25,7 +25,7 @@ public final class EnteredAmountMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the amount.
|
||||
*
|
||||
*
|
||||
* @return The amount.
|
||||
*/
|
||||
public int getAmount() {
|
||||
|
||||
@@ -2,14 +2,14 @@ package org.apollo.game.message.impl;
|
||||
|
||||
/**
|
||||
* The fifth {@link ItemActionMessage}.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class FifthItemActionMessage extends ItemActionMessage {
|
||||
|
||||
/**
|
||||
* Creates the fifth item action message.
|
||||
*
|
||||
*
|
||||
* @param interfaceId The interface id.
|
||||
* @param id The item id.
|
||||
* @param slot The item slot.
|
||||
|
||||
@@ -2,14 +2,14 @@ package org.apollo.game.message.impl;
|
||||
|
||||
/**
|
||||
* The fifth {@link ItemOptionMessage}.
|
||||
*
|
||||
*
|
||||
* @author Chris Fletcher
|
||||
*/
|
||||
public final class FifthItemOptionMessage extends ItemOptionMessage {
|
||||
|
||||
/**
|
||||
* Creates the fifth item option message.
|
||||
*
|
||||
*
|
||||
* @param interfaceId The interface id.
|
||||
* @param id The id.
|
||||
* @param slot The slot.
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.apollo.game.message.impl;
|
||||
|
||||
/**
|
||||
* The fifth {@link NpcActionMessage}.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
* @author Stuart
|
||||
*/
|
||||
|
||||
@@ -2,14 +2,14 @@ package org.apollo.game.message.impl;
|
||||
|
||||
/**
|
||||
* The fifth {@link PlayerActionMessage}.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class FifthPlayerActionMessage extends PlayerActionMessage {
|
||||
|
||||
/**
|
||||
* Creates a fifth player action message.
|
||||
*
|
||||
*
|
||||
* @param playerIndex The index of the clicked player.
|
||||
*/
|
||||
public FifthPlayerActionMessage(int playerIndex) {
|
||||
|
||||
@@ -2,14 +2,14 @@ package org.apollo.game.message.impl;
|
||||
|
||||
/**
|
||||
* The first {@link ItemActionMessage}.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class FirstItemActionMessage extends ItemActionMessage {
|
||||
|
||||
/**
|
||||
* Creates the first item action message.
|
||||
*
|
||||
*
|
||||
* @param interfaceId The interface id.
|
||||
* @param id The item id.
|
||||
* @param slot The item slot.
|
||||
|
||||
@@ -2,14 +2,14 @@ package org.apollo.game.message.impl;
|
||||
|
||||
/**
|
||||
* The first {@link ItemOptionMessage}.
|
||||
*
|
||||
*
|
||||
* @author Chris Fletcher
|
||||
*/
|
||||
public final class FirstItemOptionMessage extends ItemOptionMessage {
|
||||
|
||||
/**
|
||||
* Creates the first item option message.
|
||||
*
|
||||
*
|
||||
* @param interfaceId The interface id.
|
||||
* @param id The id.
|
||||
* @param slot The slot.
|
||||
|
||||
@@ -2,14 +2,14 @@ package org.apollo.game.message.impl;
|
||||
|
||||
/**
|
||||
* The first {@link NpcActionMessage}.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class FirstNpcActionMessage extends NpcActionMessage {
|
||||
|
||||
/**
|
||||
* Creates a new first npc action message.
|
||||
*
|
||||
*
|
||||
* @param index The index of the npc.
|
||||
*/
|
||||
public FirstNpcActionMessage(int index) {
|
||||
|
||||
@@ -4,14 +4,14 @@ import org.apollo.game.model.Position;
|
||||
|
||||
/**
|
||||
* The first {@link ObjectActionMessage}.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class FirstObjectActionMessage extends ObjectActionMessage {
|
||||
|
||||
/**
|
||||
* Creates the first object action message.
|
||||
*
|
||||
*
|
||||
* @param id The id.
|
||||
* @param position The position.
|
||||
*/
|
||||
|
||||
@@ -2,14 +2,14 @@ package org.apollo.game.message.impl;
|
||||
|
||||
/**
|
||||
* The first {@link PlayerActionMessage}.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class FirstPlayerActionMessage extends PlayerActionMessage {
|
||||
|
||||
/**
|
||||
* Creates a first player action message.
|
||||
*
|
||||
*
|
||||
* @param playerIndex The index of the clicked player.
|
||||
*/
|
||||
public FirstPlayerActionMessage(int playerIndex) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.apollo.game.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent by the client when the player clicks with their mouse (or mousekeys etc).
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class FlaggedMouseEventMessage extends Message {
|
||||
@@ -32,7 +32,7 @@ public final class FlaggedMouseEventMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates a new mouse click message.
|
||||
*
|
||||
*
|
||||
* @param clickCount The number of clicks on this point.
|
||||
* @param x The x coordinate of the mouse click.
|
||||
* @param y The y coordinate of the mouse click.
|
||||
@@ -47,7 +47,7 @@ public final class FlaggedMouseEventMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the number of clicks on this point - maximum value of 2047.
|
||||
*
|
||||
*
|
||||
* @return The number of clicks.
|
||||
*/
|
||||
public int getClickCount() {
|
||||
@@ -56,7 +56,7 @@ public final class FlaggedMouseEventMessage extends Message {
|
||||
|
||||
/**
|
||||
* The x coordinate of the click.
|
||||
*
|
||||
*
|
||||
* @return The x coordinate.
|
||||
*/
|
||||
public int getX() {
|
||||
@@ -65,7 +65,7 @@ public final class FlaggedMouseEventMessage extends Message {
|
||||
|
||||
/**
|
||||
* The y coordinate of the click.
|
||||
*
|
||||
*
|
||||
* @return The y coordinate.
|
||||
*/
|
||||
public int getY() {
|
||||
@@ -75,7 +75,7 @@ public final class FlaggedMouseEventMessage extends Message {
|
||||
/**
|
||||
* Gets the value indicating whether the {@link #x} and {@link #y} values represent the deviation from the last
|
||||
* click or an actual point.
|
||||
*
|
||||
*
|
||||
* @return The value.
|
||||
*/
|
||||
public boolean getDelta() {
|
||||
|
||||
@@ -25,7 +25,7 @@ public final class FlashTabInterfaceMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the id of the tab to flash.
|
||||
*
|
||||
*
|
||||
* @return The id.
|
||||
*/
|
||||
public int getTab() {
|
||||
|
||||
@@ -25,7 +25,7 @@ public final class FlashingTabClickedMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the index of the tab that was clicked.
|
||||
*
|
||||
*
|
||||
* @return The tab index.
|
||||
*/
|
||||
public int getTab() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.apollo.game.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent by the client to indicate a change in the client's focus (i.e. if it is the active window).
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class FocusUpdateMessage extends Message {
|
||||
@@ -16,7 +16,7 @@ public final class FocusUpdateMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates a new focus update message.
|
||||
*
|
||||
*
|
||||
* @param focused The data received.
|
||||
*/
|
||||
public FocusUpdateMessage(boolean focused) {
|
||||
@@ -25,7 +25,7 @@ public final class FocusUpdateMessage extends Message {
|
||||
|
||||
/**
|
||||
* Indicates whether or not the client is focused.
|
||||
*
|
||||
*
|
||||
* @return {@code true} if the client is focused, otherwise {@code false}.
|
||||
*/
|
||||
public boolean isFocused() {
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.apollo.game.model.entity.setting.PrivilegeLevel;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent to the client that forwards a private chat.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class ForwardPrivateChatMessage extends Message {
|
||||
@@ -27,20 +27,20 @@ public final class ForwardPrivateChatMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates a new forward private message message.
|
||||
*
|
||||
*
|
||||
* @param username The username of the player sending the message.
|
||||
* @param level The {@link PrivilegeLevel} of the player sending the message.
|
||||
* @param message The compressed message.
|
||||
*/
|
||||
public ForwardPrivateChatMessage(String username, PrivilegeLevel level, byte[] message) {
|
||||
this.username = username;
|
||||
this.privilege = level;
|
||||
privilege = level;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the username of the sender.
|
||||
*
|
||||
*
|
||||
* @return The username.
|
||||
*/
|
||||
public String getSenderUsername() {
|
||||
@@ -49,7 +49,7 @@ public final class ForwardPrivateChatMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the {@link PrivilegeLevel} of the sender.
|
||||
*
|
||||
*
|
||||
* @return The privilege level.
|
||||
*/
|
||||
public PrivilegeLevel getSenderPrivilege() {
|
||||
@@ -58,7 +58,7 @@ public final class ForwardPrivateChatMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the compressed message.
|
||||
*
|
||||
*
|
||||
* @return The message.
|
||||
*/
|
||||
public byte[] getCompressedMessage() {
|
||||
|
||||
@@ -2,14 +2,14 @@ package org.apollo.game.message.impl;
|
||||
|
||||
/**
|
||||
* The fourth {@link ItemActionMessage}.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class FourthItemActionMessage extends ItemActionMessage {
|
||||
|
||||
/**
|
||||
* Creates the fourth item action message.
|
||||
*
|
||||
*
|
||||
* @param interfaceId The interface id.
|
||||
* @param id The item id.
|
||||
* @param slot The item slot.
|
||||
|
||||
@@ -2,14 +2,14 @@ package org.apollo.game.message.impl;
|
||||
|
||||
/**
|
||||
* The fourth {@link ItemOptionMessage}.
|
||||
*
|
||||
*
|
||||
* @author Chris Fletcher
|
||||
*/
|
||||
public final class FourthItemOptionMessage extends ItemOptionMessage {
|
||||
|
||||
/**
|
||||
* Creates the fourth item option message.
|
||||
*
|
||||
*
|
||||
* @param interfaceId The interface id.
|
||||
* @param id The id.
|
||||
* @param slot The slot.
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.apollo.game.message.impl;
|
||||
|
||||
/**
|
||||
* The fourth {@link NpcActionMessage}.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
* @author Stuart
|
||||
*/
|
||||
@@ -10,7 +10,7 @@ public final class FourthNpcActionMessage extends NpcActionMessage {
|
||||
|
||||
/**
|
||||
* Creates the FourthNpcActionMessage.
|
||||
*
|
||||
*
|
||||
* @param index The index of the Npc.
|
||||
*/
|
||||
public FourthNpcActionMessage(int index) {
|
||||
|
||||
@@ -2,14 +2,14 @@ package org.apollo.game.message.impl;
|
||||
|
||||
/**
|
||||
* The fourth {@link PlayerActionMessage}.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class FourthPlayerActionMessage extends PlayerActionMessage {
|
||||
|
||||
/**
|
||||
* Creates a fourth player action message.
|
||||
*
|
||||
*
|
||||
* @param playerIndex The index of the clicked player.
|
||||
*/
|
||||
public FourthPlayerActionMessage(int playerIndex) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.apollo.game.model.entity.setting.ServerStatus;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent to the client to update the friend server status.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class FriendServerStatusMessage extends Message {
|
||||
@@ -17,7 +17,7 @@ public final class FriendServerStatusMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates a new friend server status message.
|
||||
*
|
||||
*
|
||||
* @param status The status.
|
||||
*/
|
||||
public FriendServerStatusMessage(ServerStatus status) {
|
||||
@@ -26,7 +26,7 @@ public final class FriendServerStatusMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the status code of the friend server.
|
||||
*
|
||||
*
|
||||
* @return The status code.
|
||||
*/
|
||||
public int getStatusCode() {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package org.apollo.game.message.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apollo.game.message.Message;
|
||||
import org.apollo.game.model.Position;
|
||||
import org.apollo.game.model.area.RegionCoordinates;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent to the client that contains multiple
|
||||
*
|
||||
@@ -30,20 +30,20 @@ public final class GroupedRegionUpdateMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates the GroupedRegionUpdateMessage.
|
||||
*
|
||||
*
|
||||
* @param lastKnownRegion The last known region {@link Position} of the Player.
|
||||
* @param coordinates The {@link RegionCoordinates} of the Region being updated.
|
||||
* @param messages The {@link List} of {@link RegionUpdateMessage}s.
|
||||
*/
|
||||
public GroupedRegionUpdateMessage(Position lastKnownRegion, RegionCoordinates coordinates, List<RegionUpdateMessage> messages) {
|
||||
this.lastKnownRegion = lastKnownRegion;
|
||||
this.region = new Position(coordinates.getAbsoluteX(), coordinates.getAbsoluteY());
|
||||
region = new Position(coordinates.getAbsoluteX(), coordinates.getAbsoluteY());
|
||||
this.messages = messages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the {@link Position} of the Player.
|
||||
*
|
||||
*
|
||||
* @return The Position.
|
||||
*/
|
||||
public Position getLastKnownRegion() {
|
||||
@@ -52,7 +52,7 @@ public final class GroupedRegionUpdateMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the {@link List} of {@link RegionUpdateMessage}s.
|
||||
*
|
||||
*
|
||||
* @return The Collection.
|
||||
*/
|
||||
public List<RegionUpdateMessage> getMessages() {
|
||||
@@ -61,7 +61,7 @@ public final class GroupedRegionUpdateMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the {@link Position} of the Region these updates affect.
|
||||
*
|
||||
*
|
||||
* @return The Position.
|
||||
*/
|
||||
public Position getRegionPosition() {
|
||||
|
||||
@@ -47,7 +47,7 @@ public final class HintIconMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the value of this type.
|
||||
*
|
||||
*
|
||||
* @return The value.
|
||||
*/
|
||||
public int getValue() {
|
||||
@@ -58,7 +58,7 @@ public final class HintIconMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates a HintIconMessage for the Npc with the specified index.
|
||||
*
|
||||
*
|
||||
* @param index The index of the Npc.
|
||||
* @return The HintIconMessage.
|
||||
*/
|
||||
@@ -68,7 +68,7 @@ public final class HintIconMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates a HintIconMessage for the Player with the specified index.
|
||||
*
|
||||
*
|
||||
* @param index The index of the Player.
|
||||
* @return The HintIconMessage.
|
||||
*/
|
||||
@@ -78,7 +78,7 @@ public final class HintIconMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates a HintIconMessage that removes the current Npc hint icon.
|
||||
*
|
||||
*
|
||||
* @return The HintIconMessage.
|
||||
*/
|
||||
public static HintIconMessage resetNpc() {
|
||||
@@ -87,7 +87,7 @@ public final class HintIconMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates a HintIconMessage that removes the current Player hint icon.
|
||||
*
|
||||
*
|
||||
* @return The HintIconMessage.
|
||||
*/
|
||||
public static HintIconMessage resetPlayer() {
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.apollo.game.model.entity.setting.MembershipStatus;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent to the client that specifies the local id and membership status of the current player.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class IdAssignmentMessage extends Message {
|
||||
@@ -22,7 +22,7 @@ public final class IdAssignmentMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates the local id message.
|
||||
*
|
||||
*
|
||||
* @param id The id.
|
||||
* @param members The MembershipStatus.
|
||||
*/
|
||||
@@ -33,7 +33,7 @@ public final class IdAssignmentMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the id.
|
||||
*
|
||||
*
|
||||
* @return The id.
|
||||
*/
|
||||
public int getId() {
|
||||
@@ -42,7 +42,7 @@ public final class IdAssignmentMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets whether or not the Player is a {@link MembershipStatus#PAID paying member}.
|
||||
*
|
||||
*
|
||||
* @return {@code true} if the Player is a paying member, {@code false} if not.
|
||||
*/
|
||||
public boolean isMembers() {
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.apollo.game.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent to the client that updates the ignored user list.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class IgnoreListMessage extends Message {
|
||||
@@ -18,7 +18,7 @@ public final class IgnoreListMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates a new ignore list message.
|
||||
*
|
||||
*
|
||||
* @param usernames The {@link List} of usernames to send.
|
||||
*/
|
||||
public IgnoreListMessage(List<String> usernames) {
|
||||
@@ -27,7 +27,7 @@ public final class IgnoreListMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the list of ignored usernames.
|
||||
*
|
||||
*
|
||||
* @return The usernames.
|
||||
*/
|
||||
public List<String> getUsernames() {
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.apollo.game.message.Message;
|
||||
/**
|
||||
* A {@link Message} that represents some sort of action on an item in an inventory. Note that this is the parent of
|
||||
* both item option and item action message, and so cannot be used to determine when one of those messages is fired.
|
||||
*
|
||||
*
|
||||
* @author Chris Fletcher
|
||||
*/
|
||||
public abstract class InventoryItemMessage extends Message {
|
||||
@@ -32,7 +32,7 @@ public abstract class InventoryItemMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates the item action message.
|
||||
*
|
||||
*
|
||||
* @param option The option number.
|
||||
* @param interfaceId The interface id.
|
||||
* @param id The id.
|
||||
@@ -47,7 +47,7 @@ public abstract class InventoryItemMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the item id.
|
||||
*
|
||||
*
|
||||
* @return The item id.
|
||||
*/
|
||||
public final int getId() {
|
||||
@@ -56,7 +56,7 @@ public abstract class InventoryItemMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the interface id.
|
||||
*
|
||||
*
|
||||
* @return The interface id.
|
||||
*/
|
||||
public final int getInterfaceId() {
|
||||
@@ -65,7 +65,7 @@ public abstract class InventoryItemMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the option number.
|
||||
*
|
||||
*
|
||||
* @return The option number.
|
||||
*/
|
||||
public final int getOption() {
|
||||
@@ -74,7 +74,7 @@ public abstract class InventoryItemMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the slot.
|
||||
*
|
||||
*
|
||||
* @return The slot.
|
||||
*/
|
||||
public final int getSlot() {
|
||||
|
||||
@@ -6,14 +6,14 @@ import org.apollo.game.message.Message;
|
||||
* A {@link Message} sent by the client that represents some sort of action on an item. Note that the actual message
|
||||
* sent by the client is one of the five item action messages, but this is the message that should be intercepted (and
|
||||
* the option verified).
|
||||
*
|
||||
*
|
||||
* @author Chris Fletcher
|
||||
*/
|
||||
public abstract class ItemActionMessage extends InventoryItemMessage {
|
||||
|
||||
/**
|
||||
* Creates the item action message.
|
||||
*
|
||||
*
|
||||
* @param option The option number.
|
||||
* @param interfaceId The interface id.
|
||||
* @param id The id.
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.apollo.game.message.impl;
|
||||
|
||||
/**
|
||||
* A {@link InventoryItemMessage} sent by the client when a player uses one inventory item on another.
|
||||
*
|
||||
*
|
||||
* @author Chris Fletcher
|
||||
*/
|
||||
public final class ItemOnItemMessage extends InventoryItemMessage {
|
||||
@@ -24,7 +24,7 @@ public final class ItemOnItemMessage extends InventoryItemMessage {
|
||||
|
||||
/**
|
||||
* Creates a new item-on-item message.
|
||||
*
|
||||
*
|
||||
* @param usedInterface The interface id of the used item.
|
||||
* @param usedId The id of the used item.
|
||||
* @param usedSlot The slot of the target item.
|
||||
@@ -41,7 +41,7 @@ public final class ItemOnItemMessage extends InventoryItemMessage {
|
||||
|
||||
/**
|
||||
* Gets the id of the target item.
|
||||
*
|
||||
*
|
||||
* @return The target item's interface id.
|
||||
*/
|
||||
public int getTargetId() {
|
||||
@@ -50,7 +50,7 @@ public final class ItemOnItemMessage extends InventoryItemMessage {
|
||||
|
||||
/**
|
||||
* Gets the interface id of the target item.
|
||||
*
|
||||
*
|
||||
* @return The target item's interface id.
|
||||
*/
|
||||
public int getTargetInterfaceId() {
|
||||
@@ -59,7 +59,7 @@ public final class ItemOnItemMessage extends InventoryItemMessage {
|
||||
|
||||
/**
|
||||
* Gets the slot of the target item.
|
||||
*
|
||||
*
|
||||
* @return The slot of the target item.
|
||||
*/
|
||||
public int getTargetSlot() {
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.apollo.game.model.Position;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent by the client when an item is used on an object.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class ItemOnObjectMessage extends InventoryItemMessage {
|
||||
@@ -22,7 +22,7 @@ public final class ItemOnObjectMessage extends InventoryItemMessage {
|
||||
|
||||
/**
|
||||
* Creates an item on object message.
|
||||
*
|
||||
*
|
||||
* @param interfaceId The interface id.
|
||||
* @param itemId The item id.
|
||||
* @param itemSlot The slot the item is in.
|
||||
@@ -33,12 +33,12 @@ public final class ItemOnObjectMessage extends InventoryItemMessage {
|
||||
public ItemOnObjectMessage(int interfaceId, int itemId, int itemSlot, int objectId, int x, int y) {
|
||||
super(0, interfaceId, itemId, itemSlot);
|
||||
this.objectId = objectId;
|
||||
this.position = new Position(x, y);
|
||||
position = new Position(x, y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the object id.
|
||||
*
|
||||
*
|
||||
* @return The object id.
|
||||
*/
|
||||
public int getObjectId() {
|
||||
@@ -47,7 +47,7 @@ public final class ItemOnObjectMessage extends InventoryItemMessage {
|
||||
|
||||
/**
|
||||
* Gets the position of the object.
|
||||
*
|
||||
*
|
||||
* @return The position.
|
||||
*/
|
||||
public Position getPosition() {
|
||||
|
||||
@@ -4,14 +4,14 @@ package org.apollo.game.message.impl;
|
||||
* An {@link InventoryItemMessage} sent by the client when an item's option is clicked (e.g. equip, eat, drink, etc).
|
||||
* Note that the actual message sent by the client is one of the five item option messages, but this is the message that
|
||||
* should be intercepted (and the option verified).
|
||||
*
|
||||
*
|
||||
* @author Chris Fletcher
|
||||
*/
|
||||
public abstract class ItemOptionMessage extends InventoryItemMessage {
|
||||
|
||||
/**
|
||||
* Creates the item option message.
|
||||
*
|
||||
*
|
||||
* @param option The option number.
|
||||
* @param interfaceId The interface id.
|
||||
* @param id The id.
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.apollo.game.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} periodically sent by the client to keep a connection alive.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class KeepAliveMessage extends Message {
|
||||
@@ -23,7 +23,7 @@ public final class KeepAliveMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the time when this message was created.
|
||||
*
|
||||
*
|
||||
* @return The time when this message was created.
|
||||
*/
|
||||
public long getCreatedAt() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.apollo.game.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent to the client that cleanly logs it out.
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class LogoutMessage extends Message {
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.apollo.game.message.impl;
|
||||
|
||||
/**
|
||||
* A {@link InventoryItemMessage} sent by the client when a player casts a spell on an inventory item.
|
||||
*
|
||||
*
|
||||
* @author Chris Fletcher
|
||||
*/
|
||||
public final class MagicOnItemMessage extends InventoryItemMessage {
|
||||
@@ -14,7 +14,7 @@ public final class MagicOnItemMessage extends InventoryItemMessage {
|
||||
|
||||
/**
|
||||
* Creates a new magic on item message.
|
||||
*
|
||||
*
|
||||
* @param interfaceId The interface id.
|
||||
* @param id The item id.
|
||||
* @param slot The item slot.
|
||||
@@ -27,7 +27,7 @@ public final class MagicOnItemMessage extends InventoryItemMessage {
|
||||
|
||||
/**
|
||||
* Gets the spell id.
|
||||
*
|
||||
*
|
||||
* @return The spell id.
|
||||
*/
|
||||
public int getSpellId() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.apollo.game.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent to the client to reset the animations of every mob.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class MobAnimationResetMessage extends Message {
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.apollo.game.message.Message;
|
||||
* A {@link Message} sent by the client representing the clicking of an npc menu action. Note that the actual message
|
||||
* sent by the client is one of the three npc action messages, but this is the message that should be intercepted (and
|
||||
* the option verified).
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public abstract class NpcActionMessage extends Message {
|
||||
@@ -23,7 +23,7 @@ public abstract class NpcActionMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates an npc action message.
|
||||
*
|
||||
*
|
||||
* @param option The option number.
|
||||
* @param index The index of the npc.
|
||||
*/
|
||||
@@ -34,7 +34,7 @@ public abstract class NpcActionMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the menu action number (i.e. the action message 'option') clicked.
|
||||
*
|
||||
*
|
||||
* @return The option number.
|
||||
*/
|
||||
public int getOption() {
|
||||
@@ -43,7 +43,7 @@ public abstract class NpcActionMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the index of the npc clicked.
|
||||
*
|
||||
*
|
||||
* @return The npc index.
|
||||
*/
|
||||
public int getIndex() {
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.apollo.game.sync.seg.SynchronizationSegment;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent to the client to synchronize npcs with players.
|
||||
*
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
public final class NpcSynchronizationMessage extends Message {
|
||||
@@ -31,7 +31,7 @@ public final class NpcSynchronizationMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates a new {@link NpcSynchronizationMessage}.
|
||||
*
|
||||
*
|
||||
* @param position The position of the {@link Npc}.
|
||||
* @param segments The list of segments.
|
||||
* @param localNpcs The amount of local npcs.
|
||||
@@ -44,7 +44,7 @@ public final class NpcSynchronizationMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the number of local npcs.
|
||||
*
|
||||
*
|
||||
* @return The number of local npcs.
|
||||
*/
|
||||
public int getLocalNpcCount() {
|
||||
@@ -53,7 +53,7 @@ public final class NpcSynchronizationMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the npc's position.
|
||||
*
|
||||
*
|
||||
* @return The npc's position.
|
||||
*/
|
||||
public Position getPosition() {
|
||||
@@ -62,7 +62,7 @@ public final class NpcSynchronizationMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the synchronization segments.
|
||||
*
|
||||
*
|
||||
* @return The segments.
|
||||
*/
|
||||
public List<SynchronizationSegment> getSegments() {
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.apollo.game.model.Position;
|
||||
* A {@link Message} sent by the client that represents some sort of action on an object. Note that the actual message
|
||||
* sent by the client is one of the five object action messages, but this is the message that should be intercepted (and
|
||||
* the option verified).
|
||||
*
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public abstract class ObjectActionMessage extends Message {
|
||||
@@ -29,7 +29,7 @@ public abstract class ObjectActionMessage extends Message {
|
||||
|
||||
/**
|
||||
* Creates a new object action message.
|
||||
*
|
||||
*
|
||||
* @param option The option number.
|
||||
* @param id The id of the object.
|
||||
* @param position The position of the object.
|
||||
@@ -42,7 +42,7 @@ public abstract class ObjectActionMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the id of the object.
|
||||
*
|
||||
*
|
||||
* @return The id of the object.
|
||||
*/
|
||||
public int getId() {
|
||||
@@ -51,7 +51,7 @@ public abstract class ObjectActionMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the option number.
|
||||
*
|
||||
*
|
||||
* @return The option number.
|
||||
*/
|
||||
public int getOption() {
|
||||
@@ -60,7 +60,7 @@ public abstract class ObjectActionMessage extends Message {
|
||||
|
||||
/**
|
||||
* Gets the position of the object.
|
||||
*
|
||||
*
|
||||
* @return The position of the object.
|
||||
*/
|
||||
public Position getPosition() {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user