Trigger for auto ban dupers

Newbie Spellweaver
Joined
Aug 16, 2012
Messages
41
Reaction score
2
Hello, I have been using a good hackshield that prevent other hack such as server crasher, fly hack, aspd hack, blinkers, etc.. but for dupe items it needs further investigation..

I have actually found 1 way that people keeps doing to dupe in my server, first of all try to check my db error log here:

742 10/13/12 11:50:50 : Query : UPDATE tbl_general SET X=-5942.208008,Y=-1.#QNAN0,Z=-5657.539063,TotalPlayMin=3 WHERE Serial = 566528
743 10/13/12 11:50:50 : SqlState:42000, NativeError:102 Msg:[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '#QNAN0'.
744 10/13/12 11:50:50 : SQLExecDirectA Returns : SQL_ERROR
745 10/13/12 11:53:57 : Query : UPDATE tbl_general SET HP=2202,FP=1542,SP=938,X=-4486.239258,Y=-1.#QNAN0,Z=-2462.383057,TotalPlayMin=11 WHERE Serial = 566523
746 10/13/12 11:53:57 : SqlState:42000, NativeError:102 Msg:[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '#QNAN0'.
747 10/13/12 11:53:57 : SQLExecDirectA Returns : SQL_ERROR
748 10/13/12 11:56:39 : Query : UPDATE tbl_general SET HP=2202,FP=1499,SP=938,Y=-1.#QNAN0,TotalPlayMin=9 WHERE Serial = 566523
749 10/13/12 11:56:39 : SqlState:42000, NativeError:102 Msg:[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '#QNAN0'.
750 10/13/12 11:56:39 : SQLExecDirectA Returns : SQL_ERROR
751 10/13/12 11:59:22 : Query : UPDATE tbl_general SET FP=1535,SP=938,Y=-1.#QNAN0,TotalPlayMin=9 WHERE Serial = 566523
752 10/13/12 11:59:22 : SqlState:42000, NativeError:102 Msg:[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '#QNAN0'.
753 10/13/12 11:59:22 : SQLExecDirectA Returns : SQL_ERROR
754 10/13/12 12:02:49 : Query : UPDATE tbl_general SET FP=1542,SP=938,Y=-1.#QNAN0,TotalPlayMin=10 WHERE Serial = 566523
755 10/13/12 12:02:49 : SqlState:42000, NativeError:102 Msg:[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '#QNAN0'.
756 10/13/12 12:02:49 : SQLExecDirectA Returns : SQL_ERROR
757 10/13/12 12:05:17 : Query : UPDATE tbl_general SET FP=1542,SP=934,Y=-1.#QNAN0,TotalPlayMin=9 WHERE Serial = 566523
758 10/13/12 12:05:17 : SqlState:42000, NativeError:102 Msg:[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '#QNAN0'.
759 10/13/12 12:05:17 : SQLExecDirectA Returns : SQL_ERROR
760 10/13/12 12:06:47 : Query : UPDATE tbl_general SET FP=1542,SP=930,Y=-1.#QNAN0,TotalPlayMin=9 WHERE Serial = 566523
761 10/13/12 12:06:47 : SqlState:42000, NativeError:102 Msg:[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '#QNAN0'.
762 10/13/12 12:06:47 : SQLExecDirectA Returns : SQL_ERROR
763 10/13/12 12:08:20 : Query : UPDATE tbl_general SET FP=1542,SP=934,Y=-1.#QNAN0,TotalPlayMin=9 WHERE Serial = 566523
764 10/13/12 12:08:20 : SqlState:42000, NativeError:102 Msg:[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '#QNAN0'.
765 10/13/12 12:08:20 : SQLExecDirectA Returns : SQL_ERROR
766 10/13/12 12:10:15 : Query : UPDATE tbl_general SET FP=1542,SP=936,Y=-1.#QNAN0,TotalPlayMin=9 WHERE Serial = 566523
767 10/13/12 12:10:15 : SqlState:42000, NativeError:102 Msg:[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '#QNAN0'.
768 10/13/12 12:10:15 : SQLExecDirectA Returns : SQL_ERROR

after been researching some website, the Y=-1 error in tbl.general is the one duping in my server.. so i would like to request a trigger query that will monitor the tbl.general
so if someone change their Y value to -1, they will be autobanned by that trigger query

can someone make that trigger query, it will contribute much for all of us in 2.1.6 server :)
 
thats just one dupe... using the coordinate based crash or such.
Wont work with any other ones tho.


the problem with it is that the query might not reach the db at all and throws error when its passed to the odbc driver.
 
Upvote 0
thats just one dupe... using the coordinate based crash or such.
Wont work with any other ones tho.


the problem with it is that the query might not reach the db at all and throws error when its passed to the odbc driver.

The ODBC runs the query first, then the error is returned through the ODBC driver. The ODBC doesn't do any syntax checking.

You could effectively eliminate this by using a trigger to monitor the tbl_general updates. I'd make it myself but I don't currently have a database for RF that is populated with data I can test it on.
 
Upvote 0
mm, only see 2 potential problems with what you want.

1) in the rare event Y column actually obtains a -1 value legitimately, it would ban the person as a duper. Super rare I know, but I don't see why it would be impossible.

2) doing the trigger on Update of Y in the table could potentially bog down your box if you have a larger player base. it would be checking that column every single time it gets updated for every player. So if you have say 100 players online, it will be constantly running the check for those 100 players over and over and over because every time they take a step, Y column changes.

A single trigger like this won't harm much in performance, but too many of them you may start to see drawbacks.

EDIT: just realized, may not matter, the update is failing, therefore -1 isn't probably even being placed into the column to begin with. You'd have to check the column to see if it literally shows -1. or if it stays the old value since update didn't work. Not sure how you'd check for trying to input NAN into a column that fails via a trigger itself
 
Last edited:
Upvote 0
mm, only see 2 potential problems with what you want.

1) in the rare event Y column actually obtains a -1 value legitimately, it would ban the person as a duper. Super rare I know, but I don't see why it would be impossible.

2) doing the trigger on Update of Y in the table could potentially bog down your box if you have a larger player base. it would be checking that column every single time it gets updated for every player. So if you have say 100 players online, it will be constantly running the check for those 100 players over and over and over because every time they take a step, Y column changes.

A single trigger like this won't harm much in performance, but too many of them you may start to see drawbacks.

EDIT: just realized, may not matter, the update is failing, therefore -1 isn't probably even being placed into the column to begin with. You'd have to check the column to see if it literally shows -1. or if it stays the old value since update didn't work. Not sure how you'd check for trying to input NAN into a column that fails via a trigger itself

Triggers can still monitor queries and prevent certain queries from executing based on what they are trying to do. You can easily make a trigger that cancels a query that is trying to update all rows in a table, or drop an entire table.

Cancelling the query isn't what would be required in this case, since it fails regardless. What needs to happen is an automatic ban, then insert the character name, timestamp, and other information in to a log table for later manual review. I've only ever seen this when people are trying to dupe. Even if it does mistakenly ban a legit character you can always reverse it. Better safe than sorry.
 
Upvote 0
nevermind, i already know how to prevent it, here is what i have done

In your RF_World database tbl_general find column X, Y, and Z
modify the data type to varchar(50) + not null

Hex your zoneserver.exe and find LastClassGrade
under LastClassGrade you will see X = % f , Y = % f , Z = % f
change it to X = '% f' (with quotation mark) and don't forget to change Y and Z too

btw thanks for the help..
 
Upvote 0
nevermind, i already know how to prevent it, here is what i have done

In your RF_World database tbl_general find column X, Y, and Z
modify the data type to varchar(50) + not null

Hex your zoneserver.exe and find LastClassGrade
under LastClassGrade you will see X = % f , Y = % f , Z = % f
change it to X = '% f' (with quotation mark) and don't forget to change Y and Z too

btw thanks for the help..
nice to know this man thanks :) ofc in 2.1.6version 95% of all dupers using this metod throught fly hack by changing coordinates thanks a lot ^^
 
Upvote 0
yeah no problem mate :) the DB Error is clean after doing that..

btw anyone here know a hackshield that can block these engines : Kiki Engine, Thunder Engine, and HxD memory editor?
 
Upvote 0
Back