Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 10:04

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

Advertisement



adding clear command to impluse database source

Discussion on adding clear command to impluse database source within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
zoro7070's Avatar
 
elite*gold: 0
Join Date: Aug 2008
Posts: 144
Received Thanks: 18
Post adding clear command to impluse database source

iam trying to add clear command to impluse mysql system to delete all content from a table here is my try
Code:
public MySqlCommand Clear(string table)
        {
            _command = new StringBuilder("DELETE FROM <R>");
            return this;
        }
Code:
public enum MySqlCommandType
    {
        DELETE, INSERT, SELECT, UPDATE, COUNT, CLEAR
    }
when i use it nothing happened at all
Code:
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.CLEAR);
                cmd.Clear("tradelog");
zoro7070 is offline  
Old 09/02/2013, 13:08   #2
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
why would i code smthing thats already coded use smthing like that

Code:
new MySqlCommand(MySqlCommandType.DELETE).Delete("GuildAdvertisment", "GuildID", guild.ID).Execute();
GuildAdvertisment is the Table that im going to delete Entries From
Delete is going to be Through Checking GuildID Column if it has value equals to guild.ID then Remove the Line .. its pretty easy to use

btw your code wont work as you forgot to use .Execute method
shadowman123 is offline  
Thanks
1 User
Old 09/02/2013, 13:49   #3
 
zoro7070's Avatar
 
elite*gold: 0
Join Date: Aug 2008
Posts: 144
Received Thanks: 18
Quote:
Originally Posted by shadowman123 View Post
why would i code smthing thats already coded use smthing like that

Code:
new MySqlCommand(MySqlCommandType.DELETE).Delete("GuildAdvertisment", "GuildID", guild.ID).Execute();
GuildAdvertisment is the Table that im going to delete Entries From
Delete is going to be Through Checking GuildID Column if it has value equals to guild.ID then Remove the Line .. its pretty easy to use

btw your code wont work as you forgot to use .Execute method
you are right about the delete command and .Execute method i will try with it.
i do that to clear some database tables content every 3 days with simple code and because some of this table doesn't have value in the source like my download table and other so here we are ...
zoro7070 is offline  
Old 09/02/2013, 13:54   #4
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
In my point of View you shouldnt add Tables that u rnt going to use .. like Trade Log why would i make smthing like that .. its not important and if it is you can add it in Text so it doesnt make the Database laggy and beside that u arent going to Read data from that tradelog Table so Remove it
shadowman123 is offline  
Old 09/02/2013, 14:17   #5
 
zoro7070's Avatar
 
elite*gold: 0
Join Date: Aug 2008
Posts: 144
Received Thanks: 18
Red face

Quote:
Originally Posted by shadowman123 View Post
In my point of View you shouldnt add Tables that u rnt going to use .. like Trade Log why would i make smthing like that .. its not important and if it is you can add it in Text so it doesnt make the Database laggy and beside that u arent going to Read data from that tradelog Table so Remove it
i don't recommend useless table too but its a some kind of private server for my friends and i want to make sure that no one is cheating and for text files too because of size of the data
zoro7070 is offline  
Old 09/02/2013, 14:26   #6
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
1st : its already useless ... who ever gives his account to any1 Deserve to be Robbed away from his Gears , Money or w.e and they created Locking Gear for A reason

2nd : the text file wont consume much space .. beside that you can delete it every 3 days and its much more clear than in database which means its better in reading
shadowman123 is offline  
Old 09/02/2013, 15:12   #7
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
You forgot to call Execute().
Super Aids is offline  
Old 09/09/2013, 11:18   #8
 
zoro7070's Avatar
 
elite*gold: 0
Join Date: Aug 2008
Posts: 144
Received Thanks: 18
thanks @shadowman123 @Super Aids
zoro7070 is offline  
Old 02/12/2014, 11:16   #9
 
elite*gold: 0
Join Date: Dec 2006
Posts: 133
Received Thanks: 16
I know this is an old post, but for others who is looking for this...

Replace:
Quote:
public enum MySqlCommandType
{
DELETE, INSERT, SELECT, UPDATE, COUNT, CLEAR
}
Insert:
Quote:
#region Clear
public MySqlCommand Clear(string table)
{
_command = _command.Replace("<R>", "`" + table + "`");
return this;
}
#endregion
And this to the switch (Type)
Quote:
case MySqlCommandType.CLEAR:
{
_command = new StringBuilder("DELETE FROM <R>");
break;
}
martoon is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Monsters impluse source
08/20/2013 - CO2 Private Server - 3 Replies
<div align="center">after i upgrade the source to 5700+, the monsters don't attack don't move <br>but guards attack.<br>i want to know that maybe because of ....?<br></div>
clan war impluse source 5517
01/05/2013 - CO2 Private Server - 2 Replies
i make clanwar for my server but there is some problem clans score don't appear at screen clan name don't change at the clan pole using System; using System.Collections.Generic; using System.Linq; using System.Text; using Conquer_Online_Server.Database; using Conquer_Online_Server.Network.GamePackets;
Adding command prompt to right click..
01/07/2011 - Tutorials - 1 Replies
i grabbed this of my hack-forums tutorials account, just to let you be aware. ive done this myself if you have any problems pm me and if you still have problems after that ill just make a video and post it on youtube Pirate I Bet, a great hacker loves to use Command Prompt. Wanna see the Command Prompt in every Right Click? Alright here we go... :bandit:
Monster Spawn impluse Source
05/13/2010 - CO2 Private Server - 9 Replies
can someone explain to me how to create Monsters spawn cuze thier r no monsters if you really wanted to help just give a pic or add me at yahoo to explain that with team viewer hoppe someone will do :)
Money adding command for WOWemus
01/19/2006 - WoW Private Server - 0 Replies
All this goes into the Commands.tcl in scripts/lx Folder: This two lines go in the upper paragraph of the file, just somewhere beetween 2 lines wich beginns with " (doublequotes) "addmoney" { return } "resmoney" { return } This needed to be pasted in the lower paragraph, just scroll to the last line (has only a "}" sign). Just paste in clear line before.



All times are GMT +1. The time now is 10:05.


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.