1
0
mirror of https://github.com/moparisthebest/xAuth synced 2024-12-21 22:58:51 -05:00

Compatible with CraftBukkit #612

This commit is contained in:
CypherX 2011-04-01 00:20:04 -04:00
parent a34c0bdecd
commit fdf0548bee
6 changed files with 31 additions and 30 deletions

View File

@ -20,8 +20,8 @@ public class Settings
"login.strikes.enabled",
"login.strikes.amount",
"security.filter.enabled",
"security.filter.allowed",
"security.filter.blankname"
"security.filter.allowed"
//"security.filter.blankname"
};
private static final String[][] keyUpdates =
@ -60,7 +60,7 @@ public class Settings
defaults.put("login.strikes.amount", 5);
defaults.put("security.filter.enabled", true);
defaults.put("security.filter.allowed", "abcdefghijklmnopqrstuvwxyz0123456789_- ()[]{}");
defaults.put("security.filter.blankname", true);
//defaults.put("security.filter.blankname", true);
}
public void updateKeys()

View File

@ -15,7 +15,7 @@ public class Strings
"changepw.err.disabled", "changepw.err.registered", "changepw.success.self", "changepw.success.other",
"unregister.usage", "unregister.success", "reload.success", "toggle.usage", "toggle.err.permission", "toggle.success.reg",
"toggle.success.pw", "toggle.success.save", "misc.illegal", "misc.reloaded", "misc.enabled", "misc.disabled",
"misc.filterkickmsg", "misc.blankkickmsg"
"misc.filterkickmsg"/*, "misc.blankkickmsg"*/
};
private static final String[][] keyUpdates = {};
@ -79,7 +79,7 @@ public class Strings
defaults.put("misc.enabled", "enabled");
defaults.put("misc.disabled", "disabled");
defaults.put("misc.filterkickmsg", "Your name contains one or more illegal characters.");
defaults.put("misc.blankkickmsg", "Blank names are not allowed.");
//defaults.put("misc.blankkickmsg", "Blank names are not allowed.");
}
private void updateKeys()

View File

@ -1,5 +1,5 @@
//xAuth 1.1.5a
//Built against Bukkit #486 and CraftBukkit #602
//xAuth 1.1.6
//Built against Bukkit #493 and CraftBukkit #612
package com.cypherx.xauth;
@ -123,20 +123,20 @@ public class xAuth extends JavaPlugin
pm.registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS, playerListener, Event.Priority.Lowest, this);
pm.registerEvent(Event.Type.PLAYER_DROP_ITEM, playerListener, Event.Priority.Highest, this);
pm.registerEvent(Event.Type.PLAYER_PICKUP_ITEM, playerListener, Event.Priority.Highest, this);
//pm.registerEvent(Event.Type.PLAYER_INTERACT, playerListener, Event.Priority.Highest, this);
pm.registerEvent(Event.Type.PLAYER_ITEM, playerListener, Event.Priority.Highest, this);
pm.registerEvent(Event.Type.PLAYER_INTERACT, playerListener, Event.Priority.Highest, this);
//pm.registerEvent(Event.Type.PLAYER_ITEM, playerListener, Event.Priority.Highest, this);
pm.registerEvent(Event.Type.PLAYER_JOIN, playerListener, Event.Priority.Highest, this);
pm.registerEvent(Event.Type.PLAYER_LOGIN, playerListener, Event.Priority.Highest, this);
pm.registerEvent(Event.Type.PLAYER_MOVE, playerListener, Event.Priority.Highest, this);
pm.registerEvent(Event.Type.PLAYER_QUIT, playerListener, Event.Priority.Lowest, this);
pm.registerEvent(Event.Type.BLOCK_BREAK, blockListener, Priority.Highest, this);
pm.registerEvent(Event.Type.BLOCK_INTERACT, blockListener, Priority.Highest, this);
//pm.registerEvent(Event.Type.BLOCK_PLACE, blockListener, Priority.Highest, this);
pm.registerEvent(Event.Type.BLOCK_PLACED, blockListener, Priority.Highest, this);
//pm.registerEvent(Event.Type.BLOCK_INTERACT, blockListener, Priority.Highest, this);
pm.registerEvent(Event.Type.BLOCK_PLACE, blockListener, Priority.Highest, this);
//pm.registerEvent(Event.Type.BLOCK_PLACED, blockListener, Priority.Highest, this);
//pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener, Priority.Highest, this);
pm.registerEvent(Event.Type.ENTITY_DAMAGED, entityListener, Priority.Highest, this);
pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener, Priority.Highest, this);
//pm.registerEvent(Event.Type.ENTITY_DAMAGED, entityListener, Priority.Highest, this);
pm.registerEvent(Event.Type.ENTITY_TARGET, entityListener, Priority.Highest, this);
System.out.println("[" + pdfFile.getName() + "]" + " v" + pdfFile.getVersion() + " Enabled!");
@ -144,7 +144,7 @@ public class xAuth extends JavaPlugin
//autosave stuff
fullyEnabled = true;
}
public void getAuths()
{
System.out.println("[" + pdfFile.getName() + "] Loading player accounts..");
@ -397,7 +397,8 @@ public class xAuth extends JavaPlugin
CraftWorld cWorld = (CraftWorld)player.getWorld();
CraftPlayer cPlayer = (CraftPlayer)player;
cWorld.getHandle().m().d().a(cPlayer.getHandle());
//cWorld.getHandle().m().d().a(cPlayer.getHandle());
cWorld.getHandle().o().d().a(cPlayer.getHandle());
}
//SESSION FUNCTIONS

View File

@ -27,7 +27,7 @@ public class xAuthBlockListener extends BlockListener
}
//Prevents player from using switches, buttons, etc.
public void onBlockInteract(BlockInteractEvent event)
/*public void onBlockInteract(BlockInteractEvent event)
{
if (event.isCancelled())
return;
@ -37,7 +37,7 @@ public class xAuthBlockListener extends BlockListener
Player player = (Player)event.getEntity();
plugin.handleEvent(player, event);
}
}
}*/
//Prevents player from placing blocks
public void onBlockPlace(BlockPlaceEvent event)

View File

@ -24,11 +24,11 @@ public class xAuthPlayerListener extends PlayerListener
if (xAuth.settings.getBool("security.filter.enabled") && !plugin.isNameLegal(player.getName()))
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, xAuth.strings.getString("misc.filterkickmsg"));
if (xAuth.settings.getBool("security.filter.blankname") && player.getName().trim().equals(""))
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, xAuth.strings.getString("misc.blankkickmsg"));
//if (xAuth.settings.getBool("security.filter.blankname") && player.getName().trim().equals(""))
//event.disallow(PlayerLoginEvent.Result.KICK_OTHER, xAuth.strings.getString("misc.blankkickmsg"));
}
public void onPlayerJoin(PlayerEvent event)
public void onPlayerJoin(PlayerJoinEvent event)
{
Player player = event.getPlayer();
@ -43,13 +43,13 @@ public class xAuthPlayerListener extends PlayerListener
}
}
public void onPlayerQuit(PlayerEvent event)
public void onPlayerQuit(PlayerQuitEvent event)
{
plugin.logout(event.getPlayer());
}
//Prevents players from executing commands
public void onPlayerCommandPreprocess(PlayerChatEvent event)
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event)
{
if (event.isCancelled())
return;
@ -88,16 +88,16 @@ public class xAuthPlayerListener extends PlayerListener
}
//Prevents player from using an item such as food
public void onPlayerItem(PlayerItemEvent event)
/*public void onPlayerItem(PlayerItemEvent event)
{
if (event.isCancelled())
return;
Player player = event.getPlayer();
plugin.handleEvent(player, event);
}
}*/
/*public void onPlayerInteract(PlayerInteractEvent event)
public void onPlayerInteract(PlayerInteractEvent event)
{
//if (!xAuth.settings.getBool("limit.interact"))
//return;
@ -107,7 +107,7 @@ public class xAuthPlayerListener extends PlayerListener
Player player = event.getPlayer();
plugin.handleEvent(player, event);
}*/
}
//Prevents player from moving
public void onPlayerMove(PlayerMoveEvent event)
@ -131,8 +131,8 @@ public class xAuthPlayerListener extends PlayerListener
plugin.handleEvent(player, event);
if (event.isCancelled())
player.teleportTo(event.getFrom());
//player.teleport(event.getFrom());
player.teleport(event.getFrom());
//player.teleportTo(event.getFrom());
}
//Prevents player from picking up items

View File

@ -1,6 +1,6 @@
name: xAuth
main: com.cypherx.xauth.xAuth
version: 1.1.5a
version: 1.1.6
commands:
register: