Jump to content
Korean Random
Sign in to follow this  
blueferret

Overriding Account.PlayerAccount.__init__

Recommended Posts

okay this is probably because i'm totally not fluent in python, but when i'm trying to override the __init__ function from Account.PlayerAccount (https://github.com/StranikS-Scan/WorldOfTanks-Decompiled/blob/1.11.1/source/res/scripts/client/Account.py#L118) I seem to have to call baseFunc(baseSelf) first before actually changing anything, like baseSelf.name = 'dev' (ingame this reflects). HOWEVER, I'm specifically trying to change baseSelf.initialServerSettings (or baseSelf.serverSettings, but serverSettings gets copied from initialServerSettings so same thing) but when I do so, i get a buncha annoying attribute errors from the original init. i took a copy of the client's original server settings and saved them and then just changed some values to mess around and that seems to be no-no.

can anyone help?

 

this seems to do nothing. but yet my in-game name is now 'dev' so it does* work(?)

@override(Account.PlayerAccount, '__init__')
def Account_init(baseFunc, baseSelf):
    baseFunc(baseSelf)
    baseSelf.name = 'dev'
	baseSelf.initialServerSettings = OFFLINE_INITIAL_SERVER_SETTINGS

 

_initialServerSettings.py

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...