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!

Tiny Phoenix Addon - Help prevent scammers

Status
Not open for further replies.
xHosts.uk - Windows & Linux VPS - Cosmic Guard
[VIP] Member
Joined
Sep 10, 2011
Messages
857
Reaction score
354
Hey

Its been mentioned to me many times, that people scam on hotels then use "flagme" to change name and hard for hotel owners to trace the scammers because they have changed the user names,

I came up with this idea only a small idea but may help some people in the community


Database

CREATE TABLE IF NOT EXISTS `flagme_logs` (
`old_username` varchar(100) DEFAULT NULL,
`new_username` varchar(100) DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
`time` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

In your class258 / ChangeUserNameMessageEvent.cs

Under this :


class3.ExecuteQuery(string.Concat(new object[]
{
"UPDATE users SET username = '",
text,
"' WHERE id = '",
Session.GetHabbo().Id,
"' LIMIT 1"
}));

Add this

using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
{
@class.AddParamWithValue("old_username", Session.GetHabbo().Username);
@class.AddParamWithValue("new_username", text);
@class.AddParamWithValue("user_id", Session.GetHabbo().Id);


@class.ExecuteQuery("INSERT INTO flagme_logs SET old_username = @old_username, new_username = @new_username, user_id = @user_id");

}

Now each time a user uses flagme, the old name, new name and most importantly the users ID is stored with the date and time on which they change username.
 
Newbie Spellweaver
Joined
Jul 16, 2013
Messages
50
Reaction score
10
Erm as far as I know if you use :flagme command for phoenix it is stored in cmdlogs table?
 
Newbie Spellweaver
Joined
Jul 16, 2013
Messages
50
Reaction score
10
Yes this is a little more informed for people having its own table they can add the feature into HK for staff to look this up.
cmdlogs and for HK you can code something like SELECT * FROM cmdlogs WHERE command = 'flagme'
 
Still alive.
Loyal Member
Joined
Apr 13, 2013
Messages
1,145
Reaction score
886
Something useful from G0D. Thanks for this!

Greetz,
 
Joined
Aug 10, 2011
Messages
7,398
Reaction score
3,301
If you had a properly set up database with all the relations and constraints properly implemented, you wouldn't have any problem with people changing their username.

Also rooms should've been identified by the user id instead of the username as the user id should not change. Yes I know they did use the username for caching but this is certainly not how a proper database should've been implemented.
 
Experienced Elementalist
Joined
Aug 10, 2011
Messages
270
Reaction score
23
Nice little addon Johno, thanks!
 
xHosts.uk - Windows & Linux VPS - Cosmic Guard
[VIP] Member
Joined
Sep 10, 2011
Messages
857
Reaction score
354
If you had a properly set up database with all the relations and constraints properly implemented, you wouldn't have any problem with people changing their username.

Also rooms should've been identified by the user id instead of the username as the user id should not change. Yes I know they did use the username for caching but this is certainly not how a proper database should've been implemented.

It was a simple addon as people I host have asked me for a way log the name changes, I thought of this method as people can easy add a page to housekeeping so that people who do not have direct server access can still view the information if at the time owners are offline.
 
xHosts.uk - Windows & Linux VPS - Cosmic Guard
[VIP] Member
Joined
Sep 10, 2011
Messages
857
Reaction score
354
Also make sure to filter the variable 'text'. Either use regex ([a-zA-Z0-9]) to filter it or use the prepared statements as they are more secure. ^.^

I am sure the values are ready filtered as they are all ready included within the orginal phoenix, i simply added the method to save them to a table.
 
Newbie Spellweaver
Joined
Oct 12, 2014
Messages
26
Reaction score
3
Tiny Add-on yet very useful, Thanks for this
 
Junior Spellweaver
Joined
Jul 1, 2013
Messages
173
Reaction score
12
Great add-on, now people might finally enable flagme for VIPs :D
 
Ragezone Furni Releaser
Joined
Dec 2, 2012
Messages
918
Reaction score
158
Looks nice!
You can maby make a :history username
So you can see ingame the name changes.
 
Status
Not open for further replies.
Back
Top