Jump to content
Keitenai

Utility: @ whois Command

Recommended Posts

File Name: WhoisCommand.txt
File Submitter: keitenai
File Submitted: 31 July 2017
File Category: Utility Script
Content Author: keitenai

Information:

      Admins or GMs mostly find it hard to track a player when certain player has many accounts created with many characters on each accounts.

      I too had this problem so I made this script to simplify tracing a player with a simple @ whois command.

How does it work?

      By typing the complete player's name after the command ( @ whois name of player ) will trigger sql searching for accounts which is linked to the player's IP address.

      Tracking is limited to last IP used by the player so this script is not capable of completely identifying all accounts of the player if a player use a different IP on a different account.

Features:

  1. NO src editing needed!
  2. Able to track account IDs, Character Names, and current online character on an account.

 

Script LINK: https://github.com/keitenai/keitenai/blob/master/WhoisCommand.txt

 

Give me hugs and kisses if you find this useful :D

 

 

  • Upvote 1
Link to comment
Share on other sites

You can actually replace this whole part here...

https://github.com/keitenai/keitenai/blob/master/WhoisCommand.txt#L30-L60

with this

for ([email protected] = 0; [email protected] < [email protected]_numparameters; [email protected]++) 
	[email protected]$ = [email protected]$ + ([email protected] > 0 ? " ":"") + [email protected]_parameters$[[email protected]];

or this

[email protected]$ = implode([email protected]_parameters$, " ");

(may get errors or warnings if the array size is less than 1 or 0)

Edited by Emistry
  • Upvote 1
Link to comment
Share on other sites

when you use query_sql() ... always use escape_sql() for all the string variables that you passed in.

otherwise your scripts are vulnerable to SQL injection.

query_sql("SELECT `account_id` FROM `char` WHERE `name` = '"[email protected]$+"'",[email protected]_ID$)

change to

query_sql("SELECT `account_id` FROM `char` WHERE `name` = '"+escape_sql([email protected]$)+"'",[email protected]_ID$)

etc..

Link to comment
Share on other sites

I was totally unaware of that. Thanks a bunch! now i know why i get script errors when there's a special character on a player's name like ' .

Git Updated!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.