From 14db2a31e8089cc80e8333f4b634f9363f3929ed Mon Sep 17 00:00:00 2001 From: HappyTanuki Date: Sun, 2 Feb 2025 23:55:47 +0900 Subject: [PATCH] =?UTF-8?q?=EC=99=80=20=EC=9D=B4=EC=A0=9C=20=EC=A7=84?= =?UTF-8?q?=EC=A7=9C=20=EC=A7=84=EC=A7=9C=20=EB=B2=84=EA=B7=B8=20=EB=8B=A4?= =?UTF-8?q?=20=EA=B3=A0=EC=B9=9C=20=EB=93=AF=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BuildDockerAndUpload.sh | 6 ++ include/Audio/MusicPlayManager.hpp | 9 +- include/Commands/BumbleBeeCommand.hpp | 6 +- include/Queue/MusicQueue.hpp | 29 +++---- include/Queue/MusicQueueElement.hpp | 5 +- include/Settings/SettingsManager.hpp | 5 +- include/Utils/AsyncDownloadManager.hpp | 6 +- include/Utils/ConsoleUtils.hpp | 6 +- .../Utils/QueuedMusicListEmbedProvider.hpp | 84 +++++++++++++++++++ include/Utils/VersionsCheckUtils.hpp | 5 +- src/Audio/MusicPlayManager.cpp | 32 +++---- src/Commands/Play.cpp | 57 +++++++++---- src/Commands/Queue.cpp | 47 +++++++---- src/Commands/Skip.cpp | 7 +- src/Queue/MusicQueue.cpp | 25 ++++-- 15 files changed, 219 insertions(+), 110 deletions(-) create mode 100644 include/Utils/QueuedMusicListEmbedProvider.hpp diff --git a/BuildDockerAndUpload.sh b/BuildDockerAndUpload.sh index 2ea7011..05b27b5 100755 --- a/BuildDockerAndUpload.sh +++ b/BuildDockerAndUpload.sh @@ -1,4 +1,10 @@ #!/bin/bash +if [ "$(id -u)" -ne 0 ]; then + exec sudo "$0" "$@" +fi +cd build +cmake .. && make +cd .. cat password | docker login -u happytanuki12 --password-stdin docker build --tag happytanuki12/bumblebee:latest . docker push happytanuki12/bumblebee:latest \ No newline at end of file diff --git a/include/Audio/MusicPlayManager.hpp b/include/Audio/MusicPlayManager.hpp index 497076c..d4da2a3 100644 --- a/include/Audio/MusicPlayManager.hpp +++ b/include/Audio/MusicPlayManager.hpp @@ -1,6 +1,4 @@ #pragma once -#ifndef _MUSICPLAYMANAGER_HPP_ -#define _MUSICPLAYMANAGER_HPP_ #include #include #include @@ -50,7 +48,7 @@ public: void setRepeat(const dpp::snowflake guildId, const bool value); bool getRepeat(const dpp::snowflake guildId); - std::list getQueue(const dpp::snowflake guildId); + std::pair>>, std::list>::iterator> getQueue(const dpp::snowflake guildId); MusicQueueElement getNowPlaying(const dpp::snowflake guildId); std::condition_variable queuedCondition; @@ -63,7 +61,6 @@ private: std::unordered_map> queueEmptyMutex; - void send_audio_to_voice(const MusicQueueElement& music, dpp::discord_voice_client* client); + void send_audio_to_voice(std::shared_ptr music, dpp::discord_voice_client* client); }; -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/include/Commands/BumbleBeeCommand.hpp b/include/Commands/BumbleBeeCommand.hpp index b095fe3..a97143f 100644 --- a/include/Commands/BumbleBeeCommand.hpp +++ b/include/Commands/BumbleBeeCommand.hpp @@ -1,6 +1,4 @@ #pragma once -#ifndef _BUMBLEBEECOMMAND_HPP_ -#define _BUMBLEBEECOMMAND_HPP_ #include #include