mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-12-06 11:17:19 +00:00
Modularise! Also add some unit tests.
This commit is contained in:
1 parent
902a203861
commit
e4778105f5
658 files changed
+1532
-1004
No files matched your search
+3
-3
@@ -1,9 +1,9 @@
|
||||
!.gitignore
|
||||
.*
|
||||
*~
|
||||
/target
|
||||
*.class
|
||||
*.iml
|
||||
|
||||
/data/fs
|
||||
/data/savedGames
|
||||
/bin/
|
||||
/lib/
|
||||
/lib/
|
||||
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>apollo</groupId>
|
||||
<artifactId>org.apollo</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>cache</artifactId>
|
||||
<version>0.0.1</version>
|
||||
|
||||
<name>Apollo Cache</name>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<sourceDirectory>src/main</sourceDirectory>
|
||||
<testSourceDirectory>src/test</testSourceDirectory>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>apollo</groupId>
|
||||
<artifactId>util</artifactId>
|
||||
<version>0.0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.apollo.fs;
|
||||
package org.apollo.cache;
|
||||
|
||||
/**
|
||||
* A class which points to a file in the cache.
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.apollo.fs;
|
||||
package org.apollo.cache;
|
||||
|
||||
/**
|
||||
* Holds file system related constants.
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.apollo.fs;
|
||||
package org.apollo.cache;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.apollo.fs;
|
||||
package org.apollo.cache;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.FileNotFoundException;
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.apollo.fs.archive;
|
||||
package org.apollo.cache.archive;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.apollo.fs.archive;
|
||||
package org.apollo.cache.archive;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* Contains classes which deal with archives.
|
||||
*/
|
||||
package org.apollo.fs.archive;
|
||||
package org.apollo.cache.archive;
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
package org.apollo.fs.decoder;
|
||||
package org.apollo.cache.decoder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.apollo.fs.IndexedFileSystem;
|
||||
import org.apollo.fs.archive.Archive;
|
||||
import org.apollo.fs.def.ItemDefinition;
|
||||
import org.apollo.cache.IndexedFileSystem;
|
||||
import org.apollo.cache.archive.Archive;
|
||||
import org.apollo.cache.def.ItemDefinition;
|
||||
import org.apollo.util.BufferUtil;
|
||||
|
||||
/**
|
||||
+6
-5
@@ -1,12 +1,12 @@
|
||||
package org.apollo.fs.decoder;
|
||||
package org.apollo.cache.decoder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apollo.fs.IndexedFileSystem;
|
||||
import org.apollo.fs.archive.Archive;
|
||||
import org.apollo.fs.def.NpcDefinition;
|
||||
import org.apollo.cache.IndexedFileSystem;
|
||||
import org.apollo.cache.archive.Archive;
|
||||
import org.apollo.cache.def.NpcDefinition;
|
||||
import org.apollo.util.BufferUtil;
|
||||
|
||||
/**
|
||||
@@ -89,7 +89,8 @@ public final class NpcDefinitionDecoder {
|
||||
} else if (opcode == 14) {
|
||||
definition.setWalkAnimation(buffer.getShort());
|
||||
} else if (opcode == 17) {
|
||||
definition.setWalkAnimations(buffer.getShort(), buffer.getShort(), buffer.getShort(), buffer.getShort());
|
||||
definition
|
||||
.setWalkAnimations(buffer.getShort(), buffer.getShort(), buffer.getShort(), buffer.getShort());
|
||||
} else if (opcode >= 30 && opcode < 40) {
|
||||
String str = BufferUtil.readString(buffer);
|
||||
if (str.equals("hidden")) {
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
package org.apollo.fs.decoder;
|
||||
package org.apollo.cache.decoder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.apollo.fs.IndexedFileSystem;
|
||||
import org.apollo.fs.archive.Archive;
|
||||
import org.apollo.fs.def.ObjectDefinition;
|
||||
import org.apollo.cache.IndexedFileSystem;
|
||||
import org.apollo.cache.archive.Archive;
|
||||
import org.apollo.cache.def.ObjectDefinition;
|
||||
import org.apollo.util.BufferUtil;
|
||||
|
||||
/**
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* Contains classes which parse files within the game's cache.
|
||||
*/
|
||||
package org.apollo.fs.decoder;
|
||||
package org.apollo.cache.decoder;
|
||||
+52
-20
@@ -1,20 +1,52 @@
|
||||
package org.apollo.fs.def;
|
||||
package org.apollo.cache.def;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apollo.game.model.Item;
|
||||
import org.apollo.game.model.entity.Skill;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
/**
|
||||
* Represents a type of {@link Item} which may be equipped.
|
||||
* Represents a type of Item that may be equipped.
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public final class EquipmentDefinition {
|
||||
|
||||
/**
|
||||
* The attack id.
|
||||
*/
|
||||
private static final int ATTACK = 0;
|
||||
|
||||
/**
|
||||
* The defence id.
|
||||
*/
|
||||
private static final int DEFENCE = 1;
|
||||
|
||||
/**
|
||||
* The strength id.
|
||||
*/
|
||||
private static final int STRENGTH = 2;
|
||||
|
||||
/**
|
||||
* The hitpoints id.
|
||||
*/
|
||||
private static final int HITPOINTS = 3;
|
||||
|
||||
/**
|
||||
* The ranged id.
|
||||
*/
|
||||
private static final int RANGED = 4;
|
||||
|
||||
/**
|
||||
* The prayer id.
|
||||
*/
|
||||
private static final int PRAYER = 5;
|
||||
|
||||
/**
|
||||
* The magic id.
|
||||
*/
|
||||
private static final int MAGIC = 6;
|
||||
|
||||
/**
|
||||
* The equipment definitions.
|
||||
*/
|
||||
@@ -94,7 +126,7 @@ public final class EquipmentDefinition {
|
||||
* @return The level.
|
||||
*/
|
||||
public int getAttackLevel() {
|
||||
return levels[Skill.ATTACK];
|
||||
return levels[ATTACK];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -103,7 +135,7 @@ public final class EquipmentDefinition {
|
||||
* @return The level.
|
||||
*/
|
||||
public int getDefenceLevel() {
|
||||
return levels[Skill.DEFENCE];
|
||||
return levels[DEFENCE];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -112,7 +144,7 @@ public final class EquipmentDefinition {
|
||||
* @return The level.
|
||||
*/
|
||||
public int getHitpointsLevel() {
|
||||
return levels[Skill.HITPOINTS];
|
||||
return levels[HITPOINTS];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -131,7 +163,7 @@ public final class EquipmentDefinition {
|
||||
* @return The level.
|
||||
*/
|
||||
public int getLevel(int skill) {
|
||||
Preconditions.checkArgument(skill >= Skill.ATTACK && skill <= Skill.MAGIC, "Skill id out of bounds.");
|
||||
Preconditions.checkArgument(skill >= ATTACK && skill <= MAGIC, "Skill id out of bounds.");
|
||||
return levels[skill];
|
||||
}
|
||||
|
||||
@@ -141,7 +173,7 @@ public final class EquipmentDefinition {
|
||||
* @return The level.
|
||||
*/
|
||||
public int getMagicLevel() {
|
||||
return levels[Skill.MAGIC];
|
||||
return levels[MAGIC];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -150,7 +182,7 @@ public final class EquipmentDefinition {
|
||||
* @return The level.
|
||||
*/
|
||||
public int getPrayerLevel() {
|
||||
return levels[Skill.PRAYER];
|
||||
return levels[PRAYER];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -159,7 +191,7 @@ public final class EquipmentDefinition {
|
||||
* @return The level.
|
||||
*/
|
||||
public int getRangedLevel() {
|
||||
return levels[Skill.RANGED];
|
||||
return levels[RANGED];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -177,7 +209,7 @@ public final class EquipmentDefinition {
|
||||
* @return The level.
|
||||
*/
|
||||
public int getStrengthLevel() {
|
||||
return levels[Skill.STRENGTH];
|
||||
return levels[STRENGTH];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -256,13 +288,13 @@ public final class EquipmentDefinition {
|
||||
* @param magic The required magic level.
|
||||
*/
|
||||
public void setLevels(int attack, int strength, int defence, int hitpoints, int ranged, int prayer, int magic) {
|
||||
levels[Skill.ATTACK] = attack;
|
||||
levels[Skill.STRENGTH] = strength;
|
||||
levels[Skill.DEFENCE] = defence;
|
||||
levels[Skill.HITPOINTS] = hitpoints;
|
||||
levels[Skill.RANGED] = ranged;
|
||||
levels[Skill.PRAYER] = prayer;
|
||||
levels[Skill.MAGIC] = magic;
|
||||
levels[ATTACK] = attack;
|
||||
levels[STRENGTH] = strength;
|
||||
levels[DEFENCE] = defence;
|
||||
levels[HITPOINTS] = hitpoints;
|
||||
levels[RANGED] = ranged;
|
||||
levels[PRAYER] = prayer;
|
||||
levels[MAGIC] = magic;
|
||||
}
|
||||
|
||||
/**
|
||||
Vendored
+2
-4
@@ -1,13 +1,11 @@
|
||||
package org.apollo.fs.def;
|
||||
|
||||
import org.apollo.game.model.Item;
|
||||
package org.apollo.cache.def;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
|
||||
/**
|
||||
* Represents a type of {@link Item}.
|
||||
* Represents a type of Item.
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
Vendored
+2
-4
@@ -1,11 +1,9 @@
|
||||
package org.apollo.fs.def;
|
||||
|
||||
import org.apollo.game.model.entity.Npc;
|
||||
package org.apollo.cache.def;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
/**
|
||||
* Represents a type of {@link Npc}.
|
||||
* Represents a type of Npc.
|
||||
*
|
||||
* @author Chris Fletcher
|
||||
*/
|
||||
+2
-4
@@ -1,11 +1,9 @@
|
||||
package org.apollo.fs.def;
|
||||
|
||||
import org.apollo.game.model.entity.obj.GameObject;
|
||||
package org.apollo.cache.def;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
/**
|
||||
* Represents a type of {@link GameObject}.
|
||||
* Represents a type of GameObject.
|
||||
*
|
||||
* @author Major
|
||||
*/
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* Contains definition classes which contain information about types of items, NPCs, etc.
|
||||
*/
|
||||
package org.apollo.fs.def;
|
||||
package org.apollo.cache.def;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* Contains classes which deal with the file system that the client uses to store game data files.
|
||||
*/
|
||||
package org.apollo.fs;
|
||||
package org.apollo.cache;
|
||||
+5
-4
@@ -1,13 +1,14 @@
|
||||
package org.apollo.tools;
|
||||
package org.apollo.cache.tools;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import org.apollo.fs.IndexedFileSystem;
|
||||
import org.apollo.fs.decoder.ItemDefinitionDecoder;
|
||||
import org.apollo.fs.def.ItemDefinition;
|
||||
import org.apollo.cache.IndexedFileSystem;
|
||||
import org.apollo.cache.decoder.ItemDefinitionDecoder;
|
||||
import org.apollo.cache.def.ItemDefinition;
|
||||
import org.apollo.util.tools.EquipmentConstants;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Contains cache-related tools.
|
||||
*/
|
||||
package org.apollo.cache.tools;
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
<login>
|
||||
<serializer>org.apollo.io.player.DummyPlayerSerializer</serializer>
|
||||
<serializer>org.apollo.game.io.player.DummyPlayerSerializer</serializer>
|
||||
</login>
|
||||
@@ -15,14 +15,14 @@
|
||||
require 'java'
|
||||
|
||||
java_import 'org.apollo.game.command.CommandListener'
|
||||
java_import 'org.apollo.game.message.MessageHandler'
|
||||
java_import 'org.apollo.game.message.handler.MessageHandler'
|
||||
java_import 'org.apollo.game.model.World'
|
||||
java_import 'org.apollo.game.model.entity.Player'
|
||||
java_import 'org.apollo.game.model.event.EventListener'
|
||||
java_import 'org.apollo.game.model.event.PlayerEvent'
|
||||
java_import 'org.apollo.game.model.entity.setting.PrivilegeLevel'
|
||||
java_import 'org.apollo.game.scheduling.ScheduledTask'
|
||||
java_import 'org.apollo.util.plugin.PluginContext'
|
||||
java_import 'org.apollo.game.plugin.PluginContext'
|
||||
|
||||
# Alias the privilege levels.
|
||||
RIGHTS_ADMIN = PrivilegeLevel::ADMINISTRATOR
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
require 'java'
|
||||
|
||||
java_import 'org.apollo.game.model.def.ItemDefinition'
|
||||
java_import 'org.apollo.cache.def.ItemDefinition'
|
||||
|
||||
# Adds the specified item to the player's inventory.
|
||||
on :command, :item, RIGHTS_ADMIN do |player, command|
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
require 'java'
|
||||
|
||||
java_import 'org.apollo.game.model.World'
|
||||
java_import 'org.apollo.game.model.def.ItemDefinition'
|
||||
java_import 'org.apollo.game.model.def.NpcDefinition'
|
||||
java_import 'org.apollo.game.model.def.ObjectDefinition'
|
||||
java_import 'org.apollo.cache.def.ItemDefinition'
|
||||
java_import 'org.apollo.cache.def.NpcDefinition'
|
||||
java_import 'org.apollo.cache.def.ObjectDefinition'
|
||||
java_import 'org.apollo.game.model.entity.Entity'
|
||||
java_import 'org.apollo.game.model.entity.Player'
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
require 'java'
|
||||
|
||||
java_import 'org.apollo.cache.def.NpcDefinition'
|
||||
java_import 'org.apollo.game.action.Action'
|
||||
java_import 'org.apollo.game.model.Animation'
|
||||
java_import 'org.apollo.game.model.Graphic'
|
||||
java_import 'org.apollo.game.model.Position'
|
||||
java_import 'org.apollo.game.model.World'
|
||||
java_import 'org.apollo.game.model.def.NpcDefinition'
|
||||
java_import 'org.apollo.game.model.entity.Npc'
|
||||
|
||||
# Information about npc spawning
|
||||
|
||||
@@ -3,7 +3,6 @@ require 'java'
|
||||
java_import 'org.apollo.game.action.Action'
|
||||
java_import 'org.apollo.game.model.Animation'
|
||||
java_import 'org.apollo.game.model.Item'
|
||||
java_import 'org.apollo.game.model.def.ItemDefinition'
|
||||
java_import 'org.apollo.game.model.inter.EnterAmountListener'
|
||||
java_import 'org.apollo.game.model.inter.dialogue.DialogueAdapter'
|
||||
|
||||
@@ -190,8 +189,7 @@ class GrindingAction < Action
|
||||
return true if pst_mrt and ingr
|
||||
end
|
||||
|
||||
ingr = ItemDefinition.lookup(raw).name.downcase
|
||||
mob.send_message("You do not have any more #{ingr}s.")
|
||||
mob.send_message("You do not have any more #{name_of(raw).downcase}s.")
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ require 'java'
|
||||
java_import 'org.apollo.game.action.Action'
|
||||
java_import 'org.apollo.game.model.Animation'
|
||||
java_import 'org.apollo.game.model.Item'
|
||||
java_import 'org.apollo.game.model.def.ItemDefinition'
|
||||
java_import 'org.apollo.game.model.inter.EnterAmountListener'
|
||||
java_import 'org.apollo.game.model.inter.dialogue.DialogueAdapter'
|
||||
|
||||
@@ -271,7 +270,7 @@ class FinishedMixingAction < MixingAction
|
||||
|
||||
def execute_action
|
||||
player = mob
|
||||
ingredient = ItemDefinition.lookup(@ingredient).name.downcase
|
||||
ingredient = name_of(@ingredient).downcase
|
||||
name = @potion.item.definition.name.sub('(3)', '')
|
||||
|
||||
player.send_message("You add the #{ingredient} to the mixture to make an #{name}.", true)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
require 'java'
|
||||
|
||||
java_import 'org.apollo.game.action.DistancedAction'
|
||||
java_import 'org.apollo.game.model.def.ItemDefinition'
|
||||
java_import 'org.apollo.game.model.entity.EquipmentConstants'
|
||||
java_import 'org.apollo.game.model.entity.Skill'
|
||||
|
||||
@@ -62,11 +61,10 @@ class MiningAction < DistancedAction
|
||||
else
|
||||
# count down and check if we can have a chance at some ore now
|
||||
if @counter == 0
|
||||
# TODO: calculate the chance that the mob can actually get the rock
|
||||
# TODO: calculate the chance that the player can actually get the rock
|
||||
|
||||
if mob.inventory.add(ore.id)
|
||||
ore_def = ItemDefinition.lookup(@ore.id) # TODO: split off into some method
|
||||
name = ore_def.name.sub(/ ore$/, '').downcase
|
||||
name = name_of(@ore.id).sub(/ ore$/, '').downcase
|
||||
|
||||
mob.send_message("You manage to mine some #{name}.", true)
|
||||
skills.add_experience(Skill::MINING, ore.exp)
|
||||
|
||||
@@ -18,5 +18,7 @@
|
||||
<script>respawn.rb</script>
|
||||
<script>mining.rb</script>
|
||||
</scripts>
|
||||
<dependencies />
|
||||
<dependencies>
|
||||
<dependency>util</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
@@ -1,7 +1,5 @@
|
||||
require 'java'
|
||||
|
||||
java_import 'org.apollo.game.model.def.ItemDefinition'
|
||||
|
||||
# The hash of runes.
|
||||
RUNES = {}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
require 'java'
|
||||
|
||||
java_import 'org.apollo.game.model.def.ItemDefinition'
|
||||
java_import 'org.apollo.game.model.def.NpcDefinition'
|
||||
java_import 'org.apollo.game.model.def.ObjectDefinition'
|
||||
java_import 'org.apollo.cache.def.ItemDefinition'
|
||||
java_import 'org.apollo.cache.def.NpcDefinition'
|
||||
java_import 'org.apollo.cache.def.ObjectDefinition'
|
||||
|
||||
|
||||
# Checks whether the amount of arguments provided is correct, sending the player the specified message if not.
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<services>
|
||||
<service>org.apollo.game.GameService</service>
|
||||
<service>org.apollo.login.LoginService</service>
|
||||
<service>org.apollo.update.UpdateService</service>
|
||||
</services>
|
||||
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>apollo</groupId>
|
||||
<artifactId>org.apollo</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>game</artifactId>
|
||||
<version>0.0.1</version>
|
||||
|
||||
<name>Apollo Game</name>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<sourceDirectory>src/main</sourceDirectory>
|
||||
<testSourceDirectory>src/test</testSourceDirectory>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>apollo</groupId>
|
||||
<artifactId>cache</artifactId>
|
||||
<version>0.0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>apollo</groupId>
|
||||
<artifactId>net</artifactId>
|
||||
<version>0.0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>apollo</groupId>
|
||||
<artifactId>util</artifactId>
|
||||
<version>0.0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -14,17 +14,17 @@ import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.apollo.fs.IndexedFileSystem;
|
||||
import org.apollo.cache.IndexedFileSystem;
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.net.ApolloHandler;
|
||||
import org.apollo.game.plugin.PluginContext;
|
||||
import org.apollo.game.plugin.PluginManager;
|
||||
import org.apollo.game.release.r317.Release317;
|
||||
import org.apollo.game.session.ApolloHandler;
|
||||
import org.apollo.net.HttpChannelInitializer;
|
||||
import org.apollo.net.JagGrabChannelInitializer;
|
||||
import org.apollo.net.NetworkConstants;
|
||||
import org.apollo.net.ServiceChannelInitializer;
|
||||
import org.apollo.net.release.Release;
|
||||
import org.apollo.net.release.r317.Release317;
|
||||
import org.apollo.util.plugin.PluginContext;
|
||||
import org.apollo.util.plugin.PluginManager;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
|
||||
@@ -134,9 +134,9 @@ public final class Server {
|
||||
jagGrabBootstrap.group(loopGroup);
|
||||
|
||||
World world = new World();
|
||||
ServiceManager serviceManager = new ServiceManager(world);
|
||||
ServiceManager services = new ServiceManager(world);
|
||||
IndexedFileSystem fs = new IndexedFileSystem(Paths.get("data/fs", Integer.toString(releaseNo)), true);
|
||||
ServerContext context = new ServerContext(release, serviceManager, fs);
|
||||
ServerContext context = new ServerContext(release, services, fs);
|
||||
ApolloHandler handler = new ApolloHandler(context);
|
||||
|
||||
ChannelInitializer<SocketChannel> serviceInitializer = new ServiceChannelInitializer(handler);
|
||||
@@ -152,7 +152,7 @@ public final class Server {
|
||||
jagGrabBootstrap.childHandler(jagGrabInitializer);
|
||||
|
||||
PluginManager manager = new PluginManager(world, new PluginContext(context));
|
||||
serviceManager.startAll();
|
||||
services.startAll();
|
||||
|
||||
world.init(releaseNo, fs, manager);
|
||||
}
|
||||
@@ -2,7 +2,10 @@ package org.apollo;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import org.apollo.fs.IndexedFileSystem;
|
||||
import org.apollo.cache.IndexedFileSystem;
|
||||
import org.apollo.game.service.GameService;
|
||||
import org.apollo.game.service.LoginService;
|
||||
import org.apollo.game.service.UpdateService;
|
||||
import org.apollo.net.release.Release;
|
||||
|
||||
/**
|
||||
@@ -11,9 +14,15 @@ import org.apollo.net.release.Release;
|
||||
* access to some methods such as {@link Server#bind} which user scripts/code should not be able to access.
|
||||
*
|
||||
* @author Graham
|
||||
* @author Major
|
||||
*/
|
||||
public final class ServerContext {
|
||||
|
||||
/**
|
||||
* The IndexedFileSystem.
|
||||
*/
|
||||
private final IndexedFileSystem fileSystem;
|
||||
|
||||
/**
|
||||
* The current release.
|
||||
*/
|
||||
@@ -22,36 +31,22 @@ public final class ServerContext {
|
||||
/**
|
||||
* The service manager.
|
||||
*/
|
||||
private final ServiceManager serviceManager;
|
||||
|
||||
/**
|
||||
* The IndexedFileSystem.
|
||||
*/
|
||||
private final IndexedFileSystem fileSystem;
|
||||
private final ServiceManager services;
|
||||
|
||||
/**
|
||||
* Creates a new server context.
|
||||
*
|
||||
* @param release The current release.
|
||||
* @param serviceManager The service manager.
|
||||
* @param services The service manager.
|
||||
* @param fileSystem The indexed file system.
|
||||
*/
|
||||
protected ServerContext(Release release, ServiceManager serviceManager, IndexedFileSystem fileSystem) {
|
||||
protected ServerContext(Release release, ServiceManager services, IndexedFileSystem fileSystem) {
|
||||
this.release = Objects.requireNonNull(release);
|
||||
this.serviceManager = Objects.requireNonNull(serviceManager);
|
||||
this.serviceManager.setContext(this);
|
||||
this.services = Objects.requireNonNull(services);
|
||||
this.services.setContext(this);
|
||||
this.fileSystem = Objects.requireNonNull(fileSystem);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current release.
|
||||
*
|
||||
* @return The current release.
|
||||
*/
|
||||
public Release getRelease() {
|
||||
return release;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the IndexeFileSystem
|
||||
*
|
||||
@@ -62,22 +57,39 @@ public final class ServerContext {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a service. This method is shorthand for {@code getServiceManager().getService(...)}.
|
||||
* Gets the {@link GameService}.
|
||||
*
|
||||
* @param clazz The service class.
|
||||
* @return The service, or {@code null} if it could not be found.
|
||||
* @return The GameService.
|
||||
*/
|
||||
public <S extends Service> S getService(Class<S> clazz) {
|
||||
return serviceManager.getService(clazz);
|
||||
public GameService getGameService() {
|
||||
return services.getGame();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the service manager.
|
||||
* Gets the {@link LoginService}.
|
||||
*
|
||||
* @return The service manager.
|
||||
* @return The LoginService.
|
||||
*/
|
||||
public ServiceManager getServiceManager() {
|
||||
return serviceManager;
|
||||
public LoginService getLoginService() {
|
||||
return services.getLogin();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current release.
|
||||
*
|
||||
* @return The current release.
|
||||
*/
|
||||
public Release getRelease() {
|
||||
return release;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the {@link UpdateService}.
|
||||
*
|
||||
* @return The UpdateService.
|
||||
*/
|
||||
public UpdateService getUpdateService() {
|
||||
return services.getUpdate();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,32 +1,17 @@
|
||||
package org.apollo;
|
||||
|
||||
import org.apollo.game.model.World;
|
||||
|
||||
/**
|
||||
* Represents a service that the server provides for a {@link World}.
|
||||
* Represents a service that the server provides for a World.
|
||||
*
|
||||
* @author Graham
|
||||
*/
|
||||
public abstract class Service {
|
||||
|
||||
/**
|
||||
* The World this Service is for.
|
||||
*/
|
||||
protected final World world;
|
||||
|
||||
/**
|
||||
* The server context.
|
||||
*/
|
||||
private ServerContext context;
|
||||
|
||||
/**
|
||||
* Creates the Service.
|
||||
*
|
||||
* @param world The {@link World} the Service is for.
|
||||
*/
|
||||
public Service(World world) {
|
||||
this.world = world;
|
||||
}
|
||||
protected ServerContext context;
|
||||
|
||||
/**
|
||||
* Gets the {@link ServerContext}.
|
||||
@@ -0,0 +1,97 @@
|
||||
package org.apollo;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.game.service.GameService;
|
||||
import org.apollo.game.service.LoginService;
|
||||
import org.apollo.game.service.UpdateService;
|
||||
|
||||
/**
|
||||
* A class which manages {@link Service}s.
|
||||
*
|
||||
* @author Graham
|
||||
* @author Major
|
||||
*/
|
||||
public final class ServiceManager {
|
||||
|
||||
/**
|
||||
* The Logger for this class.
|
||||
*/
|
||||
private static final Logger logger = Logger.getLogger(ServiceManager.class.getName());
|
||||
|
||||
/**
|
||||
* The GameService.
|
||||
*/
|
||||
private final GameService game;
|
||||
|
||||
/**
|
||||
* The LoginService.
|
||||
*/
|
||||
private final LoginService login;
|
||||
|
||||
/**
|
||||
* The UpdateService.
|
||||
*/
|
||||
private final UpdateService update = new UpdateService();
|
||||
|
||||
/**
|
||||
* Creates and initializes the {@link ServiceManager}.
|
||||
*
|
||||
* @param world The {@link World} to create the {@link Service}s for.
|
||||
* @throws Exception If there is an error creating the Services.
|
||||
*/
|
||||
public ServiceManager(World world) throws Exception {
|
||||
game = new GameService(world);
|
||||
login = new LoginService(world);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the {@link GameService}.
|
||||
*
|
||||
* @return The GameService.
|
||||
*/
|
||||
public GameService getGame() {
|
||||
return game;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the {@link LoginService}.
|
||||
*
|
||||
* @return The LoginService.
|
||||
*/
|
||||
public LoginService getLogin() {
|
||||
return login;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the {@link UpdateService}.
|
||||
*
|
||||
* @return The UpdateService.
|
||||
*/
|
||||
public UpdateService getUpdate() {
|
||||
return update;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the context of all services.
|
||||
*
|
||||
* @param context The server context.
|
||||
*/
|
||||
public void setContext(ServerContext context) {
|
||||
game.setContext(context);
|
||||
login.setContext(context);
|
||||
update.setContext(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts all the services.
|
||||
*/
|
||||
public void startAll() {
|
||||
logger.info("Starting services...");
|
||||
game.start();
|
||||
login.start();
|
||||
update.start();
|
||||
}
|
||||
|
||||
}
|
||||
File renamed without changes.
+3
-1
@@ -3,6 +3,8 @@ package org.apollo.game;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.apollo.game.service.GameService;
|
||||
|
||||
/**
|
||||
* A class which handles the logic for each pulse of the {@link GameService}.
|
||||
*
|
||||
@@ -25,7 +27,7 @@ public final class GamePulseHandler implements Runnable {
|
||||
*
|
||||
* @param service The {@link GameService}.
|
||||
*/
|
||||
protected GamePulseHandler(GameService service) {
|
||||
public GamePulseHandler(GameService service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+10
-7
@@ -1,4 +1,4 @@
|
||||
package org.apollo.fs.decoder;
|
||||
package org.apollo.game.fs.decoder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
@@ -8,9 +8,9 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import org.apollo.fs.IndexedFileSystem;
|
||||
import org.apollo.fs.decoder.MapFileDecoder.MapDefinition;
|
||||
import org.apollo.fs.def.ObjectDefinition;
|
||||
import org.apollo.cache.IndexedFileSystem;
|
||||
import org.apollo.cache.def.ObjectDefinition;
|
||||
import org.apollo.game.fs.decoder.MapFileDecoder.MapDefinition;
|
||||
import org.apollo.game.model.Position;
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.game.model.area.Region;
|
||||
@@ -118,9 +118,11 @@ public final class GameObjectDecoder {
|
||||
block = true;
|
||||
}
|
||||
|
||||
Predicate<Integer> walls = (value) -> value >= ObjectType.LENGTHWISE_WALL.getValue() && value <= ObjectType.RECTANGULAR_CORNER.getValue() || value == ObjectType.DIAGONAL_WALL.getValue();
|
||||
Predicate<Integer> walls = (value) -> value >= ObjectType.LENGTHWISE_WALL.getValue()
|
||||
&& value <= ObjectType.RECTANGULAR_CORNER.getValue() || value == ObjectType.DIAGONAL_WALL.getValue();
|
||||
|
||||
Predicate<Integer> roofs = (value) -> value > ObjectType.DIAGONAL_INTERACTABLE.getValue() && value < ObjectType.FLOOR_DECORATION.getValue();
|
||||
Predicate<Integer> roofs = (value) -> value > ObjectType.DIAGONAL_INTERACTABLE.getValue()
|
||||
&& value < ObjectType.FLOOR_DECORATION.getValue();
|
||||
|
||||
if (walls.test(type) || roofs.test(type)) {
|
||||
block = true;
|
||||
@@ -141,7 +143,8 @@ 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;
|
||||
int nextX = nextPosition.getX() % Region.SIZE + dx, nextY = nextPosition.getY() % Region.SIZE
|
||||
+ dy;
|
||||
if (nextX > 7) {
|
||||
nextX -= 7;
|
||||
}
|
||||
+4
-4
@@ -1,13 +1,13 @@
|
||||
package org.apollo.fs.decoder;
|
||||
package org.apollo.game.fs.decoder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apollo.fs.IndexedFileSystem;
|
||||
import org.apollo.fs.archive.Archive;
|
||||
import org.apollo.fs.archive.ArchiveEntry;
|
||||
import org.apollo.cache.IndexedFileSystem;
|
||||
import org.apollo.cache.archive.Archive;
|
||||
import org.apollo.cache.archive.ArchiveEntry;
|
||||
import org.apollo.game.model.area.Region;
|
||||
|
||||
/**
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Contains decoders.
|
||||
*/
|
||||
package org.apollo.game.fs.decoder;
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
package org.apollo.io;
|
||||
package org.apollo.game.io;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.apollo.fs.def.EquipmentDefinition;
|
||||
import org.apollo.cache.def.EquipmentDefinition;
|
||||
|
||||
/**
|
||||
* A class that parses the {@code data/equipment-[release].dat} file to create an array of {@link EquipmentDefinition}s.
|
||||
+5
-5
@@ -1,13 +1,13 @@
|
||||
package org.apollo.io;
|
||||
package org.apollo.game.io;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.apollo.game.message.Message;
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.game.message.MessageHandlerChain;
|
||||
import org.apollo.game.message.MessageHandlerChainSet;
|
||||
import org.apollo.game.message.handler.MessageHandler;
|
||||
import org.apollo.game.message.handler.MessageHandlerChain;
|
||||
import org.apollo.game.message.handler.MessageHandlerChainSet;
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.net.message.Message;
|
||||
import org.apollo.util.xml.XmlNode;
|
||||
import org.apollo.util.xml.XmlParser;
|
||||
import org.xml.sax.SAXException;
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
package org.apollo.io;
|
||||
package org.apollo.game.io;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.apollo.util.plugin.PluginMetaData;
|
||||
import org.apollo.game.plugin.PluginMetaData;
|
||||
import org.apollo.util.xml.XmlNode;
|
||||
import org.apollo.util.xml.XmlParser;
|
||||
import org.xml.sax.SAXException;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* Contains classes which deal with input/output.
|
||||
*/
|
||||
package org.apollo.io;
|
||||
package org.apollo.game.io;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.apollo.io.player;
|
||||
package org.apollo.game.io.player;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package org.apollo.io.player;
|
||||
package org.apollo.game.io.player;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.DataInputStream;
|
||||
@@ -37,9 +37,9 @@ import org.apollo.game.model.entity.setting.PrivilegeLevel;
|
||||
import org.apollo.game.model.entity.setting.ScreenBrightness;
|
||||
import org.apollo.game.model.inv.Inventory;
|
||||
import org.apollo.net.codec.login.LoginConstants;
|
||||
import org.apollo.security.PlayerCredentials;
|
||||
import org.apollo.util.NameUtil;
|
||||
import org.apollo.util.StreamUtil;
|
||||
import org.apollo.util.security.PlayerCredentials;
|
||||
|
||||
import com.lambdaworks.crypto.SCryptUtil;
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
package org.apollo.io.player;
|
||||
package org.apollo.game.io.player;
|
||||
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.game.model.entity.Player;
|
||||
import org.apollo.game.model.entity.setting.MembershipStatus;
|
||||
import org.apollo.game.model.entity.setting.PrivilegeLevel;
|
||||
import org.apollo.net.codec.login.LoginConstants;
|
||||
import org.apollo.security.PlayerCredentials;
|
||||
import org.apollo.util.security.PlayerCredentials;
|
||||
|
||||
/**
|
||||
* A {@link PlayerSerializer} that saves no data and returns an administrator member account, ideal for debugging.
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package org.apollo.io.player;
|
||||
package org.apollo.game.io.player;
|
||||
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.game.model.entity.Player;
|
||||
import org.apollo.security.PlayerCredentials;
|
||||
import org.apollo.util.security.PlayerCredentials;
|
||||
|
||||
/**
|
||||
* A {@link PlayerSerializer} that utilises {@code JDBC} to communicate with an SQL database containing player data.
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.apollo.io.player;
|
||||
package org.apollo.game.io.player;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
package org.apollo.io.player;
|
||||
package org.apollo.game.io.player;
|
||||
|
||||
import org.apollo.game.model.Position;
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.game.model.entity.Player;
|
||||
import org.apollo.security.PlayerCredentials;
|
||||
import org.apollo.util.security.PlayerCredentials;
|
||||
|
||||
/**
|
||||
* An interface which may be implemented by others which are capable of serializing and deserializing players. For
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* Contains classes which deal with loading and saving player files.
|
||||
*/
|
||||
package org.apollo.io.player;
|
||||
package org.apollo.game.io.player;
|
||||
+4
-4
@@ -1,13 +1,13 @@
|
||||
package org.apollo.login;
|
||||
package org.apollo.game.login;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.apollo.io.player.PlayerLoaderResponse;
|
||||
import org.apollo.io.player.PlayerSerializer;
|
||||
import org.apollo.game.io.player.PlayerLoaderResponse;
|
||||
import org.apollo.game.io.player.PlayerSerializer;
|
||||
import org.apollo.game.session.LoginSession;
|
||||
import org.apollo.net.codec.login.LoginConstants;
|
||||
import org.apollo.net.codec.login.LoginRequest;
|
||||
import org.apollo.net.session.LoginSession;
|
||||
|
||||
/**
|
||||
* A class which processes a single login request.
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
package org.apollo.login;
|
||||
package org.apollo.game.login;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.apollo.game.io.player.PlayerSerializer;
|
||||
import org.apollo.game.model.entity.Player;
|
||||
import org.apollo.io.player.PlayerSerializer;
|
||||
import org.apollo.net.session.GameSession;
|
||||
import org.apollo.game.session.GameSession;
|
||||
|
||||
/**
|
||||
* A class which processes a single save request.
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* Contains classes related to the login service.
|
||||
*/
|
||||
package org.apollo.login;
|
||||
package org.apollo.game.login;
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.game.message.impl.ButtonMessage;
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.game.model.entity.Player;
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.game.message.impl.ItemActionMessage;
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.game.model.entity.Player;
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.game.message.impl.ChatMessage;
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.game.model.entity.Player;
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.game.message.impl.ChatMessage;
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.game.model.entity.Player;
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.game.message.impl.ClosedInterfaceMessage;
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.game.model.entity.Player;
|
||||
+1
-2
@@ -1,11 +1,10 @@
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import org.apollo.game.command.Command;
|
||||
import org.apollo.game.message.Message;
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.game.message.impl.CommandMessage;
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.game.model.entity.Player;
|
||||
import org.apollo.net.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link MessageHandler} that dispatches {@link CommandMessage}s.
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.game.message.impl.ButtonMessage;
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.game.model.entity.Player;
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.game.message.impl.DialogueContinueMessage;
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.game.model.entity.Player;
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.game.message.impl.EnteredAmountMessage;
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.game.model.entity.Player;
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import org.apollo.fs.def.EquipmentDefinition;
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.cache.def.EquipmentDefinition;
|
||||
import org.apollo.game.message.impl.ItemOptionMessage;
|
||||
import org.apollo.game.model.Item;
|
||||
import org.apollo.game.model.World;
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.game.message.impl.ItemOnItemMessage;
|
||||
import org.apollo.game.model.Item;
|
||||
import org.apollo.game.model.World;
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.game.message.impl.ItemOnObjectMessage;
|
||||
import org.apollo.game.model.Item;
|
||||
import org.apollo.game.model.World;
|
||||
-1
@@ -3,7 +3,6 @@ package org.apollo.game.message.handler;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.game.message.impl.InventoryItemMessage;
|
||||
import org.apollo.game.model.Item;
|
||||
import org.apollo.game.model.World;
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
package org.apollo.game.message;
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.game.model.entity.Player;
|
||||
import org.apollo.net.message.Message;
|
||||
|
||||
/**
|
||||
* Listens for {@link Message}s received from the client.
|
||||
+2
-1
@@ -1,9 +1,10 @@
|
||||
package org.apollo.game.message;
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apollo.game.model.entity.Player;
|
||||
import org.apollo.net.message.Message;
|
||||
|
||||
import com.google.common.base.MoreObjects;
|
||||
|
||||
+2
-1
@@ -1,9 +1,10 @@
|
||||
package org.apollo.game.message;
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apollo.game.model.entity.Player;
|
||||
import org.apollo.net.message.Message;
|
||||
|
||||
/**
|
||||
* A group of {@link MessageHandlerChain}s classified by the {@link Message} type.
|
||||
+2
-3
@@ -1,12 +1,11 @@
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import org.apollo.fs.def.NpcDefinition;
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.cache.def.NpcDefinition;
|
||||
import org.apollo.game.message.impl.NpcActionMessage;
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.game.model.entity.MobRepository;
|
||||
import org.apollo.game.model.entity.Npc;
|
||||
import org.apollo.game.model.entity.Player;
|
||||
import org.apollo.util.MobRepository;
|
||||
|
||||
/**
|
||||
* A verification {@link MessageHandler} for the {@link NpcActionMessage}.
|
||||
+1
-2
@@ -3,8 +3,7 @@ package org.apollo.game.message.handler;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apollo.fs.def.ObjectDefinition;
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.cache.def.ObjectDefinition;
|
||||
import org.apollo.game.message.impl.ObjectActionMessage;
|
||||
import org.apollo.game.model.Position;
|
||||
import org.apollo.game.model.World;
|
||||
+1
-2
@@ -1,10 +1,9 @@
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.game.message.impl.PlayerActionMessage;
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.game.model.entity.MobRepository;
|
||||
import org.apollo.game.model.entity.Player;
|
||||
import org.apollo.util.MobRepository;
|
||||
|
||||
/**
|
||||
* A verification {@link MessageHandler} for the {@link PlayerActionMessage}.
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.game.message.impl.CloseInterfaceMessage;
|
||||
import org.apollo.game.message.impl.PlayerDesignMessage;
|
||||
import org.apollo.game.model.World;
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.game.message.impl.PlayerDesignMessage;
|
||||
import org.apollo.game.model.Appearance;
|
||||
import org.apollo.game.model.World;
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.game.message.impl.ItemActionMessage;
|
||||
import org.apollo.game.model.Item;
|
||||
import org.apollo.game.model.World;
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.game.message.impl.SwitchItemMessage;
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.game.model.entity.Player;
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
package org.apollo.game.message.handler;
|
||||
|
||||
import org.apollo.game.message.MessageHandler;
|
||||
import org.apollo.game.message.impl.WalkMessage;
|
||||
import org.apollo.game.model.Position;
|
||||
import org.apollo.game.model.World;
|
||||
File renamed without changes.
+1
-1
@@ -1,6 +1,6 @@
|
||||
package org.apollo.game.message.impl;
|
||||
|
||||
import org.apollo.game.message.Message;
|
||||
import org.apollo.net.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent by the client when a player adds someone to their friends list.
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package org.apollo.game.message.impl;
|
||||
|
||||
import org.apollo.game.message.Message;
|
||||
import org.apollo.net.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent by the client when a player adds someone to their ignore list.
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package org.apollo.game.message.impl;
|
||||
|
||||
import org.apollo.game.message.Message;
|
||||
import org.apollo.net.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent by the client when the user has pressed an arrow key.
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package org.apollo.game.message.impl;
|
||||
|
||||
import org.apollo.game.message.Message;
|
||||
import org.apollo.net.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent by the client when a player clicks a button.
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package org.apollo.game.message.impl;
|
||||
|
||||
import org.apollo.game.message.Message;
|
||||
import org.apollo.net.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent by the client to send a public chat message to other players.
|
||||
+1
-1
@@ -1,8 +1,8 @@
|
||||
package org.apollo.game.message.impl;
|
||||
|
||||
import org.apollo.game.message.Message;
|
||||
import org.apollo.game.model.Position;
|
||||
import org.apollo.game.model.area.RegionCoordinates;
|
||||
import org.apollo.net.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent to the client to remove all spawned objects and items from a Region.
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package org.apollo.game.message.impl;
|
||||
|
||||
import org.apollo.game.message.Message;
|
||||
import org.apollo.net.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent to the client that closes the open interface.
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package org.apollo.game.message.impl;
|
||||
|
||||
import org.apollo.game.message.Message;
|
||||
import org.apollo.net.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent by the client when the current interface is closed.
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package org.apollo.game.message.impl;
|
||||
|
||||
import org.apollo.game.message.Message;
|
||||
import org.apollo.net.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent by the client to send a {@code ::} command.
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package org.apollo.game.message.impl;
|
||||
|
||||
import org.apollo.game.message.Message;
|
||||
import org.apollo.net.message.Message;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent to the client to adjust a certain config or attribute setting.
|
||||
Loaded 100 of 658 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user