diff --git a/.gitea/ISSUE_TEMPLATE/bug-report.yaml b/.gitea/ISSUE_TEMPLATE/bug-report.yaml new file mode 100644 index 00000000..7ce1c896 --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/bug-report.yaml @@ -0,0 +1,60 @@ +name: Bug Report +about: Du hast einen Fehler gefunden? Melde ihn hier! +labels: [ "typ/bug" ] +body: + - type: markdown + attributes: + value: | + ACHTUNG: Sollte es bei dem Bug ein Sicherheitsrisiko geben, melde es bitte auf unserem Discord Server + - type: textarea + id: description + attributes: + label: Description + description: | + Beschreibe deinen Bug in kurzer Form. + - type: input + id: mc-ver + attributes: + label: Minecraft Version + description: Minecraft Version des Clients + validations: + required: true + - type: input + id: mc-ver-ser + attributes: + label: Minecraft Version Server + description: Minecraft Version des Servers, nur bei Bau oder Arenen Servern + - type: dropdown + id: can-reproduce + attributes: + label: Kannst du den Fehler wiederholen? + description: | + Wenn du den Fehler wiederholen kannst, können wir dieses Problem schneller beheben. + Solltest du den Fehler nicht wiederholen können, melde dich bitte auf unserem Discord Server. + options: + - "Yes" + - "No" + validations: + required: true + - type: textarea + id: reproduce-steps + attributes: + label: Wie kannst du den Fehler wiederholen? + description: Welche Schritte musst du ausführen, um den Fehler wiederholen zu können? + validations: + required: true + - type: textarea + id: expected-result + attributes: + label: Was sollte passieren? + description: Was sollte hier deiner Erwartung nach passieren? + - type: input + id: logs + attributes: + label: Auf welchem Server ist der Fehler aufgetreten? + description: Gebe bitte den Namen des Servers an, auf dem der Fehler aufgetreten ist. z.B. "Lobby", "Lixfels Bauserver" etc. + - type: textarea + id: screenshots + attributes: + label: Screenshots + description: Sollte es ein Visuelles Problem geben, kannst du hier Screenshots hinzufügen. \ No newline at end of file diff --git a/.gitea/ISSUE_TEMPLATE/config.yml b/.gitea/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..a49eab2f --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: true \ No newline at end of file diff --git a/.gitea/ISSUE_TEMPLATE/feature-request.yaml b/.gitea/ISSUE_TEMPLATE/feature-request.yaml new file mode 100644 index 00000000..fb8c2a5f --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/feature-request.yaml @@ -0,0 +1,17 @@ +name: Feature Idee +about: Du hast eine Idee für ein neues Feature, welches SteamWar nicht hat? Stelle sie hier vor. +labels: ["typ/idee"] +body: + - type: textarea + id: description + attributes: + label: Feature Beschreibung + placeholder: | + Ich glaube, dass ... + validations: + required: true + - type: textarea + id: screenshots + attributes: + label: Screenshots + description: Wenn es sich um etwas grafisches handelt, kannst du hier Screenshots hinzufügen. \ No newline at end of file diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 09fa125d..21c988f5 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -67,6 +67,7 @@ jobs: cp "VelocityCore/Dependencies/build/libs/Dependencies-all.jar" "deploy/DependenciesVelocityCore.jar" cp "VelocityCore/build/libs/VelocityCore-all.jar" "deploy/VelocityCore.jar" cp "WebsiteBackend/build/libs/WebsiteBackend-all.jar" "deploy/website-api.jar" + cp "CLI/build/distributions/sw.zip" "deploy/sw.zip" - name: Upload deploy artifacts uses: actions/upload-artifact@v3 @@ -130,3 +131,15 @@ jobs: ssh -i ~/.ssh/deploy_key -p "$port" "${DEPLOY_USER}@${DEPLOY_HOST}" "mkdir -p '$DEPLOY_PATH'" scp -i ~/.ssh/deploy_key -P "$port" deploy/* "${DEPLOY_USER}@${DEPLOY_HOST}:$DEPLOY_PATH/" + - name: Restart Services + shell: bash + env: + DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} + DEPLOY_USER: ${{ secrets.DEPLOY_USER }} + DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }} + DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }} + run: | + set -euo pipefail + + ssh -i ~/.ssh/deploy_key -p "$DEPLOY_PORT" "${DEPLOY_USER}@${DEPLOY_HOST}" "sudo systemctl restart api.service" + ssh -i ~/.ssh/deploy_key -p "$DEPLOY_PORT" "${DEPLOY_USER}@${DEPLOY_HOST}" "unzip -o /jars/current/sw.zip -d /jars" diff --git a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/DiscordChannel.java b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/DiscordChannel.java index 4922d69b..799b3638 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/DiscordChannel.java +++ b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/DiscordChannel.java @@ -26,6 +26,7 @@ import de.steamwar.velocitycore.discord.DiscordBot; import de.steamwar.velocitycore.discord.listeners.ChannelListener; import lombok.AllArgsConstructor; import lombok.Getter; +import net.dv8tion.jda.api.entities.Member; import net.dv8tion.jda.api.entities.User; import net.dv8tion.jda.api.entities.Webhook; import net.dv8tion.jda.api.entities.WebhookClient; @@ -104,10 +105,16 @@ public class DiscordChannel extends Chatter.PlayerlessChatter { return; } - String avatarUrl; + String avatarUrl = null; if (user.getDiscordId() != null) { - avatarUrl = DiscordBot.getGuild().retrieveMemberById(user.getDiscordId()).complete().getEffectiveAvatarUrl(); - } else { + Member member = DiscordBot.getGuild().retrieveMemberById(user.getDiscordId()) + .onErrorMap(throwable -> null) + .complete(); + if (member != null) { + avatarUrl = member.getEffectiveAvatarUrl(); + } + } + if (avatarUrl == null) { avatarUrl = DiscordBot.getInstance().getJda().getSelfUser().getAvatarUrl(); }