[wpdev-commits] xmlscripts/scripts/commands kickban.py,1.2,1.3
Brought to you by:
rip,
thiagocorrea
From: Richard M. <dr...@us...> - 2004-09-09 03:31:40
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15519/commands Modified Files: kickban.py Log Message: ok.. I think I'll leave it at this tonight... my brain is scrambled. Index: kickban.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/kickban.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** kickban.py 9 Sep 2004 03:04:04 -0000 1.2 --- kickban.py 9 Sep 2004 03:31:15 -0000 1.3 *************** *** 3,12 **** \description Kicks a connected client by target or account name. """ - """ \command ban \description Kick-bans an account by target or account name. """ - """ \command unban --- 3,10 ---- *************** *** 16,20 **** import wolfpack ! from wolfpack.consts import LOG_MESSAGE def onLoad(): --- 14,18 ---- import wolfpack ! import wolfpack.accounts def onLoad(): *************** *** 26,35 **** if len( args ) > 0: accname = args.lower() - account = None account = wolfpack.accounts.find( accname ) accountAction( socket, account, 'kick' ) return else: ! socket.sysmessage( "Please select the object for removal." ) socket.attachtarget( "commands.remove.doKick", [] ) return True --- 24,32 ---- if len( args ) > 0: accname = args.lower() account = wolfpack.accounts.find( accname ) accountAction( socket, account, 'kick' ) return else: ! socket.sysmessage( "Please select the character to kick." ) socket.attachtarget( "commands.remove.doKick", [] ) return True *************** *** 38,47 **** if len( args ) > 0: accname = args.lower() - account = None account = wolfpack.accounts.find( accname ) accountAction( socket, account, 'ban' ) return else: ! socket.sysmessage( "Please select the object for removal." ) socket.attachtarget( "commands.remove.doBan", [] ) return False --- 35,43 ---- if len( args ) > 0: accname = args.lower() account = wolfpack.accounts.find( accname ) accountAction( socket, account, 'ban' ) return else: ! socket.sysmessage( "Please select the character to kick-ban." ) socket.attachtarget( "commands.remove.doBan", [] ) return False *************** *** 63,77 **** if len( args ) > 0: accname = args.lower() - account = None account = wolfpack.accounts.find( accname ) ! if account: ! if account.rank > 1: ! if playeraccount.authorized( 'Misc', 'May Block Staff Accounts' ): ! continue ! else: ! socket.sysmessage( "You're not authorized to unblock staff members." ) ! return False account.unblock() ! socket.sysmessage( "You've unblocked the account %s." % account.name ) return True else: --- 59,71 ---- if len( args ) > 0: accname = args.lower() account = wolfpack.accounts.find( accname ) ! if account and account.rank <= myrank: ! if account.rank > 1 and playeraccount.authorized( 'Misc', 'May Block Staff Accounts' ): ! continue ! else: ! socket.sysmessage( "You're not authorized to unban staff members." ) ! return False account.unblock() ! socket.sysmessage( "You've unban the account %s." % account.name ) return True else: *************** *** 86,105 **** socket.sysmessage( "Failed to find an account with the given name." ) return False ! elif account and myrank > account.rank: ! if account.rank == 100: ! socket.sysmessage( "You can not kick or ban admins!" ) return False - if account.rank > 1: - if playeraccount.authorized( 'Misc', 'May Block Staff Accounts' ): - continue - else: - socket.sysmessage( "You're not authorized to kick or ban staff members." ) - return False if action == 'kick': - account.block() for char in account.characters: if char.socket: ! char.soscket.sysmessage( "You've been kicked from the shard by the staff." ) char.socket.disconnect() socket.sysmessage( "You have disconnected %s." % char.name ) --- 80,94 ---- socket.sysmessage( "Failed to find an account with the given name." ) return False ! elif account and account.rank <= myrank: ! if account.rank > 1 and playeraccount.authorized( 'Misc', 'May Block Staff Accounts' ): ! continue ! else: ! socket.sysmessage( "You're not authorized to kick or ban staff members." ) return False if action == 'kick': for char in account.characters: if char.socket: ! char.socket.sysmessage( "You've been kicked from the shard by the staff." ) char.socket.disconnect() socket.sysmessage( "You have disconnected %s." % char.name ) *************** *** 109,115 **** for char in account.characters: if char.socket: ! char.soscket.sysmessage( "You've been kick-banned from the shard by the staff." ) char.socket.disconnect() socket.sysmessage( "You have kick-banned %s." % char.name ) return True ! return False --- 98,104 ---- for char in account.characters: if char.socket: ! char.socket.sysmessage( "You've been kick-banned from the shard by the staff." ) char.socket.disconnect() socket.sysmessage( "You have kick-banned %s." % char.name ) return True ! return False |