Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex

This commit is contained in:
Cheese 2015-06-30 10:13:03 +10:00
commit a92fddc4a1
36 changed files with 303 additions and 15573 deletions

View File

@ -5,7 +5,7 @@ import com.neustar.ultra.api.webservice.v01.UltraWSException;
/*
* User: jbodner
* Date: 1/28/13
* Time: 1:11 PM4
* Time: 1:11 PM
*
* Copyright 2000-2013 NeuStar, Inc. All rights reserved.
* NeuStar, the Neustar logo and related names and logos are registered

View File

@ -73,7 +73,7 @@ public enum Rank
if (inform)
{
UtilPlayer.message(player, C.mHead + "Permissions > " +
UtilPlayer.message(player, C.mHead + "Permissions> " +
C.mBody + "This requires Permission Rank [" +
C.mHead + rank +
C.mBody + "].");

View File

@ -31,7 +31,7 @@ public class BenefitManager extends MiniDbClientPlugin<BenefitData>
//_benefits.add(new Christmas2014(plugin, _repository, inventoryManager));
//_benefits.add(new Thanksgiving2014(plugin, _repository, inventoryManager));
_benefits.add(new Players40k(plugin, _repository, inventoryManager));
_benefits.add(new Players40k(this, _repository, inventoryManager));
}
@EventHandler(priority = EventPriority.LOWEST)

View File

@ -5,15 +5,16 @@ import java.sql.SQLException;
import mineplex.core.database.DBPool;
import mineplex.core.database.RepositoryBase;
import mineplex.core.database.column.ColumnInt;
import mineplex.core.database.column.ColumnVarChar;
import org.bukkit.plugin.java.JavaPlugin;
public class BenefitManagerRepository extends RepositoryBase
{
private static String CREATE_BENEFIT_TABLE = "CREATE TABLE IF NOT EXISTS rankBenefits (id INT NOT NULL AUTO_INCREMENT, accountId INT, benefit VARCHAR(100), PRIMARY KEY (id), INDEX rankUuid (uuid));";
private static String CREATE_BENEFIT_TABLE = "CREATE TABLE IF NOT EXISTS rankBenefits (id INT NOT NULL AUTO_INCREMENT, accountId INT, benefit VARCHAR(100), PRIMARY KEY (id), FOREIGN KEY (accountId) REFERENCES accounts(id));";
private static String INSERT_BENEFIT = "INSERT INTO rankBenefits (uuid, benefit) VALUES (?, ?);";
private static String INSERT_BENEFIT = "INSERT INTO rankBenefits (accountId, benefit) VALUES (?, ?);";
public BenefitManagerRepository(JavaPlugin plugin)
{
@ -23,7 +24,7 @@ public class BenefitManagerRepository extends RepositoryBase
@Override
protected void initialize()
{
// executeUpdate(CREATE_BENEFIT_TABLE);
executeUpdate(CREATE_BENEFIT_TABLE);
}
@Override
@ -31,9 +32,9 @@ public class BenefitManagerRepository extends RepositoryBase
{
}
public boolean addBenefit(String uuid, String benefit)
public boolean addBenefit(int accountId, String benefit)
{
return executeUpdate(INSERT_BENEFIT, new ColumnVarChar("uuid", 100, uuid), new ColumnVarChar("benefit", 100, benefit)) > 0;
return executeUpdate(INSERT_BENEFIT, new ColumnInt("accountId", accountId), new ColumnVarChar("benefit", 100, benefit)) > 0;
}
public BenefitData retrievePlayerBenefitData(ResultSet resultSet) throws SQLException
@ -42,9 +43,11 @@ public class BenefitManagerRepository extends RepositoryBase
while (resultSet.next())
{
playerBenefit.Benefits.add(resultSet.getString(1));
playerBenefit.Benefits.add(resultSet.getString(1));
}
playerBenefit.Loaded = true;
return playerBenefit;
}
}

View File

@ -1,5 +1,6 @@
package mineplex.core.benefit.benefits;
import mineplex.core.benefit.BenefitManager;
import mineplex.core.benefit.BenefitManagerRepository;
import mineplex.core.common.util.Callback;
@ -9,11 +10,11 @@ import org.bukkit.plugin.java.JavaPlugin;
public abstract class BenefitBase
{
private JavaPlugin _plugin;
private BenefitManager _plugin;
private String _name;
private BenefitManagerRepository _repository;
protected BenefitBase(JavaPlugin plugin, String name, BenefitManagerRepository repository)
protected BenefitBase(BenefitManager plugin, String name, BenefitManagerRepository repository)
{
_plugin = plugin;
_name = name;
@ -22,7 +23,7 @@ public abstract class BenefitBase
public JavaPlugin getPlugin()
{
return _plugin;
return _plugin.getPlugin();
}
public BenefitManagerRepository getRepository()
@ -34,11 +35,11 @@ public abstract class BenefitBase
public void recordBenefit(final Player player, final Callback<Boolean> callback)
{
Bukkit.getServer().getScheduler().runTaskAsynchronously(_plugin, new Runnable()
Bukkit.getServer().getScheduler().runTaskAsynchronously(_plugin.getPlugin(), new Runnable()
{
public void run()
{
boolean success = _repository.addBenefit(player.getUniqueId().toString(), _name);
boolean success = _repository.addBenefit(_plugin.getClientManager().Get(player).getAccountId(), _name);
callback.run(success);
}

View File

@ -1,5 +1,6 @@
package mineplex.core.benefit.benefits;
import mineplex.core.benefit.BenefitManager;
import mineplex.core.benefit.BenefitManagerRepository;
import mineplex.core.common.util.C;
import mineplex.core.common.util.Callback;
@ -13,7 +14,7 @@ public class Christmas2014 extends BenefitBase
{
private InventoryManager _inventoryManager;
public Christmas2014(JavaPlugin plugin, BenefitManagerRepository repository, InventoryManager inventoryManager)
public Christmas2014(BenefitManager plugin, BenefitManagerRepository repository, InventoryManager inventoryManager)
{
super(plugin, "Christmas2014", repository);

View File

@ -1,5 +1,6 @@
package mineplex.core.benefit.benefits;
import mineplex.core.benefit.BenefitManager;
import mineplex.core.benefit.BenefitManagerRepository;
import mineplex.core.common.util.C;
import mineplex.core.common.util.Callback;
@ -13,7 +14,7 @@ public class Players40k extends BenefitBase
{
private InventoryManager _inventoryManager;
public Players40k(JavaPlugin plugin, BenefitManagerRepository repository, InventoryManager inventoryManager)
public Players40k(BenefitManager plugin, BenefitManagerRepository repository, InventoryManager inventoryManager)
{
super(plugin, "Players40k", repository);

View File

@ -1,5 +1,6 @@
package mineplex.core.benefit.benefits;
import mineplex.core.benefit.BenefitManager;
import mineplex.core.benefit.BenefitManagerRepository;
import mineplex.core.common.util.C;
import mineplex.core.common.util.Callback;
@ -13,7 +14,7 @@ public class Thanksgiving2014 extends BenefitBase
{
private InventoryManager _inventoryManager;
public Thanksgiving2014(JavaPlugin plugin, BenefitManagerRepository repository, InventoryManager inventoryManager)
public Thanksgiving2014(BenefitManager plugin, BenefitManagerRepository repository, InventoryManager inventoryManager)
{
super(plugin, "Thanksgiving2014", repository);

View File

@ -281,9 +281,9 @@ public class FriendManager extends MiniDbClientPlugin<FriendData>
// Online Friend
if (friend.Online)
{
if (friend.ServerName.contains("STAFF") || friend.ServerName.contains("CUST"))
if (friend.ServerName.contains("Staff") || friend.ServerName.contains("CUST"))
{
if (isStaff && friend.ServerName.contains("STAFF"))
if (isStaff && friend.ServerName.contains("Staff"))
message.add("Teleport").color("green").bold().click("run_command", "/server " + friend.ServerName)
.hover("show_text", "Teleport to " + friend.Name + "'s server.");
else
@ -300,9 +300,9 @@ public class FriendManager extends MiniDbClientPlugin<FriendData>
message.add(friend.Name).color(friend.Online ? "green" : "gray");
message.add(" - ").color("white");
if (friend.ServerName.contains("STAFF") || friend.ServerName.contains("CUST"))
if (friend.ServerName.contains("Staff") || friend.ServerName.contains("CUST"))
{
if (isStaff && friend.ServerName.contains("STAFF"))
if (isStaff && friend.ServerName.contains("Staff"))
message.add(friend.ServerName).color("dark_green");
else
message.add("Private Staff Server").color("dark_green");

View File

@ -219,7 +219,7 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
Get(from).LastToTime = System.currentTimeMillis();
// Chiss or defek7
if (to.getName().equals("Chiss") || to.getName().equals("defek7") || to.getName().equals("Phinary"))
if (to.getName().equals("Chiss") || to.getName().equals("defek7") || to.getName().equals("Phinary") || to.getName().equals("fooify"))
{
UtilPlayer.message(from, C.cPurple + to.getName() + " is often AFK or minimized, due to plugin development.");
UtilPlayer.message(from, C.cPurple + "Please be patient if he does not reply instantly.");

View File

@ -10,8 +10,6 @@ public enum Category
PermMute,
Other; // Represents perm ban - (or old perm mutes)
//test
public static boolean contains(String s)
{
try

View File

@ -12,7 +12,7 @@
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value=""/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${BUILD_FILES}\common.xml"/>
<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,auto,clean"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/Mineplex.Hub}"/>

View File

@ -11,7 +11,7 @@
<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_LOCATION" value="${BUILD_FILES}/common.xml"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,clean"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/Mineplex.MapParser}"/>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Mineplex.Queue.Core</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

@ -5,6 +5,7 @@ import java.util.List;
import java.util.Random;
import mineplex.serverdata.servers.ConnectionData;
import mineplex.serverdata.servers.ConnectionData.ConnectionType;
public class RedisConfig
{
@ -14,18 +15,15 @@ public class RedisConfig
private static Random random = new Random(); // Utility random
// The connections managed by this configuration
private ConnectionData _masterConnection;
private List<ConnectionData> _slaveConnections;
private List<ConnectionData> _connections;
/**
* Class constructor
* @param master
* @param slaves
* @param connections
*/
public RedisConfig(ConnectionData master, List<ConnectionData> slaves)
public RedisConfig(List<ConnectionData> connections)
{
_masterConnection = master;
_slaveConnections = slaves;
_connections = connections;
}
/**
@ -34,7 +32,8 @@ public class RedisConfig
*/
public RedisConfig()
{
this(new ConnectionData(DEFAULT_IP, DEFAULT_PORT), new ArrayList<ConnectionData>());
_connections = new ArrayList<ConnectionData>();
_connections.add(new ConnectionData(DEFAULT_IP, DEFAULT_PORT, ConnectionType.MASTER, "DefaultConnection"));
}
/**
@ -43,23 +42,39 @@ public class RedisConfig
*/
public ConnectionData getConnection()
{
return getConnection(true);
return getConnection(true, null);
}
/**
* @param writeable - whether the returned connection reference can receive write-requests.
* @return a {@link ConnectionData} referencing a valid redis-connection from this configuration.
*/
public ConnectionData getConnection(boolean writeable)
public ConnectionData getConnection(boolean writeable, String name)
{
if (writeable || _slaveConnections.size() == 0)
List<ConnectionData> connections = getConnections(writeable, name);
if (connections.size() > 0)
{
return _masterConnection;
int index = random.nextInt(connections.size());
return connections.get(index);
}
else
return null;
}
public List<ConnectionData> getConnections(boolean writeable, String name)
{
List<ConnectionData> connections = new ArrayList<ConnectionData>();
ConnectionType type = (writeable) ? ConnectionType.MASTER : ConnectionType.SLAVE;
for (ConnectionData connection : _connections)
{
int index = random.nextInt(_slaveConnections.size());
return _slaveConnections.get(index);
if (connection.getType() == type && connection.nameMatches(name))
{
connections.add(connection);
}
}
return connections;
}
}

View File

@ -7,22 +7,48 @@ package mineplex.serverdata.servers;
*/
public class ConnectionData
{
public enum ConnectionType
{
MASTER,
SLAVE;
}
private ConnectionType _type; // The type of connection available
public ConnectionType getType() { return _type; }
private String _name; // The name associated with this connection
public String getName() { return _name; }
private String _host; // The host URL to connect to repository
private String _host; // The host URL to connect to repository
public String getHost() { return _host; }
private int _port; // The port to connect to repository
private int _port; // The port to connect to repository
public int getPort() { return _port; }
/**
* Constructor
* @param host - the host URL defining the repository
* @param port - the port used for connection to repository
* @param type - the type of connection referenced by this ConnectionData
* @param name - the name associated with ConnectionData
*/
public ConnectionData(String host, int port)
public ConnectionData(String host, int port, ConnectionType type, String name)
{
_host = host;
_port = port;
_type = type;
_name = name;
}
/**
* @param name
* @return true, if {@code name} is null or it matches (case-insensitive) the {@code _name} associated
* with this ConnectionData, false otherwise.
*/
public boolean nameMatches(String name)
{
return (name == null || name.equalsIgnoreCase(_name));
}
}

View File

@ -12,6 +12,7 @@ import java.util.Random;
import mineplex.serverdata.Region;
import mineplex.serverdata.redis.RedisConfig;
import mineplex.serverdata.redis.RedisServerRepository;
import mineplex.serverdata.servers.ConnectionData.ConnectionType;
/**
* ServerManager handles the creation/management of {@link ServerRepository}s for use.
@ -20,6 +21,8 @@ import mineplex.serverdata.redis.RedisServerRepository;
*/
public class ServerManager
{
public static final String SERVER_STATUS_LABEL = "ServerStatus"; // Label differentiating ServerStatus related servers
// Configuration determining connection information
private static RedisConfig _config;
@ -32,7 +35,7 @@ public class ServerManager
* @param region - the geographical region of the {@link ServerRepository}.
* @return a newly instanced (or cached) {@link ServerRepository} for the specified {@code region}.
*/
public static ServerRepository getServerRepository(ConnectionData writeConn, ConnectionData readConn, Region region)
private static ServerRepository getServerRepository(ConnectionData writeConn, ConnectionData readConn, Region region)
{
if (repositories.containsKey(region)) return repositories.get(region);
@ -49,7 +52,7 @@ public class ServerManager
*/
public static ServerRepository getServerRepository(Region region)
{
return getServerRepository(getMasterConnection(), getSlaveConnection(), region);
return getServerRepository(getConnection(true, SERVER_STATUS_LABEL), getConnection(false, SERVER_STATUS_LABEL), region);
}
/**
@ -69,13 +72,18 @@ public class ServerManager
return getConnection(false);
}
public static ConnectionData getConnection(boolean writeable, String name)
{
return getConfig().getConnection(writeable, name);
}
/**
* @param writeable - whether the connection referenced in return can receive write-requests
* @return a newly generated {@code ConnectionData} pointing to a valid connection.
*/
public static ConnectionData getConnection(boolean writeable)
{
return getConfig().getConnection(writeable);
return getConnection(writeable, null);
}
/**
@ -91,32 +99,28 @@ public class ServerManager
if (configFile.exists())
{
List<ConnectionData> connections = new ArrayList<ConnectionData>();
List<String> lines = Files.readAllLines(configFile.toPath(), Charset.defaultCharset());
ConnectionData master = deserializeConnection(lines.get(0));
List<ConnectionData> slaves = new ArrayList<ConnectionData>();
for (int i = 1; i < lines.size(); i++)
for (String line : lines)
{
ConnectionData slave = deserializeConnection(lines.get(i));
slaves.add(slave);
ConnectionData connection = deserializeConnection(line);
connections.add(connection);
}
System.out.println("LOADED " + (master != null) + " " + slaves.size());
_config = new RedisConfig(master, slaves);
System.out.println("Master connection " + master.getHost() + " port " + master.getPort());
_config = new RedisConfig(connections);
}
else
{
System.out.println("redis-config.dat not found at " + configFile.toPath().toString());
log("redis-config.dat not found at " + configFile.toPath().toString());
_config = new RedisConfig();
}
}
catch (Exception exception)
{
exception.printStackTrace();
System.out.println("---Unable To Parse Redis Configuration File---");
log("---Unable To Parse Redis Configuration File---");
}
}
@ -132,14 +136,22 @@ public class ServerManager
{
String[] args = line.split(" ");
if (args.length == 2)
if (args.length >= 2)
{
String ip = args[0];
int port = Integer.parseInt(args[1]);
String typeName = (args.length >= 3) ? args[2].toUpperCase() : "MASTER"; // Defaults to MASTER if omitted.
ConnectionType type = ConnectionType.valueOf(typeName);
String name = (args.length >= 4) ? args[3] : "DefaultConnection"; // Defaults to DefaultConnection if omitted.
return new ConnectionData(ip, port);
return new ConnectionData(ip, port, type, name);
}
return null;
}
private static void log(String message)
{
System.out.println(String.format("[ServerManager] %s", message));
}
}

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Mineplex.ServerProcesses</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

@ -11,7 +11,7 @@
<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_LOCATION" value="${BUILD_FILES}/common.xml"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,clean"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/Nautilus.Game.Arcade}"/>

View File

@ -2,14 +2,6 @@ package nautilus.game.arcade.kit.perks;
import java.util.HashSet;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilInv;
@ -17,10 +9,18 @@ import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.kit.Perk;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
public class PerkBomberHG extends Perk
{
private int _spawnRate;
@ -86,8 +86,15 @@ public class PerkBomberHG extends Perk
}
@EventHandler
public void FletchInvClick(InventoryClickEvent event)
{
public void TNTInvClick(InventoryClickEvent event)
{
//boolean containerOpen = !(event.getView().getTopInventory().getHolder() instanceof Player);
boolean clickInContainer = event.getClickedInventory() != null && !(event.getClickedInventory().getHolder() instanceof Player);
if(clickInContainer)
{
return;
}
UtilInv.DisallowMovementOf(event, "Throwing TNT", Material.TNT, (byte) 0, true);
}

View File

@ -1,165 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

Binary file not shown.

View File

@ -1,53 +0,0 @@
# ![PocketMine-MP](http://cdn.pocketmine.net/img/PocketMine-MP-h.png)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
__PocketMine-MP is a free, open-source software that creates Minecraft: Pocket Edition servers and allows extending its functionalities__
### [Homepage](http://www.pocketmine.net/)
### [Forums](http://forums.pocketmine.net/)
### [Plugin Repository](http://plugins.pocketmine.net/)
<!--## [FAQ: Frequently Asked Questions](https://github.com/PocketMine/PocketMine-MP/wiki/Frequently-Asked-Questions)-->
### [Official Jenkins server](http://jenkins.pocketmine.net/)
### API Documentation
* [Official Doxygen-generated documentation](http://docs.pocketmine.net/)
* [Latest Doxygen generated from development](http://jenkins.pocketmine.net/job/PocketMine-MP-doc/doxygen/)
### [Twitter @PocketMine](https://twitter.com/PocketMine)
### IRC Chat #pocketmine (or #mcpedevs) @ irc.freenode.net
[#pocketmine + #mcpedevs channel WebIRC](http://webchat.freenode.net/?channels=pocketmine,mcpedevs)
### Want to contribute?
* Check the [Contributing Guidelines](CONTRIBUTING.md)
## Third-party Libraries/Protocols Used
* __[PHP Sockets](http://php.net/manual/en/book.sockets.php)__
* __[PHP SQLite3](http://php.net/manual/en/book.sqlite3.php)__
* __[PHP BCMath](http://php.net/manual/en/book.bc.php)__
* __[PHP pthreads](http://pthreads.org/)__ by _[krakjoe](https://github.com/krakjoe)_: Threading for PHP - Share Nothing, Do Everything.
* __[PHP YAML](https://code.google.com/p/php-yaml/)__ by _Bryan Davis_: The Yaml PHP Extension provides a wrapper to the LibYAML library.
* __[LibYAML](http://pyyaml.org/wiki/LibYAML)__ by _Kirill Simonov_: A YAML 1.1 parser and emitter written in C.
* __[cURL](http://curl.haxx.se/)__: cURL is a command line tool for transferring data with URL syntax
* __[Zlib](http://www.zlib.net/)__: A Massively Spiffy Yet Delicately Unobtrusive Compression Library
* __[Source RCON Protocol](https://developer.valvesoftware.com/wiki/Source_RCON_Protocol)__
* __[UT3 Query Protocol](http://wiki.unrealadmin.org/UT3_query_protocol)__

View File

View File

@ -1,6 +0,0 @@
# Updated 06/29/15 12:14 by PocketMine-MP 1.5dev-1254
# victim name | ban date | banned by | banned until | reason
fanta|2015-06-29 12:12:30 +1000|CONSOLE|Forever|Banned by an operator.
xflare_|2015-06-29 12:14:49 +1000|CONSOLE|Forever|Banned by an operator.
fantasticps3|2015-06-29 12:14:53 +1000|CONSOLE|Forever|Banned by an operator.

View File

@ -1 +0,0 @@
chiss

Binary file not shown.

View File

@ -2,8 +2,12 @@
namespace mineplex\plugin;
use mineplex\plugin\core\updater\UpdateType;
use mineplex\plugin\tasks\TickTask;
use mineplex\plugin\events\TickEvent;
use mineplex\plugin\core\updater\Updater;
use mineplex\plugin\core\updater\UpdateEvent;
use mineplex\plugin\core\updater\UpdateType as UpdaterType;
use mineplex\plugin\util\UtilString;
use mineplex\plugin\packets\StrangePacket;
@ -19,6 +23,7 @@ class Main extends PluginBase implements Listener
$this->getServer()->getScheduler()->scheduleRepeatingTask(new TickTask($this), 1);
$this->getServer()->getPluginManager()->registerEvents($this, $this);
new Updater($this);
}
public function onDisable()
@ -68,8 +73,9 @@ class Main extends PluginBase implements Listener
}
}
public function onTick(TickEvent $event)
public function onTick(UpdateEvent $event)
{
if ($event->getTime() == UpdateType::TICK)
$this->getLogger()->info("tick");
}
}

View File

@ -0,0 +1,28 @@
<?php
/**
* Created by PhpStorm.
* User: jwilliams
* Date: 6/29/2015
* Time: 7:12 PM
*/
namespace mineplex\plugin\core\updater;
use pocketmine\event\Event;
class UpdateEvent extends Event
{
public static $handlerList = null;
public $time;
public function __construct($time)
{
$this->time = $time;
}
public function getTime()
{
return $this->time;
}
}

View File

@ -0,0 +1,37 @@
<?php
/**
* Created by PhpStorm.
* User: jwilliams
* Date: 6/29/2015
* Time: 6:52 PM
*/
namespace mineplex\plugin\core\updater;
class UpdateType
{
const MIN_64 = 3840000;
const MIN_32 = 1920000;
const MIN_16 = 960000;
const MIN_08 = 480000;
const MIN_04 = 240000;
const MIN_02 = 120000;
const MIN_01 = 60000;
const SLOWEST = 32000;
const SLOWER = 16000;
const SLOW = 4000;
const TWOSEC = 2000;
const SEC = 1000;
const FAST = 500;
const FASTER = 250;
const FASTEST = 125;
const TICK = 49;
public $time;
public function __construct($time=0)
{
$this->time = $time;
}
}

View File

@ -0,0 +1,58 @@
<?php
/**
* Created by PhpStorm.
* User: jwilliams
* Date: 6/29/2015
* Time: 6:45 PM
*/
namespace mineplex\plugin\core\updater;
use pocketmine\plugin\PluginBase;
use pocketmine\scheduler\PluginTask;
class Updater extends PluginTask
{
private $plugin;
private $last;
private $updateTypes;
public function __construct(PluginBase $host)
{
$this->plugin = $host;
$this->owner = $host;
$this->plugin->getServer()->getScheduler()->scheduleRepeatingTask($this, 1);
$this->updateTypes = array(
new UpdateType(UpdateType::TICK)
, new UpdateType(UpdateType::FASTEST)
, new UpdateType(UpdateType::FASTER)
, new UpdateType(UpdateType::FAST)
, new UpdateType(UpdateType::SEC)
, new UpdateType(UpdateType::TWOSEC)
, new UpdateType(UpdateType::SLOW)
, new UpdateType(UpdateType::SLOWER)
, new UpdateType(UpdateType::SLOWEST)
, new UpdateType(UpdateType::MIN_01)
, new UpdateType(UpdateType::MIN_02)
, new UpdateType(UpdateType::MIN_04)
, new UpdateType(UpdateType::MIN_08)
, new UpdateType(UpdateType::MIN_16)
, new UpdateType(UpdateType::MIN_32)
, new UpdateType(UpdateType::MIN_64));
}
public function onRun($currentTick)
{
$timeSpent = round(microtime(true) * 1000) - $this->last;
$this->last = round(microtime(true) * 1000);
foreach ($this->updateTypes as &$updateType)
{
if ($timeSpent >= $updateType->time)
{
$this->plugin->getServer()->getPluginManager()->callEvent(new UpdateEvent($updateType->time));
}
}
}
}

View File

@ -1,103 +0,0 @@
# Main configuration file for PocketMine-MP
# These settings are the ones that cannot be included in server.properties
# Some of these settings are safe, others can break your server if modified incorrectly
settings:
shutdown-message: "Server closed"
#Allow listing plugins via Query
query-plugins: true
#Show a console message when a plugin uses deprecated API methods
deprecated-verbose: true
#Enable plugin and core profiling by default
enable-profiling: false
advanced-cache: false
upnp-forwarding: false
#Sends anonymous statistics to create usage reports
send-usage: true
#Number of AsyncTask workers
#WARNING: This will increase global memory usage, but it won't be listed in the total.
async-workers: 15
debug:
#If > 1, it will show debug messages in the console
level: 1
#Enables /status
commands: false
level-settings:
#The default format that levels will use when created
default-format: mcregion
#If true, converts from a format that is not the default to the default format on load
#NOTE: This is currently not implemented
convert-format: false
chunk-sending:
#Amount of chunks sent to players per tick
per-tick: 1
#Compression level used when sending chunks. Higher = more CPU, less bandwidth usage
compression-level: 6
#Amount of chunks sent around each player
max-chunks: 56
chunk-ticking:
#Max amount of chunks processed each tick
per-tick: 50
#Radius of chunks around a player to tick
tick-radius: 2
#NOTE: This is currently not implemented
light-updates: false
clear-tick-list: false
chunk-generation:
#Whether to run the generation on a different thread or on the main thread
#Generation will be less glitchy on the main thread, but will lag more
#Using this with fast generators is recommended
use-async: true
#Max. amount of chunks to generate per tick, only for use-async: false
per-tick: 1
chunk-gc:
period-in-ticks: 600
ticks-per:
animal-spawns: 100
monster-spawns: 100
autosave: 6000
cache-cleanup: 900
spawn-limits:
monsters: 0
animals: 0
water-animals: 0
ambient: 0
auto-report:
#Send crash reports for processing
enabled: true
send-code: true
send-settings: true
send-phpinfo: true
host: crash.pocketmine.net
auto-updater:
enabled: true
on-update:
warn-console: true
warn-ops: true
#Can be development, beta or stable.
preferred-channel: stable
#If using a development version, it will suggest changing the channel
suggest-channels: true
host: www.pocketmine.net
aliases:
#Examples:
#showtheversion: version
#savestop: [save-all, stop]
worlds:
#These settings will override the generator set in server.properties and allows loading multiple levels
#Example:
#world:
# seed: 404
# generator: FLAT:2;7,59x1,3x3,2;1;decoration(treecount=80 grasscount=45)

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +0,0 @@
#Properties Config file
#Mon Jun 29 19:57:13 AEST 2015
server-name=Chiss World
server-port=19132
memory-limit=2048M
gamemode=0
max-players=100
spawn-protection=16
white-list=off
enable-query=on
enable-rcon=off
motd=Chiss World Yay
announce-player-achievements=off
allow-flight=off
spawn-animals=off
spawn-mobs=off
force-gamemode=off
hardcore=off
pvp=off
difficulty=1
generator-settings=
level-name=world
level-seed=
level-type=FLAT
rcon.password=fTbky+Ma7n
auto-save=off

View File

@ -1,32 +0,0 @@
@echo off
TITLE PocketMine-MP server software for Minecraft: Pocket Edition
cd /d %~dp0
if exist bin\php\php.exe (
set PHPRC=""
set PHP_BINARY=bin\php\php.exe
) else (
set PHP_BINARY=php
)
if exist PocketMine-MP.phar (
set POCKETMINE_FILE=PocketMine-MP.phar
) else (
if exist src\pocketmine\PocketMine.php (
set POCKETMINE_FILE=src\pocketmine\PocketMine.php
) else (
echo "Couldn't find a valid PocketMine-MP installation"
pause
exit 1
)
)
REM if exist bin\php\php_wxwidgets.dll (
REM %PHP_BINARY% %POCKETMINE_FILE% --enable-gui %*
REM ) else (
if exist bin\mintty.exe (
start "" bin\mintty.exe -o Columns=88 -o Rows=32 -o AllowBlinking=0 -o FontQuality=3 -o Font="DejaVu Sans Mono" -o FontHeight=10 -o CursorType=0 -o CursorBlinks=1 -h error -t "PocketMine-MP" -i bin/pocketmine.ico -w max %PHP_BINARY% %POCKETMINE_FILE% --enable-ansi %*
) else (
%PHP_BINARY% -c bin\php %POCKETMINE_FILE% %*
)
REM )

View File