Skip to content

Commit 7795099

Browse files
authored
Merge pull request #8 from TheMatrixNetwork/feature/matridex
Feature/matridex
2 parents 189afe1 + 2135142 commit 7795099

30 files changed

Lines changed: 740 additions & 309 deletions

.github/workflows/gradle.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ jobs:
5151

5252
runs-on: ubuntu-latest
5353

54+
services:
55+
mysql:
56+
image: mariadb:10.4
57+
env:
58+
MYSQL_ROOT_PASSWORD: root
59+
MYSQL_DATABASE: matrixstats
60+
ports:
61+
- 3306:3306
62+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10
63+
5464
steps:
5565
- name: Set up JDK 17
5666
uses: actions/setup-java@v1
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
{
2+
"info": {
3+
"_postman_id": "d58e2188-29a8-49ce-97cc-1498cabfb50f",
4+
"name": "MatrixStats",
5+
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
6+
},
7+
"item": [
8+
{
9+
"name": "Login",
10+
"event": [
11+
{
12+
"listen": "test",
13+
"script": {
14+
"exec": [
15+
"var jsonData = JSON.parse(responseBody);",
16+
"postman.setEnvironmentVariable(\"token\", jsonData.token);",
17+
"pm.environment.set(\"token\", jsonData.token);"
18+
],
19+
"type": "text/javascript"
20+
}
21+
}
22+
],
23+
"request": {
24+
"method": "POST",
25+
"header": [],
26+
"body": {
27+
"mode": "raw",
28+
"raw": "{\"username\":\"S1mple133\",\"password\":\"S1mple134\"}",
29+
"options": {
30+
"raw": {
31+
"language": "json"
32+
}
33+
}
34+
},
35+
"url": {
36+
"raw": "http://localhost:8081/api/auth",
37+
"protocol": "http",
38+
"host": [
39+
"localhost"
40+
],
41+
"port": "8081",
42+
"path": [
43+
"api",
44+
"auth"
45+
]
46+
}
47+
},
48+
"response": []
49+
},
50+
{
51+
"name": "Get Skin",
52+
"request": {
53+
"method": "GET",
54+
"header": []
55+
},
56+
"response": []
57+
},
58+
{
59+
"name": "Get Stats",
60+
"request": {
61+
"method": "GET",
62+
"header": [],
63+
"url": {
64+
"raw": "http://localhost:8081/api/stats/all",
65+
"protocol": "http",
66+
"host": [
67+
"localhost"
68+
],
69+
"port": "8081",
70+
"path": [
71+
"api",
72+
"stats",
73+
"all"
74+
]
75+
}
76+
},
77+
"response": []
78+
},
79+
{
80+
"name": "Get Latest Stats",
81+
"request": {
82+
"method": "GET",
83+
"header": [],
84+
"url": {
85+
"raw": "http://localhost:8081/api/stats/latest",
86+
"protocol": "http",
87+
"host": [
88+
"localhost"
89+
],
90+
"port": "8081",
91+
"path": [
92+
"api",
93+
"stats",
94+
"latest"
95+
]
96+
}
97+
},
98+
"response": []
99+
},
100+
{
101+
"name": "Get Kills",
102+
"request": {
103+
"method": "GET",
104+
"header": []
105+
},
106+
"response": []
107+
}
108+
],
109+
"auth": {
110+
"type": "apikey",
111+
"apikey": [
112+
{
113+
"key": "value",
114+
"value": "{{token}}",
115+
"type": "string"
116+
},
117+
{
118+
"key": "key",
119+
"value": "Authorization",
120+
"type": "string"
121+
}
122+
]
123+
},
124+
"event": [
125+
{
126+
"listen": "prerequest",
127+
"script": {
128+
"type": "text/javascript",
129+
"exec": [
130+
""
131+
]
132+
}
133+
},
134+
{
135+
"listen": "test",
136+
"script": {
137+
"type": "text/javascript",
138+
"exec": [
139+
""
140+
]
141+
}
142+
}
143+
],
144+
"variable": [
145+
{
146+
"key": "token",
147+
"value": "",
148+
"type": "default"
149+
}
150+
]
151+
}

Readme.md

Lines changed: 6 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,9 @@
1-
# Spigot Plugin Template
2-
3-
[![Build Status](https://github.com/Silthus/spigot-plugin-template/workflows/Build/badge.svg)](../../actions?query=workflow%3ABuild)
4-
[![GitHub release (latest SemVer including pre-releases)](https://img.shields.io/github/v/release/Silthus/spigot-plugin-template?include_prereleases&label=release)](../../releases)
5-
![Spiget tested server versions](https://img.shields.io/spiget/tested-versions/79903)
6-
[![Spiget Downloads](https://img.shields.io/spiget/downloads/79903)](https://www.spigotmc.org/resources/splugintemplate.79903/)
7-
[![Spiget Rating](https://img.shields.io/spiget/rating/79903)](https://www.spigotmc.org/resources/splugintemplate.79903/)
8-
[![codecov](https://codecov.io/gh/Silthus/spigot-plugin-template/branch/master/graph/badge.svg)](https://codecov.io/gh/Silthus/spigot-plugin-template)
9-
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
10-
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
11-
[![Discord Shield](https://discordapp.com/api/guilds/905798902874267690/widget.png?style=shield)](https://discord.gg/R4st4QxAjb)
12-
13-
You can use this template to develop your own high quality Spigot plugins using [Gradle](https://gradle.org/) with ease.
14-
15-
> See the [minecraft-server-template](https://github.com/Silthus/minecraft-server-template) for quick starting your Minecraft network in under 30 seconds.
16-
17-
* [Features](#features)
18-
* [Quickstart setup](#quickstart-setup)
19-
* [Releasing a new version of your plugin](#releasing-a-new-version-of-your-plugin)
20-
* [Commit message format](#commit-message-format)
21-
* [Publishing your maven package](#publishing-your-maven-package)
22-
* [About the group and artifactId](#about-the-group-and-artifactid)
23-
* [Github Package Authentication](#github-package-authentication)
24-
* [Debugging your plugin](#debugging-your-plugin)
25-
* [Copy your plugin automatically](#copy-your-plugin-automatically)
26-
* [Running and debugging the Minecraft server](#running-and-debugging-the-minecraft-server)
27-
* [References](#references)
28-
29-
## Features
30-
31-
The template or better boilerplate comes with a lot of features that are useful if you want to develop high quality plugins. However you don't need to use all of them, you can simply remove the features you don't need.
32-
33-
* Ready to use [**Gradle**](https://gradle.org/) project with lots of utility tasks
34-
* Automatic **generation of `plugin.yaml`** based of project properties with [SpiGradle](https://github.com/EntryPointKR/Spigradle/)
35-
* Integrated [**Spigot test server**](https://github.com/EntryPointKR/Spigradle/) with a one click build, copy plugin and start debugging in IntelliJ task
36-
* [**Gradle shadow plugin**](https://imperceptiblethoughts.com/shadow/) to easily ship your needed dependencies with your plugin
37-
* Example integrations including tests for the [Annotation Command Framework](https://github.com/aikar/commands/) and [Vault](https://github.com/MilkBowl/VaultAPI).
38-
* **[JUnit 5](https://junit.org/junit5/docs/current/user-guide/)** test setup including [MockBukkit](https://github.com/seeseemelk/MockBukkit) and [AssertJ](https://joel-costigliola.github.io/assertj/)
39-
* **[Jacoco](https://github.com/jacoco/jacoco) code coverage** report including an upload task to [codecov](https://codecov.io/)
40-
* Fully integrated [**semantic-release**](https://semantic-release.gitbook.io/semantic-release/) release pipeline
41-
* Automatic [**changelog generation**](https://github.com/semantic-release/changelog) based on [conventional commit messages](https://www.conventionalcommits.org/)
42-
* [**Github Actions**](https://github.com/features/actions) workflow for build and release
43-
* Publishing of **maven artifacts** to [GitHub Packages](https://github.com/features/packages)
44-
> no more need for self hosted nexus or artifactory server
45-
* GitHub [**issue templates**](https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository) for bug and feature requests
46-
* Contributing and Code of Conduct **guidelines**
47-
* Nice [**badges**](https://shields.io) to show of your project
48-
49-
## Quickstart setup
50-
51-
* Create a [new Github project](https://github.com/Silthus/spigot-plugin-template/generate) using this template.
52-
* **Clone** the new repository and open it in IntelliJ.
53-
* **Update** the **gradle.properties** file and change the following variables:
54-
* `group`: your-maven-group-id (e.g.: io.github.silthus)
55-
* `pluginName`: YourPluginName
56-
* `author`: YourName
57-
* **Update** the `root.projectName` inside **settings.gradle**. This will be your `artifactId`.
58-
* **Delete** the `CHANGELOG.md`. It will be generated on your [first release](#releasing-a-new-version-of-your-plugin).
59-
* **Update** the `README` to point to your project and spigot resource id.
60-
* **Rename** the java package and plugin to match your project.
61-
* Then execute the `prepareSpigotPlugins` gradle task this will try to download all plugin denpendencies and puts them into `debug/spigot/plugins/`.
62-
* **Start** the Minecraft server by executing the `debugPaper` task. This will start the server in the background and you can connect to it using the `localhost:25565` address.
63-
* **Code away :)** - *and once you are ready, push your commit (in [conventional commit style](#commit-message-format)) to master.*
64-
65-
![Gradle tasks](docs/gradle-tasks.png)
66-
67-
Please read the [Contributing Guidelines](CONTRIBUTING.md) before submitting any pull requests or opening issues.
68-
69-
> **NOTE**
70-
> You might need to run the `gradle clean` task after renaming the packages and reimport the gradle project to resolve errors with generating the `plugin.yml`.
71-
72-
## Releasing a new version of your plugin
73-
74-
One of the major benefits of this template is the fact that it will **automatically release a new version** on every push to `master` based on your commit messages. This makes sure your plugin is released following the [semantic versioning](https://semver.org/) guidelines. For this to work you have to follow a few simple rules:
75-
76-
* Commit only working and tested code to the master branch. *Use Pull Requests to work on bigger features or bug fixes and merge them when you are ready.*
77-
* Every bugfix, feature and change should have one commit associated with it. *Do not mix multiple bugs, features, etc. into one huge commit message. Keep your commit size small and commit often.*
78-
* Your commit messages must follow the [conventional commit rules](https://www.conventionalcommits.org/).
1+
# MatrixStats2
2+
3+
[![Build Status](https://github.com/TheMatrixNetwork/MatrixStats2/workflows/Build/badge.svg)](../../actions?query=workflow%3ABuild)
4+
[![GitHub release (latest SemVer including pre-releases)](https://img.shields.io/github/v/release/TheMatrixNetwork/MatrixStats2?include_prereleases&label=release)](../../releases)
5+
6+
Minecraft plugin which provides player stats to an angular frontend. The stats can be accessed by players by logging in using their in-game credentials. (AuthMe)
797

808
### Commit message format
819

@@ -151,44 +79,6 @@ Refs #133
15179

15280
</details>
15381

154-
## Publishing your maven package
155-
156-
Your plugin will be automatically published as a maven package on [Github packages](https://github.com/features/packages) as soon as you [release a new version](#releasing-a-new-version-of-your-plugin).
157-
158-
### About the group and artifactId
159-
160-
The `group` appended by your `artifactId` is used to uniquely identify your project when importing it in other projects. When you import spigot in your project you use the group `org.spigotmc` followed by the artifactId `spigot-api` and the version.
161-
162-
The following was taken from the [offical maven naming guide](https://maven.apache.org/guides/mini/guide-naming-conventions.html).
163-
164-
* `groupId` uniquely identifies your project across all projects. A group ID should follow [Java's package name rules](https://docs.oracle.com/javase/specs/jls/se6/html/packages.html#7.7). This means it starts with a reversed domain name you control. For example: `org.apache.maven`, `org.apache.commons`.
165-
If you dont't own a domain, you can use the github domain `io.github` appended by your Github username, e.g. `io.github.silthus`
166-
* `artifactId` is the name of the jar without version. If you created it, then you can choose whatever name you want with lowercase letters and no strange symbols. For example: `maven, commons-math
167-
168-
### Github Package Authentication
169-
170-
You need to configure [authentication for Github Packages](https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-gradle-for-use-with-github-packages#authenticating-to-github-packages) if you want to use your maven package in other projects.
171-
172-
1. [Create a Github Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line)
173-
2. Create or update the `gradle.properties` inside `C:\Users\%username%\.gradle` with the following and replace `YOUR_GITHUB_USERNAME` with your Github username and `YOUR_PERSONAL_ACCESS_TOKEN` with the access token from step 1.
174-
175-
```properties
176-
gpr.user=YOUR_GITHUB_USERNAME
177-
gpr.key=YOUR_PERSONAL_ACCESS_TOKEN
178-
```
179-
180-
## Debugging your plugin
181-
182-
### Copy your plugin automatically
183-
184-
You can export your plugin to the plugins directory from your working directory with the Gradle **prepareSpigotPlugins** task. The task will **build and copy** your plugin **automatically** into the `plugins/` directory.
185-
186-
### Running and debugging the Minecraft server
187-
188-
You can run or debug your plugin using the `Server` run configuration from within IntelliJ to automatically download the Minecraft server, built it, copy your and dependent plugins into it and start it in debugging mode.
189-
190-
This is due to the awesome power of Spigradle's debug tasks. Find out more on the [Spigradle Github page](https://github.com/spigradle/spigradle).
191-
19282
## References
19383

19484
* [Spigradle](https://github.com/spigradle/spigradle/): *provides awesome gradle tasks that make your live a lot easier*

build.gradle

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,16 @@ dependencies {
7777
exclude group: 'org.bukkit', module: 'bukkit'
7878
}
7979

80-
implementation("org.glassfish.jersey.containers:jersey-container-jdk-http:2.25")
80+
implementation("org.glassfish.jersey.containers:jersey-container-jdk-http:2.27")
81+
implementation("org.glassfish.jersey.media:jersey-media-json-jackson:2.27")
82+
implementation("org.glassfish.jersey.inject:jersey-hk2:2.28")
8183
implementation("com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.7.5")
8284
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.2")
85+
86+
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.20.0'
87+
88+
testImplementation group: 'org.slf4j', name: 'slf4j-jdk14', version: '2.0.0-alpha0'
89+
8390
implementation("org.hibernate:hibernate-core:5.3.23.Final")
8491
implementation("mysql:mysql-connector-java:8.0.27")
8592
implementation("com.google.inject:guice:4.0")
@@ -99,8 +106,9 @@ dependencies {
99106
// Test dependencies
100107
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2'
101108
testImplementation 'org.mockito:mockito-core:4.11.0'
102-
testImplementation 'com.github.seeseemelk:MockBukkit-v1.19:2.144.3'
109+
testImplementation 'com.github.seeseemelk:MockBukkit-v1.19:2.147.1'
103110
testImplementation 'org.assertj:assertj-core:3.24.1'
111+
testImplementation("com.github.MilkBowl:VaultAPI:1.7")
104112
}
105113

106114
shadowJar {

frontend/src/app/app.module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ import {CookieModule} from "ngx-cookie";
1313
import {JWT_OPTIONS, JwtHelperService} from "@auth0/angular-jwt";
1414
import {NgOptimizedImage} from "@angular/common";
1515
import {AddHeaderInterceptor} from "./interceptor/backend-interceptor";
16+
import { PlayerStatusComponent } from './components/player-status/player-status.component';
1617

1718
@NgModule({
1819
declarations: [
1920
AppComponent,
2021
LoginComponent,
21-
HomeComponent
22+
HomeComponent,
23+
PlayerStatusComponent
2224
],
2325
imports: [
2426
BrowserModule,

0 commit comments

Comments
 (0)