{"id":39067450,"url":"https://github.com/fatihkahveci/simple-matchmaking","last_synced_at":"2026-01-17T18:17:32.574Z","repository":{"id":45191624,"uuid":"402511323","full_name":"fatihkahveci/simple-matchmaking","owner":"fatihkahveci","description":"Simple rule based matchmaking for your online game with support of Redcon(RESP) protocol.","archived":false,"fork":false,"pushed_at":"2022-01-02T10:16:59.000Z","size":305,"stargazers_count":85,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-06-19T00:28:52.115Z","etag":null,"topics":["gaming","gaming-software","go","golang","matchmaking","resp"],"latest_commit_sha":null,"homepage":"","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/fatihkahveci.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":"2021-09-02T17:43:25.000Z","updated_at":"2024-04-26T04:07:12.000Z","dependencies_parsed_at":"2022-08-31T11:04:03.438Z","dependency_job_id":null,"html_url":"https://github.com/fatihkahveci/simple-matchmaking","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fatihkahveci/simple-matchmaking","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fatihkahveci%2Fsimple-matchmaking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fatihkahveci%2Fsimple-matchmaking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fatihkahveci%2Fsimple-matchmaking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fatihkahveci%2Fsimple-matchmaking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fatihkahveci","download_url":"https://codeload.github.com/fatihkahveci/simple-matchmaking/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fatihkahveci%2Fsimple-matchmaking/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28515217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T17:57:59.192Z","status":"ssl_error","status_checked_at":"2026-01-17T17:57:52.527Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["gaming","gaming-software","go","golang","matchmaking","resp"],"created_at":"2026-01-17T18:17:31.948Z","updated_at":"2026-01-17T18:17:32.543Z","avatar_url":"https://github.com/fatihkahveci.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/fatihkahveci/simple-matchmaking/blob/main/mascot.png?raw=true\" width=\"256px\"/\u003e\u003cbr/\u003e\n  Simple Matchmaking\n\u003c/h1\u003e\n\n\n\u003cp align=\"center\"\u003e\n    Simple rule based matchmaking for your online game with support of Redcon(RESP) protocol.\n\u003c/p\u003e\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/fatihkahveci/simple-matchmaking)](https://goreportcard.com/report/github.com/fatihkahveci/simple-matchmaking)\n[![Go Cover Card](https://gocover.io/_badge/github.com/fatihkahveci/simple-matchmaking)](https://gocover.io/_badge/github.com/fatihkahveci/simple-matchmaking)\n[![GitHub license](https://img.shields.io/github/license/fatihkahveci/simple-matchmaking)](https://github.com/fatihkahveci/simple-matchmaking/blob/main/LICENSE)\n\n## 1- Simple Match Rule\n\nEasiest usage of system is \"Direct Match Rule\" in this rule players match each other without any rule.\n\n```bash\npackage main\n\nimport (\n\t\"github.com/fatihkahveci/simple-matchmaking/matchmaking\"\n\t\"github.com/fatihkahveci/simple-matchmaking/server\"\n\t\"github.com/fatihkahveci/simple-matchmaking/store\"\n\t\"time\"\n)\n\nfunc main()  {\n\tinMemory := store.NewInMemoryStore()\n\tdur, _ := time.ParseDuration(\"10s\")\n\n\tr := matchmaking.NewDirectMatchRule()\n\n\n\trespServer := server.NewRespServer(inMemory, \":1234\")\n\n\tmatcher := matchmaking.NewMatchmaking(\"test\",respServer,inMemory, r, dur)\n\n\tmatcher.Start()\n}\n```\n\n## 2- Score Match Rule\n\nIn this example users match with given score rule which means match happens only user score 10 between 15.\n\n```bash\npackage main\n\nimport (\n\t\"github.com/fatihkahveci/simple-matchmaking\"\n\t\"github.com/fatihkahveci/simple-matchmaking/rules\"\n\t\"github.com/fatihkahveci/simple-matchmaking/server\"\n\t\"github.com/fatihkahveci/simple-matchmaking/store\"\n\t\"time\"\n)\n\nfunc main()  {\n\tinMemory := store.NewInMemoryStore()\n\tdur, _ :=time.ParseDuration(\"10s\")\n\n\tr := rules.NewScoreMatchRule(10,15)\n\n\n\trespServer := server.NewRespServer(inMemory, \":1234\")\n\n\tmatcher := simpe_mm.NewMatchmaking(\"score\",respServer,inMemory, r, dur)\n\n\tmatcher.Start()\n}\n```\n\n## 3- Custom Match Rule\n\nIn this example we create our own rule. We just need to follow \"MatchRule\" interface.\n\n```\npackage main\n\nimport (\n\t\"github.com/fatihkahveci/simple-matchmaking\"\n\t\"github.com/fatihkahveci/simple-matchmaking/server\"\n\t\"github.com/fatihkahveci/simple-matchmaking/store\"\n\t\"time\"\n)\n\n\ntype CustomFieldMatchRule struct {\n\tField string\n\tMinThreshold int\n\tMaxThreshold int\n}\n\nfunc NewCustomFieldMatchRule(field string,minThreshold, maxThreshold int) CustomFieldMatchRule {\n\treturn CustomFieldMatchRule{\n\t\tField: field,\n\t\tMinThreshold: minThreshold,\n\t\tMaxThreshold: maxThreshold,\n\t}\n}\n\nfunc (r CustomFieldMatchRule) Match(user1, user2 store.User) bool {\n\tuser1Level := user1.Fields[r.Field].(int)\n\tuser2Level := user2.Fields[r.Field].(int)\n\n\n\tminLevel := user1Level - r.MinThreshold\n\tmaxLevel := user1Level + r.MaxThreshold\n\n\tif user2Level \u003e= minLevel \u0026\u0026 user2Level \u003c= maxLevel {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\nfunc (r CustomFieldMatchRule) GetName() string {\n\treturn \"CustomField\"\n}\n\nfunc main()  {\n\tinMemory := store.NewInMemoryStore()\n\tdur, _ :=time.ParseDuration(\"10s\")\n\n\tr := NewCustomFieldMatchRule(\"level\",10,20)\n\n\n\trespServer := server.NewRespServer(inMemory, \":1234\")\n\n\tmatcher := simpe_mm.NewMatchmaking(\"custom\",respServer,inMemory, r, dur)\n\n\tmatcher.Start()\n}\n```\n\n## Usage\n\nYou can add new user to pool using any redis client. Thanks for Redcon ❤️\n\n```\nredis-cli -p 1234 add '{\n  \"id\": \"55\",\n  \"score\": 5\n}'\n```\n\nAlso you need to subscribe your matchmaking channel.\n\n```\nredis-cli -p 1234\n127.0.0.1:1234\u003e subscribe simple\nReading messages... (press Ctrl-C to quit)\n1) \"subscribe\"\n2) \"simple\"\n3) (integer) 1\n1) \"message\"\n2) \"simple\"\n3) \"{\\\"user_1\\\":{\\\"id\\\":\\\"12\\\",\\\"score\\\":5,\\\"join_time\\\":\\\"2021-08-31T22:57:27.109609+03:00\\\",\\\"fields\\\":null},\\\"user_2\\\":{\\\"id\\\":\\\"55\\\",\\\"score\\\":5,\\\"join_time\\\":\\\"2021-08-31T22:57:27.109614+03:00\\\",\\\"fields\\\":null},\\\"match_rule_name\\\":\\\"Direct\\\",\\\"time\\\":\\\"2021-08-31T22:57:27.116724+03:00\\\",\\\"action_type\\\":\\\"match\\\"}\"\n\n```\n\n## TODOS\n\n- More Server Support (WebSocket etc)\n- More Store Support (Redis, Mongo etc)\n- Multiple User Support (Team matchmaking)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffatihkahveci%2Fsimple-matchmaking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffatihkahveci%2Fsimple-matchmaking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffatihkahveci%2Fsimple-matchmaking/lists"}