{"id":23757093,"url":"https://github.com/mmitch/bash-n","last_synced_at":"2025-08-19T03:10:37.111Z","repository":{"id":138318502,"uuid":"229998082","full_name":"mmitch/bash-n","owner":"mmitch","description":"bash client library for connected-n game server","archived":false,"fork":false,"pushed_at":"2025-08-14T07:25:37.000Z","size":73,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-14T09:26:18.061Z","etag":null,"topics":["bash","bot","bot-framework","connect-four","connect4","demo-clients","game-clients","library","udp-communication"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mmitch.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,"zenodo":null}},"created_at":"2019-12-24T20:02:12.000Z","updated_at":"2025-08-14T07:25:39.000Z","dependencies_parsed_at":"2023-12-17T20:45:50.645Z","dependency_job_id":"517d7624-11ca-4c42-bc22-01c06dfbf5d0","html_url":"https://github.com/mmitch/bash-n","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mmitch/bash-n","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmitch%2Fbash-n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmitch%2Fbash-n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmitch%2Fbash-n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmitch%2Fbash-n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmitch","download_url":"https://codeload.github.com/mmitch/bash-n/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmitch%2Fbash-n/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271093077,"owners_count":24697927,"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","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bash","bot","bot-framework","connect-four","connect4","demo-clients","game-clients","library","udp-communication"],"created_at":"2024-12-31T19:37:24.594Z","updated_at":"2025-08-19T03:10:37.091Z","avatar_url":"https://github.com/mmitch.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"bash-n\n======\n\n[![Build status](https://github.com/mmitch/bash-n/workflows/Tests/badge.svg)](https://github.com/mmitch/bash-n/actions?query=workflow%3ATests)\n[![GPL 3+](https://img.shields.io/badge/license-GPL%203%2B-blue.svg)](http://www.gnu.org/licenses/gpl-3.0-standalone.html)\n\n\n_bash-n_ is a library to simplify writing\n[connected-n](https://github.com/fiduciagad/connected-n) game clients\nin bash.\n\nTo write a client, `source bash-n-client` in your script and then\nimplement the methods at the top of `bash-n-client` by redefining the\nfunctions with your own code.\n\nUse `udpwrap.pl` to run a client; see below for details.\n\n\ndemo clients\n------------\n\nSome simple demo clients are included:\n\n - `bash-n-failbot` permanently makes illegal moves\n - `bash-n-slothbot` permanently times out\n - `bash-n-simplebot` plays completely random\n - `bash-n-towerbot` tries to build vertical stacks\n\n\nUDP communication\n-----------------\n\nTwo pecularities of the way the game implements the UDP protocol\nprevent the usage of the internal bash methods for UDP communication\nvia `/dev/udp/host/port`:\n\n - the individual messages have no end-of-packet marker like a line\n   ending or a final semicolon, so the raw UDP datagrams need to be\n   handled by the client\n\n - the game server sends from a different port than the one it is\n   listening on\n\nTo mitigate this, `udpwrap.pl` provides a UDP wrapper written in Perl\nthat translates between UDP datagrams and a single lines of text with\na proper line terminator in both directions:\n\n```\nusage:\n  udpwrap.pl \u003clocal_port\u003e \u003cserver:port\u003e \u003cbot_script\u003e\n\nexample:\n  udpwrap.pl 5000 localhost:4446 ./bash-n-simplebot\n```\n\nThis will also work for game clients not using `bash-n-client` and/or\nwritten in another language.  Any game client that talks the game\nprotocol via stdin/stdout can be wrapped with `udpwrap.pl`, removing\nthe need to implement the low-level network stuff.\n\n\nproject location\n----------------\n\n_bash-n_ has its home at https://github.com/mmitch/bash-n/\n\n\ncopyright\n---------\n\nbash-n - bash library for connect-n game clients\n\nCopyright (C) 2019, 2020, 2023  Christian Garbs \u003cmitch@cgarbs.de\u003e  \nLicensed under GNU GPL v3 or later.\n\nbash-n is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nbash-n is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with bash-n.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmitch%2Fbash-n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmitch%2Fbash-n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmitch%2Fbash-n/lists"}