8.1.4 Changes

Version update, fixed /trust public, streamlined player lookup by name,
made SQL connection logs more detailed.
This commit is contained in:
ryanhamshire 2014-09-27 20:13:50 -07:00
parent 65857aecd8
commit 59f394ab11
3 changed files with 12 additions and 13 deletions

View File

@ -2,7 +2,7 @@ name: GriefPrevention
main: me.ryanhamshire.GriefPrevention.GriefPrevention main: me.ryanhamshire.GriefPrevention.GriefPrevention
softdepend: [Vault, Multiverse-Core, My Worlds, MystCraft, Transporter] softdepend: [Vault, Multiverse-Core, My Worlds, MystCraft, Transporter]
dev-url: http://dev.bukkit.org/server-mods/grief-prevention dev-url: http://dev.bukkit.org/server-mods/grief-prevention
version: 8.1.3 version: 8.1.4
commands: commands:
abandonclaim: abandonclaim:
description: Deletes a claim. description: Deletes a claim.

View File

@ -356,8 +356,8 @@ public class Claim
//anyone with explicit build permission can make changes //anyone with explicit build permission can make changes
if(this.hasExplicitPermission(player, ClaimPermission.Build)) return null; if(this.hasExplicitPermission(player, ClaimPermission.Build)) return null;
//also everyone is a member of the "public", so check for public permission, indicated by a null key //also everyone is a member of the "public", so check for public permission
ClaimPermission permissionLevel = this.playerIDToClaimPermissionMap.get(null); ClaimPermission permissionLevel = this.playerIDToClaimPermissionMap.get("public");
if(ClaimPermission.Build == permissionLevel) return null; if(ClaimPermission.Build == permissionLevel) return null;
//subdivision permission inheritance //subdivision permission inheritance

View File

@ -682,6 +682,8 @@ public class GriefPrevention extends JavaPlugin
catch(Exception e) catch(Exception e)
{ {
GriefPrevention.AddLogEntry("Because there was a problem with the database, GriefPrevention will not function properly. Either update the database config settings resolve the issue, or delete those lines from your config.yml so that GriefPrevention can use the file system to store data."); GriefPrevention.AddLogEntry("Because there was a problem with the database, GriefPrevention will not function properly. Either update the database config settings resolve the issue, or delete those lines from your config.yml so that GriefPrevention can use the file system to store data.");
GriefPrevention.AddLogEntry(e.getMessage());
e.printStackTrace();
return; return;
} }
} }
@ -2143,17 +2145,14 @@ public class GriefPrevention extends JavaPlugin
private OfflinePlayer resolvePlayerByName(String name) private OfflinePlayer resolvePlayerByName(String name)
{ {
//try online players first //try online players first
OfflinePlayer [] players = this.getServer().getOnlinePlayers(); Player targetPlayer = this.getServer().getPlayerExact(name);
for(int i = 0; i < players.length; i++) if(targetPlayer != null) return targetPlayer;
{
if(players[i].getName().equalsIgnoreCase(name))
{
return players[i];
}
}
//then search offline players targetPlayer = this.getServer().getPlayer(name);
players = this.getServer().getOfflinePlayers(); if(targetPlayer != null) return targetPlayer;
//then search offline players
OfflinePlayer [] players = this.getServer().getOfflinePlayers();
for(int i = 0; i < players.length; i++) for(int i = 0; i < players.length; i++)
{ {
if(players[i].getName().equalsIgnoreCase(name)) if(players[i].getName().equalsIgnoreCase(name))