diff --git a/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java b/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java index 98fea4f14..5cd9ba309 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java @@ -37,6 +37,8 @@ import org.bukkit.event.player.PlayerLoginEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.plugin.java.JavaPlugin; +import com.google.common.base.Charsets; + public class CoreClientManager extends MiniPlugin { private JavaPlugin _plugin; @@ -149,6 +151,28 @@ public class CoreClientManager extends MiniPlugin } } + public void loadClientByName(final String playerName, final Runnable runnable) + { + final CoreClient client = Add(playerName); + final UUID uuid = UUID.nameUUIDFromBytes((playerName).getBytes(Charsets.UTF_8)); + + Bukkit.getServer().getScheduler().runTaskAsynchronously(GetPlugin(), new Runnable() + { + public void run() + { + LoadClient(client, uuid, "null"); + Bukkit.getServer().getScheduler().runTask(GetPlugin(), new Runnable() + { + public void run() + { + if (runnable != null) + runnable.run(); + } + }); + } + }); + } + private void LoadClient(final CoreClient client, final UUID uuid, String ipAddress) { TimingManager.start(client.GetPlayerName() + " LoadClient Total."); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/account/repository/AccountRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/account/repository/AccountRepository.java index ac8e99228..133dc26b0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/account/repository/AccountRepository.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/account/repository/AccountRepository.java @@ -30,6 +30,11 @@ public class AccountRepository return new JsonWebCall(_webAddress + "PlayerAccount/Login").ExecuteReturnStream(token); } + + public String getClientByUUID(UUID uuid) + { + return new JsonWebCall(_webAddress + "PlayerAccount/GetAccountByUUID").ExecuteReturnStream(uuid.toString()); + } public void SaveRank(Callback callback, String name, Rank rank, boolean perm) { diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java index 70e090b22..96b6d9b49 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java @@ -62,7 +62,7 @@ import mineplex.serverdata.MinecraftServer; public class ServerManager extends MiniPlugin { - private static final Long FREE_PORTAL_TIMER = 30000L; + private static final Long FREE_PORTAL_TIMER = 1000L; private CoreClientManager _clientManager; private DonationManager _donationManager; diff --git a/Plugins/Mineplex.StaffServer/.classpath b/Plugins/Mineplex.StaffServer/.classpath new file mode 100644 index 000000000..0169f5fdb --- /dev/null +++ b/Plugins/Mineplex.StaffServer/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Plugins/Mineplex.StaffServer/.project b/Plugins/Mineplex.StaffServer/.project new file mode 100644 index 000000000..89a8d6d8e --- /dev/null +++ b/Plugins/Mineplex.StaffServer/.project @@ -0,0 +1,17 @@ + + + Mineplex.StaffServer + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/StaffServer.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/StaffServer.java new file mode 100644 index 000000000..699afe207 --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/StaffServer.java @@ -0,0 +1,47 @@ +package mineplex.staffServer; + +import mineplex.core.account.CoreClientManager; +import mineplex.core.chat.Chat; +import mineplex.core.command.CommandCenter; +import mineplex.core.donation.DonationManager; +import mineplex.core.memory.MemoryFix; +import mineplex.core.monitor.LagMeter; +import mineplex.core.playerTracker.PlayerTracker; +import mineplex.core.portal.Portal; +import mineplex.core.preferences.PreferencesManager; +import mineplex.core.status.ServerStatusManager; +import mineplex.core.updater.FileUpdater; + +import org.bukkit.plugin.java.JavaPlugin; + +public class StaffServer extends JavaPlugin +{ + private String WEB_CONFIG = "webServer"; + + @Override + public void onEnable() + { + getConfig().addDefault(WEB_CONFIG, "http://accounts.mineplex.com/"); + getConfig().set(WEB_CONFIG, getConfig().getString(WEB_CONFIG)); + saveConfig(); + + String webServerAddress = getConfig().getString(WEB_CONFIG); + + //Static Modules + CommandCenter.Initialize(this); + CoreClientManager clientManager = new CoreClientManager(this, webServerAddress); + CommandCenter.Instance.setClientManager(clientManager); + + DonationManager donationManager = new DonationManager(this, webServerAddress); + + ServerStatusManager serverStatusManager = new ServerStatusManager(this, new LagMeter(this, clientManager)); + new PlayerTracker(this, serverStatusManager.getCurrentServerName(), serverStatusManager.getUs()); + PreferencesManager preferenceManager = new PreferencesManager(this, clientManager, donationManager); + preferenceManager.GiveItem = false; + + Portal portal = new Portal(this, serverStatusManager.getCurrentServerName()); + new Chat(this, clientManager, preferenceManager, serverStatusManager.getCurrentServerName()); + new MemoryFix(this); + new FileUpdater(this, portal); + } +} diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java new file mode 100644 index 000000000..d9d311bc4 --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java @@ -0,0 +1,61 @@ +package mineplex.staffServer.customerSupport; + +import java.util.HashSet; +import java.util.List; + +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +import mineplex.core.MiniPlugin; +import mineplex.core.account.CoreClient; +import mineplex.core.account.CoreClientManager; +import mineplex.core.common.util.F; +import mineplex.core.common.util.NautHashMap; +import mineplex.core.donation.DonationManager; +import mineplex.core.donation.Donor; + +public class CustomerSupport extends MiniPlugin +{ + private CoreClientManager _clientManager; + private DonationManager _donationManager; + + private NautHashMap> _agentCacheMap = new NautHashMap>(); + + public CustomerSupport(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager) + { + super("Customer Support", plugin); + + _clientManager = clientManager; + _donationManager = donationManager; + } + + @Override + public void AddCommands() + { + AddCommand(new checkCommand(this)); + } + + public void Help(Player caller) + { + caller.sendMessage(F.main(GetName(), "Usage : /check jRayx")); + } + + public void addAgentMapping(Player caller, String playerName) + { + if (!_agentCacheMap.containsKey(caller)) + _agentCacheMap.put(caller, new HashSet()); + + _agentCacheMap.get(caller).add(playerName); + } + + public void showPlayerInfo(Player caller, String playerName) + { + CoreClient client = _clientManager.Get(playerName); + Donor donor = _donationManager.Get(playerName); + + caller.sendMessage(F.main(GetName(), "Name : " + F.elem(playerName))); + caller.sendMessage(F.main(GetName(), "Rank : " + F.elem(client.GetRank().Name))); + + //for (donor.GetUnknownSalesPackagesOwned()) + } +} diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/checkCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/checkCommand.java new file mode 100644 index 000000000..383443db3 --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/checkCommand.java @@ -0,0 +1,46 @@ +package mineplex.staffServer.customerSupport; + +import org.bukkit.entity.Player; + +import mineplex.core.command.CommandBase; +import mineplex.core.common.Rank; +import mineplex.core.common.util.Callback; + +public class checkCommand extends CommandBase +{ + public checkCommand(CustomerSupport plugin) + { + super(plugin, Rank.MODERATOR, "check"); + } + + @Override + public void Execute(final Player caller, String[] args) + { + if (args == null || args.length != 1) + { + Plugin.Help(caller); + } + else + { + final String playerName = args[0]; + + CommandCenter.GetClientManager().checkPlayerName(caller, playerName, new Callback() + { + public void run(Boolean matched) + { + if (matched) + { + CommandCenter.GetClientManager().loadClientByName(playerName, new Runnable() + { + public void run() + { + Plugin.addAgentMapping(caller, playerName); + Plugin.showPlayerInfo(caller, playerName); + } + }); + } + } + }); + } + } +} diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/Password.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/Password.java new file mode 100644 index 000000000..0fe95546b --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/Password.java @@ -0,0 +1,51 @@ +package mineplex.staffServer.password; + +import java.util.HashSet; + +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.plugin.java.JavaPlugin; + +import mineplex.core.MiniPlugin; +import mineplex.core.common.util.F; + +public class Password extends MiniPlugin +{ + private HashSet _accepted = new HashSet(); + + public Password(JavaPlugin plugin) + { + super("Password", plugin); + } + + @Override + public void AddCommands() + { + AddCommand(new PasswordCommand(this)); + } + + @EventHandler + public void promptForPassword(final PlayerJoinEvent event) + { + event.getPlayer().sendMessage(F.main(GetName(), "Please enter the server password within 5 seconds.")); + + GetPlugin().getServer().getScheduler().scheduleSyncDelayedTask(GetPlugin(), new Runnable() + { + public void run() + { + if (!_accepted.contains(event.getPlayer())) + event.getPlayer().kickPlayer("You don't know the password little twerp."); + } + }, 100L); + } + + public void checkPassword(Player caller, String attempt) + { + if (attempt.equals("ClothStarRust")) + { + _accepted.add(caller); + caller.sendMessage(F.main(GetName(), "I guess you get to stay.")); + } + } +} diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/PasswordCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/PasswordCommand.java new file mode 100644 index 000000000..29b0f96b8 --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/password/PasswordCommand.java @@ -0,0 +1,23 @@ +package mineplex.staffServer.password; + +import org.bukkit.entity.Player; + +import mineplex.core.command.CommandBase; +import mineplex.core.common.Rank; + +public class PasswordCommand extends CommandBase +{ + public PasswordCommand(Password plugin) + { + super(plugin, Rank.MODERATOR, "password"); + } + + @Override + public void Execute(Player caller, String[] args) + { + if (args.length == 1) + { + Plugin.checkPassword(caller, args[0]); + } + } +} diff --git a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/PvP.java b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/PvP.java index 149e03802..615574bc6 100644 --- a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/PvP.java +++ b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/PvP.java @@ -2,29 +2,24 @@ package nautilus.game.pvp; import java.util.HashSet; -import me.chiss.Core.Class.ClassFactory; import me.chiss.Core.Config.Config; import me.chiss.Core.Field.Field; import mineplex.core.itemstack.ItemStackFactory; import me.chiss.Core.Loot.LootFactory; -import me.chiss.Core.MemoryFix.MemoryFix; import me.chiss.Core.Module.ModuleManager; import me.chiss.Core.Modules.*; -import me.chiss.Core.NAC.NAC; import me.chiss.Core.Plugin.IPlugin; import me.chiss.Core.Plugin.IRelation; import me.chiss.Core.Scheduler.Scheduler; -import mineplex.core.message.Message; +import mineplex.core.monitor.LagMeter; import mineplex.core.npc.NpcManager; -import mineplex.core.packethandler.TabLobbyList; import mineplex.core.pet.PetFactory; import mineplex.core.pet.PetManager; -import mineplex.core.pet.PetShop; import mineplex.core.portal.Portal; import mineplex.core.projectile.ProjectileManager; +import mineplex.core.punish.Punish; import mineplex.core.recharge.Recharge; -import mineplex.core.server.ServerListener; -import mineplex.core.server.event.PlayerVoteEvent; +import mineplex.core.status.ServerStatusManager; import mineplex.core.updater.Updater; import mineplex.core.account.CoreClient; import mineplex.core.account.CoreClientManager; @@ -42,7 +37,6 @@ import mineplex.minecraft.game.core.combat.CombatManager; import mineplex.minecraft.game.core.condition.ConditionManager; import mineplex.minecraft.game.core.fire.Fire; import mineplex.minecraft.game.core.mechanics.Weapon; -import mineplex.minecraft.punish.Punish; import nautilus.game.pvp.modules.Farming; import nautilus.game.pvp.modules.Gameplay; import nautilus.game.pvp.modules.Recipes; @@ -78,10 +72,8 @@ public class PvP extends JavaPlugin implements IPlugin, Listener private BlockRestore _blockRestore; private Blood _blood; private Clans _clans; - private ClassFactory _classFactory; private ConditionManager _condition; private Creature _creature; - private DamageManager _damage; private Energy _energy; private Explosion _explosion; private Field _field; @@ -102,29 +94,21 @@ public class PvP extends JavaPlugin implements IPlugin, Listener //Repo private PvPRepository _repository; - - private ServerListener _serverListener; @Override public void onEnable() { - getConfig().addDefault(WEB_CONFIG, "http://www.nautmc.com/"); + getConfig().addDefault(WEB_CONFIG, "http://accounts.mineplex.com/"); getConfig().set(WEB_CONFIG, getConfig().getString(WEB_CONFIG)); saveConfig(); - //Repo - _repository = new PvPRepository(GetWebServerAddress()); + CommandCenter.Initialize(this); + CoreClientManager clientManager = new CoreClientManager(this, GetWebServerAddress()); + CommandCenter.Instance.setClientManager(clientManager); - //Init Modules - GetModules(); - - _clientManager = CoreClientManager.Initialize(this, GetWebServerAddress()); - CommandCenter.Initialize(this, _clientManager); + ItemStackFactory.Initialize(this, true); - CombatManager.Initialize(this); - ItemStackFactory.Initialize(this); - - new Punish(this, GetWebServerAddress()); + new Punish(this, GetWebServerAddress(), clientManager); GetBlood(); GetClans(); GetClasses(); @@ -148,12 +132,9 @@ public class PvP extends JavaPlugin implements IPlugin, Listener GetObserver(); GetServer(); GetWeapon(); - //GetWiki(); - - _petManager = new PetManager(this, GetWebServerAddress(), GetCreature(), GetClients()); //Unreferenced Modules - new AntiStack(); + new AntiStack(null); new Chat(this, _clientManager, GetClans()); new EventManager(this); new Farming(this); @@ -165,7 +146,6 @@ public class PvP extends JavaPlugin implements IPlugin, Listener new Information(this); new PlayerInfo(this); new PointManager(this, Scheduler.Instance, _repository, 4000, 150, 80, 8, 80, 8, 300); - new PetShop(this, _repository, GetClients(), new PetFactory(_repository), GetPetManager()); new Quit(this); new Recipes(this); new SoundTest(this); @@ -182,11 +162,12 @@ public class PvP extends JavaPlugin implements IPlugin, Listener //Activate Class Save //GetClasses().GetRestore().Activate(); - new Portal(this); + ServerStatusManager serverStatusManager = new ServerStatusManager(this, new LagMeter(this, clientManager)); + new Portal(this, serverStatusManager.getCurrentServerName()); //Shops new ShopManager(this, _repository, new BenefitManager(this, GetWebServerAddress(), GetEnergy())); - new NpcManager(this); + new NpcManager(this, _creature); //Items HashSet itemIgnore = new HashSet(); @@ -541,15 +522,6 @@ public class PvP extends JavaPlugin implements IPlugin, Listener return _weapon; } - @Override - public Wiki GetWiki() - { - if (_wiki == null) - _wiki = new Wiki(this, _repository); - - return _wiki; - } - @Override public Location GetSpawnLocation() { diff --git a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/ShopManager.java b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/ShopManager.java index 7f7e5ec3d..c9fc24ce3 100644 --- a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/ShopManager.java +++ b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/modules/ShopManager.java @@ -7,6 +7,7 @@ import me.chiss.Core.Shop.PvpBuildShop; import me.chiss.Core.Shop.PvpDonatorShop; import me.chiss.Core.Shop.PvpItemShop; import mineplex.core.CurrencyType; +import mineplex.core.MiniPlugin; import mineplex.core.server.RemoteRepository; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; @@ -20,7 +21,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.plugin.java.JavaPlugin; -public class ShopManager extends AModule +public class ShopManager extends MiniPlugin { private PvpDonatorShop _donatorShop; private PvpBuildShop _buildShop; diff --git a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/EventManager.java b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/EventManager.java index c3e793479..536968000 100644 --- a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/EventManager.java +++ b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/EventManager.java @@ -2,11 +2,12 @@ package nautilus.game.pvp.worldevent; import java.util.HashSet; -import mineplex.core.Rank; -import me.chiss.Core.Module.AModule; +import mineplex.core.MiniPlugin; +import mineplex.core.common.Rank; import mineplex.core.common.util.UtilServer; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; +import nautilus.game.pvp.worldevent.command.EventCommand; import nautilus.game.pvp.worldevent.events.BossSkeleton; import nautilus.game.pvp.worldevent.events.BossSlime; import nautilus.game.pvp.worldevent.events.BaseUndead; @@ -20,7 +21,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.HandlerList; import org.bukkit.plugin.java.JavaPlugin; -public class EventManager extends AModule +public class EventManager extends MiniPlugin { private HashSet _active = new HashSet(); @@ -38,65 +39,13 @@ public class EventManager extends AModule _lastStart = System.currentTimeMillis(); _lastStop = System.currentTimeMillis(); } - - @Override - public void enable() - { - } - @Override - public void disable() + public void AddCommands() { - for (EventBase cur : _active) - cur.TriggerStop(); + AddCommand(new EventCommand(this)); } - @Override - public void config() - { - - } - - @Override - public void commands() - { - AddCommand("ev"); - } - - @Override - public void command(Player caller, String cmd, String[] args) - { - if (!Clients().Get(caller).Rank().Has(Rank.ADMIN, true)) - return; - - if (args.length == 0) - { - caller.sendMessage("Missing Event Parameter."); - return; - } - - EventBase event = null; - - if (args[0].equals("dead")) event = new BaseUndead(this); - if (args[0].equals("dead4")) event = new BaseUndead(this, 4); - if (args[0].equals("slime")) event = new BossSlime(this); - if (args[0].equals("skel")) event = new BossSkeleton(this); - if (args[0].equals("swarm")) event = new BossSwarmer(this); - if (args[0].equals("wither")) event = new BossWither(this); - if (args[0].equals("brood")) event = new BossSpider(this); - - if (args[0].equals("flood")) event = new EndFlood(this, caller.getLocation()); - - if (event != null) - { - event.TriggerStart(); - _active.add(event); - - UtilServer.getServer().getPluginManager().registerEvents(event, Plugin()); - } - } - @EventHandler public void StartEvent(UpdateEvent event) { @@ -138,7 +87,7 @@ public class EventManager extends AModule _active.add(event); //Register Events - UtilServer.getServer().getPluginManager().registerEvents(event, Plugin()); + UtilServer.getServer().getPluginManager().registerEvents(event, GetPlugin()); _lastStart = System.currentTimeMillis(); } @@ -152,4 +101,9 @@ public class EventManager extends AModule _lastStop = System.currentTimeMillis(); } + + public void addEvent(EventBase event) + { + _active.add(event); + } } diff --git a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/command/EventCommand.java b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/command/EventCommand.java new file mode 100644 index 000000000..94db9d1fc --- /dev/null +++ b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/command/EventCommand.java @@ -0,0 +1,54 @@ +package nautilus.game.pvp.worldevent.command; + +import org.bukkit.entity.Player; + +import nautilus.game.pvp.worldevent.EventBase; +import nautilus.game.pvp.worldevent.EventManager; +import nautilus.game.pvp.worldevent.events.BaseUndead; +import nautilus.game.pvp.worldevent.events.BossSkeleton; +import nautilus.game.pvp.worldevent.events.BossSlime; +import nautilus.game.pvp.worldevent.events.BossSpider; +import nautilus.game.pvp.worldevent.events.BossSwarmer; +import nautilus.game.pvp.worldevent.events.BossWither; +import nautilus.game.pvp.worldevent.events.EndFlood; +import mineplex.core.command.CommandBase; +import mineplex.core.common.Rank; +import mineplex.core.common.util.UtilServer; + +public class EventCommand extends CommandBase +{ + public EventCommand(EventManager plugin) + { + super(plugin, Rank.ADMIN, "ev", "event"); + } + + @Override + public void Execute(Player caller, String[] args) + { + if (args.length == 0) + { + caller.sendMessage("Missing Event Parameter."); + return; + } + + EventBase event = null; + + if (args[0].equals("dead")) event = new BaseUndead(Plugin); + if (args[0].equals("dead4")) event = new BaseUndead(Plugin, 4); + if (args[0].equals("slime")) event = new BossSlime(Plugin); + if (args[0].equals("skel")) event = new BossSkeleton(Plugin); + if (args[0].equals("swarm")) event = new BossSwarmer(Plugin); + if (args[0].equals("wither")) event = new BossWither(Plugin); + if (args[0].equals("brood")) event = new BossSpider(Plugin); + + if (args[0].equals("flood")) event = new EndFlood(Plugin, caller.getLocation()); + + if (event != null) + { + event.TriggerStart(); + Plugin.addEvent(event); + + UtilServer.getServer().getPluginManager().registerEvents(event, Plugin.GetPlugin()); + } + } +} diff --git a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/creature/SkeletonKing.java b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/creature/SkeletonKing.java index 3435b50a0..22724d44f 100644 --- a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/creature/SkeletonKing.java +++ b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/creature/SkeletonKing.java @@ -3,7 +3,7 @@ package nautilus.game.pvp.worldevent.creature; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; -import org.bukkit.craftbukkit.v1_6_R3.entity.CraftSkeleton; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftSkeleton; import org.bukkit.entity.EntityType; import org.bukkit.entity.Skeleton; import org.bukkit.entity.Skeleton.SkeletonType; @@ -20,9 +20,9 @@ import mineplex.core.common.util.UtilTime; import nautilus.game.pvp.worldevent.EventBase; import nautilus.game.pvp.worldevent.EventMobBoss; import nautilus.game.pvp.worldevent.EventMobMinion; -import net.minecraft.server.v1_6_R3.EntitySkeleton; -import net.minecraft.server.v1_6_R3.Item; -import net.minecraft.server.v1_6_R3.ItemStack; +import net.minecraft.server.v1_7_R4.EntitySkeleton; +import net.minecraft.server.v1_7_R4.Item; +import net.minecraft.server.v1_7_R4.ItemStack; public class SkeletonKing extends EventMobBoss { @@ -50,7 +50,7 @@ public class SkeletonKing extends EventMobBoss CraftSkeleton skelC = (CraftSkeleton)skel; EntitySkeleton skelMC = skelC.getHandle(); - skelMC.setEquipment(0, new ItemStack(Item.IRON_SWORD)); + skelMC.setEquipment(0, new ItemStack(Item.getById(Material.IRON_SWORD.getId()))); } catch (Exception e) { diff --git a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/creature/SkeletonMinion.java b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/creature/SkeletonMinion.java index e1a4488dc..d1bdb873d 100644 --- a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/creature/SkeletonMinion.java +++ b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/creature/SkeletonMinion.java @@ -3,8 +3,8 @@ package nautilus.game.pvp.worldevent.creature; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; -import org.bukkit.craftbukkit.v1_6_R3.entity.CraftCreature; -import org.bukkit.craftbukkit.v1_6_R3.entity.CraftSkeleton; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftSkeleton; import org.bukkit.entity.Arrow; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; @@ -20,11 +20,11 @@ import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; import nautilus.game.pvp.worldevent.EventBase; import nautilus.game.pvp.worldevent.EventMobMinion; -import net.minecraft.server.v1_6_R3.EntityCreature; -import net.minecraft.server.v1_6_R3.EntitySkeleton; -import net.minecraft.server.v1_6_R3.Item; -import net.minecraft.server.v1_6_R3.ItemStack; -import net.minecraft.server.v1_6_R3.Navigation; +import net.minecraft.server.v1_7_R4.EntityCreature; +import net.minecraft.server.v1_7_R4.EntitySkeleton; +import net.minecraft.server.v1_7_R4.Item; +import net.minecraft.server.v1_7_R4.ItemStack; +import net.minecraft.server.v1_7_R4.Navigation; public class SkeletonMinion extends EventMobMinion { @@ -33,7 +33,7 @@ public class SkeletonMinion extends EventMobMinion super(event, location, "Skeleton Minion", true, 32, EntityType.SKELETON, host); if (GetState() == 0) - SetWeapon(Item.IRON_SWORD); + SetWeapon(Item.getById(Material.IRON_SWORD.getId())); } @Override @@ -48,7 +48,7 @@ public class SkeletonMinion extends EventMobMinion CraftSkeleton skelC = (CraftSkeleton)skel; EntitySkeleton skelMC = skelC.getHandle(); - skelMC.setEquipment(0, new ItemStack(Item.BOW)); + skelMC.setEquipment(0, new ItemStack(Item.getById(Material.BOW.getId()))); } catch (Exception e) { diff --git a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/events/BaseUndead.java b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/events/BaseUndead.java index d278e041e..b6dccad13 100644 --- a/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/events/BaseUndead.java +++ b/Plugins/Nautilus.Game.PvP/src/nautilus/game/pvp/worldevent/events/BaseUndead.java @@ -14,6 +14,7 @@ import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.player.PlayerInteractEvent; import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.recharge.Recharge; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; import mineplex.core.common.util.F; @@ -457,7 +458,7 @@ public class BaseUndead extends EventBase event.setCancelled(true); - if (!Manager.Recharge().use(event.getPlayer(), "Loot Chest", 60000, true)) + if (!Recharge.Instance.use(event.getPlayer(), "Loot Chest", 60000, true, false)) return; if (event.getClickedBlock().getType() == Material.ENDER_CHEST) LootChest(event.getClickedBlock()); diff --git a/Website/LOC.Website.Common/Models/AccountAdministrator.cs b/Website/LOC.Website.Common/Models/AccountAdministrator.cs index 2dd62d254..39faa04ff 100644 --- a/Website/LOC.Website.Common/Models/AccountAdministrator.cs +++ b/Website/LOC.Website.Common/Models/AccountAdministrator.cs @@ -686,5 +686,20 @@ repository.Add(newMacAddress); repository.CommitChanges(); } + + public Account GetAccountByUUID(string uuid) + { + using (var repository = _repositoryFactory.CreateRepository()) + { + var account = repository.Where(x => x.Uuid == uuid).FirstOrDefault(); + + if (account == null) + return null; + + account.LoadNavigationProperties(repository.Context); + + return account; + } + } } } \ No newline at end of file diff --git a/Website/LOC.Website.Common/Models/IAccountAdministrator.cs b/Website/LOC.Website.Common/Models/IAccountAdministrator.cs index a6a146ef0..8391389a9 100644 --- a/Website/LOC.Website.Common/Models/IAccountAdministrator.cs +++ b/Website/LOC.Website.Common/Models/IAccountAdministrator.cs @@ -38,5 +38,7 @@ void UpdateAccountUUIDs(List tokens); bool CoinReward(GemRewardToken token); + + Account GetAccountByUUID(string uuid); } } diff --git a/Website/LOC.Website.Web/Controllers/PlayerAccountController.cs b/Website/LOC.Website.Web/Controllers/PlayerAccountController.cs index e24fe93e5..d0c85c5aa 100644 --- a/Website/LOC.Website.Web/Controllers/PlayerAccountController.cs +++ b/Website/LOC.Website.Web/Controllers/PlayerAccountController.cs @@ -39,6 +39,15 @@ return Content(json, "application/json"); } + [HttpPost] + public ActionResult GetAccountByUUID(string uuid) + { + var account = _accountAdministrator.GetAccountByUUID(uuid); + + var json = JsonConvert.SerializeObject(new ClientToken(account)); + return Content(json, "application/json"); + } + [HttpPost] public ActionResult GetDonor(string name) { diff --git a/Website/LOCWebsite.suo b/Website/LOCWebsite.suo index baf4e023c..c2392d83b 100644 Binary files a/Website/LOCWebsite.suo and b/Website/LOCWebsite.suo differ