Mise à jour de craftbukkit vers 1.7.2 R0.4 et correction de bugs sur la base de donnée et sur le système de Ban

This commit is contained in:
Marc Baloup 2015-03-18 18:01:42 -04:00
parent f912c76ae6
commit 4ebae9627a
11 changed files with 20 additions and 15 deletions

View File

@ -2,12 +2,6 @@
<classpath> <classpath>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="resources"/> <classpathentry kind="src" path="resources"/>
<classpathentry kind="lib" path="lib/bukkit-1.7.2-R0.3.jar">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/PandacraftUtils/lib/bukkit-1.7.2-R0.3-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/craftbukkit-1.7.2-R0.3.jar" sourcepath="lib/craftbukkit-1.7.2-R0.3.src.zip"/>
<classpathentry kind="lib" path="lib/ProtocolLib-3.2.0.jar"/> <classpathentry kind="lib" path="lib/ProtocolLib-3.2.0.jar"/>
<classpathentry kind="lib" path="lib/WorldEdit-5.6.jar"/> <classpathentry kind="lib" path="lib/WorldEdit-5.6.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
@ -17,5 +11,10 @@
<classpathentry kind="lib" path="lib/PermissionsEx.jar"/> <classpathentry kind="lib" path="lib/PermissionsEx.jar"/>
<classpathentry kind="lib" path="lib/fanciful-0.3.2-20150109.234753-1.jar"/> <classpathentry kind="lib" path="lib/fanciful-0.3.2-20150109.234753-1.jar"/>
<classpathentry kind="lib" path="lib/gson-2.3.1.jar"/> <classpathentry kind="lib" path="lib/gson-2.3.1.jar"/>
<classpathentry kind="lib" path="lib/craftbukkit-1.7.2-R0.4-20140316.221310-4.jar" sourcepath="lib/craftbukkit-1.7.2-R0.4-20140316.221310-4.src.zip">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/PandacraftUtils/lib/bukkit-1.7.2-R0.3-javadoc.zip!/"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

Binary file not shown.

View File

@ -4,6 +4,7 @@ import java.sql.SQLException;
import net.mc_pandacraft.java.plugin.pandacraftutils.commands.PandacraftUtilsCommandsManager; import net.mc_pandacraft.java.plugin.pandacraftutils.commands.PandacraftUtilsCommandsManager;
import net.mc_pandacraft.java.plugin.pandacraftutils.config.ConfigManager; import net.mc_pandacraft.java.plugin.pandacraftutils.config.ConfigManager;
import net.mc_pandacraft.java.plugin.pandacraftutils.data_model.SQLManager;
import net.mc_pandacraft.java.plugin.pandacraftutils.modules.AutoMessagesManager; import net.mc_pandacraft.java.plugin.pandacraftutils.modules.AutoMessagesManager;
import net.mc_pandacraft.java.plugin.pandacraftutils.modules.CalculatorManager; import net.mc_pandacraft.java.plugin.pandacraftutils.modules.CalculatorManager;
import net.mc_pandacraft.java.plugin.pandacraftutils.modules.CommandAliasManager; import net.mc_pandacraft.java.plugin.pandacraftutils.modules.CommandAliasManager;
@ -106,6 +107,7 @@ public class PandacraftUtils extends JavaPlugin {
ConfigManager.loadNewInstance(); ConfigManager.loadNewInstance();
SQLManager.loadNewInstance();
OnlinePlayerManager.loadNewInstance(); OnlinePlayerManager.loadNewInstance();
PandacraftUtilsCommandsManager.loadNewInstance(); PandacraftUtilsCommandsManager.loadNewInstance();

View File

@ -15,6 +15,7 @@ import org.bukkit.World;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
import org.bukkit.entity.Damageable;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
public class CommandList extends AbstractCommandExecutor { public class CommandList extends AbstractCommandExecutor {
@ -184,7 +185,7 @@ public class CommandList extends AbstractCommandExecutor {
else if (args.length > 0 && (args[0].toLowerCase().equals("gm") || args[0].toLowerCase().equals("gamemode"))) else if (args.length > 0 && (args[0].toLowerCase().equals("gm") || args[0].toLowerCase().equals("gamemode")))
{ {
String world = p.getWorld().getName(); String world = p.getWorld().getName();
double health = Math.rint(p.getHealth()*100)/100; double health = Math.rint(((Damageable)p).getHealth()*100)/100;
double eat = Math.rint(p.getFoodLevel()*100)/100; double eat = Math.rint(p.getFoodLevel()*100)/100;
boolean flyMode = p.getAllowFlight(); boolean flyMode = p.getAllowFlight();
String gm = (p.getGameMode() == GameMode.SURVIVAL)?("§CSurvie§r;vie:§7"+health+"§r;faim:§7"+eat+"§r"+((flyMode)?";§7canFly":"")) String gm = (p.getGameMode() == GameMode.SURVIVAL)?("§CSurvie§r;vie:§7"+health+"§r;faim:§7"+eat+"§r"+((flyMode)?";§7canFly":""))

View File

@ -47,7 +47,7 @@ public class ModoHistoryElement extends SQLElement {
"actionType", "actionType",
"time", "time",
"playerName", "playerName",
"duration", "value",
"message" "message"
}; };
} }

View File

@ -25,8 +25,8 @@ public abstract class SQLElement {
protected SQLElement(String name) { protected SQLElement(String name) {
this(name, 0); tableName = name;
saved = false;
} }
protected SQLElement(String name, int id) { protected SQLElement(String name, int id) {
tableName = name; tableName = name;
@ -39,7 +39,6 @@ public abstract class SQLElement {
public void save() { public void save() {
String tableName = this.getClass().getSimpleName();
try { try {
Connection conn; Connection conn;
@ -54,9 +53,12 @@ public abstract class SQLElement {
String sql = ""; String sql = "";
for (int i=0; i<fields.length && i<values.length; i++) for (int i=0; i<fields.length && i<values.length; i++)
{ {
sql += fields[i]+" = ? "; sql += fields[i]+" = ? ,";
} }
if (sql.length() > 0)
sql = sql.substring(0, sql.length()-1);
PreparedStatement st = conn.prepareStatement("UPDATE "+tableName+" SET "+sql+" WHERE id="+id); PreparedStatement st = conn.prepareStatement("UPDATE "+tableName+" SET "+sql+" WHERE id="+id);
for (int i=0; i<fields.length && i<values.length; i++) for (int i=0; i<fields.length && i<values.length; i++)
@ -98,7 +100,6 @@ public abstract class SQLElement {
public void delete() { public void delete() {
String tableName = this.getClass().getSimpleName();
try { try {
if (saved) if (saved)

View File

@ -21,7 +21,7 @@ public class CreativCheatManager implements Listener {
return; return;
e.getPlayer().setFallDistance(0); e.getPlayer().setFallDistance(0);
e.getPlayer().setHealth(20); e.getPlayer().setHealth(20D);
e.getPlayer().teleport(e.getTo().getWorld().getSpawnLocation()); e.getPlayer().teleport(e.getTo().getWorld().getSpawnLocation());
plugin.getLogger().info("§7"+e.getPlayer().getDisplayName()+"§r teleported to §7"+e.getTo().getWorld().getName()+"§r's spawn to avoid a bug exploit"); plugin.getLogger().info("§7"+e.getPlayer().getDisplayName()+"§r teleported to §7"+e.getTo().getWorld().getName()+"§r's spawn to avoid a bug exploit");

View File

@ -2,6 +2,8 @@ package net.mc_pandacraft.java.plugin.pandacraftutils.network_api.request_execut
import java.util.Collection; import java.util.Collection;
import org.bukkit.entity.Damageable;
import net.mc_pandacraft.java.plugin.pandacraftutils.network_api.Response; import net.mc_pandacraft.java.plugin.pandacraftutils.network_api.Response;
import net.mc_pandacraft.java.plugin.pandacraftutils.players.OnlinePlayer; import net.mc_pandacraft.java.plugin.pandacraftutils.players.OnlinePlayer;
import net.mc_pandacraft.java.plugin.pandacraftutils.players.OnlinePlayerManager; import net.mc_pandacraft.java.plugin.pandacraftutils.players.OnlinePlayerManager;
@ -38,7 +40,7 @@ public class RequestExecutorPlayerList extends AbstractRequestExecutor {
returnData.append(nul+op.getPlayer().getGameMode().toString()); returnData.append(nul+op.getPlayer().getGameMode().toString());
returnData.append(nul+(int)op.getPlayer().getHealth()); returnData.append(nul+(int)((Damageable)op.getPlayer()).getHealth());
returnData.append(nul+(int)op.getPlayer().getFoodLevel()); returnData.append(nul+(int)op.getPlayer().getFoodLevel());