Add jukebox skip command
* Prevents the jukebox being locked up by long playing songs without any way to skip it
This commit is contained in:
parent
e80f452352
commit
5cea6674c9
@ -83,4 +83,7 @@ aliases = togglewtce
|
|||||||
aliases = toggleshouts
|
aliases = toggleshouts
|
||||||
|
|
||||||
[kick_other]
|
[kick_other]
|
||||||
aliases = kickother
|
aliases = kickother
|
||||||
|
|
||||||
|
[jukebox_skip]
|
||||||
|
aliases = jukeboxskip
|
@ -678,5 +678,10 @@
|
|||||||
"name":"kick_other",
|
"name":"kick_other",
|
||||||
"usage":"/kick_other",
|
"usage":"/kick_other",
|
||||||
"text":"Removes all multiclients of the user from the server."
|
"text":"Removes all multiclients of the user from the server."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"jukebox_skip",
|
||||||
|
"usage":"/jukebox_skip",
|
||||||
|
"text":"Skips the current song in the Jukebox and plays the next available one."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -1969,6 +1969,11 @@ class AOClient : public QObject
|
|||||||
*/
|
*/
|
||||||
void cmdClearCustom(int argc, QStringList argv);
|
void cmdClearCustom(int argc, QStringList argv);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Skips the current song in the Jukebox and plays the next available one.
|
||||||
|
*/
|
||||||
|
void cmdJukeboxSkip(int argc, QStringList argv);
|
||||||
|
|
||||||
///@}
|
///@}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -146,7 +146,8 @@ const QMap<QString, AOClient::CommandInfo> AOClient::COMMANDS{
|
|||||||
{"clearcustom", {{ACLRole::CM}, 0, &AOClient::cmdClearCustom}},
|
{"clearcustom", {{ACLRole::CM}, 0, &AOClient::cmdClearCustom}},
|
||||||
{"toggle_wtce", {{ACLRole::CM}, 0, &AOClient::cmdToggleWtce}},
|
{"toggle_wtce", {{ACLRole::CM}, 0, &AOClient::cmdToggleWtce}},
|
||||||
{"toggle_shouts", {{ACLRole::CM}, 0, &AOClient::cmdToggleShouts}},
|
{"toggle_shouts", {{ACLRole::CM}, 0, &AOClient::cmdToggleShouts}},
|
||||||
{"kick_other", {{ACLRole::NONE}, 0, &AOClient::cmdKickOther}}};
|
{"kick_other", {{ACLRole::NONE}, 0, &AOClient::cmdKickOther}},
|
||||||
|
{"jukebox_skip", {{ACLRole::CM}, 0, &AOClient::cmdJukeboxSkip}}};
|
||||||
|
|
||||||
void AOClient::clientDisconnected()
|
void AOClient::clientDisconnected()
|
||||||
{
|
{
|
||||||
|
@ -208,3 +208,16 @@ void AOClient::cmdClearCustom(int argc, QStringList argv)
|
|||||||
m_music_manager->clearCustomList(m_current_area);
|
m_music_manager->clearCustomList(m_current_area);
|
||||||
sendServerMessage("Custom songs have been cleared.");
|
sendServerMessage("Custom songs have been cleared.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AOClient::cmdJukeboxSkip(int argc, QStringList argv)
|
||||||
|
{
|
||||||
|
Q_UNUSED(argc);
|
||||||
|
Q_UNUSED(argv);
|
||||||
|
|
||||||
|
QString l_name = m_current_char;
|
||||||
|
if (!m_showname.isEmpty()) {
|
||||||
|
l_name = m_showname;
|
||||||
|
}
|
||||||
|
server->getAreaById(m_current_area)->switchJukeboxSong();
|
||||||
|
sendServerMessageArea(l_name + " has forced a skip. Playing the next available song.");
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user