Skip to content

Commit

Permalink
default apollo
Browse files Browse the repository at this point in the history
  • Loading branch information
Major- committed Oct 27, 2013
0 parents commit 4abea0c
Show file tree
Hide file tree
Showing 406 changed files with 23,043 additions and 0 deletions.
14 changes: 14 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Copyright (c) 2010-2011 Graham Edgecombe

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

55 changes: 55 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Apollo is a RuneScape emulator which aims to encourage a fundamentally-different alternative to the way in which private server development is done today. It consists of a high-performance, modular server written in Java as well as a collection of utilities for managing the data files and plugins.

Currently people download a server, read through tutorials and apply their modifications or write their own code on top of it. They'll then host it or release it. The result is we currently have a complete mess of servers (this includes every current base - Hyperion, rs2hd, winterlove) all created from cobbled-together code.

Apollo is going to change that through its plugin system. Instead of throwing everything into one big application, Apollo consists of:

A small 'core' application which provides features necessary for the server to operate.
A set of plugins, and the tools to manage them (install, uninstall, publish, download, etc).
Some additional tools and utilities for managing the data files.


This will make it much easier for everyone to develop a private server, no longer restricting it to people who can (or can't as the case is here) program. Instead of messing around copying and pasting lines of code from a woodcutting tutorial, people will simply have to download and install a woodcutting plugin.

There is also a plan to have a plugin repository (or maybe multiple repositories) and a set of tools to make the experience very much like a package manager on Linux.

It also means updates can be provided for the core server (e.g. security, stability, optimizations) very easily. Users will just have to download the new jar, overwrite the current one with the new one, and reboot their server.

And best of all, inexperienced users are protected from making fatal mistakes in the core and are kept away from stuff that they shouldn't be editing at their experience level.

Plugins are currently written in Ruby, however, in the future other languages could be added.

Core Features

Some of the significant (technically) current core features include:

Packet encoding/decoding has been split from the representations of the packets themselves. This allows the potential for encoding/decoding to go on in parallel and also allows multiple revisions to be supported. Currently 317 and 377 are both completely supported.
Update server support (JAGGRAB, ondemand and HTTP).
Packet handler chaining: this allows multiple plugins to be able to intercept a single packet and deal with it appropriately. For example, a quest plugin could intercept searching a bookshelf for instance, if the behaviour needed to change in certain cases.
Parallel execution of player updating for multi-core machines - this has a significant benefit on my dual core machine used to test the server.


As well as that, it has the bog standard stuff:

Login
Appearance updating
Multiplayer
Walking/running
Rights management
Travel back algorithm for movement
Character design
Chatting
Commands
Inventory support
Equipment support
Animations
Graphics
Facing/turn to
Action system
Working distanced actions
All data types implemented
Task scheduler based on game ticks
Saving/loading with a custom binary format
Skill levels/experiences
Plugin management
Reads item information from the cache
93 changes: 93 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0"?>
<project name="apollo" default="build" xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="root" location="." />
<property name="src" location="src" />
<property name="test" location="test" />
<property name="bin" location="bin" />
<property name="lib" location="lib" />
<property name="doc" location="doc" />
<property name="version" value="377" />

<path id="binaries">
<pathelement path="${bin}" />
</path>

<path id="libraries">
<fileset dir="${lib}">
<include name="*.jar" />
</fileset>
</path>

<path id="master">
<path refid="binaries" />
<path refid="libraries" />
</path>

<fileset id="sources" dir="${src}">
<include name="**/*.java" />
</fileset>

<fileset id="tests" dir="${bin}">
<include name="**/*Test*.class" />
<exclude name="**/*$*.class" />
</fileset>

<target name="init">
<mkdir dir="${bin}" />
<mkdir dir="${lib}" />
<mkdir dir="${doc}" />
</target>

<target name="resolve" depends="init">
<ivy:retrieve pattern="${lib}/[artifact]-[revision].[ext]" sync="true" />
</target>

<target name="build" depends="init">
<javac srcdir="${src}:${test}" destdir="${bin}" includeantruntime="false">
<classpath refid="libraries" />
</javac>
</target>

<target name="clean">
<delete dir="${bin}" />
<delete dir="${doc}" />
</target>

<target name="rebuild" depends="clean, build" />

<target name="test" depends="build">
<junit fork="true" haltonfailure="true">
<classpath refid="master" />
<formatter type="plain" usefile="false" />
<batchtest>
<fileset refid="tests" />
</batchtest>
</junit>
</target>

<target name="doc" depends="build">
<javadoc sourcepath="${src}" classpathref="libraries" access="private" destdir="${doc}" windowtitle="Apollo">
<doclet name="org.jboss.apiviz.APIviz" pathref="libraries">
<param name="-sourceclasspath" value="${bin}" />
<param name="-author" />
<param name="-version" />
<param name="-use" />
<param name="-nopackagediagram" />
</doclet>
<doctitle><![CDATA[<h1>Apollo</h1>]]></doctitle>
<link href="http://download.oracle.com/javase/6/docs/api/" />
<link href="http://docs.jboss.org/netty/3.2/api/" />
<link href="http://guava-libraries.googlecode.com/svn/trunk/javadoc/" />
<link href="http://www.junit.org/apidocs/" />
<link href="http://commons.apache.org/compress/apidocs/" />
<link href="http://jruby.org/apidocs/" />
</javadoc>
</target>

<target name="run" depends="build">
<java classpathref="master" fork="true" classname="org.apollo.Server">
<arg value="org.apollo.net.release.r${version}.Release${version}" />
<jvmarg value="-Xbootclasspath/a:${lib}/jsr166-1.0.0.jar" />
</java>
</target>
</project>
Binary file added data/equipment-317.dat
Binary file not shown.
Binary file added data/equipment-377.dat
Binary file not shown.
73 changes: 73 additions & 0 deletions data/events.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<events>
<event>
<type>org.apollo.game.event.impl.KeepAliveEvent</type>
<chain />
</event>
<event>
<type>org.apollo.game.event.impl.CharacterDesignEvent</type>
<chain>
<handler>org.apollo.game.event.handler.impl.CharacterDesignVerificationHandler</handler>
<handler>org.apollo.game.event.handler.impl.CharacterDesignEventHandler</handler>
</chain>
</event>
<event>
<type>org.apollo.game.event.impl.WalkEvent</type>
<chain>
<handler>org.apollo.game.event.handler.impl.WalkEventHandler</handler>
</chain>
</event>
<event>
<type>org.apollo.game.event.impl.ChatEvent</type>
<chain>
<handler>org.apollo.game.event.handler.impl.ChatVerificationHandler</handler>
<handler>org.apollo.game.event.handler.impl.ChatEventHandler</handler>
</chain>
</event>
<event>
<type>org.apollo.game.event.impl.ButtonEvent</type>
<chain>
<handler>org.apollo.game.event.handler.impl.BankButtonEventHandler</handler>
</chain>
</event>
<event>
<type>org.apollo.game.event.impl.CommandEvent</type>
<chain>
<handler>org.apollo.game.event.handler.impl.CommandEventHandler</handler>
</chain>
</event>
<event>
<type>org.apollo.game.event.impl.SwitchItemEvent</type>
<chain>
<handler>org.apollo.game.event.handler.impl.SwitchItemEventHandler</handler>
</chain>
</event>
<event>
<type>org.apollo.game.event.impl.ObjectActionEvent</type>
<chain />
</event>
<event>
<type>org.apollo.game.event.impl.EquipEvent</type>
<chain>
<handler>org.apollo.game.event.handler.impl.EquipEventHandler</handler>
</chain>
</event>
<event>
<type>org.apollo.game.event.impl.ItemActionEvent</type>
<chain>
<handler>org.apollo.game.event.handler.impl.RemoveEventHandler</handler>
<handler>org.apollo.game.event.handler.impl.BankEventHandler</handler>
</chain>
</event>
<event>
<type>org.apollo.game.event.impl.ClosedInterfaceEvent</type>
<chain>
<handler>org.apollo.game.event.handler.impl.ClosedInterfaceEventHandler</handler>
</chain>
</event>
<event>
<type>org.apollo.game.event.impl.EnteredAmountEvent</type>
<chain>
<handler>org.apollo.game.event.handler.impl.EnteredAmountEventHandler</handler>
</chain>
</event>
</events>
4 changes: 4 additions & 0 deletions data/login.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<login>
<loader>org.apollo.io.player.impl.BinaryPlayerLoader</loader>
<saver>org.apollo.io.player.impl.BinaryPlayerSaver</saver>
</login>
Binary file added data/note-317.dat
Binary file not shown.
Binary file added data/note-377.dat
Binary file not shown.
33 changes: 33 additions & 0 deletions data/plugins/bank/bank.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
require 'java'
java_import 'org.apollo.game.action.DistancedAction'
java_import 'org.apollo.game.model.inter.bank.BankUtils'

BANK_BOOTH_ID = 2213
BANK_BOOTH_SIZE = 1

class BankAction < DistancedAction
attr_reader :position

def initialize(character, position)
super 0, true, character, position, BANK_BOOTH_SIZE
@position = position
end

def executeAction
character.turn_to @position
BankUtils.open_bank character
stop
end

def equals(other)
return (get_class == other.get_class and @position == other.position)
end
end

on :event, :object_action do |ctx, player, event|
if event.option == 2 and event.id == BANK_BOOTH_ID
player.startAction BankAction.new(player, event.position)
end
end

# TODO: when we have NPCs/dialogue, also respond to clicking on them
14 changes: 14 additions & 0 deletions data/plugins/bank/plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<plugin>
<id>bank</id>
<version>1</version>
<name>Bank</name>
<description>Opens the bank interface when players select 'use-quickly' on a bank booth.</description>
<authors>
<author>Graham</author>
</authors>
<scripts>
<script>bank.rb</script>
</scripts>
<dependencies />
</plugin>
Loading

0 comments on commit 4abea0c

Please sign in to comment.