{"id":25475017,"url":"https://github.com/diogo464/gma","last_synced_at":"2025-11-05T18:30:25.559Z","repository":{"id":40455848,"uuid":"282050324","full_name":"diogo464/gma","owner":"diogo464","description":"Crate to read and write .gma files","archived":false,"fork":false,"pushed_at":"2023-01-09T11:39:17.000Z","size":54,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-15T16:19:39.146Z","etag":null,"topics":["garrysmod","gma","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diogo464.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-23T20:35:41.000Z","updated_at":"2023-07-02T15:47:27.000Z","dependencies_parsed_at":"2023-02-08T10:15:15.398Z","dependency_job_id":null,"html_url":"https://github.com/diogo464/gma","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diogo464%2Fgma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diogo464%2Fgma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diogo464%2Fgma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diogo464%2Fgma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diogo464","download_url":"https://codeload.github.com/diogo464/gma/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239467454,"owners_count":19643605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["garrysmod","gma","rust"],"created_at":"2025-02-18T11:52:30.694Z","updated_at":"2025-11-05T18:30:25.526Z","avatar_url":"https://github.com/diogo464.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GMA\n![Rust](https://github.com/diogo464/gma/workflows/Rust/badge.svg)\n[![Crates.io version](https://img.shields.io/crates/v/gma.svg)](https://crates.io/crates/gma)\n\n[Documentation](https://docs.rs/gma)\n\nA crate to read and write to .gma files.\n\nReading/Writing lzma compressed files is supported.\nGarry's mod cant read compressed gma files but some when downloaded directly from the steam workshop some files are lzma compressed.\n\n## Reading a .gma file\n```rust\n    let archive = gma::open(\"myfile.gma\").unwrap();\n    println!(\"Version : {}\", archive.version());\n    println!(\"Author steam id : {}\", archive.author_steamid());\n    println!(\"Timestamp : {}\", archive.timestamp());\n    println!(\"Name : {}\", archive.name());\n    println!(\"Description : {}\", archive.description());\n    println!(\"Addon Type : {:?}\", archive.addon_type());\n    println!(\"Addon Tags : {:?}\", archive.addon_tags());\n    println!(\"Author name : {}\", archive.author());\n    println!(\"Compressed : {}\", archive.compressed());\n    println!();\n\n    for entry in archive.entries() {\n        println!(\"{} :\", entry.filename());\n        println!(\"\\tSize : {} bytes\", entry.size());\n        println!(\"\\tCRC32 : {:x}\", entry.crc());\n\n        //Only print the contents of lua files\n        if entry.filename().ends_with(\".lua\") {\n            archive\n                .read_entry(entry, |_, reader| {\n                    let mut file_contents = String::new();\n                    reader.read_to_string(\u0026mut file_contents).unwrap();\n                    println!(\"\\tContents : '{}'\", file_contents);\n                })\n                .expect(\"Error when reading the file\");\n        }\n    }\n```\n\n## Creating a .gma file\n```rust\n    const VERSION: u8 = 3;\n    const STEAMID: u64 = 123456;\n    const TIMESTAMP: u64 = 987654;\n    const NAME: \u0026str = \"ADDON_NAME\";\n    const DESC: \u0026str = \"ADDON_DESC\";\n    const AUTHOR: \u0026str = \"AUTHOR_NAME\";\n    const TYPE: AddonType = AddonType::Model;\n    const TAG1: AddonTag = AddonTag::Build;\n    const TAG2: AddonTag = AddonTag::Fun;\n\n    let file = File::create(\"myaddon.gma\").unwrap();\n    let mut writer = BufWriter::new(file);\n\n    let mut builder = GMABuilder::new();\n\n    builder\n        .version(VERSION)\n        .steamid(STEAMID)\n        .timestamp(TIMESTAMP)\n        .name(NAME)\n        .description(DESC)\n        .addon_type(TYPE)\n        .addon_tag(TAG1)\n        .addon_tag(TAG2)\n        .author(AUTHOR)\n        .file_from_bytes(\"file1\", b\"hello\")\n        .compression(true);\n\n    builder.write_to(\u0026mut writer).unwrap();\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiogo464%2Fgma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiogo464%2Fgma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiogo464%2Fgma/lists"}