{"id":22156224,"url":"https://github.com/andy489/battleships_online","last_synced_at":"2026-02-26T06:27:04.542Z","repository":{"id":129116647,"uuid":"468096969","full_name":"andy489/Battleships_Online","owner":"andy489","description":"Java SE Online Console Game. MJT Project @ FMI","archived":false,"fork":false,"pushed_at":"2022-11-09T07:13:06.000Z","size":12683,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-26T11:39:03.944Z","etag":null,"topics":["java","threads","threadsafe"],"latest_commit_sha":null,"homepage":"","language":"Java","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/andy489.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":"2022-03-09T21:26:13.000Z","updated_at":"2023-03-31T07:30:36.000Z","dependencies_parsed_at":"2023-03-30T17:19:12.131Z","dependency_job_id":null,"html_url":"https://github.com/andy489/Battleships_Online","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andy489/Battleships_Online","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andy489%2FBattleships_Online","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andy489%2FBattleships_Online/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andy489%2FBattleships_Online/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andy489%2FBattleships_Online/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andy489","download_url":"https://codeload.github.com/andy489/Battleships_Online/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andy489%2FBattleships_Online/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273782455,"owners_count":25167134,"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-09-05T02:00:09.113Z","response_time":402,"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":["java","threads","threadsafe"],"created_at":"2024-12-02T02:38:52.369Z","updated_at":"2025-10-30T20:38:28.747Z","avatar_url":"https://github.com/andy489.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Battleships-Online\nJava Console Game. MJT Project @ FMI\n\n- [PROJECT DESCRIPTION](https://github.com/andy489/Modern_Java_Technologies/blob/main/course-projects/battleships.md)\n\n\u003cstrong\u003e\n  \n- [DOCUMENTATION LINK](https://github.com/andy489/Battleships_Online/blob/main/Documentation/BSO%20EN.pdf)\n  \n\u003c/strong\u003e\n\n## Testing\n\n\u003cdiv align=\"center\"\u003e\n  \n![](https://img.shields.io/badge/Code%20Coverage-Class%2089%25%2C%20Method%2090%25%2C%20Line%2084%25-brightgreen) \u0026nbsp; \u0026nbsp;\n![](https://img.shields.io/badge/Tests-183%20passed%2C%200%20failed-brightgreen)\n\n\u003c/div\u003e\n\n## Functionalities\n\n### User manual\n\nFormats and displays the on-line commands. User manual is divided into two sections, game mode and non-game mode. Depending on the mode in which the user is, the usual commands will be displayed.\n\n```\nman\n```\n\n### Who am I\n\nDisplay message containing effective user username.\n\n```\nwho-am-i\n```\n\n### Set username\n\nAttaches username to the user id on the server.\n\n```\nset-username \u003cusername\u003e\n```\n\n### Change username\n\nChanges the current username of the user.\n\n```\nchange-username \u003cusername\u003e\n```\n\n### List users\n\nDisplays the total number of users currently connected to the server on the first line and on each subsequent line shows the username and status of each user.\n\n```\nlist-users\n```\n\n### List games\n\nDisplays a table with information about the available games that are currently being played and served by the server.\n\n```\nlist-games\n```\n\n### Register\n\nRegisters a user on the server to allow him to create (host) a game or join as a second (guest) player in already created games. Execution of the command returns a unique api-key with which the user can be identified on the server when logging in again.\n\n```\nregister\n```\n\n### Login\n\nIdentifies a pre-registered user on the server. All saved games are loaded on the server in the RAM reserved for this user.\n\n```\nlogin \u003capi-key\u003e\n```\n\n### Create game\n\nCreates a new game with the submitted name, in which the creator is host. The status of the game is pending and a second player is waited to join the game. Boats can be placed while waiting (see place commands below)\n\n```\ncreate-game \u003cgame_name\u003e\n```\n\n### Join game\n\nCommand with one optional parameter. In case this optional parameter is missing, the user joins any pending game. If the argument is given, the player tries to join the game with the name given as an argument.\n\n```\njoin-game {\u003cgame_name\u003e}\n```\n\n### Current game\n\nReturns the current game to a user who is registered and is currently in a game as creator or guest.\n\n```\ncurrent-game\n```\n\n### Save game\n\nSaves the current game of the user who calls it. The command can only be called if the user's current game is in progress.\n\n```\nsave-game\n```\n\n### Saved games\n\nDisplays a table of the currently saved games of a registered user.\n\n```\nsaved-games\n```\n\n### Delete game\n\nCommand with one required argument and several optional ones. All arguments are names of games to be deleted. Server tries to delete each game with the given name if it finds such a game in the games saved by the user.\n\n```\ndelete-game \u003cgame_name_1\u003e {\u003cgame_name_2\u003e \u003cgame_name_3\u003e ... \u003cgame_name_n\u003e}\n```\n\n### Place\n\nPlaces a battleship on the board. Case-insensitive.\n\n```\nplace \u003c[A-J]\u003e \u003c[1-10]\u003e \u003c[UP, RIGHT, DOWN, LEFT]\u003e \u003c[2-5]\u003e\n```\n\n### Place all\n\nPlaces all battleships stochastically.\n\n```\nplace-all\n```\n\n### Start\n\nIndicates that the opponent is ready to start attacking (he has already placed all his ships on the board). Case-insensitive.\n\n```\nstart\n```\n\n### Attack\n\nAttacks at a position corresponding to the coordinates given as arguments.\n\n```\nattack \u003c[A-J]\u003e \u003c[1-10]\u003e\n```\n\n### Cheats manual\n\nDisplays a usage message of a hidden command.\n\n```\nhacks\n```\n\n### Attack all\n\nAttacks the lines that correspond to the letters given as arguments. Case-insensitive.\n\n```\nattack-all \u003c[A-J]\u003e {\u003c[A-J]\u003e ... }\n```\n\n### Display\n\nDisplays the state of the boards of the current game.\n\n```\ndisplay\n```\n\n### Disconnect\n\nDisconnects the user from the server.\n\n```\ndisconnect\n``` \n\n## Specifics\n\n### Username\n\nТhe username is validated with a regular expression must be no less than 4 and no more than 9 lowercase or uppercase Latin letters.\n\n### Player status\n\n* ONLINE\n* HOST\n* GUEST\n\n### Game Status\n\n* PENDING\n* IN PROGRESS\n\n## Structure\n\n```\nsrc\n└─ bg.sofia.uni.fmi.mjt.battleships.online.server\n    ├── command\n    │     ├── manager \n    │     │    ├── Command.java\n    │     │    ├── CommandCreator.java\n    │     │    └── CommandExecutor.java\n    │     ├── mode\n    │     │     ├── playing\n    │     │     │     ├── attack\n    │     │     │     │     ├── Attack.java\n    │     │     │     │     └── AttackAll.java\n    │     │     │     │── placement     \n    │     │     │     │     ├── Place.java\n    │     │     │     │     └── PlaceAll.java\n    │     │     │     ├── DeleteGame.java\n    │     │     │     ├── Hacks.java\n    │     │     │     ├── SaveGame.java\n    │     │     │     └── Start.java\n    │     │     ├── surfing\n    │     │     │     ├── ChangeUsername.java\n    │     │     │     ├── CreateGame.java\n    │     │     │     ├── CurrentGame.java\n    │     │     │     ├── JoinGame.java\n    │     │     │     ├── LoadGame.java\n    │     │     │     ├── Login.java\n    │     │     │     ├── Register.java\n    │     │     │     ├── SavedGames.java\n    │     │     │     └── SetUsername.java\n    │     │     ├── view     \n    │     │     │     ├── Display.java\n    │     │     │     ├── ListGames.java\n    │     │     │     ├── ListUsers.java\n    │     │     │     └──  WhoAmI.java\n    │     │     ├── Disconnect.java   \n    │     │     └──  UserManual.java    \n    │     └── response\n    │           ├── AttackResponseDTO.java   \n    │           ├── CommandResponseDTO.java   \n    │           ├── MessageJson.java   \n    │           ├── PlaceResponseDTO.java   \n    │           └── SaveResponseDTO.java   \n    ├── exception\n    │     └── Log.java\n    ├── file.manager\n    │     └── FileManager.java\n    ├── game\n    │     ├── player    \n    │     │     ├── board  \n    │     │     │     ├── field  \n    │     │     │     │     ├── ship   \n    │     │     │     │     │     ├── coordinate   \n    │     │     │     │     │     │     └── Coordinate.java   \n    │     │     │     │     │     ├── Ship.java  \n    │     │     │     │     │     ├── ShipConstants.java    \n    │     │     │     │     │     ├── ShipDirection.java    \n    │     │     │     │     │     └── ShipType.java  \n    │     │     │     │     ├── Field.java    \n    │     │     │     │     ├── FieldConstants.java          \n    │     │     │     │     └── FieldType.java\n    │     │     │     ├── Board.java    \n    │     │     │     └── BoardConstants.java\n    │     │     ├── Player.java\n    │     │     └── PlayerStatus.java\n    │     ├── Game.java\n    │     ├── GameStatus.java\n    │     └── SavedGame.java\n    ├── storage\n    │     ├── DisplayGameHelper.java\n    │     ├── ListGamesViewHelper.java\n    │     ├── SetUpRegisteredUsersAndSavedGames.java\n    │     ├── Storage.java\n    │     └── UserIn.java\n    └── BattleshipsServer.java  \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandy489%2Fbattleships_online","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandy489%2Fbattleships_online","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandy489%2Fbattleships_online/lists"}