Jump to content
Korean Random
unfortunately_lazy

Mod with blacklist-function

Recommended Posts

Hey guys, 

 

I'm relatively new to modding WoT and currently I'm trying to make a mod which blacklists player. Therefore a function is obviously necessary. I think I've found it here: \scripts\client\messenger\proto\xmpp\contacts\__init__.py in the class ContactsManager.

My attempt to use this function is here:

def teambl_key():
    CM = ContactsManager()
    databID = getAvatarDatabaseID()
    names_ = avatar_getter.getPlayerName()
    CM.addIgnored(databID, names_)

The function addIgnored has 3 arguments: self, dbID and name. I used all arguments, didn't I? 

If I try to execute this, it doesn't work and I can find this in the logfile:

2020-04-19 22:38:52.718: ERROR:   File "mod_test", line 23, in teambl_key
2020-04-19 22:38:52.718: ERROR:   File "scripts/client/messenger/proto/xmpp/decorators.py", line 80, in wrapper
2020-04-19 22:38:52.718: ERROR: TypeError: addIgnored() takes exactly 4 arguments (3 given)

This function also has a decorator, but I can't discover any 4th argument. 

Am I missing something or is this probably the wrong function?

I'd appreciate any help and thanks in advance.:smile:

 

Regards 

unfortunately_lazy

Share this post


Link to post

Short link
Share on other sites
@proto_getter(PROTO_TYPE.MIGRATION)
def proto():
    return None

proto.contacts.addIgnored(databaseID, userName)

 

Share this post


Link to post

Short link
Share on other sites

Wow, thanks for the quick answer!

Unfortunately this doesn't work for me :sad:

Do I have to replace something? 

Now the logfile says:

2020-04-19 23:43:39.058: ERROR: AttributeError: 'NoneType' object has no attribute 'addIgnored'

These are the modules I imported:

from messenger.m_constants import PROTO_TYPE
from messenger.proto.__init__ import proto_getter

Is this correct?

Share this post


Link to post

Short link
Share on other sites
3 минуты назад, unfortunately_lazy сказал:

Wow, thanks for the quick answer!

Unfortunately this doesn't work for me :sad:

Do I have to replace something? 

Now the logfile says:


2020-04-19 23:43:39.058: ERROR: AttributeError: 'NoneType' object has no attribute 'addIgnored'

These are the modules I imported:


from messenger.m_constants import PROTO_TYPE
from messenger.proto.__init__ import proto_getter

Is this correct?

 

from messenger.proto import proto_getter

 

Share this post


Link to post

Short link
Share on other sites

Big thanks! 

The funtion itself is working as intended.

Furthermore I want to get all the data of the players in each battle. I've used these functions:

from gui.battle_control.avatar_getter import getPlayerName
from avatar_helpers import getAvatarDatabaseID

Unfortunately I don't know the data type of these. Most likely they're lists, aren't they?

 

Edit: Hmmm, getAvatarDatabaseID() returns only a number, not a list, maybe the dbID from the actual player :mellow: I'm trying to get the solution on my own, if I fail, I'll ask again :blinky:

Edited by unfortunately_lazy

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.

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.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...