All pastes #749535 Raw Edit

Unnamed

public text v1 · immutable
#749535 ·published 2007-10-25 19:14 UTC
rendered paste body
Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminBanChat.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminBanChat.java	(revision 1240)
+++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminBanChat.java	(working copy)
@@ -19,7 +19,6 @@
 package net.sf.l2j.gameserver.handler.admincommandhandlers;
 
 import net.sf.l2j.Config;
-import net.sf.l2j.gameserver.ThreadPoolManager;
 import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
 import net.sf.l2j.gameserver.model.GMAudit;
 import net.sf.l2j.gameserver.model.L2Object;
@@ -92,20 +91,18 @@
 		if (command.startsWith("admin_banchat"))
 		{
             String banLengthStr = "";
-            
 			if (banLength > -1)
             {
-                targetPlayer.setChatUnbanTask(ThreadPoolManager.getInstance().scheduleGeneral(new SchedChatUnban(targetPlayer, activeChar), banLength));
                 banLengthStr = " for " + banLength + " seconds.";
             }
 			
             activeChar.sendMessage(targetPlayer.getName() + " is now chat banned" + banLengthStr + ".");
-            targetPlayer.setChatBanned(true);
+            targetPlayer.setChatBanned(true, (int) banLength);
 		}
 		else if (command.startsWith("admin_unbanchat"))
 		{
             activeChar.sendMessage(targetPlayer.getName() + "'s chat ban has now been lifted.");
-			targetPlayer.setChatBanned(false);
+			targetPlayer.setChatBanned(false, 0);
 		}
 		
 		GMAudit.auditGMAction(activeChar.getName(), command,  targetPlayer.getName(), "");
@@ -119,21 +116,4 @@
 	private boolean checkLevel(int level) {
 		return (level >= REQUIRED_LEVEL);
 	}
-	
-	private class SchedChatUnban implements Runnable
-	{
-		L2PcInstance _player;
-		L2PcInstance _banner;
-		
-		protected SchedChatUnban(L2PcInstance player, L2PcInstance banner)
-		{
-			_player = player;
-			_banner = banner;
-		}
-		
-		public void run()
-		{
-			_player.setChatBanned(false);
-		}
-	}
 }