Jump to content

Python ignore function


Recommended Posts

  • Gold

Hey guys,

I'm trying to get blocked members by block button which u can use like block/unblock or just delete the name from blocked.txt.

But there's a little problem because Friends and Guild members are saved in database, but I need to do it like:
Some player annoying you so you use a block button in chat whisper. After click on a button the name will be saved in a file blocked.txt and showed in Ignored slot in uimessenger.py and if you want to unblock the blocked player u can simply use Friend delete button or delete the friend manually and the player will be deleted from the file blocked.txt.

Hope someone understand me and will be glad for your answers!

PS: I know this system is already released but there are missing some parts which i mentioned above like adding to ignored list in uimessenger.

Have a nice day!

Sincerely,

ReFresh

Edited by ReFresh

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Gold

@PACI Thanks for your answer!

Now I have blocked players in blocked.txt all works good they can't send me a message but I can't see them in IGNORED list ingame. On the picture you can see how I want to do it. I just need to implement some function which can get the list of blocked players from blocked.txt and make one button for deleting friends and ignored players, already there's one button for deleting friends (simply said 1 button = deletion for friends (database - already done by packet)and for ignored players from blocked.txt to make them able to use whisper with me again.

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Gold

@PACI

Client sided - blocked.txt is in base directory for client.

I try to explain how it will work:

I opened whisper chat with someone and he is annoying so I just click on the button and the user is now blocked and his name is saved in my client directory in file blocked.txt and you can see this blocked user in IGNORED list too. When I want to unblock him I can easily open a whisper chat again with him and use unblock button or easier way is go to the Friends and then go to IGNORED and click on his name and use trash icon to delete his name from blocked.txt too. So there will be 2 ways to unblock him.

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Developer

I assume you already have the Ignored group added to your client's friends list. If that's not the case, just take a look at root/uiMessenger.py and UIScript/messengerwindow.py and follow the pattern.


Now I'd personally cache the file's entries at the client's startup, but even if you don't do that, the concept's still the same.

Loop over your file lines/dict content and then use the AppendMember(key, playerName) function in order to add the entries to the list.
Regarding the deletion, it is almost the same, the only difference is you firstly need to find the object, FindMember(key), and then use the RemoveMember(obj) func.

when you return 0 and server doesn't boot:

unknown.png

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.