Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

GM Check Script

Skilled Illusionist
Joined
Dec 26, 2010
Messages
390
Reaction score
157
Alright, since I remember one of my coders during caali times made this to protect anyone from gaining GM powers in game through SQL injections or something, I will now remake into MsSQL.

Caution: I'm making this RIGHT NOW. So I haven't tested it yet. Don't be pissed if I ruin your whole damn character tbl - Not my fault <3

1. Put this script into your config file.

PHP:
$getallgms = mssql_query("SELECT * FROM [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] WHERE m_chAuthority != 'F' AND isblock != 'D'");


$gm_ids = array("m_szName", "m_szName", "m_szName", "m_szName");

while($fetch = mssql_fetch_array($getallgms))
{

if(!in_array($fetch['m_szName'], $gm_ids))
{
$update = mssql_query("UPDATE [CHARACTER_01_DBF].dbo.[CHARACTER_TBL] SET isblock='D' where m_szName='{$fetch['m_szName']}'");
}


Now, where the line says
Code:
$gm_ids = array("m_szName", "m_szName", "m_szName", "m_szName");
Put the GM's Name in the "".

What this does is if a character is GM, BUT ISN'T in the array on the script, it'll set isblock to equal D, which makes the GM inuseable.

kthx
-Apixen
 
Last edited:
i sell platypus
Loyal Member
Joined
Jun 26, 2009
Messages
2,640
Reaction score
1,326
The least you could do is check it O_O
 
Experienced Elementalist
Joined
Aug 25, 2009
Messages
216
Reaction score
31
All I can say is Thank ya and I'm not expecting less from you.
 
It's a lemon thing
Joined
Dec 19, 2007
Messages
257
Reaction score
112
You could just run an easy query but meh, usefull if you want to do a GM's online page :p
 
Newbie Spellweaver
Joined
Sep 6, 2008
Messages
99
Reaction score
17
Tbh. this protects nothing. Either you need to run it manually or you need to implent it into several queries your site usually runs (online count or w.e.) which will slow the site down to death. How about just make everybodies site resistable to SQL Injections. ;)
If your registered character count goes over the 100.000 good luck on implenting this into usual SQL queries the site run. ;)
 
Skilled Illusionist
Joined
Dec 26, 2010
Messages
390
Reaction score
157
Tbh. this protects nothing. Either you need to run it manually or you need to implent it into several queries your site usually runs (online count or w.e.) which will slow the site down to death. How about just make everybodies site resistable to SQL Injections. ;)
If your registered character count goes over the 100.000 good luck on implenting this into usual SQL queries the site run. ;)

Actually read the script, bro.


The query in the script only selects the GM Characters. Do you really think there's going to be over 200 GMs? No. Only a few, which makes this script good.

Kthx bai.
 
Junior Spellweaver
Joined
Nov 19, 2010
Messages
110
Reaction score
16
This script seems a bit... overrated, seeing as how if you follow proper procedures, your script could be secure without having to code your GM Names in.

SQL Injection is very easy to do, but even easier to prevent in my opinion. o.o;
 
Newbie Spellweaver
Joined
Dec 25, 2010
Messages
16
Reaction score
10
The script is not overrated for that reason... it's overrated because it's pointless. The servers owners know who they promote, therefore a check script is not necessary.

+1 for effort though.
-1 for pointless.
 
Newbie Spellweaver
Joined
Sep 6, 2008
Messages
99
Reaction score
17
Actually read the script, bro.


The query in the script only selects the GM Characters. Do you really think there's going to be over 200 GMs? No. Only a few, which makes this script good.

Kthx bai.

Run this query in a database with 150,000 character entries in. Good luck on having this speed all the time you execute this script ;)
 
Newbie Spellweaver
Joined
Dec 31, 2010
Messages
36
Reaction score
3
what you should really do is create a new table and load the GM ids, names and online status. That way you don't bog down the database looking for them.

You can run a cron job or execute a stored procedure every 30min or whatever then store it in a new table for the website. Its very logical.

The table itself wouldn't be dependent on anything in the server.
 
Not working on UnitedFlyf
Loyal Member
Joined
Apr 21, 2009
Messages
1,385
Reaction score
934
what you should really do is create a new table and load the GM ids, names and online status. That way you don't bog down the database looking for them.

You can run a cron job or execute a stored procedure every 30min or whatever then store it in a new table for the website. Its very logical.

The table itself wouldn't be dependent on anything in the server.

Not necessary at all... SELECT m_idPlayer FROM CHARACTER_TBL WHERE m_chAuthority != 'F'

Takes less than a second(probably less than 1/1000ths of a second) in a character database with over 250k records.

Looking for GMs doesn't bog down the database...I could run that query 1,000x times a second and it wouldn't lag the database in the slightest. SELECT * FROM LOG_ITEM_TBL, on the other hand...with over 20million records...THAT bogs down the database.
 
Newbie Spellweaver
Joined
Dec 31, 2010
Messages
36
Reaction score
3
I agree with you. I didn't think there was any slowdown myself because I've managed a lot of database driven websites with thousands of customers and never any slowdowns on the database.

I only mentioned that method because the person above me said the script would slowdown the server.

I don't even think it would slowdown if you had over a million accounts in the database. Wouldn't be as fast as a thousand but still wouldn't slow the game down.
 
Not working on UnitedFlyf
Loyal Member
Joined
Apr 21, 2009
Messages
1,385
Reaction score
934
I agree with you. I didn't think there was any slowdown myself because I've managed a lot of database driven websites with thousands of customers and never any slowdowns on the database.

I only mentioned that method because the person above me said the script would slowdown the server.

I don't even think it would slowdown if you had over a million accounts in the database. Wouldn't be as fast as a thousand but still wouldn't slow the game down.

Tbh, after looking at the script, he uses a *(SELECT ALL). It would be hugely more effective to "SELECT m_szName". Even though it wouldn't slow the gameserver down, it is a very inefficient/slow script. Also, the database will never effect Worldserver lag unless it lags for like 60 seconds straight(mssql would have to crash) and crashes the entire server.
 
Last edited:
Back
Top