Finally fix default port displaying and added better Jenkins messages

This commit is contained in:
rtm516 2020-10-25 14:38:40 +00:00
parent efdff4ee8e
commit 45769d6e75
No known key found for this signature in database
GPG key ID: 331715B8B007C67A
3 changed files with 35 additions and 18 deletions

33
Jenkinsfile vendored
View file

@ -32,9 +32,40 @@ pipeline {
post { post {
always { always {
script {
def changeLogSets = currentBuild.changeSets
def message = "**Changes:**"
if (changeLogSets.size() == 0) {
message += "\n*No changes.*"
} else {
def repositoryUrl = scm.userRemoteConfigs[0].url.replace(".git", "")
def count = 0;
def extra = 0;
for (int i = 0; i < changeLogSets.size(); i++) {
def entries = changeLogSets[i].items
for (int j = 0; j < entries.length; j++) {
if (count <= 10) {
def entry = entries[j]
def commitId = entry.commitId.substring(0, 6)
message += "\n - [`${commitId}`](${repositoryUrl}/commit/${entry.commitId}) ${entry.msg}"
count++
} else {
extra++;
}
}
}
if (extra != 0) {
message += "\n - ${extra} more commits"
}
}
env.changes = message
}
deleteDir() deleteDir()
withCredentials([string(credentialsId: 'geyser-discord-webhook', variable: 'DISCORD_WEBHOOK')]) { withCredentials([string(credentialsId: 'geyser-discord-webhook', variable: 'DISCORD_WEBHOOK')]) {
discordSend description: "**Build:** [${currentBuild.id}](${env.BUILD_URL})\n**Status:** [${currentBuild.currentResult}](${env.BUILD_URL})\n\n[**Artifacts on Jenkins**](https://ci.nukkitx.com/job/GeyserMC/job/GeyserConnect)", footer: 'NukkitX Jenkins', link: env.BUILD_URL, successful: currentBuild.resultIsBetterOrEqualTo('SUCCESS'), title: "${env.JOB_NAME} #${currentBuild.id}", webhookURL: DISCORD_WEBHOOK discordSend description: "**Build:** [${currentBuild.id}](${env.BUILD_URL})\n**Status:** [${currentBuild.currentResult}](${env.BUILD_URL})\n${changes}\n\n[**Artifacts on Jenkins**](https://ci.nukkitx.com/job/GeyserMC/job/GeyserConnect)", footer: 'Cloudburst Jenkins', link: env.BUILD_URL, successful: currentBuild.resultIsBetterOrEqualTo('SUCCESS'), title: "${env.JOB_NAME} #${currentBuild.id}", webhookURL: DISCORD_WEBHOOK
} }
} }
} }

View file

@ -17,17 +17,3 @@ GeyserConnect is a server that Minecraft: Bedrock Edition clients can connect to
If you wish to run this in docker and/or use DNS redirection please see the appropriate folders in this repo. If you wish to run this in docker and/or use DNS redirection please see the appropriate folders in this repo.
#### Docker: [here](docker) #### Docker: [here](docker)
#### DNS: [here](bind9) #### DNS: [here](bind9)
## TODO
- [x] Auto start Geyser instance
- [x] Transfer player to Geyser instance and connect to correct server
- [x] Server list
- [x] View
- [x] Add
- [x] Remove
- [x] Edit
- [x] Stop Geyser server after its idle for a while
- [x] Config file
- [x] Fix server images not loading straight away on Win10
- [x] Per server online/offline mode
- [x] Add option to add a bedrock server

View file

@ -35,13 +35,13 @@ import lombok.NoArgsConstructor;
public class Server { public class Server {
private String address; private String address;
private int port = 25565; private int port = -1;
private boolean online = true; private boolean online = true;
private boolean bedrock = false; private boolean bedrock = false;
private String name = null; private String name = null;
public Server(String address) { public Server(String address) {
this(address, 25565); this(address, -1);
} }
public Server(String address, int port) { public Server(String address, int port) {
@ -62,6 +62,6 @@ public class Server {
@Override @Override
public String toString() { public String toString() {
return name != null ? name : address + (port != defaultPort() ? ":" + port : ""); return name != null ? name : address + (getPort() != defaultPort() ? ":" + getPort() : "");
} }
} }