Jump to content

Recommended Posts

Posted

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
  • Love 1
Posted (edited)

You can actually replace this whole part here...

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

with this

for (.@i = 0; .@i < .@atcmd_numparameters; .@i++) 
	.@name$ = .@name$ + (.@i > 0 ? " ":"") + .@atcmd_parameters$[.@i];

or this

.@name$ = implode(.@atcmd_parameters$, " ");

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

Edited by Emistry
  • Upvote 1
Posted

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` = '"+.@name$+"'",.@acc_ID$)

change to

query_sql("SELECT `account_id` FROM `char` WHERE `name` = '"+escape_sql(.@name$)+"'",.@acc_ID$)

etc..

Posted

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!

  • 2 years later...
  • 2 weeks later...

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...