Ejemplo n.º 1
0
def _new():
    """New SSBB setting update."""
    MISC = bytearray.fromhex(
        "01 01 7F 7F"
        "7F 7F 7F 7F"
        "7F 7F 7F 7F"
        "7F 7F 7F 7F"
        "7F 7F 7F 7F"
        "7F 7F 7F 7F"
        "7F 7F 7F 7F"
        "7F 00 7F 7F"
        "7F 7F 7F 7F"
        "7F 7F 7F 7F"
        "7F 7F 7F 7F"
        "7F 7F 7F 7F"
        "7F 7F 7F 7F"
        "7F 7F 7F"
    )
    s = Setting()
    s.contribute = Setting.Contribute.ALL
    s.is_infinity_contribute = 0x01
    s.collection_lifetime = 0x18
    s.upload_size_limit = 0x18
    s.unknown_0x03 = 0x03
    s.contribute_start = Setting.Date(2018, 1, 1)
    s.contribute_end = Setting.Date(2123, 12, 31)
    s.watch_start = Setting.Date(2018, 1, 1)
    s.watch_end = Setting.Date(2123, 12, 31)
    s.deliv_start = Setting.Date(2018, 1, 1)
    s.deliv_end = Setting.Date(2123, 12, 11)
    s.enable_upload_character = Setting.Character.ALL
    s.enable_upload_stage = Setting.Stage.ALL
    s.spectator_misc = MISC

    with open("s20180301_test.bin", "wb") as f:
        from archive import Archive
        archive = Archive()
        archive.add_section(s.pack())
        f.write(archive.pack())
Ejemplo n.º 2
0
def _test():
    """Recreate s20130702_1.bin."""
    MISC = bytearray.fromhex(
        "00 01 64 14"
        "0a 28 64 64"
        "00 00 00 0a"
        "00 00 1e 00"
        "83 83 83 83"
        "83 00 00 0a"
        "0f 14 19 82"
        "7d 78 73 00"
        "01 01 02 03"
        "03 02 01 00"
        "00 03 04 04"
        "03 03 02 00"
        "00 00 00 00"
        "0a 00 50"
    )
    s = Setting()
    s.contribute = Setting.Contribute.SPECTATOR
    s.is_infinity_contribute = 0x00
    s.collection_lifetime = 0x18
    s.upload_size_limit = s.collection_lifetime
    s.unknown_0x03 = 0x03
    s.contribute_start = Setting.Date(2008, 1, 29)
    s.contribute_end = Setting.Date(2009, 6, 30)
    s.watch_start = Setting.Date(2008, 1, 29)
    s.watch_end = Setting.Date(2018, 7, 1)
    s.deliv_start = Setting.Date(2008, 1, 29)
    s.deliv_end = Setting.Date(2015, 7, 1)
    s.enable_upload_character = Setting.Character.ALL
    s.enable_upload_stage = Setting.Stage.ALL
    s.spectator_misc = MISC

    with open("s20130702_test.bin", "wb") as f:
        from archive import Archive
        archive = Archive()
        archive.add_section(s.pack())
        f.write(archive.pack())