Skip to content

Commit

Permalink
Alpha 0.1.0 (#54)
Browse files Browse the repository at this point in the history
* Fix/update from master (#28)

* Bump vue-tsc from 1.8.27 to 2.0.3 in /frontend (#27)

Bumps [vue-tsc](https://github.com/vuejs/language-tools/tree/HEAD/packages/tsc) from 1.8.27 to 2.0.3.
- [Release notes](https://github.com/vuejs/language-tools/releases)
- [Changelog](https://github.com/vuejs/language-tools/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vuejs/language-tools/commits/v2.0.3/packages/tsc)

---
updated-dependencies:
- dependency-name: vue-tsc
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump quarkus.platform.version from 3.7.4 to 3.8.1 in /backend (#26)

Bumps `quarkus.platform.version` from 3.7.4 to 3.8.1.

Updates `io.quarkus.platform:quarkus-bom` from 3.7.4 to 3.8.1
- [Commits](quarkusio/quarkus-platform@3.7.4...3.8.1)

Updates `io.quarkus.platform:quarkus-maven-plugin` from 3.7.4 to 3.8.1
- [Commits](quarkusio/quarkus-platform@3.7.4...3.8.1)

---
updated-dependencies:
- dependency-name: io.quarkus.platform:quarkus-bom
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: io.quarkus.platform:quarkus-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump vue from 3.4.20 to 3.4.21 in /frontend (#25)

Bumps [vue](https://github.com/vuejs/core) from 3.4.20 to 3.4.21.
- [Release notes](https://github.com/vuejs/core/releases)
- [Changelog](https://github.com/vuejs/core/blob/main/CHANGELOG.md)
- [Commits](vuejs/core@v3.4.20...v3.4.21)

---
updated-dependencies:
- dependency-name: vue
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump vue-i18n from 9.9.1 to 9.10.1 in /frontend (#24)

Bumps [vue-i18n](https://github.com/intlify/vue-i18n-next/tree/HEAD/packages/vue-i18n) from 9.9.1 to 9.10.1.
- [Release notes](https://github.com/intlify/vue-i18n-next/releases)
- [Changelog](https://github.com/intlify/vue-i18n-next/blob/master/CHANGELOG.md)
- [Commits](https://github.com/intlify/vue-i18n-next/commits/v9.10.1/packages/vue-i18n)

---
updated-dependencies:
- dependency-name: vue-i18n
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Server & game status detection (#21)

* Feature/focus and macro (#37)

* Add alert system & Patches (#39)

* Clean and refacto backend socket message system (#45)

* Config page (#41)

* Add real time game status update in session (#46)

* Feature/port listening fix (#47)

* Add auto updater to app (#49)

* Session run research (#50)

* Fix IP fetching (#51)

* Add SotServer user workflow (#48)

* Add cached actions Closes #53

* README.md (#23)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dadodasyra <44753923+dadodasyra@users.noreply.github.com>
Co-authored-by: Zelytra <contact@zelytra.fr>
  • Loading branch information
4 people authored Mar 7, 2024
1 parent 65a2296 commit 5c9f907
Show file tree
Hide file tree
Showing 73 changed files with 3,064 additions and 1,794 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,13 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-20.04, windows-latest]
platform: [windows-latest]
defaults:
run:
working-directory: 'frontend'
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4

- name: setup node
uses: actions/setup-node@v4
with:
Expand All @@ -67,6 +66,10 @@ jobs:
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.config.rust_target }}

- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
run: |
Expand All @@ -79,4 +82,6 @@ jobs:
# If tagName and releaseId are omitted tauri-action will only build the app and won't try to upload any asstes.
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
11 changes: 9 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-20.04, windows-latest]
platform: [windows-latest]
defaults:
run:
working-directory: 'frontend'
Expand All @@ -29,6 +29,10 @@ jobs:
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.config.rust_target }}

- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
run: |
Expand All @@ -41,12 +45,15 @@ jobs:
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
tagName: betterfleet-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
releaseName: "BetterFleet v__VERSION__"
releaseBody: "See the assets to download this version and install."
releaseDraft: true
prerelease: false

publish-backend:
name: Backend app
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
deployement/psql-data/
deployment/psql-data/
.idea/
14 changes: 14 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
Version 2.0, January 2004
http://www.apache.org/licenses/

0. Specific Exclusion Clause.

It is expressly stipulated that [Lazarus], identified by their online pseudonym
associated with the creation and management of the FleetCreator application,
is under no circumstances granted the right to use, modify, distribute,
or sell the [BetterFleet] application (the "Product"), for both personal
and commercial purposes. This prohibition is indefinite until expressly
revoked in writing by the Product's owner. Any violation of this clause will
result in legal action and demands for remedy in accordance with applicable laws.

This clause is incorporated into the Project [BetterFleet]'s license,
and its breach constitutes an infringement of the terms of this license,
potentially leading to civil and/or criminal penalties.

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.
Expand Down
78 changes: 76 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,76 @@
![banner](/frontend/src/assets/banners/banner.png)
# BetterFleet
![image](/frontend/src/assets/banners/banner.png)

# BetterFleet

## About BetterFleet

BetterFleet is a free open source application designed to enhance the gaming experience in Sea Of Thieves by
facilitating the creation of alliances among players. With BetterFleet, you can organize game sessions and invite your
friends to join in a simple and intuitive manner.

:warning: BetterFleet is not an official application of Sea Of Thieves. It was developed by the community for
players looking to improve their gaming experience.
---

## Features

- **Automatic Session Management:** Facilitates joining the same server with your friends by providing real-time in-game status and server information.

- **Increase likelihood of finding a server:** Includes an automatic "Set sail" feature so that everyone clicks at the same time.

- **Self-Hosted Backend:** The open-source nature of the application allows users to host the backend, offering greater control over deployment and maintenance.

- **Statistics Tracking:** Provides statistical insights to help users assess their server-finding success rate.
---

## Comparison of Fleet Management Applications: BetterFleet vs. FleetCreator

| Feature | BetterFleet | FleetCreator |
|---------------------------------------|-----------------------------|-----------------------------|
| Speed | :question: (Need benchmark) | :question: (Need benchmark) |
| Ad free | :white_check_mark: | :x: |
| Complete free access | :white_check_mark: | :x: |
| UX friendly | :white_check_mark: | :x: |
| Open source | :white_check_mark: | :x: |
| IPv6 support | :white_check_mark: | :x: |
| Automatic click between the same crew | :white_check_mark: | :x: |
| Size of file | <20MB | >200MB |
| No memory leak | :white_check_mark: | :warning:* |

\* FleetCreator has been observed to consume 8GB of RAM after 10 hours of usage, indicating a possible memory leak.

---

## OS Compatibility

| Operating System | Compatible |
|------------------|--------------------|
| Windows 11 | :white_check_mark: |
| Windows 10 | :white_check_mark: |
| macOS | :x: |
| Linux | :x: |

---

## Credits 👥

- **Development:** [Zelytra](https://zelytra.fr) & [dadodasyra](https://github.com/dadodasyra)
- **Design/Graphics:** [ZeTro](https://zetro.fr)
- **Translator/proofreader:** [Ichabodt](https://github.com/Ichabodt)

We thank everyone who contributes to making BetterFleet better every day. If you would like to contribute to the
project, feel free to fork the repository and submit your pull requests.

---

## License 📄

BetterFleet is distributed under the MIT license. See the [LICENSE](/LICENSE) file for more information.

---

## Support

If you have any questions or encounter problems with the app, please open an issue.

We hope you enjoy using BetterFleet as much as we enjoyed developing it!
12 changes: 11 additions & 1 deletion backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>3.7.4</quarkus.platform.version>
<quarkus.platform.version>3.8.1</quarkus.platform.version>
<skipITs>true</skipITs>
<surefire-plugin.version>3.2.5</surefire-plugin.version>
</properties>
Expand Down Expand Up @@ -52,10 +52,20 @@
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.16.1</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-websockets</artifactId>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20231013</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
3 changes: 0 additions & 3 deletions backend/src/main/java/fr/zelytra/PublicEndpoints.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package fr.zelytra;

import io.quarkus.logging.Log;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.core.Response;

import java.util.UUID;

@Path("/")
public class PublicEndpoints {

Expand Down
77 changes: 68 additions & 9 deletions backend/src/main/java/fr/zelytra/session/SessionManager.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package fr.zelytra.session;

import com.fasterxml.jackson.databind.ObjectMapper;
import fr.zelytra.session.fleet.Fleet;
import fr.zelytra.session.fleet.Player;
import fr.zelytra.session.player.Player;
import fr.zelytra.session.server.SotServer;
import fr.zelytra.session.socket.MessageType;
import io.quarkus.logging.Log;
import jakarta.annotation.Nullable;

import java.io.IOException;
import java.util.*;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

/**
* Manages sessions for a multiplayer game, allowing players to create, join, and leave sessions.
Expand All @@ -18,11 +20,15 @@ public class SessionManager {

private final HashMap<String, Fleet> sessions;

// SotServer cached to avoid API spam and faster server response
private final HashMap<String, SotServer> sotServers;

/**
* Private constructor for singleton pattern.
*/
private SessionManager() {
this.sessions = new HashMap<>();
this.sotServers = new HashMap<>();
}

/**
Expand Down Expand Up @@ -65,9 +71,9 @@ public boolean isSessionExist(String sessionId) {
*
* @param sessionId The ID of the session to join.
* @param player The player attempting to join the session.
* @return true if the player was successfully added, false otherwise.
* @return the Fleet where the player was added or null
*/
public boolean joinSession(String sessionId, Player player) {
public Fleet joinSession(String sessionId, Player player) {
// First, leave any session the player might currently be in
if (getPlayerFromSessionId(player.getSocket().getId()) != null) {
leaveSession(player);
Expand All @@ -76,11 +82,11 @@ public boolean joinSession(String sessionId, Player player) {
Fleet fleet = getFleetFromId(sessionId);
if (fleet == null) {
Log.error("[" + sessionId + "] Session doesnt exist for player : " + player.getUsername());
return false;
return null;
}
fleet.getPlayers().add(player);
Log.info("[" + sessionId + "] " + player.getUsername() + " Join the session !");
return true;
return fleet;
}

/**
Expand All @@ -91,7 +97,10 @@ public boolean joinSession(String sessionId, Player player) {
public void leaveSession(Player player) {
for (Fleet fleet : sessions.values()) {
fleet.getPlayers().remove(player);
SessionSocket.broadcastSessionUpdate(fleet.getSessionId());
fleet.getServers().forEach((key, value) -> {
value.getConnectedPlayers().remove(player);
});
SessionSocket.broadcastDataToSession(fleet.getSessionId(), MessageType.UPDATE, fleet);
Log.info("[" + fleet.getSessionId() + "] " + player.getUsername() + " Leave the session !");

// Clean empty session
Expand Down Expand Up @@ -170,5 +179,55 @@ public boolean isPlayerInSession(Player player, String sessionId) {
return false; // The specified player is not found in the session
}

public SotServer getServerFromHashing(SotServer server) {
String hash = server.generateHash();

// Return cached SOT server
if (sotServers.containsKey(hash)) {
return sotServers.get(hash);
}

// The object inject may not be completed, so we're creating fresh one to make sure all data has been initialized
SotServer newServer = new SotServer(server.getIp(), server.getPort());
sotServers.put(newServer.getHash(), newServer);
return newServer;
}

public void playerJoinSotServer(Player player, SotServer server) {
SotServer findedSotServer = getServerFromHashing(server);

Fleet fleet = getFleetByPlayerName(player.getUsername());
assert fleet != null;

// Detect if the server is not already know by the fleet
if (!fleet.getServers().containsKey(findedSotServer.getHash())) {
fleet.getServers().put(findedSotServer.getHash(), findedSotServer);
}
// Do not add player if already in
if (fleet.getServers().get(findedSotServer.getHash()).getConnectedPlayers().contains(player)) {
return;
}

// Add player to SotServer in Fleet and broadcast update
fleet.getServers().get(findedSotServer.getHash()).getConnectedPlayers().add(player);
Log.info("[" + fleet.getSessionId() + "] " + player.getUsername() + " join the SotServer: " + fleet.getServers().get(findedSotServer.getHash()).getHash());
SessionSocket.broadcastDataToSession(fleet.getSessionId(), MessageType.UPDATE, fleet);
}

public void playerLeaveSotServer(Player player, SotServer server) {
SotServer findedSotServer = getServerFromHashing(server);

Fleet fleet = getFleetByPlayerName(player.getUsername());
assert fleet != null;

SotServer fleetFindedServer = fleet.getServers().get(findedSotServer.getHash());
fleetFindedServer.getConnectedPlayers().remove(player);

// If SotServer empty remove server from the list
if (fleetFindedServer.getConnectedPlayers().isEmpty()) {
fleet.getServers().remove(fleetFindedServer.getHash());
}
Log.info("[" + fleet.getSessionId() + "] " + player.getUsername() + " leave the SotServer: " + fleetFindedServer.getHash());
SessionSocket.broadcastDataToSession(fleet.getSessionId(), MessageType.UPDATE, fleet);
}
}
Loading

0 comments on commit 5c9f907

Please sign in to comment.