{"id":13623223,"url":"https://github.com/paralin/go-dota2","last_synced_at":"2025-04-04T20:02:35.133Z","repository":{"id":37458504,"uuid":"103461337","full_name":"paralin/go-dota2","owner":"paralin","description":"Go implementation of the DOTA2 game-coordinator client.","archived":false,"fork":false,"pushed_at":"2025-03-25T22:44:11.000Z","size":9692,"stargazers_count":135,"open_issues_count":6,"forks_count":40,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-28T23:48:33.779Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/paralin.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-13T23:17:24.000Z","updated_at":"2025-03-15T14:10:36.000Z","dependencies_parsed_at":"2023-11-13T21:24:35.957Z","dependency_job_id":"8f50e0ef-8e67-4221-83c7-770527ceeaeb","html_url":"https://github.com/paralin/go-dota2","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paralin%2Fgo-dota2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paralin%2Fgo-dota2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paralin%2Fgo-dota2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paralin%2Fgo-dota2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paralin","download_url":"https://codeload.github.com/paralin/go-dota2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242657,"owners_count":20907130,"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":[],"created_at":"2024-08-01T21:01:29.299Z","updated_at":"2025-04-04T20:02:35.095Z","avatar_url":"https://github.com/paralin.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Dota2\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/paralin/go-dota2.svg)](https://pkg.go.dev/github.com/paralin/go-dota2)\n[![Go Report Card Widget]][Go Report Card]\n[![DOI](https://zenodo.org/badge/103461337.svg)](https://zenodo.org/badge/latestdoi/103461337)\n\n[Go Report Card Widget]: https://goreportcard.com/badge/github.com/paralin/go-dota2\n[Go Report Card]: https://goreportcard.com/report/github.com/paralin/go-dota2\n\n## Introduction \n\n**go-dota2** is a DOTA 2 client plugin for go-steam.\n\nGames implemented:\n\n - [dota2](https://github.com/paralin/go-dota2)\n - [underlords](https://github.com/paralin/go-underlords)\n\nAlso see: the old [C#/SteamKit Implementation](https://github.com/paralin/Dota2).\n\nThis project makes use of a dynamic API generator (apigen) designed to\nautomatically interpret Valve's various naming conventions into a intermediate\nAPI scheme representation, which is then converted into Go code.\n\n## Implementation Progress\n\nComplete.\n\n - [x] GC session state management\n - [x] Player profile fetching / call tracking\n - [x] SOCache tracking / state management\n - [x] Basic chat interaction\n - [x] Lobby tracking / state management\n    - [x] Read lobby state correctly\n    - [x] Implement normal lobby operations\n - [x] Party tracking / state management\n    - [x] Read party and invite state correctly\n    - [x] Implement normal party operations\n - [x] Code generation for API\n - [x] Code generation for events\n\n## SOCache Mechanism\n\nThe caching mechanism makes it easy to watch for changes to common objects, like `Lobby, LobbyInvite, Party, PartyInvite`.\n\nThis mechanism is used everywhere, these objects are not exposed in their own events.\n\n```go\nimport (\n\tgcmm \"github.com/paralin/go-dota2/protocol\"\n\t\"github.com/paralin/go-dota2/cso\"\n)\n\neventCh, eventCancel, err := dota.GetCache().SubscribeType(cso.Lobby)\nif err != nil {\n    return err\n}\n\ndefer eventCancel()\n\nlobbyEvent := \u003c-eventCh\nlobby := lobbyEvent.Object.(*gcmm.CSODOTALobby)\n```\n\nEvents for the object type are emitted on the eventCh. Be sure to call `eventCancel` once you are done with the channel to prevent resource leaks.\n\nThe cache object also adds interfaces to get and list the current objects in the cache.\n\n## Implementation Generation\n\nThe base API implementation is generated by the [apigen](./apigen) code. Using heuristics, request IDs are matched to response IDs, and events and action-only requests are identified. Some manual tweaking is done in the overrides file.\n\nNext, the API information is used to build a Go code-gen set of implementations around the `MakeRequest` request tracking mechanism.\n\nThis means that ALL of the Dota API will be available in this codebase, although only some of it is documented.\n\n## go-steam Dependency\n\nThis library depends on [go-steam](https://github.com/paralin/go-steam).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparalin%2Fgo-dota2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparalin%2Fgo-dota2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparalin%2Fgo-dota2/lists"}