Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server > CO2 PServer Guides & Releases
You last visited: Today at 01:28

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release]User Delete (Console Commands for 5165)

Discussion on [Release]User Delete (Console Commands for 5165) within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
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:


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:
[COLOR="Red"]        public static void DeleteAccount(string Name)
        {
            if (File.Exists(@"C:\OldCODB\Users\" + Name + ".usr"))
            {
                File.Delete(@"C:\OldCODB\Users\" + Name + ".usr");
            }
        }[/COLOR]
[COLOR="Blue"]        public static void DeleteCharacter(string Name)
        {
            if (File.Exists(@"C:\OldCODB\Users\Characters\" + Name + ".chr"))
            {
                File.Delete(@"C:\OldCODB\Users\Characters\" + Name + ".chr");
            }
        }[/COLOR]
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:
[COLOR="Red"]                    if (Cmd[0] == "/deleteaccount" && Cmd.Length > 1)
                    {
                        Database.DeleteAccount(Cmd[1]);
                    }[/COLOR]
[COLOR="Blue"]                    if (Cmd[0] == "/deletecharacter" && Cmd.Length > 1)
                    {
                        Database.DeleteCharacter(Cmd[1]);
                    }[/COLOR]
Now press f6 (build), then f5 (debug), let it load the text then close and save.

Your done, Enjoy.
copz1337 is offline  
Thanks
12 Users
Old 02/09/2010, 01:29   #2
 
elite*gold: 0
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
 
elite*gold: 0
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.
copz1337 is offline  
Old 02/09/2010, 01:39   #4
 
elite*gold: 0
Join Date: Feb 2010
Posts: 480
Received Thanks: 207
Good job Alex!
Decker_ is offline  
Old 02/09/2010, 03:07   #5
 
salem rey's Avatar
 
elite*gold: 0
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
 
elite*gold: 0
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
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
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
 
ramix's Avatar
 
elite*gold: 0
Join Date: Aug 2008
Posts: 272
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
 
elite*gold: 0
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..
copz1337 is offline  
Old 02/09/2010, 18:34   #10
 
walmartboi's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 378
Received Thanks: 163
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
Old 02/09/2010, 21:00   #11
 
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
Quote:
Originally Posted by walmartboi View Post
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.
I think a ban command would just do it lol.
copz1337 is offline  
Old 04/19/2010, 03:24   #12
 
elite*gold: 0
Join Date: Sep 2009
Posts: 159
Received Thanks: 9
so how does this the player types /deletecharacter n the character gets deleted?
or is it a admin command as in /deletecharacter (character name)
greasontim is offline  
Old 04/22/2010, 14:52   #13
 
notforme's Avatar
 
elite*gold: 0
Join Date: Mar 2006
Posts: 21
Received Thanks: 5
Quote:
Originally Posted by copz1337 View Post
Update: For some reason, deleting Characters isn't working. But deleting Accounts does.

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:


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:
[COLOR="Red"]        public static void DeleteAccount(string Name)
        {
            if (File.Exists(@"C:\OldCODB\Users\" + Name + ".usr"))
            {
                File.Delete(@"C:\OldCODB\Users\" + Name + ".usr");
            }
        }[/COLOR]
[COLOR="Blue"]        public static void DeleteCharacter(string Name)
        {
            if (File.Exists(@"C:\OldCODB\Users\Characters" + Name + ".chr"))
            {
                File.Delete(@"C:\OldCODB\Users\Characters" + Name + ".chr");
            }
        }[/COLOR]
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:
[COLOR="Red"]                    if (Cmd[0] == "/deleteaccount" && Cmd.Length > 1)
                    {
                        Database.DeleteAccount(Cmd[1]);
                    }[/COLOR]
[COLOR="Blue"]                    if (Cmd[0] == "/deletecharacter" && Cmd.Length > 1)
                    {
                        Database.DeleteCharacter(Cmd[1]);
                    }[/COLOR]
Now press f6 (build), then f5 (debug), let it load the text then close and save.

Your done, Enjoy.
you're missing a \ here:
Code:
if (File.Exists(@"C:\OldCODB\Users\Characters" + Name + ".chr"))
            {
                File.Delete(@"C:\OldCODB\Users\Characters" + Name + ".chr");
            }
should be:
Code:
if (File.Exists(@"C:\OldCODB\Users\Characters\" + Name + ".chr"))
            {
                File.Delete(@"C:\OldCODB\Users\Characters\" + Name + ".chr");
            }
Change that and deleting characters will work aswell.
notforme is offline  
Thanks
1 User
Old 04/22/2010, 14:54   #14
 
notforme's Avatar
 
elite*gold: 0
Join Date: Mar 2006
Posts: 21
Received Thanks: 5
Quote:
Originally Posted by greasontim View Post
so how does this the player types /deletecharacter n the character gets deleted?
or is it a admin command as in /deletecharacter (character name)
Not trying to be rude or anything, but if you can't read the code, you shouldn't be trying to change it. Learn to read code first, don't go ask basic questions like this.
notforme is offline  
Old 04/22/2010, 23:34   #15
 
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
Lmao that's it notforme. I didn't see that. Won't test it though, I don't mess with this stuff anymore.
copz1337 is offline  
Reply


Similar Threads Similar Threads
[RELEASE] Console Commands for Lame Console Look
12/07/2011 - CO2 PServer Guides & Releases - 12 Replies
Well, to avoid any further useless posts on this subject... here are a ton of console based commands that will control the game from the server console. I will not explain what each does, it should be pretty easy to figure out, and I don't intend to answer stupid questions. If its a good question, I will answer it. public static void DoStuff() { bool flag = true; Console.Clear(); Console.ForegroundColor = ConsoleColor.Red; ...
[Release] Delete Character 5165
08/06/2010 - CO2 PServer Guides & Releases - 20 Replies
Not sure if this has been released or not but here it is First of add this to PacketHandler.cs in case 10010: case 95: //Delete Character { GC.Disconnect(); Database.DeleteCharacter(GC.MyChar.Name); break; }
[Release]/commands for 5165
02/18/2010 - CO2 PServer Guides & Releases - 21 Replies
Hello all, I have noticed that the /arrest command for 5165 didnt work... and I found out how to make a /revive playername command work so here it goes, the /arrest did begin off with someone off 4botters made it but it did NOT work and it made them like level 1 with no gold or silvers so I made it better, For the /revive playername command it is if (Cmd == "/revive") { Game.Character C = Game.World.CharacterFromName(Cmd); ...
[RELEASE] is your 5165 console/server spamming?
02/11/2010 - CO2 PServer Guides & Releases - 12 Replies
:pimp: I have no idea if this is out there yet but im gonna give it a shot......lmao Is your server constantly saying this? (Your Account) has suspiciously much silvers999999999 (Your Account) suspiciously much cps 999999999 ********************************** open Database.cs in C# **********************************
[Release]Console Commands with a bit of color [CoEmu V2]
07/19/2009 - CO2 PServer Guides & Releases - 9 Replies
Alright here it is dident take to long to make Umm there is one thing you will have to do that is not very hard and that is add a defintion for CSocket This is for the Game Server btw Ok To start off Add To Nano.cs using System.Diagnostics; Then add using System.Windows.Forms;



All times are GMT +1. The time now is 01:29.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.