Skip to content

Commit

Permalink
feat: added velocity
Browse files Browse the repository at this point in the history
  • Loading branch information
confuser committed Jun 6, 2024
1 parent 595029d commit 34a06f4
Show file tree
Hide file tree
Showing 19 changed files with 132 additions and 57 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ on:
jobs:
build:
runs-on: ubuntu-latest
name: Node.js ${{ matrix.java }} - ${{ matrix.storageType }}
name: Node.js ${{ matrix.node-version }} - ${{ matrix.storageType }}
strategy:
matrix:
node-version: [16.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { Code } from 'components/code'
const downloadUrls = {
BungeeCord: 'https://ci.frostcast.net/job/BanManager/lastSuccessfulBuild/artifact/bungee/build/libs/BanManagerBungeeCord.jar',
Sponge: 'https://ore.spongepowered.org/confuser/BanManager/versions',
'CraftBukkit/Spigot/Paper': 'https://dev.bukkit.org/projects/ban-management/files/latest'
'CraftBukkit/Spigot/Paper': 'https://dev.bukkit.org/projects/ban-management/files/latest',
Velocity: 'https://ci.frostcast.net/job/BanManager/lastSuccessfulBuild/artifact/velocity/build/libs/BanManagerVelocity.jar'
}

export const FinalStage = ({ currentState, configYaml }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const machine = createMachine({
actions: setContext('networkType')
},
Velocity: {
target: 'serverType',
target: 'storageType',
actions: setContext('networkType')
}
}
Expand Down Expand Up @@ -119,7 +119,7 @@ export const machine = createMachine({
H2: {
target: 'success',
actions: setContext('storageType'),
cond: (context) => context.syncType !== 'INDIVIDUAL' && (!context.networkType || context.networkType === 'BUNGEECORD')
cond: (context) => context.syncType !== 'INDIVIDUAL' && (!context.networkType || context.networkType === 'BUNGEECORD' || context.networkType === 'VELOCITY')
}
}
},
Expand Down
16 changes: 10 additions & 6 deletions components/pages/docs/banmanager/developers/get-static-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@ async function getEvents () {
}

export async function getStaticProps () {
const versions = {
bukkit: await getLatestRelease('BanManagerBukkit'),
bungeecord: await getLatestRelease('BanManagerBungeeCord'),
common: await getLatestRelease('BanManagerCommon'),
sponge: await getLatestRelease('BanManagerSponge')
}

versions.velocity = versions.bungeecord

return {
props: {
versions: {
bukkit: await getLatestRelease('BanManagerBukkit'),
bungeecord: await getLatestRelease('BanManagerBungeeCord'),
common: await getLatestRelease('BanManagerCommon'),
sponge: await getLatestRelease('BanManagerSponge')
},
versions,
events: await getEvents()
},
revalidate: 3600 // Cache for an hour
Expand Down
18 changes: 11 additions & 7 deletions components/pages/download/download-card.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
import PropTypes from 'prop-types'
import Image from 'next/image'
import { FaDownload } from 'react-icons/fa'
import clsx from 'clsx'

const styles = {
image: 'h-32 w-full relative',
image: 'h-32 w-full',
card: 'pt-8 pb-8 rounded overflow-hidden shadow-lg bg-white mx-auto'
}

export const DownloadCard = ({ title, imgSrc, description, stableUrl, experimentalUrl, coverImage, size = 'sm', children }) => (
export const DownloadCard = ({ title, imgSrc, description, stableUrl, experimentalUrl, coverImage, size = 'sm', children, showDisabledDownload }) => (
<div className="p-2 sm:p-4 text-center">
<div className={`${styles.card} max-w-${size}`}>
<div className="px-6">
<div className="space-y-5">
<div className="space-y-1">
<div>
<Image className={`${styles.image} ${coverImage ? 'object-cover' : ''}`} src={imgSrc} height="100" width="100" unoptimized alt={`${title} logo`} />
</div>
<div className="font-bold text-xl mb-2">{title}</div>
<p className="text-gray-700 text-base sm:h-16 md:h-12">
{description}
</p>
{stableUrl && <a
{(showDisabledDownload || stableUrl) && <a
href={stableUrl}
className="py-3 px-4 text-white bg-primary-500 hover:bg-primary-800 rounded-lg shadow inline-flex items-center"
className={clsx('py-3 px-4 text-white bg-primary-500 hover:bg-primary-800 rounded-lg shadow inline-flex items-center', {
'bg-primary-100 hover:bg-primary-100': !stableUrl
})}
>
<FaDownload className="fill-current w-4 h-4 mr-2" />
<span>Download</span>
</a>
}
{stableUrl && experimentalUrl && <br />}
{(showDisabledDownload || (stableUrl && experimentalUrl)) && <br />}
{experimentalUrl && <a
href={experimentalUrl}
className="py-3 px-4 hover:bg-gray-200 font-bold rounded-lg shadow inline-flex items-center"
Expand All @@ -51,5 +54,6 @@ DownloadCard.propTypes = {
stableUrl: PropTypes.string,
experimentalUrl: PropTypes.string,
children: PropTypes.node,
size: PropTypes.oneOf(['sm', 'md', 'lg'])
size: PropTypes.oneOf(['sm', 'md', 'lg']),
showDisabledDownload: PropTypes.bool
}
11 changes: 11 additions & 0 deletions pages/docs/banmanager/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ To make use of BanManager's API, simply add the relevant build as a Maven depend
</dependencies>`}
</Code>

#### Velocity
<Code>{`<dependencies>
<dependency>
<groupId>me.confuser.banmanager</groupId>
<artifactId>BanManagerVelocity</artifactId>
<version>${props.versions.velocity}</version>
<scope>provided</scope>
</dependency>
</dependencies>`}
</Code>

## BmAPI

This is a static API class for BanManager to create and manipulate punishments.
Expand Down
1 change: 1 addition & 0 deletions pages/docs/banmanager/configuration/config-yml.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The main configuration file for BanManager.
| CraftBukkit/Spigot/Paper | `/plugins/BanManager/config.yml` |
| BungeeCord | `/plugins/BanManager/config.yml` |
| Sponge | `/config/banmanager/config.yml` |
| Velocity | `/plugins/BanManager/config.yml` |

<div className="config-info">

Expand Down
1 change: 1 addition & 0 deletions pages/docs/banmanager/configuration/console-yml.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Defines properties to identify punishments issued via the console.
| CraftBukkit/Spigot/Paper | `/plugins/BanManager/console.yml` |
| BungeeCord | `/plugins/BanManager/console.yml` |
| Sponge | `/config/banmanager/console.yml` |
| Velocity | `/plugins/BanManager/console.yml` |

###### `name` - The actor name of punishments issued by the console, e.g. X banned by <name\>

Expand Down
1 change: 1 addition & 0 deletions pages/docs/banmanager/configuration/discord-yml.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Allows sending messages to Discord server channels when a punishment occurs. Buk
| CraftBukkit/Spigot/Paper | `/plugins/BanManager/discord.yml` |
| BungeeCord | Unsupported |
| Sponge | `/config/banmanager/discord.yml` |
| Velocity | Unsupported |

<div className="config-info">

Expand Down
1 change: 1 addition & 0 deletions pages/docs/banmanager/configuration/exemptions-yml.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Players listed here are exempt from certain punishments even when offline. This
| CraftBukkit/Spigot/Paper | `/plugins/BanManager/exemptions.yml` |
| BungeeCord | `/plugins/BanManager/exemptions.yml` |
| Sponge | `/config/banmanager/exemptions.yml` |
| Velocity | `/plugins/BanManager/exemptions.yml` |

<div className="config-info">

Expand Down
1 change: 1 addition & 0 deletions pages/docs/banmanager/configuration/geoip-yml.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Please note this now requires a license key from MaxMind. Please follow [these i
| CraftBukkit/Spigot/Paper | `/plugins/BanManager/geoip.yml` |
| BungeeCord | `/plugins/BanManager/geoip.yml` |
| Sponge | `/config/banmanager/geoip.yml` |
| Velocity | `/plugins/BanManager/geoip.yml` |

<div className="config-info">

Expand Down
1 change: 1 addition & 0 deletions pages/docs/banmanager/configuration/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The configuration files for BanManager can be found at the following locations:
| CraftBukkit/Spigot/Paper | `/plugins/BanManager/` |
| BungeeCord | `/plugins/BanManager/` |
| Sponge | `/config/banmanager/` |
| Velocity | `/plugins/BanManager/` |

## Files
- [config.yml](/docs/banmanager/configuration/config-yml)
Expand Down
1 change: 1 addition & 0 deletions pages/docs/banmanager/configuration/messages-yml.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Messages support [JSON](https://minecraft.fandom.com/wiki/Raw_JSON_text_format)
| CraftBukkit/Spigot/Paper | `/plugins/BanManager/messages.yml` |
| BungeeCord | `/plugins/BanManager/messages.yml` |
| Sponge | `/config/banmanager/messages.yml` |
| Velocity | `/plugins/BanManager/messages.yml` |

<div className="config-info">

Expand Down
1 change: 1 addition & 0 deletions pages/docs/banmanager/configuration/reasons-yml.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ You can combine multiple shortcuts or append/prepend them to reasons, e.g. `/ban
| CraftBukkit/Spigot/Paper | `/plugins/BanManager/reasons.yml` |
| BungeeCord | `/plugins/BanManager/reasons.yml` |
| Sponge | `/config/banmanager/reasons.yml` |
| Velocity | `/plugins/BanManager/reasons.yml` |

<div className="config-info">

Expand Down
1 change: 1 addition & 0 deletions pages/docs/banmanager/configuration/schedules-yml.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Controls how often data is synced between the database and Minecraft server to p
| CraftBukkit/Spigot/Paper | `/plugins/BanManager/schedules.yml` |
| BungeeCord | `/plugins/BanManager/schedules.yml` |
| Sponge | `/config/banmanager/schedules.yml` |
| Velocity | `/plugins/BanManager/schedules.yml` |

<div className="config-info">

Expand Down
12 changes: 6 additions & 6 deletions pages/docs/banmanager/install-network.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ A full guide for installing, configuring and running BanManager for use on a Min

---

## Option 1 - BungeeCord
**Requirement:** you're using BungeeCord and would like punishments to be **shared across every Minecraft server**
## Option 1 - BungeeCord or Velocity
**Requirement:** you're using BungeeCord or Velocity and would like punishments to be **shared across every Minecraft server**

### Initial Setup
1. Download the BanManager BungeeCord jar from our [downloads page](/download) and save it in an easily accessible location
1. Copy the BanManager jar file to your BungeeCord proxy's `plugins` folder
1. Fully restart your BungeeCord proxy
1. Download the BanManager BungeeCord or Velocity jar from our [downloads page](/download) and save it in an easily accessible location
1. Copy the BanManager jar file to your proxy's `plugins` folder
1. Fully restart your proxy
* This is required to generate the default configuration files and enable BanManager
1. Check your server logs to confirm BanManager enables correctly

## Option 2 - Alternative networks
**Requirement:** you're using a proxy such as LilyPad and would like punishments to be **shared across every Minecraft server**

Currently only BungeeCord has first class support, however alternative networks such as LilyPad *are supported* by installing BanManager on each Minecraft instance (CraftBukkit/Spigot/Paper/Sponge) using the same shared database to sync data.
Currently only BungeeCord & Velocity have first class support, however alternative networks such as LilyPad *are supported* by installing BanManager on each Minecraft instance (CraftBukkit/Spigot/Paper/Sponge) using the same shared database to sync data.

### Prerequisites
- MySQL or MariaDB
Expand Down
15 changes: 10 additions & 5 deletions pages/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,22 @@ function DownloadPage ({ release }) {
<Layout title="Download" description="Download BanManager for your Minecraft server, supporting Bukkit, Craftbukkit, Spigot, PaperMC, Sponge, BungeeCord and more!">
<PageHeader>Download</PageHeader>
<DownloadSection title="BanManager" subTitle="Minecraft plugin">
<div className="grid grid-cols-1 lg:grid-cols-4">
<div className="grid grid-cols-1 lg:grid-cols-5">
<div className="p-2 text-center">
<h4 className="text-xl font-bold leading-7">{release.version}</h4>
<p className="text-sm">{formatDistanceToNowStrict(new Date(release.publishedAt))} ago</p>
<ul className="pt-3 list-disc text-left overflow-auto max-h-96 pl-4">
{release.changelog.map((change, i) => <li key={i}>{change}</li>)}
</ul>
</div>
<DownloadCard title="Bukkit" description="CraftBukkit/Spigot/Paper etc, 1.7.2+" imgSrc="/images/bukkit-logo.png" stableUrl={release.downloadUrls.bukkit} experimentalUrl="https://ci.frostcast.net/job/BanManager/lastSuccessfulBuild/artifact/bukkit/build/libs/BanManagerBukkit.jar" />
<DownloadCard title="BungeeCord" description="Latest build" imgSrc="/images/bungeecord-logo.png" stableUrl={release.downloadUrls.bungeecord} experimentalUrl="https://ci.frostcast.net/job/BanManager/lastSuccessfulBuild/artifact/bungee/build/libs/BanManagerBungeeCord.jar" />
<DownloadCard title="Sponge" description="Sponge Forge/Sponge Vanilla API 7+" imgSrc="/images/sponge-logo.svg" stableUrl={release.downloadUrls.sponge} experimentalUrl="https://ci.frostcast.net/job/BanManager/lastSuccessfulBuild/artifact/sponge/build/libs/BanManagerSponge.jar" />
<div className="lg:col-span-4">
<div className="grid lg:grid-cols-2">
<DownloadCard title="Bukkit" description="CraftBukkit/Spigot/Paper etc, 1.7.2+" imgSrc="/images/bukkit-logo.png" stableUrl={release.downloadUrls.bukkit} experimentalUrl="https://ci.frostcast.net/job/BanManager/lastSuccessfulBuild/artifact/bukkit/build/libs/BanManagerBukkit.jar" />
<DownloadCard title="BungeeCord" description="Latest build" imgSrc="/images/bungeecord-logo.png" stableUrl={release.downloadUrls.bungeecord} experimentalUrl="https://ci.frostcast.net/job/BanManager/lastSuccessfulBuild/artifact/bungee/build/libs/BanManagerBungeeCord.jar" />
<DownloadCard title="Sponge" description="Sponge Forge/Sponge Vanilla API 7+" imgSrc="/images/sponge-logo.svg" stableUrl={release.downloadUrls.sponge} experimentalUrl="https://ci.frostcast.net/job/BanManager/lastSuccessfulBuild/artifact/sponge/build/libs/BanManagerSponge.jar" />
<DownloadCard title="Velocity" description="Latest build" imgSrc="/images/velocity-logo.svg" stableUrl={release.downloadUrls.velocity} experimentalUrl="https://ci.frostcast.net/job/BanManager/lastSuccessfulBuild/artifact/velocity/build/libs/BanManagerVelocity.jar" showDisabledDownload />
</div>
</div>
</div>
</DownloadSection>
<hr className="max-w-7xl mx-auto mt-12" />
Expand All @@ -86,7 +91,7 @@ function DownloadPage ({ release }) {
Demo
</a>
<a
href="/docs"
href="/docs/webui/install"
className="py-3 px-4 text-white bg-primary-500 hover:bg-primary-800 rounded-lg shadow inline-flex items-center ml-4"
>
<FaCog className="fill-current w-4 h-4 mr-2" />
Expand Down
Loading

0 comments on commit 34a06f4

Please sign in to comment.