Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to delete accounts without charters?
Author Message
Russian
Journeyman
*

Posts: 75
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 0



Post: #1
How to delete accounts without charters?
Hello!
I have very more accounts without charters. Please help me tho write this function, for delete all accounts without charters. Thank you!
I does not know how to write it.
01-09-2015 07:02 PM
Find all posts by this user Like Post Quote this message in a reply
Gyros
Apprentice
*

Posts: 28
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: Mar 2012
Reputation: 1



Post: #2
RE: How to delete accounts without charters?
SERV.ACCOUNT UNUSED DELETE x
SERV.ACCOUNT UNUSED x DELETE
01-09-2015 07:30 PM
Find all posts by this user Like Post Quote this message in a reply
Russian
Journeyman
*

Posts: 75
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 0



Post: #3
RE: How to delete accounts without charters?
This function delete unused accounts.

This is not help if player was registered from site and have registration on forum of game.
And this function does not help with accounts, who registered some days ago and not created charters.
01-10-2015 02:25 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 246
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #4
RE: How to delete accounts without charters?
Try this:

PHP Code:
[FUNCTION deleteEmptyAccounts]
FOR 
<eval <serv.accounts> - 1>

 if <
serv.account.<dlocal._for>.chars> == 0
    serv
.log Preparing <serv.account.<dlocal._for>.name> for deletion..
    
args .= <serv.account.<dlocal._for>.name>,   
 endif
ENDFOR

FOR 
<eval <argv> - 1>
 
serv.log Deleting Account <argv[<dlocal._for>]>
 
account <argv[<dlocal._for>]> delete
ENDFOR
serv.account UPDATE 
Why two FOR ? Because if the account is deleted inside the first FOR, the serv.account is automatically reduced by 1, and this will cause problem with the first FOR loop condition (not noticeable with one empty account). I think it's possible to do that in a single loop by using while and a more strong condition check.
(This post was last modified: 01-10-2015 06:04 AM by darksun84.)
01-10-2015 06:03 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes darksun84's post
Russian
Journeyman
*

Posts: 75
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 0



Post: #5
RE: How to delete accounts without charters?
(01-10-2015 06:03 AM)darksun84 Wrote:  ...

Thanks you, i was some edited, but function some broken

[Image: 16522378585807002370.png]

Function find accounts without charters, but second loop have some error.

Code:
[FUNCTION DELETE_CLEAR_ACCOUNTS]
FOR 0 <EVAL <SERV.ACCOUNTS> - 1>
IF (<SERV.ACCOUNT.<dlocal._for>.chars> == 0) && (<ISEMPTY <SERV.ACCOUNT.<dlocal._for>.DTAG0.EMAIL>>)
SERV.LOG Preparing <SERV.ACCOUNT.<dlocal._for>.name> for deletion...
args .= <SERV.ACCOUNT.<dlocal._for>.name>,
ENDIF
ENDFOR

FOR 0 <EVAL <argv> - 1>
SERV.log Deleting ACCOUNT <argv[<dlocal._for>]>
ACCOUNT <argv[<dlocal._for>]> delete
ENDFOR
SERV.ACCOUNT UPDATE

Than you!
I was got account list, who have not charters and delete them.
(This post was last modified: 01-10-2015 06:30 PM by Russian.)
01-10-2015 06:16 PM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #6
RE: How to delete accounts without charters?
(01-10-2015 06:03 AM)darksun84 Wrote:  Try this:

PHP Code:
[FUNCTION deleteEmptyAccounts]
FOR 
<eval <serv.accounts> - 1>

 if <
serv.account.<dlocal._for>.chars> == 0
    serv
.log Preparing <serv.account.<dlocal._for>.name> for deletion..
    
args .= <serv.account.<dlocal._for>.name>,   
 endif
ENDFOR

FOR 
<eval <argv> - 1>
 
serv.log Deleting Account <argv[<dlocal._for>]>
 
account <argv[<dlocal._for>]> delete
ENDFOR
serv.account UPDATE 
Why two FOR ? Because if the account is deleted inside the first FOR, the serv.account is automatically reduced by 1, and this will cause problem with the first FOR loop condition (not noticeable with one empty account). I think it's possible to do that in a single loop by using while and a more strong condition check.

Use reverse loop:
Code:
for <eval <serv.accounts>-1> 0
serv.log Deleting account <dlocal._for> (<serv.account.<dlocal._for>.name>).
serv.account.<dlocal._for>.delete
endfor
01-11-2015 02:04 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 246
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #7
RE: How to delete accounts without charters?
ihhh Blush
01-11-2015 03:51 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)