Tiny phoenix command - Help prevent scammers
So yeah... @Johno lately released this but sadly... phoenix do this already :cool: Because phoenix is so awesome and cool we want use way how phoenix do it so cmdlogs table. I made simple command for everyone to track name changes. :shownames
Add to RoleManager.cs where other commands exit this:
this.dictionary_4.Add("shownames", 97);
Then to ChatCommandManager.cs somewhere end of case this:
Code:
case 97:
{
if (Params.Length >= 2)
{
using (DatabaseClient dbClient = Phoenix.GetDatabase().GetClient())
{
dbClient.AddParamWithValue("userid", Phoenix.GetGame().GetClientManager().method_27(Params[1]));
DataTable dataTable = dbClient.ReadDataTable("SELECT extra_data, timestamp FROM cmdlogs WHERE user_id = @userid AND command='flagme' LIMIT 100;");
string motdMessage = "User " + Params[1] + " last 100 name changes: \n";
foreach(DataRow dataRow in dataTable.Rows)
{
string extraData = dataRow["extra_data"].ToString();
string newName = extraData.Substring(extraData.IndexOf(':') + 1).Split(' ')[1];
string oldName = extraData.Substring(extraData.IndexOf(':') + 1).Split(' ')[3];
DateTime whenChangedName = Phoenix.smethod_21(double.Parse((string)dataRow["timestamp"].ToString()));
motdMessage += whenChangedName.ToString() + " - Old name: " + oldName + " - New name: " + newName + "\n";
}
Session.SendNotif(motdMessage, 2);
}
return true;
}
else
{
return false;
}
}
Now everyone can do :shownames <name> and they will see latest 100 name change :P
https://forum.ragezone.com/cache.php...96e0f795c8.png
Re: Tiny phoenix command - Help prevent scammers
Make it only for rank 4 and higher, because some people sometimes don't want to know what your old names where. It's only important for staffs.
ONT: Like this release.
Re: Tiny phoenix command - Help prevent scammers
Quote:
Originally Posted by
Vimsoration
Make it only for rank 4 and higher, because some people sometimes don't want to know what your old names where. It's only important for staffs.
ONT: Like this release.
Set a permission node for it. Hardcoding those ranks is just useless if you ever want to edit it in the future.
Re: Tiny phoenix command - Help prevent scammers
Wait a second why didn't you just put this in the other thread because its anoying that peaple make threads for all small things....
But ok I like the command but I can't see why this should of prevend cheaters? your chatlog is ID based... and your CMD log is ID based do I hope...
And your room system is ID based and... even the user system is ID based so yeah....
Re: Tiny phoenix command - Help prevent scammers
Quote:
Originally Posted by
Spot Ify
Wait a second why didn't you just put this in the other thread because its anoying that peaple make threads for all small things....
But ok I like the command but I can't see why this should of prevend cheaters? your chatlog is ID based... and your CMD log is ID based do I hope...
And your room system is ID based and... even the user system is ID based so yeah....
Room system isin't id based? And yeah if user have changed many time his name and user use this command he can figure out if he have scammed someone under his old username ;)
Re: Tiny phoenix command - Help prevent scammers
Quote:
Originally Posted by
The General
Set a permission node for it. Hardcoding those ranks is just useless if you ever want to edit it in the future.
Thanks for your idea
Re: Tiny phoenix command - Help prevent scammers
Who would use MySQL for a simple command.... :thumbdown:
and Phoenix is a terrible emulator.
Re: Tiny phoenix command - Help prevent scammers
Can anyone make :shownames for Goldtree emu?
Re: Tiny phoenix command - Help prevent scammers
Quote:
Originally Posted by
Wotsuba
Who would use MySQL for a simple command.... :thumbdown:
and Phoenix is a terrible emulator.
How to access the database and get name changes, if for instance it's after an emulator restart and it's not in the cache.
Re: Tiny phoenix command - Help prevent scammers
Can someone make this command on GTE? Thanks i advance <3
Re: Tiny phoenix command - Help prevent scammers
Quote:
Originally Posted by
Wotsuba
Who would use MySQL for a simple command.... :thumbdown:
and Phoenix is a terrible emulator.
If it's a simple command, then why not use MySQL?
It is overkill to use any other method (for eg cache it) because it leads to more memory usage which could've been prevented in the first place.
Re: Tiny phoenix command - Help prevent scammers
Quote:
Originally Posted by
Quackster
If it's a simple command, then why not use MySQL?
It is overkill to use any other method (for eg cache it) because it leads to more memory usage which could've been prevented in the first place.
Maybe you can make it for GTE? :')
Re: Tiny phoenix command - Help prevent scammers
I suggest a cool down timer should be added so this command can't be spammed and abused.
Quote:
Originally Posted by
Vimsoration
Maybe you can make it for GTE? :')
Make what?
Re: Tiny phoenix command - Help prevent scammers
Quote:
Originally Posted by
Quackster
I suggest a cool down timer should be added so this command can't be spammed and abused.
Make what?
I'm trying to make it for Goldtree emulator. But i get a error, do you know how to fix this?
Screen: Screenshot by Lightshot
Re: Tiny phoenix command - Help prevent scammers
Quote:
Originally Posted by
Vimsoration
I'm trying to make it for Goldtree emulator. But i get a error, do you know how to fix this?
Screen:
Screenshot by Lightshot
Code:
Code:
case 108: {
if (Params.Length >= 2)
{
using (DatabaseClient dbClient = GoldTree.GetDatabase().GetClient())
{
dbClient.AddParamWithValue("userid", GoldTree.GetGame().GetClientManager().method_27(Params[1]));
DataTable dataTable = dbClient.ReadDataTable("SELECT extra_data, timestamp FROM cmdlogs WHERE user_id = @userid AND command='flagme' LIMIT 100;");
string motdMessage = "User " + Params[1] + " last 100 name changes: \n";
foreach (DataRow dataRow in dataTable.Rows)
{
string extraData = dataRow["extra_data"].ToString();
string newName = extraData.Substring(extraData.IndexOf(':') + 1).Split(' ')[1];
string oldName = extraData.Substring(extraData.IndexOf(':') + 1).Split(' ')[3];
DateTime whenChangedName = GoldTree.smethod_21(double.Parse((string)dataRow["timestamp"].ToString()));
motdMessage += whenChangedName.ToString() + " - Old name: " + oldName + " - New name: " + newName + "\n";
}
Session.SendNotification(motdMessage, 2);
}
return true;
}
else
{
return false;
}
}
Replace "smethod_21" with "TimestampToDate"