Added horse disguise.
Added Hub redirect on full. Fixed Repo for ServerMonitor. Fixed Bridge QuitOut/AutoBalance issue. Removed unnecessary region folder create in dominate.
This commit is contained in:
parent
f2570caad5
commit
c2044f7e8a
Binary file not shown.
@ -7,7 +7,7 @@ import java.sql.SQLException;
|
||||
|
||||
public class GlobalServerRepository
|
||||
{
|
||||
private String _connectionString = "jdbc:mysql://sql.mineplex.com:3306/BungeeServers";
|
||||
private String _connectionString = "jdbc:mysql://db.mineplex.com:3306/BungeeServers";
|
||||
private String _userName = "root";
|
||||
private String _password = "tAbechAk3wR7tuTh";
|
||||
|
||||
|
@ -8,7 +8,7 @@ import java.sql.SQLException;
|
||||
|
||||
public class PlayerTrackerRepository
|
||||
{
|
||||
private String _connectionString = "jdbc:mysql://sql.mineplex.com:3306/PlayerTracker";
|
||||
private String _connectionString = "jdbc:mysql://db.mineplex.com:3306/PlayerTracker";
|
||||
private String _userName = "root";
|
||||
private String _password = "tAbechAk3wR7tuTh";
|
||||
|
||||
|
@ -0,0 +1,89 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import org.bukkit.entity.Horse;
|
||||
|
||||
public class DisguiseHorse extends DisguiseAnimal
|
||||
{
|
||||
public DisguiseHorse(org.bukkit.entity.Entity entity)
|
||||
{
|
||||
super(entity);
|
||||
|
||||
DataWatcher.a(16, Integer.valueOf(0));
|
||||
DataWatcher.a(19, Byte.valueOf((byte) 0));
|
||||
DataWatcher.a(20, Integer.valueOf(0));
|
||||
DataWatcher.a(21, String.valueOf(""));
|
||||
DataWatcher.a(22, Integer.valueOf(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int GetEntityTypeId()
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
|
||||
public void setType(Horse.Variant horseType)
|
||||
{
|
||||
DataWatcher.watch(19, Byte.valueOf((byte) horseType.ordinal()));
|
||||
}
|
||||
|
||||
public Horse.Variant getType()
|
||||
{
|
||||
return Horse.Variant.values()[DataWatcher.getByte(19)];
|
||||
}
|
||||
|
||||
public void setVariant(Horse.Color color)
|
||||
{
|
||||
DataWatcher.watch(20, Integer.valueOf(color.ordinal()));
|
||||
}
|
||||
|
||||
public Horse.Color getVariant()
|
||||
{
|
||||
return Horse.Color.values()[DataWatcher.getInt(20)];
|
||||
}
|
||||
|
||||
private boolean w(int i)
|
||||
{
|
||||
return (DataWatcher.getInt(16) & i) != 0;
|
||||
}
|
||||
|
||||
public void kick()
|
||||
{
|
||||
b(32, false);
|
||||
b(64, true);
|
||||
}
|
||||
|
||||
public void stopKick()
|
||||
{
|
||||
b(64, false);
|
||||
}
|
||||
|
||||
private void b(int i, boolean flag)
|
||||
{
|
||||
int j = DataWatcher.getInt(16);
|
||||
|
||||
if (flag)
|
||||
DataWatcher.watch(16, Integer.valueOf(j | i));
|
||||
else
|
||||
DataWatcher.watch(16, Integer.valueOf(j & (i ^ 0xFFFFFFFF)));
|
||||
}
|
||||
|
||||
public String getOwnerName()
|
||||
{
|
||||
return DataWatcher.getString(21);
|
||||
}
|
||||
|
||||
public void setOwnerName(String s)
|
||||
{
|
||||
DataWatcher.watch(21, s);
|
||||
}
|
||||
|
||||
public int cf()
|
||||
{
|
||||
return DataWatcher.getInt(22);
|
||||
}
|
||||
|
||||
public void r(int i)
|
||||
{
|
||||
DataWatcher.watch(22, Integer.valueOf(i));
|
||||
}
|
||||
}
|
@ -21,10 +21,12 @@ import org.bukkit.event.entity.ItemSpawnEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerLoginEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import org.bukkit.event.server.ServerListPingEvent;
|
||||
@ -35,6 +37,7 @@ import org.bukkit.scoreboard.Objective;
|
||||
import org.bukkit.scoreboard.Scoreboard;
|
||||
|
||||
import mineplex.core.MiniClientPlugin;
|
||||
import mineplex.core.account.CoreClient;
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.blockrestore.BlockRestore;
|
||||
import mineplex.core.common.Rank;
|
||||
@ -281,6 +284,29 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void login(final PlayerLoginEvent event)
|
||||
{
|
||||
CoreClient client = _clientManager.Get(event.getPlayer().getName());
|
||||
|
||||
// Reserved Slot Check
|
||||
if (Bukkit.getOnlinePlayers().length >= Bukkit.getServer().getMaxPlayers())
|
||||
{
|
||||
if (!client.GetRank().Has(Rank.ULTRA))
|
||||
{
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(GetPlugin(), new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
_portal.SendPlayerToServer(event.getPlayer(), "Lobby");
|
||||
}
|
||||
});
|
||||
|
||||
event.allow();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void PlayerJoin(PlayerJoinEvent event)
|
||||
|
@ -12,16 +12,16 @@ import java.util.List;
|
||||
|
||||
public class Repository
|
||||
{
|
||||
private String _connectionString = "jdbc:mysql://localhost:3306/ServerStatus";
|
||||
private String _connectionString = "jdbc:mysql://db.mineplex.com:3306/ServerStatus";
|
||||
private String _userName = "root";
|
||||
private String _password = "y2D4atu3Pene2asw";
|
||||
private String _password = "tAbechAk3wR7tuTh";
|
||||
|
||||
private static String CREATE_TABLE = "CREATE TABLE IF NOT EXISTS ServerStatus (id INT NOT NULL AUTO_INCREMENT, serverName VARCHAR(256), serverGroup VARCHAR(256), address VARCHAR(256), updated LONG, lastTimeWithPlayers LONG, motd VARCHAR(256), players INT, maxPlayers INT, tps INT, ram INT, maxRam INT, PRIMARY KEY (id));";
|
||||
private static String RETRIEVE_OLD_SERVER_STATUSES = "SELECT ServerStatus.serverName, DynamicServers.address, ServerStatus.address, motd, players, maxPlayers FROM ServerStatus INNER JOIN DynamicServers ON ServerStatus.address LIKE CONCAT(DynamicServers.privateAddress, '%') WHERE DynamicServers.US = false AND TIME_TO_SEC(TIMEDIFF(now(), ServerStatus.updated)) > 10;";
|
||||
private static String RETRIEVE_OLD_SERVER_STATUSES = "SELECT ServerStatus.serverName, DynamicServers.address, ServerStatus.address, motd, players, maxPlayers FROM ServerStatus INNER JOIN DynamicServers ON ServerStatus.address LIKE CONCAT(DynamicServers.privateAddress, '%') WHERE DynamicServers.US = true AND TIME_TO_SEC(TIMEDIFF(now(), ServerStatus.updated)) > 15;";
|
||||
|
||||
private static String CREATE_DYNAMIC_TABLE = "CREATE TABLE IF NOT EXISTS DynamicServers (id INT NOT NULL AUTO_INCREMENT, serverName VARCHAR(256), address VARCHAR(256), privateAddress VARCHAR(256), US BOOLEAN NOT NULL DEFAULT 'true', PRIMARY KEY (id));";
|
||||
private static String RETRIEVE_AVAILABLE_SERVERS = "SELECT DynamicServers.serverName, DynamicServers.address, DynamicServers.privateAddress, DynamicServers.US, DynamicServers.availableCpu, DynamicServers.availableRam, ServerStatus.serverGroup, COUNT(*) As serverCount FROM DynamicServers LEFT JOIN ServerStatus ON ServerStatus.address LIKE CONCAT(DynamicServers.privateAddress, '%') WHERE DynamicServers.US = false GROUP BY DynamicServers.address, ServerStatus.serverGroup;";
|
||||
private static String RETRIEVE_SERVERGROUP_STATUSES = "SELECT ServerStatus.serverName, serverGroup, motd, DynamicServers.address, ServerStatus.address, players, maxPlayers, case when TIME_TO_SEC(TIMEDIFF(now(), ServerStatus.lastTimeWithPlayers)) > 300 then 1 else 0 end as empty FROM ServerStatus INNER JOIN DynamicServers ON ServerStatus.address LIKE CONCAT(DynamicServers.privateAddress, '%') WHERE DynamicServers.US = false AND TIME_TO_SEC(TIMEDIFF(now(), ServerStatus.updated)) <= 15";
|
||||
private static String RETRIEVE_AVAILABLE_SERVERS = "SELECT DynamicServers.serverName, DynamicServers.address, DynamicServers.privateAddress, DynamicServers.US, DynamicServers.availableCpu, DynamicServers.availableRam, ServerStatus.serverGroup, COUNT(*) As serverCount FROM DynamicServers LEFT JOIN ServerStatus ON ServerStatus.address LIKE CONCAT(DynamicServers.privateAddress, '%') WHERE DynamicServers.US = true GROUP BY DynamicServers.address, ServerStatus.serverGroup;";
|
||||
private static String RETRIEVE_SERVERGROUP_STATUSES = "SELECT ServerStatus.serverName, serverGroup, motd, DynamicServers.address, ServerStatus.address, players, maxPlayers, case when TIME_TO_SEC(TIMEDIFF(now(), ServerStatus.lastTimeWithPlayers)) > 300 then 1 else 0 end as empty FROM ServerStatus INNER JOIN DynamicServers ON ServerStatus.address LIKE CONCAT(DynamicServers.privateAddress, '%') WHERE DynamicServers.US = true AND TIME_TO_SEC(TIMEDIFF(now(), ServerStatus.updated)) <= 15";
|
||||
private static String RETRIEVE_SERVER_GROUP_DATA = "SELECT groupName, prefix, scriptName, requiredRam, cpuRequired, requiredTotal, requiredJoinable FROM ServerGroups;";
|
||||
private static String DELETE_SERVER_STATUS = "DELETE FROM ServerStatus WHERE address = ? AND serverName = ?;";
|
||||
|
||||
|
@ -122,8 +122,6 @@ public class Bridge extends TeamGame implements OreObsfucation
|
||||
|
||||
// Flags
|
||||
DamageSelf = true;
|
||||
|
||||
QuitOut = true;
|
||||
|
||||
ItemDrop = true;
|
||||
ItemPickup = true;
|
||||
|
@ -14,6 +14,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.disguise.disguises.DisguiseCow;
|
||||
import mineplex.core.disguise.disguises.DisguiseHorse;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.game.Game.GameState;
|
||||
@ -88,7 +89,8 @@ public class KitSkeletalHorse extends SmashKit
|
||||
player.getInventory().setBoots(ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS));
|
||||
|
||||
//Disguise
|
||||
DisguiseCow disguise = new DisguiseCow(player);
|
||||
DisguiseHorse disguise = new DisguiseHorse(player);
|
||||
disguise.setType(Variant.SKELETON_HORSE);
|
||||
disguise.SetName(C.cYellow + player.getName());
|
||||
disguise.SetCustomNameVisible(true);
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
|
@ -22,6 +22,7 @@ import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.disguise.disguises.DisguiseBase;
|
||||
import mineplex.core.disguise.disguises.DisguiseHorse;
|
||||
import mineplex.core.disguise.disguises.DisguisePig;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
@ -67,11 +68,12 @@ public class PerkHorseKick extends Perk
|
||||
return;
|
||||
|
||||
//Horse Animation
|
||||
//DisguiseBase horse = Manager.GetDisguise().getDisguise(player);
|
||||
//if (horse != null && horse instanceof DisguiseHorse)
|
||||
//{
|
||||
//((CraftHorse)player).getHandle().p(true); //XXX MAKE LEGS KICK AIR HERE
|
||||
//}
|
||||
DisguiseBase horse = Manager.GetDisguise().getDisguise(player);
|
||||
if (horse != null && horse instanceof DisguiseHorse)
|
||||
{
|
||||
((DisguiseHorse)horse).kick();
|
||||
Manager.GetDisguise().updateDisguise(horse);
|
||||
}
|
||||
|
||||
//Animation
|
||||
_active.put(player, System.currentTimeMillis());
|
||||
@ -158,11 +160,12 @@ public class PerkHorseKick extends Perk
|
||||
playerIterator.remove();
|
||||
|
||||
//Horse Animation
|
||||
//DisguiseBase horse = Manager.GetDisguise().getDisguise(player);
|
||||
//if (horse != null && horse instanceof DisguiseHorse)
|
||||
//{
|
||||
//((CraftHorse)player).getHandle().p(true); //XXX STOP KICKING AIR HERE
|
||||
//}
|
||||
DisguiseBase horse = Manager.GetDisguise().getDisguise(player);
|
||||
if (horse != null && horse instanceof DisguiseHorse)
|
||||
{
|
||||
((DisguiseHorse)horse).stopKick();
|
||||
Manager.GetDisguise().updateDisguise(horse);
|
||||
}
|
||||
|
||||
Manager.GetCondition().EndCondition(player, null, GetName());
|
||||
}
|
||||
|
@ -99,7 +99,6 @@ public class ArenaManager<ArenaType extends IArena> implements Listener, Runnabl
|
||||
String name = directory + _arenaCount;
|
||||
|
||||
new File(name).mkdir();
|
||||
new File(name + File.separator + "region").mkdir();
|
||||
|
||||
// TODO Queue/Optimize unzip - currently 50ms on production server.
|
||||
ZipUtil.UnzipToDirectory(key, name);
|
||||
|
@ -33,6 +33,7 @@ public class DominateGameEngine extends TeamGameEngine<IDominateGame, IDominateS
|
||||
_notifier = notifier;
|
||||
new DominateStatsReporter(plugin, donationManager, webServerAddress);
|
||||
|
||||
MinQueuePlayersToStart = 4;
|
||||
TeamSize = 5;
|
||||
AddToActiveGame = true;
|
||||
}
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user