Change username in buddy list database

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Persy
Posts: 9
Joined: 20 Sep 2021, 18:52

Change username in buddy list database

Postby Persy » 20 Sep 2021, 19:02

When I change my username in my project I lost all my buddy list
And I noticed if another One register after that with the name which is changed, he will get the buddylist

So I think there is a seperate database which contain buddy list

How Can I Edit username also in this database to allow user when change his username, to keep owing his buddylist

I read the topics about sfs pro in the site, but it didn't help me to reach the database

I want the steps or the path please

Thanks
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Change username in buddy list database

Postby Lapo » 21 Sep 2021, 09:06

Hi,
the username is a unique identifier and if it's changed it will cause the problem you have mentioned, because the buddylist is tied to the name it was created with.
There is no easy way to fix this, because buddy lists are entirely based on user names, therefore it's not enough to change the name in the buddy storage, you would also need to go in everyone's buddy list and change the reference to the name that is being changed.

In other words if player Kermit decides to change his/her name, then all buddy lists containing a reference to Kermit would also need to be changed. With a large number of users it's likely to become a pretty heavy operation.

If your application is designed to let players change their user names, it would be probably best to store this name elsewhere (custom database) and keep the original so that SmartFoxServer remains internally consistent.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
Persy
Posts: 9
Joined: 20 Sep 2021, 18:52

Re: Change username in buddy list database

Postby Persy » 22 Sep 2021, 04:02

Oh okay, can you tell me where is buddylist stored exactly?

How can I reach it for every single user
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Change username in buddy list database

Postby Lapo » 22 Sep 2021, 08:53

They are stored under the buddyLists/ folder, but you won't be able to modify them manually. The data files contain binary serialized objects.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
Persy
Posts: 9
Joined: 20 Sep 2021, 18:52

Re: Change username in buddy list database

Postby Persy » 23 Sep 2021, 04:41

Thanks sir, Can you please help me with the other topic ( about NPC)

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 44 guests