Skip to content

Instantly share code, notes, and snippets.

@Turupawn
Last active October 16, 2018 22:54
Show Gist options
  • Save Turupawn/b58f85f62dd7ceb788500f934739080f to your computer and use it in GitHub Desktop.
Save Turupawn/b58f85f62dd7ceb788500f934739080f to your computer and use it in GitHub Desktop.

.modio/ directory structure

.modio/
  cache/
    1539728467.json
    1539728492.json
  mods/
    1173/
      modio.json
      <all mod files extracted>
    1309/
      modio.json
      <all mod files extracted>
  tmp/
    1091_modfile.zip
  authentication.json
  cache.json
  config.json
  event_polling.json
  installed_mods.json
  log
  mod_download_queue.json

Directory explanation

cache/

Holds the cache data from previews calls one file per call. All cache files are cleared when mod.io starts.

mods/

Holds the mods installed by mod.io. One folder per mod. There is a modio.json file in each folder that stores the mod object returned by the API.

tmp/

Holds the zip files of mods being downloaded or uploaded.

Json files examples and explanation

authentication.json

Stores information about the current user logged in.

{
    "access_token": "eyJ0eXAiOiJKV1QiLC...",
    "last_user_event_poll": 1539728738
}

cache.json

Stores information about the cache files generated from previous calls.

[
    {
        "datetime": 1539728467,
        "file": "1539728467.json",
        "url": "https://api.test.mod.io/v1/games/7/mods?id-in=1173&api_key=e91c01b8882f4affeddd56c96111977b"
    },
    {
        "datetime": 1539728492,
        "file": "1539728492.json",
        "url": "https://api.test.mod.io/v1/games/7/mods?id-in=1309&api_key=e91c01b8882f4affeddd56c96111977b"
    }
]

config.json

Stores configuration set by the players in-game. This is not released yet needs more thinkering and testing.

{
    "allow_background_downloads": 1,
    "automatic_updates": 1
}

event_polling.json

So far it only stores the time of the last event that was polled.

{
    "last_mod_event_poll": 1539728730
}

installed_mods.json

Stores information about the mods that are currently installed.

[
    {
        "date_updated": 1539294720,
        "mod_id": 1309,
        "modfile_id": 1315,
        "path": ".modio/mods/1309/"
    },
    {
        "date_updated": 1539357917,
        "mod_id": 1173,
        "modfile_id": 1373,
        "path": ".modio/mods/1173/"
    }
]

log

SDK's log output for debugging and error reports.

[1539728370] [LOG] Initializing SDK
[1539728370] [LOG] Version 0.9.0
[1539728370] [LOG] Creating directory .modio/
[1539728370] [LOG] Creating directory .modio/mods/
[1539728370] [LOG] Creating directory .modio/cache/
[1539728370] [LOG] Creating directory .modio/tmp/
[1539728370] [LOG] Loading mod events data...
[1539728370] [LOG] No mod events data found, downloading from the beginning.
[1539728370] [LOG] Loading authentication data...
etc...

mod_download_queue.json

Stores the data of the current download queue.

[
    {
        "mod": {
            "date_added": 1529984180,
            "date_live": 1529985875,
            "date_updated": 1534700188,
            "description": "This mod description was added via the SDK examples. This mod description was added via the SDK examples.",
            "description_plaintext": "This mod description was added via the SDK examples. This mod\ndescription was added via the SDK examples.",
            "game_id": 7,
            "homepage_url": "http://www.webpage.com",
            "id": 1091,
            "logo": {
                "filename": "logo.png",
                "original": "https://image.test.mod.io/mods/754d/1091/logo.png",
                "thumb_1280x720": "https://thumb.test.mod.io/mods/754d/1091/crop_1280x720/logo.png",
                "thumb_320x180": "https://thumb.test.mod.io/mods/754d/1091/crop_320x180/logo.png",
                "thumb_640x360": "https://thumb.test.mod.io/mods/754d/1091/crop_640x360/logo.png"
            },
            "maturity_option": 5,
            "media": {
                "images": null,
                "sketchfab": null,
                "youtube": null
            },
            "metadata_blob": "Optional metadata",
            "metadata_kvp": null,
            "modfile": {
                "changelog": "Stuff was changed on this mod via the examples.",
                "date_added": 1534699897,
                "date_scanned": 0,
                "download": {
                    "binary_url": "https://test.mod.io/mods/file/1210",
                    "date_expires": 1602887140
                },
                "filehash": {
                    "md5": "14e49203da1918e8845302c2b097f8fb"
                },
                "filename": "upload_1091_modfile.4.zip",
                "filesize": 76049,
                "id": 1210,
                "metadata_blob": "This metadata was edited via the SDK examples.",
                "mod_id": 1091,
                "version": "v1.1.0",
                "virus_positive": 0,
                "virus_status": 0,
                "virustotal_hash": ""
            },
            "name": "Example Mod Test",
            "name_id": "example-mod-test18",
            "profile_url": "https://flatshot.test.mod.io/example-mod-test18",
            "stats": {
                "date_expires": 1539811505,
                "downloads_total": 18,
                "mod_id": 1091,
                "popularity_rank_position": 1,
                "popularity_rank_total_mods": 26,
                "ratings_display_text": "Unrated",
                "ratings_negative": 0,
                "ratings_percentage_positive": 0,
                "ratings_positive": 0,
                "ratings_total": 0,
                "ratings_weighted_aggregate": 0.0,
                "subscribers_total": 1
            },
            "status": 1,
            "submitted_by": {
                "avatar": {
                    "filename": "ao_profile_square.1.jpg.png",
                    "original": "https://image.test.mod.io/members/f512/31338/ao_profile_square.1.jpg",
                    "thumb_100x100": "https://thumb.test.mod.io/members/f512/31338/crop_100x100/ao_profile_square.1.jpg",
                    "thumb_50x50": "https://thumb.test.mod.io/members/f512/31338/crop_50x50/ao_profile_square.1.jpg"
                },
                "date_online": 1539728615,
                "id": 31338,
                "language": "en",
                "name_id": "turupawn",
                "profile_url": "https://test.mod.io/members/turupawn",
                "timezone": "America/Belize",
                "username": "turupawn"
            },
            "summary": "Mod added via the SDK examples. Mod added via the SDK examples. Mod added via the SDK examples. Mod added via the SDK examples. Mod added via the SDK examples. Mod added via the SDK examples.",
            "tags": [
                {
                    "date_added": 1529984180,
                    "name": "Easy"
                },
                {
                    "date_added": 1529984180,
                    "name": "Medium"
                }
            ],
            "visible": 1
        },
        "mod_id": 1091,
        "path": ".modio/tmp/1091_modfile.zip",
        "state": 2,
        "total_size": 0.0,
        "url": ""
    }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment