Not a member yet? Register for your free account!


Go Back   elitepvpers > Conquer Online 2 > CO2 PServer - Discussions / Questions > CO2 PServer Guides & Releases
You last visited: Today at 16:37

  • Did you know? elitepvpers has its own image host, epvpimg.com.

 

[Release]User Delete (Console Commands for 5165)

This is a discussion on [Release]User Delete (Console Commands for 5165) within the CO2 PServer Guides & Releases forum part of the CO2 PServer - Discussions / Questions category; #Fixed but not tested. If fixed, thank you 'notforme'. Okay so I came up with the idea on doing this ...

Reply
 
Thread Tools
Old 02-09-2010, 01:17   #1
Banned
 
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
Post [Release]User Delete (Console Commands for 5165)


#Fixed but not tested. If fixed, thank you 'notforme'.

Okay so I came up with the idea on doing this a while back but I forgot about it. But now I remembered and I've decided to release it.

Function: It deletes the Account or Character from your OldCODB.

Purpose: For lazy people that do not want to go through folders to find what they are looking for to then delete it. Also, a little practice for me in C#.

How can this be improved: Well, I wanted it to be able to delete the Account that ties along with the Character but I do not know how. So I simply made 2 Commands separately for the Console so that you can delete the Account and/or Character. So this could be "improved" if you could just delete the Account and Character in just 1 hit instead of 2.

Requirements: [Only registered and activated users can see links. ]


Credits: I forgot who actually told me how to do this but credits to him/her.

Let's get started.

Open up the Source using C# and in Database.cs find:

Code:
        public static void CreateAccount(string Name, string Password, string Status)
        {
            if (!File.Exists(@"C:\OldCODB\Users\" + Name + ".usr"))
            {
                FileStream FS = new FileStream(@"C:\OldCODB\Users\" + Name + ".usr", FileMode.CreateNew);
                BinaryWriter BW = new BinaryWriter(FS);
                BW.Write(Password);
                BW.Write(Status);
                BW.Close();
                FS.Close();
            }
        }
Below that add:

Code:
        public static void DeleteAccount(string Name)
        {
            if (File.Exists(@"C:\OldCODB\Users\" + Name + ".usr"))
            {
                File.Delete(@"C:\OldCODB\Users\" + Name + ".usr");
            }
        }
        public static void DeleteCharacter(string Name)
        {
            if (File.Exists(@"C:\OldCODB\Users\Characters\" + Name + ".chr"))
            {
                File.Delete(@"C:\OldCODB\Users\Characters\" + Name + ".chr");
            }
        }
Now open Program.cs and find:

Code:
                    if (Cmd[0] == "/newacc" && Cmd.Length > 2)
                    {
                        if (Cmd.Length == 3)
                            Database.CreateAccount(Cmd[1], Cmd[2], "");
                        else
                            Database.CreateAccount(Cmd[1], Cmd[2], Cmd[3]);
                    }
Below that add:

Code:
                    if (Cmd[0] == "/deleteaccount" && Cmd.Length > 1)
                    {
                        Database.DeleteAccount(Cmd[1]);
                    }
                    if (Cmd[0] == "/deletecharacter" && Cmd.Length > 1)
                    {
                        Database.DeleteCharacter(Cmd[1]);
                    }
Now press f6 (build), then f5 (debug), let it load the text then close and save.

Your done, Enjoy.
__________________


Last edited by copz1337; 04-22-2010 at 23:36. Reason: Improvement.
copz1337 is offline  
Thanks
12 Users
Adziunia (02-10-2010), Arcо (02-09-2010), bestcheater (03-26-2010), Decker_ (02-09-2010), menaelmalak1 (04-20-2010), Metapod (02-09-2010), Myndeth (05-06-2010), ohbaby9 (05-31-2010), salem rey (02-09-2010), snipexandy (04-16-2010), Sp!!ke (07-24-2010), [X]-Cape (05-15-2010)
Old 02-09-2010, 01:29   #2
Banned
 
Join Date: Jan 2010
Posts: 74
Received Thanks: 18
Wow, I didn't know you were this smart.
Very good job bro.
+k
Metapod is offline  
Old 02-09-2010, 01:32   #3
Banned
 
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
Quote:
Originally Posted by Metapod View Post
Wow, I didn't know you were this smart.
Very good job bro.
+k
Read the Credits but thanks for the compliment anyway.

Last edited by copz1337; 02-09-2010 at 01:40.
copz1337 is offline  
Old 02-09-2010, 01:39   #4
Banned
 
Join Date: Feb 2010
Posts: 480
Received Thanks: 205
Good job Alex!
Decker_ is offline  
Old 02-09-2010, 03:07   #5
Learning C Foods
 
salem rey's Avatar
 
Join Date: Apr 2008
Posts: 275
Received Thanks: 43
lols. thanks it save me lot of time.

THANKS
salem rey is offline  
Old 02-09-2010, 03:16   #6
Banned
 
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
Quote:
Originally Posted by salem rey View Post
lols. thanks it save me lot of time.

THANKS
Yeah I know.
copz1337 is offline  
Old 02-09-2010, 07:57   #7
Banned
 
Join Date: Oct 2009
Posts: 8,744
Received Thanks: 5,235
Blog Entries: 13
Quote:
Originally Posted by copz1337 View Post
Yeah I know.
Ugh suckiest release ever.
Jk
Proud to see you are getting better at coding.
+k
Arcо is offline  
Old 02-09-2010, 12:34   #8
Senior Member
 
ramix's Avatar
 
Join Date: Aug 2008
Posts: 268
Received Thanks: 61
is a good release but icant delete characters

i chance this

Quote:
public static void DeleteCharacter(string Name)
{
if (File.Exists(@"C:\OldCODB\Users\Characters" + Name + ".usr"))
{
File.Delete(@"C:\OldCODB\Users\Characters" + Name + ".usr");
}
}
to this

Quote:
public static void DeleteCharacter(string Name)
{
if (File.Exists(@"C:\OldCODB\Users\Characters" + Name + ".chr"))
{
File.Delete(@"C:\OldCODB\Users\Characters" + Name + ".chr");
}
}
but not too :S
ramix is offline  
Old 02-09-2010, 17:08   #9
Banned
 
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
Quote:
Originally Posted by ramix View Post
is a good release but icant delete characters

i chance this



to this



but not too :S
Uh erm, actually I don't even think I've tested deleting Characters. I made it for Accounts but then I decided it would make sense to make one for both, let me see what's wrong.


#update- Yeah I tried it and I did change from .usr to .chr. That's pretty weird I really do not understand, sorry..

Last edited by copz1337; 02-09-2010 at 17:16.
copz1337 is offline  
Old 02-09-2010, 18:34   #10
Senior Member
 
walmartboi's Avatar
 
Join Date: Dec 2007
Posts: 378
Received Thanks: 162
The most practical way to do this would be to check if the character is online, if he is, kick him, then delete the character.
walmartboi is offline  
Thanks
1 User
copz1337 (07-29-2010)
Reply

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
[RELEASE] Console Commands for Lame Console Look taguro CO2 PServer Guides & Releases 12 12-07-2011 04:02
[Release] Delete Character 5165 t_dubble_uu CO2 PServer Guides & Releases 20 08-06-2010 19:32
[Release]/commands for 5165 paralyzer2 CO2 PServer Guides & Releases 21 02-18-2010 18:58
[RELEASE] is your 5165 console/server spamming? ASSN9NE CO2 PServer Guides & Releases 12 02-11-2010 19:58
[Release]Console Commands with a bit of color [CoEmu V2] hunterman01 CO2 PServer Guides & Releases 9 07-19-2009 20:08




All times are GMT +2. The time now is 16:37.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.