Skip to content

Commit

Permalink
Bump org.junit.jupiter:junit-jupiter-api from 5.9.3 to 5.10.0 (WiIIia…
Browse files Browse the repository at this point in the history
…m278#149)

Bumps [org.junit.jupiter:junit-jupiter-api](https://github.com/junit-team/junit5) from 5.9.3 to 5.10.0.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](junit-team/junit5@r5.9.3...r5.10.0)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
actions-user and dependabot[bot] committed Jul 26, 2023
1 parent 854bf37 commit 2416d4e
Show file tree
Hide file tree
Showing 20 changed files with 1,186 additions and 0 deletions.
12 changes: 12 additions & 0 deletions temp_wiki_854bf371865d2a040d6b35f90cabc94b85180bd3/API-Events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
HuskSync provides three API events your plugin can listen to when certain parts of the data synchronisation process are performed. These events deal in HuskSync class types, so you may want to familiarize yourself with the [API basics](API) first. Two of the events can be cancelled (thus aborting the synchronisation process at certain stages) and some of the events expose methods letting you affect their outcome (such as modifying the data that is saved during the process).

Consult the Javadocs for more information -- and don't forget to register your listener when listening for these event calls. Please note that carrying out expensive blocking operations during these events is strongly discouraged as this may affect plugin performance.

## List of API Events
| Bukkit Event class | Cancellable | Description |
|---------------------------|:-----------:|---------------------------------------------------------------------------------------------|
| `BukkitDataSaveEvent` || Called when player data snapshot is created, saved and cached due to a DataSaveCause |
| `BukkitPreSync` || Called before a player has their data updated from the cache or database, just after login |
| `BukkitSyncCompleteEvent` || Called once a player has completed their data synchronisation on login successfully&dagger; |

&dagger;This can also fire when a user's data is updated while the player is logged in; i.e. when an admin rolls back the user, updates their inventory or Ender Chest through the respective commands, or when an API call is made forcing the user to have their data updated.
86 changes: 86 additions & 0 deletions temp_wiki_854bf371865d2a040d6b35f90cabc94b85180bd3/API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
The HuskSync API provides methods for retrieving and updating user data, as well as a number of events for tracking when user data is synced and saved.

## Compatibility
[![Maven](https://repo.william278.net/api/badge/latest/releases/net/william278/husksync?color=00fb9a&name=Maven&prefix=v)](https://repo.william278.net/#/releases/net/william278/husksync/)

The HuskSync API shares version numbering with the plugin itself for consistency and convenience. Please note minor and patch plugin releases may make API additions and deprecations, but will not introduce breaking changes without notice.

| API Version | HuskSync Versions | Supported |
|:-----------:|:--------------------:|:---------:|
| v2.x | _v2.0&mdash;Current_ ||
| v1.x | _v1.0&mdash;v1.4.1_ | ❌️ |

<details>
<summary>Targeting older versions</summary>

HuskSync versions prior to `v2.2.5` are distributed on [JitPack](https://jitpack.io/#/net/william278/HuskSync), and you will need to use the `https://jitpack.io` repository instead.
</details>

## Table of contents
1. Adding the API to your project
2. Adding HuskSync as a dependency
3. Next steps

## API Introduction
### 1.1 Setup with Maven
<details>
<summary>Maven setup information</summary>

Add the repository to your `pom.xml` as per below. You can alternatively specify `/snapshots` for the repository containing the latest development builds (not recommended).
```xml
<repositories>
<repository>
<id>william278.net</id>
<url>https://repo.william278.net/releases</url>
</repository>
</repositories>
```
Add the dependency to your `pom.xml` as per below. Replace `VERSION` with the latest version of HuskSync (without the v): ![Latest version](https://img.shields.io/github/v/tag/WiIIiam278/HuskSync?color=%23282828&label=%20&style=flat-square)
```xml
<dependency>
<groupId>net.william278</groupId>
<artifactId>husksync</artifactId>
<version>VERSION</version>
<scope>provided</scope>
</dependency>
```
</details>

### 1.2 Setup with Gradle
<details>
<summary>Gradle setup information</summary>

Add the dependency as per below to your `build.gradle`. You can alternatively specify `/snapshots` for the repository containing the latest development builds (not recommended).
```groovy
allprojects {
repositories {
maven { url 'https://repo.william278.net/releases' }
}
}
```
Add the dependency as per below. Replace `VERSION` with the latest version of HuskSync (without the v): ![Latest version](https://img.shields.io/github/v/tag/WiIIiam278/HuskSync?color=%23282828&label=%20&style=flat-square)

```groovy
dependencies {
compileOnly 'net.william278:husksync:VERSION'
}
```
</details>

### 2. Adding HuskSync as a dependency
- Add HuskSync to your `softdepend` (if you want to optionally use HuskSync) or `depend` (if your plugin relies on HuskSync) section in `plugin.yml` of your project.

```yaml
name: MyPlugin
version: 1.0
main: net.william278.myplugin.MyPlugin
author: William278
description: 'A plugin that hooks with the HuskSync API!'
softdepend: # Or, use 'depend' here
- HuskSync
```
### 3. Next steps
Now that you've got everything ready, you can start doing stuff with the HuskSync API!
- [[UserData API]] &mdash; Get data snapshots and update current user data
- [[API Events]] &mdash; Listen to, cancel and modify the result of data synchronization events
17 changes: 17 additions & 0 deletions temp_wiki_854bf371865d2a040d6b35f90cabc94b85180bd3/Commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
This page contains a table of HuskSync commands and their required permission nodes.

| Command | Description | Permission |
|-----------------------------------------------|--------------------------------------|--------------------------------------|
| `/husksync` | Use `/husksync` subcommands | `husksync.command.husksync` |
| `/husksync info` | View plugin information | `husksync.command.husksync info` |
| `/husksync reload` | Reload config & message files | `husksync.command.husksync.reload` |
| `/husksync update` | Check if an update is available | `husksync.command.husksync.update` |
| `/husksync migrate <migrator> [args]` | Migrate user data | _Console-only_ |
| `/userdata view <username> [version_uuid]` | View a snapshot of user data | `husksync.command.userdata` |
| `/userdata restore <username> <version_uuid>` | Restore a snapshot of user data | `husksync.command.userdata.manage` |
| `/userdata delete <username> <version_uuid>` | Delete a snapshot of user data | `husksync.command.userdata.manage` |
| `/userdata pin <username> <version_uuid>` | Pin a snapshot of user data | `husksync.command.userdata.manage` |
| `/inventory <username> [version_uuid]` | View a user's inventory contents | `husksync.command.inventory`&dagger; |
| `/enderchest <username> [version_uuid]` | View a user's ender chest contents | `husksync.command.enderchest`&dagger;|

&dagger; The respective `husksync.command.inventory.edit` and `husksync.command.enderchest.edit` permission node is required to be able to edit a user's inventory/ender chest using the interface.
78 changes: 78 additions & 0 deletions temp_wiki_854bf371865d2a040d6b35f90cabc94b85180bd3/Config-File.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
This page contains the configuration file reference for HuskSync. The config file is located in `/plugins/HuskSync/config.yml`

## Example config
<details>
<summary>config.yml</summary>

```yaml
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ HuskSync Config ┃
# ┃ Developed by William278 ┃
# ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
# ┣╸ Information: https://william278.net/project/husksync
# ┗╸ Documentation: https://william278.net/docs/husksync
language: en-gb
check_for_updates: true
cluster_id: ''
debug_logging: false
database:
credentials:
# Database connection settings
host: localhost
port: 3306
database: HuskSync
username: root
password: pa55w0rd
parameters: ?autoReconnect=true&useSSL=false
connection_pool:
# MySQL connection pool properties
maximum_pool_size: 10
minimum_idle: 10
maximum_lifetime: 1800000
keepalive_time: 0
connection_timeout: 5000
table_names:
users: husksync_users
user_data: husksync_user_data
redis:
credentials:
# Redis connection settings
host: localhost
port: 6379
password: ''
use_ssl: false
synchronization:
# Synchronization settings
max_user_data_snapshots: 5
save_on_world_save: true
save_on_death: false
save_empty_drops_on_death: true
compress_data: true
notification_display_slot: ACTION_BAR
synchronise_dead_players_changing_server: true
network_latency_milliseconds: 500
features:
health: true
statistics: true
persistent_data_container: false
hunger: true
ender_chests: true
advancements: true
location: false
game_mode: true
potion_effects: true
locked_maps: false
inventories: true
max_health: true
experience: true
blacklisted_commands_while_locked: []
event_priorities:
join_listener: LOWEST
quit_listener: LOWEST
death_listener: NORMAL
```
</details>
## Messages files
You can customize the plugin locales, too, by editing your `messages-xx-xx.yml` file. This file is formatted using [MineDown syntax](https://github.com/Phoenix616/MineDown). For more information, see [[Translations]].
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
HuskSync provides options for backing up and automatically rotating user data. That way, if something goes wrong, you can restore a user from a previous snapshot of user data.

## Snapshots
HuskSync creates what is known as "Snapshots" of a user's data whenever it saves data.

Each user data snapshot has:
- a unique ID
- a timestamp (when it was created)
- a save cause (why it was created)
- a flag to indicate if the snapshot has been pinned (preventing it from being rotated)

By default, HuskSync will store 5 user data snapshots about a user (including their latest snapshot). After that, when a new user snapshot is set, the oldest snapshot will automatically be deleted. You can change the number of snapshots to keep by changing the `max_user_data_snapshots` setting in the `config.yml` file (minimum 1).

Pinned user data snapshots are exempt from being rotated and can only be deleted manually in-game.

## Viewing user data
To view a list of a user's snapshots, use `/userdata list <username>`. Their most recent snapshots will be listed from the database, from newest to oldest. You can click the buttons to navigate through their pages.

[![Data snapshot list](https://raw.githubusercontent.com/WiIIiam278/HuskSync/master/images/data-snapshot-list.png)](#)

Snapshots marked with a star after the number have been pinned. Hover over it to view more information.

You can then click on the items in the list in chat to view an overview of each snapshot. Alternatively, to view a user's most recent data snapshot, use `/userdata view <username>`.

[![Data snapshot viewer](https://raw.githubusercontent.com/WiIIiam278/HuskSync/master/images/data-snapshot-viewer.png)](#)

## Managing user data
You can use the "Manage" buttons to manage user data. These buttons will only appear if you have the userdata command manage permission. (See [[Commands]])
- Click on "Delete" to remove the data
- Click on "Restore" to restore the user data. If the user is online, their items and stats will be updated, otherwise they will be set to this data upon next login.
- Click on "Pin" to pin the user data. An indicator will appear in the data viewer and list marking the snapshot as being pinned.

## Save causes
Data save causes, marked with a 🚩 flag, indicate what caused the data to be saved.

- **disconnect**: Indicates data saved when a player disconnected from the server (either to change servers, or to log off)
- **world save**: Indicates data saved when the world saved. This can be turned off in `config.yml` by setting `save_on_world_save` to false under `synchronization`.
- **server shutdown**: Indicates data saved when the server shut down
- **inventory command**: Indicates data was saved by editing inventory contents via the `/inventory` command
- **enderchest command**: Indicates data was saved by editing Ender Chest contents via the `/enderchest` command
- **backup restore**: Indicates data was saved by restoring it from a previous version
- **api**: Indicates data was saved by an [[API]] call
- **mpdb migration**: Indicates data was saved from being imported from MySQLPlayerDataBridge (See [[MPDB Migration]])
- **legacy migration**: Indicates data was saved from being imported from a legacy version (v1.x - See [[Legacy Migration]])
- **unknown**: Indicates data was saved by an unknown cause.
Loading

0 comments on commit 2416d4e

Please sign in to comment.