{"id":19908754,"url":"https://github.com/railseventstore/civ","last_synced_at":"2025-05-03T02:31:23.042Z","repository":{"id":39678231,"uuid":"88353111","full_name":"RailsEventStore/civ","owner":"RailsEventStore","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-07T23:06:40.000Z","size":245,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-07T10:29:18.650Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RailsEventStore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-04-15T14:45:19.000Z","updated_at":"2024-12-07T23:06:44.000Z","dependencies_parsed_at":"2024-02-19T20:29:52.895Z","dependency_job_id":"44e9ac9c-4801-401a-81d7-dec9ade1a370","html_url":"https://github.com/RailsEventStore/civ","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RailsEventStore%2Fciv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RailsEventStore%2Fciv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RailsEventStore%2Fciv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RailsEventStore%2Fciv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RailsEventStore","download_url":"https://codeload.github.com/RailsEventStore/civ/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252133703,"owners_count":21699583,"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-11-12T21:13:20.301Z","updated_at":"2025-05-03T02:31:22.624Z","avatar_url":"https://github.com/RailsEventStore.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PitbossStats\n\n## Usage\n\n### Web app\n\n#### Game setup\n\n##### host game:\n\n```ruby\nevent_store = Rails.configuration.event_store\nservice = Game::Service.new(event_store)\ngame_id = SecureRandom.uuid\nhost_game_command = Game::HostGame.new(game_id, 24.hours)\nservice.host_game(host_game_command)\n```\n\n##### rename game and add slack data:\n\n```ruby\ngame_read_model = ReadModel::GameReadModel.find(game_id)\ngame_read_model.name = \"arkency2\"\ngame_read_model.slack_token = \"your-token\"\ngame_read_model.slack_channel = \"your-game-channel\"\ngame_read_model.ip_address = \"your-game-ip-address\"\ngame_read_model.save\n```\n\n##### create players\n\n```ruby\nPlayer.create!(steam_name: \"swistak35\", slack_name: \"swistak\")\nPlayer.create!(steam_name: \"jura55\", slack_name: \"jorgen\")\nPlayer.create!(steam_name: \"halkye\", slack_name: \"halki\")\nPlayer.create!(steam_name: \"The Rubyist\", slack_name: \"pkondzior\")\n```\n\n##### register players in correct order\n\n```ruby\n[\"halkye\", \"tango_mig\", \"pan_sarin\", \"swistak35\", \"The Rubyist\", \"jura55\", \"jamesworthy\", \"dysk\"].each_with_index do |steam_name, index|\n  player = Player.find_by(steam_name: steam_name)\n  command = Game::RegisterPlayer.new(game_id, player.id, index)\n  service.register_player(command)\nend\n```\n\n##### unregister players in case they are no longer playing\n\n```ruby\nevent_store = Rails.configuration.event_store\nservice = Game::Service.new(event_store)\ncommand = Game::UnregisterPlayer.new(\"189e3f21-27c7-431b-9025-1feb92697635\", Player.find_by(steam_name: \"halkye\").id, 2)\nservice.unregister_player(command)\n```\n\n### Game server\n\n#### change game config to enabled logging\n#### download parser:\n\n* [Script](https://github.com/dysk/pitboss-stats/blob/master/script/pbs3.rb)\n* [Parser lib](https://github.com/dysk/pitboss-stats/blob/master/logs_parser/lib/logs_parser.rb)\n\nand place in Logs directory\n\n#### make sure you have ruby installed\n\nYou can use [Ruby installer](https://rubyinstaller.org/)\n\n#### run from command line\n\n`ruby pbs3.rb [game_uuid] [players_count]`\n\n##### in case of game crash use\n\n[Afer crash script](https://github.com/dysk/pitboss-stats/blob/master/script/after_crash.rb)\n\nto reset current turn, turn time and players end turn status\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frailseventstore%2Fciv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frailseventstore%2Fciv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frailseventstore%2Fciv/lists"}