Jump to content
Korean Random
Sign in to follow this  
cezarica

Blacklist

Recommended Posts

Anyone know how can access the blacklist via Python?

 

Кто-нибудь знает, как можно получить доступ к черный список с помощью Python?

Edited by cezarica

Share this post


Link to post

Short link
Share on other sites

not sure it's best way, but:

    import messenger.storage as storage
    usersStorage = storage.storage_getter('users')
    for user in usersStorage().all():
        if 'muted' in user.getTags():
            print user.getName()
  • Upvote 2

Share this post


Link to post

Short link
Share on other sites

Thanks Helkar.

 

usersStorage().all() seems to be empty. Any other way to get that list?

 

Edit: The list is populated when LobbyView_populate is triggered.

import messenger.storage as storage
from gui.Scaleform.daapi.view.lobby.LobbyView import LobbyView

def new_LobbyView_populate(current):
old_LobbyView_populate(current)
usersStorage = storage.storage_getter('users')
for user in usersStorage().all():
  if 'ignored' in user.getTags():
   print user.getName()

old_LobbyView_populate = LobbyView._populate
LobbyView._populate = new_LobbyView_populate

Same results I got with:

from messenger.storage import _STORAGE
from gui.Scaleform.daapi.view.lobby.LobbyView import LobbyView

def new_LobbyView_populate(current):
old_LobbyView_populate(current)
for id in _STORAGE['users']._UsersStorage__contacts:
  user = _STORAGE['users'].getUser(id)
  if 'ignored' in user.getTags():
   print user.getName()

old_LobbyView_populate = LobbyView._populate
LobbyView._populate = new_LobbyView_populate

Any idea how to remove a player from the blacklist if got the id/name that I want to remove?

Edited by cezarica

Share this post


Link to post

Short link
Share on other sites

Yes. As for removing an ignored user g_messengerEvents.users.onUserActionReceived(_ACTION_ID.IGNORED_REMOVED, user) will do that, but still get them in the blacklist as muted so my guess would have to use g_messengerEvents.users.onUserActionReceived(_ACTION_ID.MUTE_UNSET, user) too.

 

Wish I had this knowledge a while back when had 200 idiots in my blacklist and had to remove them manually one by one. :D

Edited by cezarica

Share this post


Link to post

Short link
Share on other sites

 

not sure it's best way, but:

    import messenger.storage as storage
    usersStorage = storage.storage_getter('users')
    for user in usersStorage().all():
        if 'muted' in user.getTags():
            print user.getName()

А как получить этот же список в бою? При воспроизведении реплея этот код не получает данные.

Share this post


Link to post

Short link
Share on other sites

А как получить этот же список в бою? При воспроизведении реплея этот код не получает данные.

игра не подключается к серверу в реплее
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites
игра не подключается к серверу в реплее

Вот я баран, таки да, работает в реальных боях, не в реплеях. СПС

Edited by Megagrob

Share this post


Link to post

Short link
Share on other sites

апну тему

 

не получается через

g_messengerEvents.users.onUserActionReceived(USER_ACTION_ID.IGNORED_REMOVED, user)

и

g_messengerEvents.users.onUserActionReceived(USER_ACTION_ID.MUTE_UNSET, user)

 

черный список так и остается нетронутым (даже с учетом перезагрузки игры)

 

Кто-нибдуь может подсказать как всё-таки очистить его "одним движением пера"?

 

Share this post


Link to post

Short link
Share on other sites
В 23.09.2017 в 10:39, RangerRU сказал:

Кто-нибдуь может подсказать как всё-таки очистить его "одним движением пера"?

Одним не получится. Нужно городить велосипед удаляя в цикле по одному IDу да еще с задержкой в 2-3 секунды.

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

 

@ShuraBB 

Спасибо за 

Шикарная возможность!!!

 

Можно узнать, команда на удаление одна/две идет в цикле?

BigWorld.player().removeIgnored(dbID) и BigWorld.player().unsetMuted(dbID)?

Edited by RangerRU

Share this post


Link to post

Short link
Share on other sites
4 часа назад, RangerRU сказал:

Можно узнать, команда на удаление одна/две идет в цикле?

Я делал через ContactsManager().removeIgnored(Id) Он делает полное корректное удаление, возможно BigWorld.player().removeIgnored(dbID) ее-же и вызывает - не проверял :-)

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...