Initial Commit

This commit is contained in:
Jonathan Williams 2013-08-27 08:14:08 -07:00
commit 3fb52c5c71
4016 changed files with 930326 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Maps/Domination/gulley.zip Normal file

Binary file not shown.

BIN
Maps/Domination/hidden.zip Normal file

Binary file not shown.

BIN
Maps/Domination/pyramid.zip Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Maps/Domination/village.zip Normal file

Binary file not shown.

BIN
Maps/MK64/BattleA.zip Normal file

Binary file not shown.

BIN
Maps/MK64/BattleB.zip Normal file

Binary file not shown.

BIN
Maps/MK64/BattleC.zip Normal file

Binary file not shown.

BIN
Maps/MK64/HUB.zip Normal file

Binary file not shown.

BIN
Maps/MK64/MushroomA.zip Normal file

Binary file not shown.

BIN
Maps/MK64/MushroomB.zip Normal file

Binary file not shown.

BIN
Maps/MK64/MushroomC.zip Normal file

Binary file not shown.

BIN
Maps/MK64/MushroomD.zip Normal file

Binary file not shown.

BIN
Maps/MK64/Result.zip Normal file

Binary file not shown.

BIN
Maps/world_ruins.rar Normal file

Binary file not shown.

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre7"/>
<classpathentry combineaccessrules="false" kind="src" path="/Nautilus.Core.Server"/>
<classpathentry combineaccessrules="false" kind="src" path="/Nautilus.Core"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/bukkit.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Nautilus.Core.VoteHub"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/Nautilus.Core.VoteHub/Hub.xml}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value=""/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/Nautilus.Core.VoteHub}"/>
</launchConfiguration>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Nautilus.Core.VoteHub</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/VoteHub.launch</value>
</dictionary>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="VoteHub" default="VoteHub" basedir=".">
<target name ="VoteHub" description="VoteHub">
<jar jarfile="../bin/VoteHub.jar">
<fileset dir="../Nautilus.Core.VoteHub/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Nautilus.Core.Server/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Plugins/Nautilus.Core/bin">
<include name="**/*.class"/>
</fileset>
<zipfileset src="../Plugins/Libraries/bukkit.jar" />
<zipfileset src="../Plugins/Libraries/commons-io-2.4.jar" />
<zipfileset src="../Plugins/Libraries/gson-2.2.1.jar" />
<zipfileset src="../Plugins/Libraries/httpcore-4.2.jar" />
<zipfileset src="../Plugins/Libraries/httpclient-4.2.jar" />
<zipfileset src="../Plugins/Libraries/commons-logging-1.1.1.jar" />
<manifest>
<attribute name="Main-Class" value="nautilus.core.votehub.Program" />
</manifest>
</jar>
<copy file="../bin/VoteHub.jar" todir="../Testing/VoteHub"/>
</target>
</project>

View File

@ -0,0 +1,40 @@
package nautilus.core.votehub;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Program
{
public static void main(String[] args) throws Exception
{
VoteHub hub = new VoteHub();
System.out.println("Enabled Nautilus Vote Hub");
BufferedReader br = new BufferedReader(new InputStreamReader( System.in ));
while (hub.IsRunning())
{
try
{
Thread.sleep(25);
}
catch (Exception ex)
{
ex.printStackTrace();
}
String line = br.readLine();
if (line != null)
{
boolean handled = hub.ProcessCommand(line);
if (!handled)
{
System.err.println("Command not found");
}
}
}
System.exit(0);
}
}

View File

@ -0,0 +1,91 @@
package nautilus.core.votehub;
import java.io.File;
import java.io.IOException;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import mineplex.core.server.ServerBroadcaster;
import nautilus.core.votehub.votifier.net.VoteReceiver;
public class VoteHub
{
private String WEB_CONFIG = "webServer";
private String IP = "ip";
private String PORT = "port";
private String CONFIG_FILE = "config.yml";
private FileConfiguration _config;
private VoteReceiver _voteReceiver;
private boolean _isRunning = true;
private ServerBroadcaster _serverTalker;
public VoteHub()
{
_config = YamlConfiguration.loadConfiguration(new File(CONFIG_FILE));
_config.addDefault(WEB_CONFIG, "http://bettermc.com/");
_config.set(WEB_CONFIG, _config.getString(WEB_CONFIG));
_config.addDefault(IP, "bettermc.com");
_config.set(IP, _config.getString(IP));
_config.addDefault(PORT, 8192);
_config.set(PORT, _config.getInt(PORT));
try
{
_config.save(CONFIG_FILE);
}
catch (IOException e1)
{
e1.printStackTrace();
}
_config = YamlConfiguration.loadConfiguration(new File(CONFIG_FILE));
_serverTalker = new ServerBroadcaster(_config.getString(WEB_CONFIG));
_serverTalker.start();
try
{
_voteReceiver = new VoteReceiver(_serverTalker, _config.getString(WEB_CONFIG), _config.getString(IP), _config.getInt(PORT));
_voteReceiver.start();
}
catch (Exception e)
{
e.printStackTrace();
}
}
public boolean IsRunning()
{
return _isRunning;
}
public boolean ProcessCommand(String line)
{
if (line.equalsIgnoreCase("stop"))
{
_isRunning = false;
System.out.println("Shutting down...");
return true;
}
else if (line.equalsIgnoreCase("packets"))
{
_serverTalker.PrintPackets();
return true;
}
else if (line.equalsIgnoreCase("servers"))
{
_serverTalker.PrintServers();
return true;
}
return false;
}
}

View File

@ -0,0 +1,32 @@
package nautilus.core.votehub.votifier;
import java.util.logging.*;
/**
* A custom log filter for prepending plugin identifier on all log messages.
*
* @author frelling
*
*/
class LogFilter implements Filter {
private String prefix;
/**
* Constructs a log filter that prepends the given prefix on all log
* messages.
*
* @param prefix
*/
public LogFilter(String prefix) {
this.prefix = prefix;
}
/**
* Always returns true, but adds prefix to log message.
*/
public boolean isLoggable(LogRecord record) {
record.setMessage(prefix + record.getMessage());
return true;
}
}

View File

@ -0,0 +1,68 @@
/*
* Copyright (C) 2011 Vex Software LLC
* This file is part of Votifier.
*
* Votifier is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Votifier is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Votifier. If not, see <http://www.gnu.org/licenses/>.
*/
package nautilus.core.votehub.votifier.crypto;
import java.security.PrivateKey;
import java.security.PublicKey;
import javax.crypto.Cipher;
/**
* Static RSA utility methods for encrypting and decrypting blocks of
* information.
*
* @author Blake Beaupain
*/
public class RSA {
/**
* Encrypts a block of data.
*
* @param data
* The data to encrypt
* @param key
* The key to encrypt with
* @return The encrypted data
* @throws Exception
* If an error occurs
*/
public static byte[] encrypt(byte[] data, PublicKey key) throws Exception {
Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.ENCRYPT_MODE, key);
return cipher.doFinal(data);
}
/**
* Decrypts a block of data.
*
* @param data
* The data to decrypt
* @param key
* The key to decrypt with
* @return The decrypted data
* @throws Exception
* If an error occurs
*/
public static byte[] decrypt(byte[] data, PrivateKey key) throws Exception {
Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.DECRYPT_MODE, key);
return cipher.doFinal(data);
}
}

View File

@ -0,0 +1,111 @@
/*
* Copyright (C) 2011 Vex Software LLC
* This file is part of Votifier.
*
* Votifier is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Votifier is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Votifier. If not, see <http://www.gnu.org/licenses/>.
*/
package nautilus.core.votehub.votifier.crypto;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import javax.xml.bind.DatatypeConverter;
/**
* Static utility methods for saving and loading RSA key pairs.
*
* @author Blake Beaupain
*/
public class RSAIO {
/**
* Saves the key pair to the disk.
*
* @param directory
* The directory to save to
* @param keyPair
* The key pair to save
* @throws Exception
* If an error occurs
*/
public static void save(File directory, KeyPair keyPair) throws Exception {
PrivateKey privateKey = keyPair.getPrivate();
PublicKey publicKey = keyPair.getPublic();
// Store the public key.
X509EncodedKeySpec publicSpec = new X509EncodedKeySpec(
publicKey.getEncoded());
FileOutputStream out = new FileOutputStream(directory + "/public.key");
out.write(DatatypeConverter.printBase64Binary(publicSpec.getEncoded())
.getBytes());
out.close();
// Store the private key.
PKCS8EncodedKeySpec privateSpec = new PKCS8EncodedKeySpec(
privateKey.getEncoded());
out = new FileOutputStream(directory + "/private.key");
out.write(DatatypeConverter.printBase64Binary(privateSpec.getEncoded())
.getBytes());
out.close();
}
/**
* Loads an RSA key pair from a directory. The directory must have the files
* "public.key" and "private.key".
*
* @param directory
* The directory to load from
* @return The key pair
* @throws Exception
* If an error occurs
*/
public static KeyPair load(File directory) throws Exception {
// Read the public key file.
File publicKeyFile = new File(directory + "/public.key");
FileInputStream in = new FileInputStream(directory + "/public.key");
byte[] encodedPublicKey = new byte[(int) publicKeyFile.length()];
in.read(encodedPublicKey);
encodedPublicKey = DatatypeConverter.parseBase64Binary(new String(
encodedPublicKey));
in.close();
// Read the private key file.
File privateKeyFile = new File(directory + "/private.key");
in = new FileInputStream(directory + "/private.key");
byte[] encodedPrivateKey = new byte[(int) privateKeyFile.length()];
in.read(encodedPrivateKey);
encodedPrivateKey = DatatypeConverter.parseBase64Binary(new String(
encodedPrivateKey));
in.close();
// Instantiate and return the key pair.
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(
encodedPublicKey);
PublicKey publicKey = keyFactory.generatePublic(publicKeySpec);
PKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(
encodedPrivateKey);
PrivateKey privateKey = keyFactory.generatePrivate(privateKeySpec);
return new KeyPair(publicKey, privateKey);
}
}

View File

@ -0,0 +1,52 @@
/*
* Copyright (C) 2011 Vex Software LLC
* This file is part of Votifier.
*
* Votifier is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Votifier is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Votifier. If not, see <http://www.gnu.org/licenses/>.
*/
package nautilus.core.votehub.votifier.crypto;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.spec.RSAKeyGenParameterSpec;
import java.util.logging.Logger;
/**
* An RSA key pair generator.
*
* @author Blake Beaupain
*/
public class RSAKeygen {
/** The logger instance. */
private static final Logger LOG = Logger.getLogger("Votifier");
/**
* Generates an RSA key pair.
*
* @param bits
* The amount of bits
* @return The key pair
*/
public static KeyPair generate(int bits) throws Exception {
LOG.info("Votifier is generating an RSA key pair...");
KeyPairGenerator keygen = KeyPairGenerator.getInstance("RSA");
RSAKeyGenParameterSpec spec = new RSAKeyGenParameterSpec(bits,
RSAKeyGenParameterSpec.F4);
keygen.initialize(spec);
return keygen.generateKeyPair();
}
}

View File

@ -0,0 +1,122 @@
/*
* Copyright (C) 2011 Vex Software LLC
* This file is part of Votifier.
*
* Votifier is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Votifier is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Votifier. If not, see <http://www.gnu.org/licenses/>.
*/
package nautilus.core.votehub.votifier.model;
/**
* A model for a vote.
*
* @author Blake Beaupain
*/
public class Vote {
/** The name of the vote service. */
private String serviceName;
/** The username of the voter. */
private String username;
/** The address of the voter. */
private String address;
/** The date and time of the vote. */
private String timeStamp;
@Override
public String toString() {
return "Vote (from:" + serviceName + " username:" + username
+ " address:" + address + " timeStamp:" + timeStamp + ")";
}
/**
* Sets the serviceName.
*
* @param serviceName
* The new serviceName
*/
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}
/**
* Gets the serviceName.
*
* @return The serviceName
*/
public String getServiceName() {
return serviceName;
}
/**
* Sets the username.
*
* @param username
* The new username
*/
public void setUsername(String username) {
this.username = username;
}
/**
* Gets the username.
*
* @return The username
*/
public String getUsername() {
return username;
}
/**
* Sets the address.
*
* @param address
* The new address
*/
public void setAddress(String address) {
this.address = address;
}
/**
* Gets the address.
*
* @return The address
*/
public String getAddress() {
return address;
}
/**
* Sets the time stamp.
*
* @param timeStamp
* The new time stamp
*/
public void setTimeStamp(String timeStamp) {
this.timeStamp = timeStamp;
}
/**
* Gets the time stamp.
*
* @return The time stamp
*/
public String getTimeStamp() {
return timeStamp;
}
}

View File

@ -0,0 +1,213 @@
package nautilus.core.votehub.votifier.net;
import java.io.BufferedWriter;
import java.io.File;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketException;
import java.security.KeyPair;
import java.util.logging.*;
import javax.crypto.BadPaddingException;
import mineplex.core.server.ServerBroadcaster;
import mineplex.core.server.packet.PlayerVotePacket;
import mineplex.core.server.remotecall.AsyncJsonWebCall;
import mineplex.core.server.util.Callback;
import mineplex.minecraft.donation.repository.token.PlayerUpdateToken;
import nautilus.core.votehub.votifier.crypto.RSA;
import nautilus.core.votehub.votifier.crypto.RSAIO;
import nautilus.core.votehub.votifier.crypto.RSAKeygen;
import nautilus.core.votehub.votifier.model.Vote;
public class VoteReceiver extends Thread
{
private static final Logger LOG = Logger.getLogger("Votifier");
private final String _host;
private final int _port;
private KeyPair _keyPair;
private ServerSocket server;
private ServerBroadcaster _serverTalker;
private String _webserver;
private boolean running = true;
public VoteReceiver(ServerBroadcaster serverTalker, String webserver, String host, int port) throws Exception
{
_serverTalker = serverTalker;
_webserver = webserver;
_host = host;
_port = port;
initialize();
}
private void initialize() throws Exception
{
try
{
server = new ServerSocket();
server.bind(new InetSocketAddress(_host, _port));
System.out.println("Bound to : " + _host + ":" + _port);
}
catch (Exception ex)
{
LOG.log(Level.SEVERE, "Error initializing vote receiver. Please verify that the configured");
LOG.log(Level.SEVERE, "IP address and port are not already in use. This is a common problem");
LOG.log(Level.SEVERE, "with hosting services and, if so, you should check with your hosting provider.", ex);
throw new Exception(ex);
}
File rsaDirectory = new File("rsa/");
try
{
if (!rsaDirectory.exists())
{
rsaDirectory.mkdir();
_keyPair = RSAKeygen.generate(2048);
RSAIO.save(rsaDirectory, _keyPair);
}
else
{
_keyPair = RSAIO.load(rsaDirectory);
}
}
catch (Exception ex)
{
LOG.log(Level.SEVERE, "Error reading configuration file or RSA keys", ex);
return;
}
}
public void shutdown()
{
running = false;
if (server == null)
return;
try
{
server.close();
}
catch (Exception ex)
{
LOG.log(Level.WARNING, "Unable to shut down vote receiver cleanly.");
}
}
@Override
public void run()
{
while (running)
{
try
{
Socket socket = server.accept();
socket.setSoTimeout(5000); // Don't hang on slow connections.
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
InputStream in = socket.getInputStream();
// Send them our version.
writer.write("VOTIFIER 1.9");
writer.newLine();
writer.flush();
// Read the 256 byte block.
byte[] block = new byte[256];
in.read(block, 0, block.length);
// Decrypt the block.
block = RSA.decrypt(block, _keyPair.getPrivate());
int position = 0;
// Perform the opcode check.
String opcode = readString(block, position);
position += opcode.length() + 1;
if (!opcode.equals("VOTE"))
{
throw new Exception("Unable to decode RSA");
}
// Parse the block.
String serviceName = readString(block, position);
position += serviceName.length() + 1;
String username = readString(block, position);
position += username.length() + 1;
String address = readString(block, position);
position += address.length() + 1;
String timeStamp = readString(block, position);
position += timeStamp.length() + 1;
// Create the vote.
final Vote vote = new Vote();
vote.setServiceName(serviceName);
vote.setUsername(username);
vote.setAddress(address);
vote.setTimeStamp(timeStamp);
System.out.println(serviceName);
System.out.println(address);
if (serviceName.equalsIgnoreCase("MinecraftServers.org") || serviceName.equalsIgnoreCase("Minestatus"))
{
new AsyncJsonWebCall(_webserver + "PlayerAccount/PlayerVoted").Execute(PlayerUpdateToken.class, new Callback<PlayerUpdateToken>()
{
public void run(PlayerUpdateToken token)
{
_serverTalker.QueuePacket(new PlayerVotePacket(vote.getUsername(), token.Points));
}
}, username);
}
else
{
System.out.println("Received invalid vote from : " + serviceName + " for username : " + username + " at : " + timeStamp);
}
// Clean up.
writer.close();
in.close();
socket.close();
}
catch (SocketException ex)
{
LOG.log(Level.WARNING, "Protocol error. Ignoring packet - " + ex.getLocalizedMessage());
}
catch (BadPaddingException ex)
{
LOG.log(Level.WARNING, "Unable to decrypt vote record. Make sure that that your public key");
LOG.log(Level.WARNING, "matches the one you gave the server list.", ex);
}
catch (Exception ex)
{
LOG.log(Level.WARNING, "Exception caught while receiving a vote notification", ex);
}
}
}
/**
* Reads a string from a block of data.
*
* @param data
* The data to read from
* @return The string
*/
private String readString(byte[] data, int offset)
{
StringBuilder builder = new StringBuilder();
for (int i = offset; i < data.length; i++)
{
if (data[i] == '\n')
break; // Delimiter reached.
builder.append((char) data[i]);
}
return builder.toString();
}
}

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="loc" default="GemAccountSystem" basedir=".">
<target name ="GemAccountSystem" description="GemAccountSystem">
<jar jarfile="../bin/GemAccountSystem.jar">
<fileset dir="../Mineplex.Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Core.Common/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Minecraft.GemAccountSystem/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Minecraft.GemAccountSystem">
<include name="*.yml"/>
</fileset>
<zipfileset src="../Libraries/httpclient-4.2.jar" />
<zipfileset src="../Libraries/httpcore-4.2.jar" />
<zipfileset src="../Libraries/commons-logging-1.1.1.jar" />
</jar>
<copy file="../bin/GemAccountSystem.jar" todir="../../Testing/GemAccountSystem/plugins"/>
</target>
</project>

View File

@ -0,0 +1,276 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="loc" default="default" basedir=".">
<target name ="Dominate" description="Dominate">
<jar jarfile="../bin/Dominate.jar">
<fileset dir="../Nautilus.Game.Dominate/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Nautilus.Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Core.Common/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Minecraft.Game.ClassCombat/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Minecraft.Game.Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Nautilus.Game.Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Nautilus.Game.Dominate">
<include name="*.yml"/>
</fileset>
<zipfileset src="../Libraries/httpclient-4.2.jar" />
<zipfileset src="../Libraries/httpcore-4.2.jar" />
<zipfileset src="../Libraries/httpclient-cache-4.2.jar" />
<zipfileset src="../Libraries/httpmime-4.2.jar" />
<zipfileset src="../Libraries/gson-2.2.1.jar" />
<zipfileset src="../Libraries/commons-logging-1.1.1.jar" />
</jar>
<copy file="../bin/Dominate.jar" todir="../../Testing/Dominate/plugins"/>
</target>
<target name ="CaptureThePig" description="CaptureThePig">
<jar jarfile="../bin/CaptureThePig.jar">
<fileset dir="../Nautilus.Game.CaptureThePig/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Nautilus.Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Nautilus.Game.Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Nautilus.Game.CaptureThePig">
<include name="*.yml"/>
</fileset>
<zipfileset src="../Libraries/httpclient-4.2.jar" />
<zipfileset src="../Libraries/httpcore-4.2.jar" />
<zipfileset src="../Libraries/httpclient-cache-4.2.jar" />
<zipfileset src="../Libraries/httpmime-4.2.jar" />
<zipfileset src="../Libraries/gson-2.2.1.jar" />
<zipfileset src="../Libraries/commons-logging-1.1.1.jar" />
</jar>
<copy file="../bin/CaptureThePig.jar" todir="../../Testing/CaptureThePig/plugins"/>
</target>
<target name ="PvP" description="PvP">
<jar jarfile="../bin/PvP.jar">
<fileset dir="../Nautilus.Game.PvP/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Nautilus.Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Nautilus.Game.PvP">
<include name="*.yml"/>
</fileset>
<zipfileset src="../Libraries/httpclient-4.2.jar" />
<zipfileset src="../Libraries/httpcore-4.2.jar" />
<zipfileset src="../Libraries/httpclient-cache-4.2.jar" />
<zipfileset src="../Libraries/httpmime-4.2.jar" />
<zipfileset src="../Libraries/gson-2.2.1.jar" />
<zipfileset src="../Libraries/commons-logging-1.1.1.jar" />
</jar>
<copy file="../bin/PvP.jar" todir="../../Testing/PvP/plugins"/>
</target>
<target name ="Tutorial" description="Tutorial">
<jar jarfile="../bin/Tutorial.jar">
<fileset dir="../Nautilus.Game.Tutorial/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Nautilus.Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Nautilus.Game.Tutorial">
<include name="*.yml"/>
</fileset>
<zipfileset src="../Libraries/httpclient-4.2.jar" />
<zipfileset src="../Libraries/httpcore-4.2.jar" />
<zipfileset src="../Libraries/httpclient-cache-4.2.jar" />
<zipfileset src="../Libraries/httpmime-4.2.jar" />
<zipfileset src="../Libraries/gson-2.2.1.jar" />
<zipfileset src="../Libraries/commons-logging-1.1.1.jar" />
</jar>
<copy file="../bin/Tutorial.jar" todir="../../Testing/Tutorial/plugins"/>
</target>
<target name ="Arcade" description="Arcade">
<jar jarfile="../bin/Arcade.jar">
<fileset dir="../Nautilus.Game.Arcade/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Nautilus.Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Core.Common/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Minecraft.Punish/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Minecraft.Game.Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Nautilus.Game.Arcade">
<include name="*.yml"/>
</fileset>
<zipfileset src="../Libraries/httpclient-4.2.jar" />
<zipfileset src="../Libraries/httpcore-4.2.jar" />
<zipfileset src="../Libraries/httpclient-cache-4.2.jar" />
<zipfileset src="../Libraries/httpmime-4.2.jar" />
<zipfileset src="../Libraries/gson-2.2.1.jar" />
<zipfileset src="../Libraries/commons-logging-1.1.1.jar" />
</jar>
<copy file="../bin/Arcade.jar" todir="../../Testing/Arcade/plugins"/>
</target>
<target name ="Hub" description="Hub">
<jar jarfile="../bin/Hub.jar">
<fileset dir="../Mineplex.Hub/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Nautilus.Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Core.Common/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Minecraft.Shop/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Minecraft.Punish/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Minecraft.Game.Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Hub">
<include name="*.yml"/>
</fileset>
<zipfileset src="../Libraries/httpclient-4.2.jar" />
<zipfileset src="../Libraries/httpcore-4.2.jar" />
<zipfileset src="../Libraries/httpclient-cache-4.2.jar" />
<zipfileset src="../Libraries/httpmime-4.2.jar" />
<zipfileset src="../Libraries/gson-2.2.1.jar" />
<zipfileset src="../Libraries/commons-logging-1.1.1.jar" />
</jar>
<copy file="../bin/Hub.jar" todir="../../Testing/Hub/plugins"/>
</target>
<target name ="MineKart" description="MineKart">
<jar jarfile="../bin/MineKart.jar">
<fileset dir="../Nautilus.Game.MineKart/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Nautilus.Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Core.Common/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Minecraft.Game.Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Minecraft.Shop/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Mineplex.Minecraft.Punish/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Nautilus.Game.MineKart">
<include name="*.yml"/>
</fileset>
<zipfileset src="../Libraries/httpclient-4.2.jar" />
<zipfileset src="../Libraries/httpcore-4.2.jar" />
<zipfileset src="../Libraries/httpclient-cache-4.2.jar" />
<zipfileset src="../Libraries/httpmime-4.2.jar" />
<zipfileset src="../Libraries/gson-2.2.1.jar" />
<zipfileset src="../Libraries/commons-logging-1.1.1.jar" />
</jar>
<copy file="../bin/MineKart.jar" todir="../../Testing/MineKart/plugins"/>
</target>
<target name ="Lobby" description="Lobby">
<jar jarfile="../bin/Lobby.jar">
<fileset dir="../Nautilus.Game.Lobby/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Nautilus.Core/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../../Nautilus.Core.Server/bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="../Nautilus.Game.Lobby">
<include name="*.yml"/>
</fileset>
<zipfileset src="../Libraries/httpclient-4.2.jar" />
<zipfileset src="../Libraries/httpcore-4.2.jar" />
<zipfileset src="../Libraries/httpclient-cache-4.2.jar" />
<zipfileset src="../Libraries/httpmime-4.2.jar" />
<zipfileset src="../Libraries/gson-2.2.1.jar" />
<zipfileset src="../Libraries/commons-logging-1.1.1.jar" />
</jar>
<copy file="../bin/Lobby.jar" todir="../../Testing/Lobby/plugins"/>
</target>
<target name="NautilusCraftBukkit2" description="NautilusCraftBukkit2">
<jar jarfile="../bin/craftbukkit-0.0.1-SNAPSHOT.jar">
<zipfileset src="../Libraries/craftbukkit.jar" excludes="META-INF/*.SF"/>
<fileset dir="../Nautilus.Core.CraftBukkit/bin">
<include name="**/*.class"/>
</fileset>
<manifest>
<attribute name="Main-Class" value="org.bukkit.craftbukkit.Main" />
</manifest>
<zipfileset src="../Libraries/jopt-simple-3.2.jar" />
</jar>
</target>
</project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre7"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/BungeeCord.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Mineplex.Bungee.BungeeSigns</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -0,0 +1,4 @@
name: BungeeSigns
main: mineplex.bungee.BungeeSigns.BungeeSigns
version: 1
author: defek7

View File

@ -0,0 +1,220 @@
package mineplex.bungee.BungeeSigns;
import java.io.ByteArrayInputStream;
import java.io.DataInput;
import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.ConnectException;
import java.net.Socket;
import java.net.SocketTimeoutException;
import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.Connection;
import net.md_5.bungee.api.event.PluginMessageEvent;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.event.EventHandler;
import net.md_5.bungee.protocol.packet.PacketFAPluginMessage;
public class BungeeSigns extends Plugin implements Listener
{
@Override
public void onEnable()
{
getProxy().getPluginManager().registerListener(this, this);
getProxy().registerChannel("BungeeSigns");
}
@EventHandler
public void ReceiveServerRequest(final PluginMessageEvent event)
{
if (event.getTag().equals("BungeeSigns"))
{
DataInputStream in = null;
try
{
in = new DataInputStream(new ByteArrayInputStream(event.getData()));
final ServerInfo serverInfo = getProxy().getServerInfo(in.readUTF());
in.close();
if (serverInfo != null)
{
new Thread() {
public void run()
{
SendServerInfo(serverInfo, event.getSender());
}
}.start();
}
}
catch (IOException e)
{
System.out.println("[BungeeSigns] Error retrieving serverInfo.");
}
finally
{
try
{
if (in != null)
{
in.close();
}
}
catch (Exception e)
{
}
}
}
}
protected void SendServerInfo(ServerInfo serverInfo, Connection sender)
{
Socket socket = null;
DataInputStream dataInputStream = null;
DataOutputStream dataOutputStream = null;
try
{
socket = new Socket();
socket.setSoTimeout(3000);
socket.setTcpNoDelay(true);
socket.setTrafficClass(18);
socket.connect(serverInfo.getAddress(), 3000);
dataInputStream = new DataInputStream(socket.getInputStream());
dataOutputStream = new DataOutputStream(socket.getOutputStream());
dataOutputStream.writeByte(254);
dataOutputStream.writeByte(1);
dataOutputStream.writeByte(254);
writeString("MC|PingHost", dataOutputStream);
dataOutputStream.writeShort(3 + 2 * serverInfo.getAddress().getHostString().length() + 4);
dataOutputStream.writeByte(74);
writeString(serverInfo.getAddress().getHostString(), dataOutputStream);
dataOutputStream.writeInt(serverInfo.getAddress().getPort());
if (dataInputStream.read() != 255)
{
return;
}
String var6 = readString(dataInputStream, 256);
String[] var27;
if (var6.startsWith("\u00a7") && var6.length() > 1)
{
var27 = var6.substring(1).split("\u0000");
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF(serverInfo.getName());
out.writeUTF(var27[3]);
out.writeInt(Integer.parseInt(var27[4]));
out.writeInt(Integer.parseInt(var27[5]));
byte[] b = out.toByteArray();
if (b.length != 0)
{
sender.unsafe().sendPacket(new PacketFAPluginMessage("BungeeSigns", b));
}
}
}
catch (SocketTimeoutException e)
{
;
}
catch (ConnectException e)
{
;
}
catch(IOException e)
{
System.out.println("[BungeeSigns] Error pinging " + serverInfo.getName() + "(" + serverInfo.getAddress().getHostString() + ":" + serverInfo.getAddress().getPort());
}
finally
{
try
{
if (dataInputStream != null)
{
dataInputStream.close();
}
}
catch (Exception exception)
{
;
}
try
{
if (dataOutputStream != null)
{
dataOutputStream.close();
}
}
catch (Exception exception)
{
;
}
try
{
if (socket != null)
{
socket.close();
}
}
catch (Exception exception)
{
;
}
}
}
public static void writeString(String par0Str, DataOutput par1DataOutput) throws IOException
{
if (par0Str.length() > 32767)
{
throw new IOException("String too big");
}
else
{
par1DataOutput.writeShort(par0Str.length());
par1DataOutput.writeChars(par0Str);
}
}
public static String readString(DataInput par0DataInput, int par1) throws IOException
{
short var2 = par0DataInput.readShort();
if (var2 > par1)
{
throw new IOException("Received string length longer than maximum allowed (" + var2 + " > " + par1 + ")");
}
else if (var2 < 0)
{
throw new IOException("Received string length is less than zero! Weird string!");
}
else
{
StringBuilder var3 = new StringBuilder();
for (int var4 = 0; var4 < var2; ++var4)
{
var3.append(par0DataInput.readChar());
}
return var3.toString();
}
}
}

13
Plugins/Core/.classpath Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/Nautilus.Core.CraftBukkit"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/craftbukkit.jar" sourcepath="/REPO_DIR/GitHubLibraries/CraftBukkit/src"/>
<classpathentry combineaccessrules="false" kind="src" path="/Nautilus.Core"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Core.Common"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Minecraft.Game.Core"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/bukkit.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/Mineplex.Core"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AFTER_CLEAN_TARGETS" value="Dominate,PvP,CaptureThePig,Tutorial,MineKart,"/>
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_MANUAL_TARGETS" value="Dominate,PvP,CaptureThePig,Tutorial,MineKart,"/>
<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/>
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value=""/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${BUILD_FILES}/common.xml"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/Core}"/>
</launchConfiguration>

27
Plugins/Core/.project Normal file
View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Core</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/CoreBuilder.launch</value>
</dictionary>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

91
Plugins/Core/Core.xml Normal file
View File

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. -->
<project basedir="." default="build" name="Core">
<property environment="env"/>
<property name="REPO_DIR" value="../../"/>
<property name="Game.location" value="../Base"/>
<property name="Nautilus.Game.CaptureThePig.location" value="../Nautilus.Game.CaptureThePig"/>
<property name="Nautilus.Game.Core.location" value="../Nautilus.Game.Core"/>
<property name="Nautilus.Game.Dominate.location" value="../Nautilus.Game.Dominate"/>
<property name="Nautilus.Game.Lobby.location" value="../Nautilus.Game.Lobby"/>
<property name="Nautilus.Game.PvP.location" value="../Nautilus.Game.PvP"/>
<property name="Nautilus.Game.Tutorial.location" value="../Nautilus.Game.Tutorial"/>
<property name="Nautilus.Main.location" value="../Nautilus.Main"/>
<property name="ECLIPSE_HOME" value="../../../../../Program Files/eclipse"/>
<property name="Nautilus.Core.location" value="../Nautilus.Core"/>
<property name="Nautilus.Core.CraftBukkit.location" value="../Nautilus.Core.CraftBukkit"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.6"/>
<property name="source" value="1.6"/>
<path id="Nautilus.Core.CraftBukkit.classpath">
<pathelement location="${Nautilus.Core.CraftBukkit.location}/bin"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/jline-2.6.jar"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/craftbukkit.jar"/>
</path>
<path id="Nautilus.Core.classpath">
<pathelement location="${Nautilus.Core.location}/bin"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/httpcore-4.2.jar"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/httpclient-4.2.jar"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/craftbukkit.jar"/>
</path>
<path id="Core.classpath">
<pathelement location="bin"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/bukkit.jar"/>
<path refid="Nautilus.Core.CraftBukkit.classpath"/>
<pathelement location="${REPO_DIR}/Plugins/Libraries/craftbukkit.jar"/>
<path refid="Nautilus.Core.classpath"/>
</path>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="src">
<exclude name="**/*.launch"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall">
<ant antfile="Nautilus.Core.xml" dir="${Nautilus.Core.location}" inheritAll="false" target="clean"/>
<ant antfile="Nautilus.Core.CraftBukkit.xml" dir="${Nautilus.Core.CraftBukkit.location}" inheritAll="false" target="clean"/>
</target>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects">
<ant antfile="Nautilus.Core.xml" dir="${Nautilus.Core.location}" inheritAll="false" target="build-project">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
<ant antfile="Nautilus.Core.CraftBukkit.xml" dir="${Nautilus.Core.CraftBukkit.location}" inheritAll="false" target="build-project">
<propertyset>
<propertyref name="build.compiler"/>
</propertyset>
</ant>
</target>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
<src path="src"/>
<classpath refid="Core.classpath"/>
</javac>
</target>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
</target>
</project>

Binary file not shown.

View File

@ -0,0 +1,90 @@
package me.chiss.Core.ClientData;
import org.bukkit.Location;
import mineplex.core.account.CoreClient;
public class ClientPlayer extends ClientDataBase<Object>
{
private long _lastAction = 0;
private long _lastGrounded = 0;
private long _lastMovement = 0;
private long _lastDamagee = 0;
private long _lastDamager = 0;
private Location _lastLocation = null;
public ClientPlayer(CoreClient client)
{
super(client, "Player", null);
}
@Override
public void Load()
{
}
@Override
protected void LoadToken(Object token)
{
}
public long GetLastAction() {
return _lastAction;
}
public void SetLastAction(long _lastAction) {
this._lastAction = _lastAction;
}
public long GetLastGrounded() {
return _lastGrounded;
}
public void SetLastGrounded(long _lastGrounded) {
this._lastGrounded = _lastGrounded;
}
public long GetLastMovement() {
return _lastMovement;
}
public void SetLastMovement(long _lastMovement) {
this._lastMovement = _lastMovement;
}
public Location GetLastLocation() {
return _lastLocation;
}
public void SetLastLocation(Location _lastLocation) {
this._lastLocation = _lastLocation;
}
public long GetLastDamagee()
{
return _lastDamagee;
}
public void SetLastDamagee(long _lastDamaged) {
this._lastDamagee = _lastDamaged;
}
public long GetLastDamager()
{
return _lastDamager;
}
public void SetLastDamager(long _lastDamaged) {
this._lastDamager = _lastDamaged;
}
public long GetLastCombat()
{
if (_lastDamager > _lastDamagee)
return _lastDamager;
return _lastDamagee;
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,253 @@
package me.chiss.Core.Modules;
import java.util.AbstractMap;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map.Entry;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import mineplex.core.MiniPlugin;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.blockrestore.BlockRestore;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilMath;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.ExplosionPrimeEvent;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
public class Explosion extends MiniPlugin
{
private boolean _damageEnabled = true;
private boolean _regenerateGround = false;
private HashSet<FallingBlock> _explosionBlocks = new HashSet<FallingBlock>();
private BlockRestore _blockRestore;
public Explosion(JavaPlugin plugin, BlockRestore blockRestore)
{
super("Block Restore", plugin);
_blockRestore = blockRestore;
}
@EventHandler
public void ExplosionPrime(ExplosionPrimeEvent event)
{
if (event.getRadius() >= 5)
return;
for (Block block : UtilBlock.getInRadius(event.getEntity().getLocation(), (double) event.getRadius()).keySet())
if (block.isLiquid())
block.setTypeId(0);
}
@EventHandler
public void ExplosionEntity(EntityExplodeEvent event)
{
if (event.isCancelled())
return;
try
{
if (event.getEntityType() == EntityType.CREEPER)
event.blockList().clear();
if (event.getEntityType() == EntityType.WITHER_SKULL)
event.blockList().clear();
}
catch(Exception e)
{
//Bloop
}
if (event.blockList().isEmpty())
return;
event.setYield(0f);
//Save
final HashMap<Block, Entry<Integer, Byte>> blocks = new HashMap<Block, Entry<Integer, Byte>>();
for (Block cur : event.blockList())
{
if (cur.getTypeId() == 0 || cur.isLiquid())
continue;
if (cur.getType() == Material.CHEST ||
cur.getType() == Material.IRON_ORE ||
cur.getType() == Material.COAL_ORE ||
cur.getType() == Material.GOLD_ORE ||
cur.getType() == Material.DIAMOND_ORE)
{
cur.breakNaturally();
continue;
}
blocks.put(cur, new AbstractMap.SimpleEntry<Integer, Byte>(cur.getTypeId(), cur.getData()));
if (!_regenerateGround)
{
if (cur.getTypeId() != 98 || cur.getData() != 0)
cur.setTypeId(0);
}
else
_blockRestore.Add(cur, 0, (byte)0, 10000);
}
event.blockList().clear();
//DELAY
final Entity fEnt = event.getEntity();
final Location fLoc = event.getLocation();
_plugin.getServer().getScheduler().runTaskLater(_plugin, new Runnable()
{
public void run()
{
//Launch
for (Block cur : blocks.keySet())
{
if (blocks.get(cur).getKey() == 98)
if (blocks.get(cur).getValue() == 0)
continue;
//TNT
if (blocks.get(cur).getKey() == 46)
{
TNTPrimed ent = cur.getWorld().spawn(cur.getLocation().add(0.5, 0.5, 0.5), TNTPrimed.class);
Vector vec = UtilAlg.getTrajectory(fEnt, ent);
if (vec.getY() < 0) vec.setY(vec.getY() * -1);
UtilAction.velocity(ent, vec, 1, false, 0, 0.6, 10, false);
ent.setFuseTicks(10);
}
//Other
else
{
FallingBlock fall = cur.getWorld().spawnFallingBlock(cur.getLocation().add(0.5, 0.5, 0.5), blocks.get(cur).getKey(), blocks.get(cur).getValue());
Vector vec = UtilAlg.getTrajectory(fEnt, fall);
if (vec.getY() < 0) vec.setY(vec.getY() * -1);
vec.multiply(0.6 + 0.4*Math.random());
UtilAction.velocity(fall, vec, 0.75, false, 0, 0.6, 10, false);
_explosionBlocks.add(fall);
}
}
//Items
/**
for (Item item : event.getEntity().getWorld().getEntitiesByClass(Item.class))
if (UtilMath.offset(item, event.getEntity()) < 5)
{
Vector vec = UtilAlg.getTrajectory(event.getEntity(), item);
if (vec.getY() < 0) vec.setY(vec.getY() * -1);
UtilAction.velocity(item, vec, 1, false, 0, 0.6, 10, false);
}
**/
//Crack
for (Block cur : UtilBlock.getInRadius(fLoc, 4d).keySet())
if (cur.getTypeId() == 98)
if (cur.getData() == 0)
cur.setTypeIdAndData(98, (byte)2, true);
}
}, 1);
}
@EventHandler
public void ExplosionBlockUpdate(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
HashSet<FallingBlock> fallen = new HashSet<FallingBlock>();
for (FallingBlock cur : _explosionBlocks)
{
if (cur.isDead() || !cur.isValid() || cur.getTicksLived() > 600)
fallen.add(cur);
}
for (FallingBlock cur : fallen)
{
_explosionBlocks.remove(cur);
if (cur.getTicksLived() > 600)
{
cur.remove();
continue;
}
Block block = cur.getLocation().getBlock();
block.setTypeIdAndData(0, (byte)0, true);
//Block Replace
_blockRestore.Add(block, cur.getBlockId(), cur.getBlockData(), 10000);
cur.remove();
}
}
@EventHandler
public void ExplosionItemSpawn(ItemSpawnEvent event)
{
for (FallingBlock block : _explosionBlocks)
if (UtilMath.offset(event.getEntity().getLocation(), block.getLocation()) < 1)
event.setCancelled(true);
}
@EventHandler
public void ExplosionDamage(CustomDamageEvent event)
{
if (_damageEnabled)
return;
if (event.GetCause() == DamageCause.ENTITY_EXPLOSION || event.GetCause() == DamageCause.BLOCK_EXPLOSION)
event.SetCancelled("Explosion Damage Disabled");
}
@EventHandler(priority = EventPriority.LOW)
public void ExplosionBlocks(EntityExplodeEvent event)
{
if (event.getEntity() == null)
event.blockList().clear();
}
public void SetDamage(boolean enabled)
{
_damageEnabled = enabled;
}
public void SetRegenerate(boolean regenerate)
{
_regenerateGround = regenerate;
}
public HashSet<FallingBlock> GetExplosionBlocks()
{
return _explosionBlocks;
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More