• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Tiny phoenix command - Help prevent scammers

Status
Not open for further replies.
Newbie Spellweaver
Joined
Jul 18, 2014
Messages
85
Reaction score
39
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 = @[I][B][URL="https://forum.ragezone.com/members/1335.html"]user[/URL][/B][/I]id 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

SuklaaVene - Tiny phoenix command - Help prevent scammers - RaGEZONE Forums
 
Last edited:
Experienced Elementalist
Joined
Apr 4, 2015
Messages
237
Reaction score
88
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.
 
Experienced Elementalist
Joined
Jun 7, 2012
Messages
288
Reaction score
250
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....
 
Newbie Spellweaver
Joined
Jul 18, 2014
Messages
85
Reaction score
39
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 ;)
 
Junior Spellweaver
Joined
Oct 26, 2014
Messages
176
Reaction score
117
Who would use MySQL for a simple command.... :thumbdown:
and Phoenix is a terrible emulator.
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,688
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.
 
Experienced Elementalist
Joined
Apr 4, 2015
Messages
237
Reaction score
88
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? :')
 
Experienced Elementalist
Joined
Apr 4, 2015
Messages
237
Reaction score
88
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:
 
Last edited:
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,688
I'm trying to make it for Goldtree emulator. But i get a error, do you know how to fix this?
Screen:

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 = [USER=1335]user[/USER]id 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"
 
Status
Not open for further replies.
Back
Top