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

This commit is contained in:
Chiss 2014-08-22 17:08:29 +10:00
commit 0022586e3e
38 changed files with 607 additions and 288 deletions

View File

@ -73,6 +73,37 @@
</jar>
<copy file="../bin/Hub.jar" todir="../../Testing/Hub/plugins"/>
</target>
<target name ="StaffServer" description="StaffServer">
<jar jarfile="../bin/StaffServer.jar">
<fileset dir="../Mineplex.StaffServer/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.StaffServer">
<include name="*.yml"/>
</fileset>
<fileset dir="../Mineplex.ServerData/bin">
<include name="**/*.class"/>
</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" />
<zipfileset src="../Libraries/commons-io-2.4.jar" />
<zipfileset src="../Libraries/commons-codec-1.6.jar" />
<zipfileset src="../Libraries/jedis-2.4.2.jar" />
<zipfileset src="../Libraries/commons-pool2-2.2.jar" />
</jar>
<copy file="../bin/StaffServer.jar" todir="../../Testing/StaffServer/plugins"/>
</target>
<target name ="MapParser" description="MapParser">
<jar jarfile="../bin/MapParser.jar">
<fileset dir="../Mineplex.MapParser/bin">

View File

@ -0,0 +1,103 @@
package mineplex.core.common.util;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.ByteBuffer;
import java.util.*;
public class UUIDFetcher
{
private static UUIDFetcher _instance = new UUIDFetcher();
private static final String PROFILE_URL = "https://api.mojang.com/profiles/minecraft";
private final JSONParser _jsonParser = new JSONParser();
public UUID getPlayerUUID(String name)
{
UUID uuid = null;
List<String> nameList = new ArrayList<String>();
nameList.add(name);
try
{
HttpURLConnection connection = createConnection();
String body = JSONArray.toJSONString(nameList.subList(0, Math.min(100, 1)));
writeBody(connection, body);
JSONArray array = (JSONArray) _jsonParser.parse(new InputStreamReader(connection.getInputStream()));
for (Object profile : array)
{
JSONObject jsonProfile = (JSONObject) profile;
String id = (String) jsonProfile.get("id");
uuid = UUIDFetcher.getUUID(id);
}
}
catch (Exception exception)
{
exception.printStackTrace();
}
return uuid;
}
private static void writeBody(HttpURLConnection connection, String body) throws Exception
{
OutputStream stream = connection.getOutputStream();
stream.write(body.getBytes());
stream.flush();
stream.close();
}
private static HttpURLConnection createConnection() throws Exception
{
URL url = new URL(PROFILE_URL);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type", "application/json");
connection.setUseCaches(false);
connection.setDoInput(true);
connection.setDoOutput(true);
return connection;
}
private static UUID getUUID(String id)
{
return UUID.fromString(id.substring(0, 8) + "-" + id.substring(8, 12) + "-" + id.substring(12, 16) + "-"
+ id.substring(16, 20) + "-" + id.substring(20, 32));
}
public static byte[] toBytes(UUID uuid)
{
ByteBuffer byteBuffer = ByteBuffer.wrap(new byte[16]);
byteBuffer.putLong(uuid.getMostSignificantBits());
byteBuffer.putLong(uuid.getLeastSignificantBits());
return byteBuffer.array();
}
public static UUID fromBytes(byte[] array)
{
if (array.length != 16)
{
throw new IllegalArgumentException("Illegal byte array length: " + array.length);
}
ByteBuffer byteBuffer = ByteBuffer.wrap(array);
long mostSignificant = byteBuffer.getLong();
long leastSignificant = byteBuffer.getLong();
return new UUID(mostSignificant, leastSignificant);
}
public static UUID getUUIDOf(String name)
{
if (_instance == null)
_instance = new UUIDFetcher();
return _instance.getPlayerUUID(name);
}
}

View File

@ -1,8 +1,8 @@
<?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="Arcade,Hub,"/>
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AUTO_TARGETS" value="Arcade,Hub,"/>
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_MANUAL_TARGETS" value="Arcade,Hub,"/>
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AFTER_CLEAN_TARGETS" value="Arcade,Hub,StaffServer,"/>
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AUTO_TARGETS" value="Arcade,Hub,StaffServer,"/>
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_MANUAL_TARGETS" value="Arcade,Hub,StaffServer,"/>
<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}"/>

View File

@ -18,6 +18,7 @@ import mineplex.core.account.repository.token.ClientToken;
import mineplex.core.common.Rank;
import mineplex.core.common.util.Callback;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UUIDFetcher;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.logger.Logger;
import mineplex.core.timing.TimingManager;
@ -37,8 +38,6 @@ 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;
@ -154,13 +153,24 @@ 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));
final UUID uuid = UUIDFetcher.getUUIDOf(playerName);
Bukkit.getServer().getScheduler().runTaskAsynchronously(GetPlugin(), new Runnable()
{
public void run()
{
LoadClient(client, uuid, "null");
ClientToken token = null;
Gson gson = new Gson();
String response = _repository.getClientByUUID(uuid);
token = gson.fromJson(response, ClientToken.class);
client.SetAccountId(token.AccountId);
client.SetRank(Rank.valueOf(token.Rank));
// JSON sql response
Bukkit.getServer().getPluginManager().callEvent(new ClientWebResponseEvent(response));
Bukkit.getServer().getScheduler().runTask(GetPlugin(), new Runnable()
{
public void run()

View File

@ -4,7 +4,9 @@ import java.util.ArrayList;
import java.util.List;
import mineplex.core.common.CurrencyType;
import mineplex.core.donation.repository.token.CoinTransactionToken;
import mineplex.core.donation.repository.token.DonorToken;
import mineplex.core.donation.repository.token.TransactionToken;
public class Donor
{
@ -13,6 +15,8 @@ public class Donor
private boolean _donated;
private List<Integer> _salesPackagesOwned;
private List<String> _unknownSalesPackagesOwned;
private List<TransactionToken> _transactions;
private List<CoinTransactionToken> _coinTransactions;
private boolean _update = true;
@ -24,6 +28,9 @@ public class Donor
_salesPackagesOwned = token.SalesPackages;
_unknownSalesPackagesOwned = token.UnknownSalesPackages;
_transactions = token.Transactions;
_coinTransactions = token.CoinRewards;
if (_salesPackagesOwned == null)
{
@ -34,6 +41,11 @@ public class Donor
{
_unknownSalesPackagesOwned = new ArrayList<String>();
}
if (_unknownSalesPackagesOwned == null)
{
_transactions = new ArrayList<TransactionToken>();
}
}
public int GetGems()
@ -117,6 +129,11 @@ public class Donor
{
_unknownSalesPackagesOwned.add(packageName);
}
public List<TransactionToken> getTransactions()
{
return _transactions;
}
public boolean OwnsUltraPackage()
{
@ -138,4 +155,9 @@ public class Donor
{
_coins += amount;
}
public List<CoinTransactionToken> getCoinTransactions()
{
return _coinTransactions;
}
}

View File

@ -0,0 +1,8 @@
package mineplex.core.donation.repository.token;
public class CoinTransactionToken
{
public long Date;
public String Source;
public int Amount;
}

View File

@ -9,5 +9,6 @@ public class DonorToken
public List<Integer> SalesPackages;
public List<String> UnknownSalesPackages;
public List<TransactionToken> Transactions;
public List<CoinTransactionToken> CoinRewards;
public int Coins;
}

View File

@ -112,11 +112,11 @@ public class RopedArrow extends SkillActive
int level = getLevel(((Player)proj.getShooter()));
if (level == 0) return;
Vector vec = UtilAlg.getTrajectory(proj.getShooter(), proj);
Vector vec = UtilAlg.getTrajectory((Entity)proj.getShooter(), proj);
double mult = (proj.getVelocity().length() / 3d);
//Action
UtilAction.velocity(proj.getShooter(), vec,
UtilAction.velocity((Entity)proj.getShooter(), vec,
0.4 + mult, false, 0, 0.3 * mult, 1.2 * mult, true);
//Effect

View File

@ -83,7 +83,7 @@ public class Sharpshooter extends Skill
_hitCount.put(player, limit);
//Inform
UtilPlayer.message(projectile.getShooter(), F.main(GetClassType().name(), GetName() + ": " +
UtilPlayer.message((Entity)projectile.getShooter(), F.main(GetClassType().name(), GetName() + ": " +
F.elem(_hitCount.get(player) + " Consecutive Hits") + C.cGray + " (" + F.skill("+"+ (limit * 2) + "Damage" ) + C.cGray + ")" ) );
}
else

View File

@ -14,6 +14,7 @@ public class ItemSalesPackage extends SalesPackageBase
super("Champions " + item.GetName(), Material.BOOK, (byte)0, item.GetDesc(), item.GetGemCost());
Free = item.isFree();
KnownPackage = false;
CurrencyCostMap.put(CurrencyType.Gems, item.GetGemCost());
}
@Override

View File

@ -0,0 +1,17 @@
<?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="StaffServer,"/>
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AUTO_TARGETS" value="StaffServer,"/>
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_MANUAL_TARGETS" value="StaffServer,"/>
<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="${resource}"/>
<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,auto,"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/Mineplex.StaffServer}"/>
</launchConfiguration>

View File

@ -10,6 +10,16 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>auto,full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/StaffBuilder.launch</value>
</dictionary>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>

View File

@ -0,0 +1,3 @@
name: StaffServer
main: mineplex.staffServer.StaffServer
version: 0.1

View File

@ -3,14 +3,19 @@ package mineplex.staffServer;
import mineplex.core.account.CoreClientManager;
import mineplex.core.chat.Chat;
import mineplex.core.command.CommandCenter;
import mineplex.core.creature.Creature;
import mineplex.core.donation.DonationManager;
import mineplex.core.memory.MemoryFix;
import mineplex.core.monitor.LagMeter;
import mineplex.core.npc.NpcManager;
import mineplex.core.playerTracker.PlayerTracker;
import mineplex.core.portal.Portal;
import mineplex.core.preferences.PreferencesManager;
import mineplex.core.recharge.Recharge;
import mineplex.core.status.ServerStatusManager;
import mineplex.core.updater.FileUpdater;
import mineplex.staffServer.customerSupport.CustomerSupport;
import mineplex.staffServer.password.Password;
import org.bukkit.plugin.java.JavaPlugin;
@ -31,9 +36,11 @@ public class StaffServer extends JavaPlugin
CommandCenter.Initialize(this);
CoreClientManager clientManager = new CoreClientManager(this, webServerAddress);
CommandCenter.Instance.setClientManager(clientManager);
Recharge.Initialize(this);
DonationManager donationManager = new DonationManager(this, webServerAddress);
new NpcManager(this, new Creature(this));
ServerStatusManager serverStatusManager = new ServerStatusManager(this, new LagMeter(this, clientManager));
new PlayerTracker(this, serverStatusManager.getCurrentServerName(), serverStatusManager.getUs());
PreferencesManager preferenceManager = new PreferencesManager(this, clientManager, donationManager);
@ -43,5 +50,8 @@ public class StaffServer extends JavaPlugin
new Chat(this, clientManager, preferenceManager, serverStatusManager.getCurrentServerName());
new MemoryFix(this);
new FileUpdater(this, portal);
new CustomerSupport(this, clientManager, donationManager);
new Password(this);
}
}

View File

@ -1,34 +1,40 @@
package mineplex.staffServer.customerSupport;
import java.text.SimpleDateFormat;
import java.util.HashSet;
import java.util.List;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerQuitEvent;
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.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.donation.DonationManager;
import mineplex.core.donation.Donor;
import mineplex.core.donation.repository.token.CoinTransactionToken;
import mineplex.core.donation.repository.token.TransactionToken;
public class CustomerSupport extends MiniPlugin
{
private CoreClientManager _clientManager;
private DonationManager _donationManager;
private NautHashMap<Player, HashSet<String>> _agentCacheMap = new NautHashMap<Player, HashSet<String>>();
private SimpleDateFormat _date = new SimpleDateFormat("MM/dd/yy HH:mm");
public CustomerSupport(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager)
{
super("Customer Support", plugin);
_clientManager = clientManager;
_donationManager = donationManager;
}
@Override
public void AddCommands()
{
@ -44,7 +50,7 @@ public class CustomerSupport extends MiniPlugin
{
if (!_agentCacheMap.containsKey(caller))
_agentCacheMap.put(caller, new HashSet<String>());
_agentCacheMap.get(caller).add(playerName);
}
@ -52,10 +58,29 @@ public class CustomerSupport extends MiniPlugin
{
CoreClient client = _clientManager.Get(playerName);
Donor donor = _donationManager.Get(playerName);
caller.sendMessage(C.cDGreen + C.Strike + "=============================================");
caller.sendMessage(F.main(GetName(), "Name : " + F.elem(playerName)));
caller.sendMessage(F.main(GetName(), "Rank : " + F.elem(client.GetRank().Name)));
//for (donor.GetUnknownSalesPackagesOwned())
caller.sendMessage(F.main(GetName(),
"Rank : " + F.elem(client.GetRank().Name.isEmpty() ? "Regular" : client.GetRank().Name)));
for (CoinTransactionToken transaction : donor.getCoinTransactions())
{
if (transaction.Source.equalsIgnoreCase("purchase"))
caller.sendMessage("[" + _date.format(transaction.Date) + "] " + C.cYellow + transaction.Amount + " Coins");
}
for (TransactionToken transaction : donor.getTransactions())
{
if (transaction.Coins == 0 && transaction.Gems == 0 && transaction.SalesPackageName.contains("Gem Booster"))
caller.sendMessage("[" + _date.format(transaction.Date) + "] " + C.cGreen
+ transaction.SalesPackageName);
}
caller.sendMessage(C.cDGreen + C.Strike + "=============================================");
}
@EventHandler
public void removeMapping(PlayerQuitEvent event)
{
_agentCacheMap.remove(event.getPlayer());
}
}

View File

@ -28,7 +28,7 @@ public class Password extends MiniPlugin
@EventHandler
public void promptForPassword(final PlayerJoinEvent event)
{
event.getPlayer().sendMessage(F.main(GetName(), "Please enter the server password within 5 seconds."));
event.getPlayer().sendMessage(F.main(GetName(), "Please enter the server password within 10 seconds."));
GetPlugin().getServer().getScheduler().scheduleSyncDelayedTask(GetPlugin(), new Runnable()
{
@ -37,7 +37,7 @@ public class Password extends MiniPlugin
if (!_accepted.contains(event.getPlayer()))
event.getPlayer().kickPlayer("You don't know the password little twerp.");
}
}, 100L);
}, 200L);
}
public void checkPassword(Player caller, String attempt)

View File

@ -15,7 +15,7 @@ public class PasswordCommand extends CommandBase<Password>
@Override
public void Execute(Player caller, String[] args)
{
if (args.length == 1)
if (args != null && args.length == 1)
{
Plugin.checkPassword(caller, args[0]);
}

View File

@ -0,0 +1,6 @@
package mineplex.staffServer.salespackages;
public class MonthlyUltra
{
}

View File

@ -2,15 +2,55 @@ package org.bukkit.entity;
import org.bukkit.projectiles.ProjectileSource;
public abstract interface Projectile extends Entity
{
/**
* Represents a shootable entity.
*/
public interface Projectile extends Entity {
/**
* This method exists for legacy reasons to provide backwards
* compatibility. It will not exist at runtime and should not be used
* under any circumstances.
*/
@Deprecated
public abstract LivingEntity getShooter();
public LivingEntity _INVALID_getShooter();
/**
* Retrieve the shooter of this projectile.
*
* @return the {@link ProjectileSource} that shot this projectile
*/
public ProjectileSource getShooter();
/**
* This method exists for legacy reasons to provide backwards
* compatibility. It will not exist at runtime and should not be used
* under any circumstances.
*/
@Deprecated
public abstract void setShooter(LivingEntity paramLivingEntity);
public void _INVALID_setShooter(LivingEntity shooter);
public abstract boolean doesBounce();
/**
* Set the shooter of this projectile.
*
* @param source the {@link ProjectileSource} that shot this projectile
*/
public void setShooter(ProjectileSource source);
public abstract void setBounce(boolean paramBoolean);
}
/**
* Determine if this projectile should bounce or not when it hits.
* <p>
* If a small fireball does not bounce it will set the target on fire.
*
* @return true if it should bounce.
*/
public boolean doesBounce();
/**
* Set whether or not this projectile should bounce or not when it hits
* something.
*
* @param doesBounce whether or not it should bounce.
*/
public void setBounce(boolean doesBounce);
}

View File

@ -810,13 +810,6 @@ public class ArcadeManager extends MiniPlugin implements IRelation
}
}
@EventHandler
public void TeleportLog(PlayerTeleportEvent event)
{
System.out.println("Teleporting: " + event.getPlayer().getName() + " to "
+ event.getTo().getWorld().getWorldFolder().getName());
}
public InventoryManager getInventoryManager()
{
return _inventoryManager;

View File

@ -647,7 +647,7 @@ public class CastleSiege extends TeamGame
int damage = (int) (5 * (event.getEntity().getVelocity().length() / 3d));
//Damage Event
Manager.GetDamage().NewDamageEvent(player, event.getEntity().getShooter(), event.getEntity(),
Manager.GetDamage().NewDamageEvent(player, (LivingEntity)event.getEntity().getShooter(), event.getEntity(),
DamageCause.CUSTOM, damage, true, false, false,
null, GetName());

View File

@ -14,7 +14,9 @@ import org.bukkit.FireworkEffect.Type;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftFallingSand;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.Slime;
@ -568,9 +570,9 @@ public class Gravity extends SoloGame
if (obj.Ent instanceof Player)
{
//Damage Event
Manager.GetDamage().NewDamageEvent((Player)obj.Ent, proj.getShooter(), null,
Manager.GetDamage().NewDamageEvent((Player)obj.Ent, (LivingEntity)proj.getShooter(), null,
DamageCause.CUSTOM, 1, false, true, true,
UtilEnt.getName(proj.getShooter()), "Sonic Blast");
UtilEnt.getName((Entity)proj.getShooter()), "Sonic Blast");
}

View File

@ -479,7 +479,7 @@ public class HideSeek extends TeamGame
if (eventEE.getDamager() instanceof Projectile)
{
proj = (Projectile)eventEE.getDamager();
damager = proj.getShooter();
damager = (LivingEntity)proj.getShooter();
}
else if (eventEE.getDamager() instanceof LivingEntity)
{

View File

@ -3,6 +3,7 @@ package nautilus.game.arcade.game.games.runner.kits;
import org.bukkit.EntityEffect;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Snowball;
import org.bukkit.event.EventHandler;
@ -52,6 +53,6 @@ public class KitFrosty extends Kit
event.GetDamageeEntity().playEffect(EntityEffect.HURT);
Manager.GetCondition().Factory().Slow("Snowball Slow", event.GetDamageeEntity(), event.GetProjectile().getShooter(), 2, 1, false, false, true, false);
Manager.GetCondition().Factory().Slow("Snowball Slow", event.GetDamageeEntity(), (LivingEntity)event.GetProjectile().getShooter(), 2, 1, false, false, true, false);
}
}

View File

@ -4,6 +4,7 @@ import java.util.HashMap;
import org.bukkit.Sound;
import org.bukkit.entity.Egg;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
@ -118,9 +119,9 @@ public class PerkEggGun extends Perk
Egg egg = (Egg)event.GetProjectile();
//Damage Event
Manager.GetDamage().NewDamageEvent(event.GetDamageeEntity(), egg.getShooter(), egg,
Manager.GetDamage().NewDamageEvent(event.GetDamageeEntity(), (LivingEntity)egg.getShooter(), egg,
DamageCause.PROJECTILE, 1, true, true, false,
UtilEnt.getName(egg.getShooter()), GetName());
UtilEnt.getName((LivingEntity)egg.getShooter()), GetName());
event.GetDamageeEntity().setVelocity(new Vector(0,0,0));
}

View File

@ -7,6 +7,7 @@ import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.event.EventHandler;
@ -89,11 +90,11 @@ public class PerkRopedArrow extends Perk
if (!(proj.getShooter() instanceof Player))
return;
Vector vec = UtilAlg.getTrajectory(proj.getShooter(), proj);
Vector vec = UtilAlg.getTrajectory((LivingEntity)proj.getShooter(), proj);
double mult = (proj.getVelocity().length() / 3d);
//Action
UtilAction.velocity(proj.getShooter(), vec,
UtilAction.velocity((LivingEntity)proj.getShooter(), vec,
0.4 + mult * _power, false, 0, 0.6 * mult * _power, 1.2 * mult * _power, true);
//Effect

View File

@ -3,6 +3,7 @@ package nautilus.game.arcade.kit.perks;
import java.util.ArrayList;
import java.util.Iterator;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.ThrownPotion;
@ -25,7 +26,6 @@ import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.kit.Perk;
public class PerkWitchPotion extends Perk
@ -89,9 +89,9 @@ public class PerkWitchPotion extends Perk
continue;
//Damage Event
Manager.GetDamage().NewDamageEvent(player, event.getEntity().getShooter(), null,
Manager.GetDamage().NewDamageEvent(player, (LivingEntity)event.getEntity().getShooter(), null,
DamageCause.CUSTOM, 5, true, true, false,
UtilEnt.getName(event.getEntity().getShooter()), GetName());
UtilEnt.getName((LivingEntity)event.getEntity().getShooter()), GetName());
}
}

View File

@ -132,7 +132,7 @@ public class PerkWitherSkull extends Perk
WitherSkull skull = (WitherSkull)event.getEntity();
Explode(skull, event.getLocation(), skull.getShooter());
Explode(skull, event.getLocation(), (LivingEntity)skull.getShooter());
}
@EventHandler(priority = EventPriority.LOWEST)

View File

@ -590,7 +590,7 @@ public class GameManager implements Listener
player.leaveVehicle();
player.teleport(Manager.GetLobby().GetSpawn());
}
}, i*3);
}, i);
}
}

View File

@ -83,6 +83,7 @@
<Compile Include="Tokens\AccountBatchToken.cs" />
<Compile Include="Tokens\AccountNameToken.cs" />
<Compile Include="Tokens\Client\AccountTransactionToken.cs" />
<Compile Include="Tokens\Client\CoinTransactionToken.cs" />
<Compile Include="Tokens\Client\RankUpdateToken.cs" />
<Compile Include="Tokens\Client\DonationBenefitToken.cs" />
<Compile Include="Model\Server\PetExtra.cs" />

View File

@ -43,6 +43,7 @@
SalesPackages = new List<int>(),
UnknownSalesPackages = new List<string>(),
Transactions = new List<AccountTransactionToken>(),
CoinRewards = new List<CoinTransactionToken>(),
CustomBuilds = new List<CustomBuildToken>(),
Pets = new List<PetToken>(),
PetNameTagCount = account.PetNameTagCount
@ -82,7 +83,7 @@
}
if (account.AccountTransactions == null)
account.AccountTransactions = new List<AccountTransaction>();
account.AccountTransactions = new List<AccountTransaction>();
foreach (var transaction in account.AccountTransactions)
{

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LOC.Core.Tokens.Client
{
public class CoinTransactionToken
{
public long Date { get; set; }
public int Amount { get; set; }
public string Source { get; set; }
public CoinTransactionToken(Model.Sales.CoinTransaction transaction)
{
Amount = transaction.Amount;
Date = transaction.Date;
Source = transaction.Source;
}
}
}

View File

@ -1,6 +1,7 @@
namespace LOC.Core.Tokens.Client
{
using System.Collections.Generic;
using LOC.Core.Model.Sales;
public class DonorToken
{
@ -10,6 +11,7 @@
public List<int> SalesPackages { get; set; }
public List<string> UnknownSalesPackages { get; set; }
public List<AccountTransactionToken> Transactions { get; set; }
public List<CoinTransactionToken> CoinRewards { get; set; }
public List<CustomBuildToken> CustomBuilds { get; set; }
public List<PetToken> Pets { get; set; }
public int PetNameTagCount { get; set; }

View File

@ -687,7 +687,7 @@
repository.CommitChanges();
}
public Account GetAccountByUUID(string uuid)
public ClientToken GetAccountByUUID(string uuid)
{
using (var repository = _repositoryFactory.CreateRepository())
{
@ -698,7 +698,16 @@
account.LoadNavigationProperties(repository.Context);
return account;
ClientToken clientToken = null;
clientToken = new ClientToken(account);
foreach (var trans in repository.Where<CoinTransaction>(x => x.Account.AccountId == account.AccountId).ToList())
{
clientToken.DonorToken.CoinRewards.Add(new CoinTransactionToken(trans));
}
return clientToken;
}
}
}

View File

@ -39,6 +39,6 @@
bool CoinReward(GemRewardToken token);
Account GetAccountByUUID(string uuid);
ClientToken GetAccountByUUID(string uuid);
}
}

View File

@ -42,9 +42,7 @@
[HttpPost]
public ActionResult GetAccountByUUID(string uuid)
{
var account = _accountAdministrator.GetAccountByUUID(uuid);
var json = JsonConvert.SerializeObject(new ClientToken(account));
var json = JsonConvert.SerializeObject(_accountAdministrator.GetAccountByUUID(uuid));
return Content(json, "application/json");
}

File diff suppressed because it is too large Load Diff

Binary file not shown.