parent
20be237daf
commit
164a1789d0
@ -80,4 +80,7 @@ aliases = ignorebglist
|
|||||||
aliases = togglewtce
|
aliases = togglewtce
|
||||||
|
|
||||||
[toggle_shouts]
|
[toggle_shouts]
|
||||||
aliases = toggleshouts
|
aliases = toggleshouts
|
||||||
|
|
||||||
|
[kick_other]
|
||||||
|
aliases = kickother
|
@ -673,5 +673,10 @@
|
|||||||
"name":"clearcustom",
|
"name":"clearcustom",
|
||||||
"usage":"/clearcustom",
|
"usage":"/clearcustom",
|
||||||
"text":"Removes all custom songs from the area."
|
"text":"Removes all custom songs from the area."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"kick_other",
|
||||||
|
"usage":"/kick_other",
|
||||||
|
"text":"Removes all multiclients of the user from the server."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -1363,6 +1363,15 @@ class AOClient : public QObject
|
|||||||
*/
|
*/
|
||||||
void cmdClearCM(int argc, QStringList argv);
|
void cmdClearCM(int argc, QStringList argv);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Removes all multiclient instances of a client on the server, excluding the one using the command.
|
||||||
|
*
|
||||||
|
* @details This command gracefully removes all multiclients from the server, disconnecting them and freeing their used character.
|
||||||
|
*
|
||||||
|
* @iscommand
|
||||||
|
*/
|
||||||
|
void cmdKickOther(int argc, QStringList argv);
|
||||||
|
|
||||||
///@}
|
///@}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -145,7 +145,8 @@ const QMap<QString, AOClient::CommandInfo> AOClient::COMMANDS{
|
|||||||
{"toggleroot", {{ACLRole::CM}, 0, &AOClient::cmdToggleRootlist}},
|
{"toggleroot", {{ACLRole::CM}, 0, &AOClient::cmdToggleRootlist}},
|
||||||
{"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}}};
|
||||||
|
|
||||||
void AOClient::clientDisconnected()
|
void AOClient::clientDisconnected()
|
||||||
{
|
{
|
||||||
|
@ -630,3 +630,20 @@ void AOClient::cmdClearCM(int argc, QStringList argv)
|
|||||||
arup(ARUPType::CM, true);
|
arup(ARUPType::CM, true);
|
||||||
sendServerMessage("Removed all CMs from this area.");
|
sendServerMessage("Removed all CMs from this area.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AOClient::cmdKickOther(int argc, QStringList argv)
|
||||||
|
{
|
||||||
|
Q_UNUSED(argc);
|
||||||
|
Q_UNUSED(argv);
|
||||||
|
|
||||||
|
int l_kick_counter = 0;
|
||||||
|
|
||||||
|
const QList<AOClient *> l_target_clients = server->getClientsByIpid(m_ipid);
|
||||||
|
for (AOClient *l_target_client : l_target_clients) {
|
||||||
|
if (l_target_client != this) {
|
||||||
|
l_target_client->m_socket->close();
|
||||||
|
l_kick_counter++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sendServerMessage("Kicked " + QString::number(l_kick_counter) + " multiclients from the server.");
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user