[Python] Avoid closing client on missing locales

  • Hello,


    if a key / attribute is missing in the localeinfo in normally crashes and dont let you ingame - I added a "small" workaround for it (it's easy to implement):

    Add these class into system.py


    Search for that:

    Code
    1. # in this if case: 'pack.Exist(filename)'
    2. return newmodule

    Add this above:

    Code
    1. if filename.lower() == "localeinfo.py":
    2. sys.modules[name] = LocaleInfoWrapper(newmodule)
    3. return sys.modules[name]

    done, now you can start the game with missing locales and it will print in out to the TraceError


    NOTE: This is just something I did because one of my clients work with locales and sometimes crashes my client, you need to adjust for e.g. supporting calling etc / formating strings.. blabla


    for python3 you can define the __getattr__ function inside localeinfo.py which is way easier to implement.
    Bitte melden Sie sich an, um diesen Link zu sehen.


    best regards


    clocky

    ok

  • clocky

    Hat den Titel des Themas von „[Python] Avoid closing client on have missing locales“ zu „[Python] Avoid closing client on missing locales“ geändert.