Fixed some issues
This commit is contained in:
parent
fc7df4bf2a
commit
2d52fb9915
@ -42,8 +42,6 @@ using namespace ts;
|
|||||||
using namespace ts::server;
|
using namespace ts::server;
|
||||||
using namespace ts::token;
|
using namespace ts::token;
|
||||||
|
|
||||||
extern ts::server::InstanceHandler *serverInstance;
|
|
||||||
|
|
||||||
#define QUERY_PASSWORD_LENGTH 12
|
#define QUERY_PASSWORD_LENGTH 12
|
||||||
|
|
||||||
//TODO: Map permsid!
|
//TODO: Map permsid!
|
||||||
@ -6512,7 +6510,7 @@ CommandResult ConnectedClient::handleCommandMusicBotCreate(Command& cmd) {
|
|||||||
shared_lock server_channel_lock(this->server->channel_tree_lock);
|
shared_lock server_channel_lock(this->server->channel_tree_lock);
|
||||||
auto channel = cmd[0].has("cid") ? this->server->channelTree->findChannel(cmd["cid"]) : this->currentChannel;
|
auto channel = cmd[0].has("cid") ? this->server->channelTree->findChannel(cmd["cid"]) : this->currentChannel;
|
||||||
if(!channel) {
|
if(!channel) {
|
||||||
if(cmd[0].has("cid")) return {findError("client_invalid_id")};
|
if(cmd[0].has("cid")) return {findError("channel_invalid_id")};
|
||||||
} else {
|
} else {
|
||||||
CHANNEL_PERMISSION_TEST(permission::i_channel_description_view_power, permission::i_channel_needed_description_view_power, channel, false);
|
CHANNEL_PERMISSION_TEST(permission::i_channel_description_view_power, permission::i_channel_needed_description_view_power, channel, false);
|
||||||
auto permission_granted = this->calculate_permission_value(permission::i_channel_join_power, channel->channelId());
|
auto permission_granted = this->calculate_permission_value(permission::i_channel_join_power, channel->channelId());
|
||||||
@ -6549,6 +6547,7 @@ CommandResult ConnectedClient::handleCommandMusicBotCreate(Command& cmd) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
bot->properties()[property::CLIENT_LAST_CHANNEL] = channel ? channel->channelId() : 0;
|
bot->properties()[property::CLIENT_LAST_CHANNEL] = channel ? channel->channelId() : 0;
|
||||||
|
bot->properties()[property::CLIENT_COUNTRY] = config::geo::countryFlag;
|
||||||
|
|
||||||
if(permissions[permission::i_client_music_delete_power] > 0) {
|
if(permissions[permission::i_client_music_delete_power] > 0) {
|
||||||
bot->clientPermissions->set_permission(permission::i_client_music_needed_delete_power, {permissions[permission::i_client_music_delete_power],0}, permission::v2::set_value, permission::v2::do_nothing);
|
bot->clientPermissions->set_permission(permission::i_client_music_needed_delete_power, {permissions[permission::i_client_music_delete_power],0}, permission::v2::set_value, permission::v2::do_nothing);
|
||||||
@ -7304,11 +7303,13 @@ CommandResult ConnectedClient::handleCommandHelp(Command& cmd) {
|
|||||||
|
|
||||||
auto file = fs::u8path("commanddocs/" + command + ".txt");
|
auto file = fs::u8path("commanddocs/" + command + ".txt");
|
||||||
if(!fs::exists(file)) return {findError("file_not_found"), "Could not resolve file " + file.string()};
|
if(!fs::exists(file)) return {findError("file_not_found"), "Could not resolve file " + file.string()};
|
||||||
|
|
||||||
string line;
|
string line;
|
||||||
ifstream stream(file);
|
ifstream stream(file);
|
||||||
if(!stream) return {findError("file_io_error"), "Could not read documentation file " + file.string()};
|
if(!stream) return {findError("file_io_error"), "Could not read documentation file " + file.string()};
|
||||||
while(getline(stream, line))
|
while(getline(stream, line))
|
||||||
this->sendCommand(Command(line));
|
this->sendCommand(Command{line});
|
||||||
|
|
||||||
return CommandResult::Success;
|
return CommandResult::Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,7 +231,7 @@ void MusicClient::forwardSong() {
|
|||||||
|
|
||||||
void MusicClient::rewindSong() {
|
void MusicClient::rewindSong() {
|
||||||
this->player_reset(true);
|
this->player_reset(true);
|
||||||
logError(this->getServerId(), "MusicClient::rewindSong hasnt been implemented yet!");
|
logError(this->getServerId(), "MusicClient::rewindSong hasn't been implemented yet!");
|
||||||
}
|
}
|
||||||
|
|
||||||
void MusicClient::musicEventHandler(const std::weak_ptr<ts::music::PlayableSong>& weak_player, ::music::MusicEvent event) {
|
void MusicClient::musicEventHandler(const std::weak_ptr<ts::music::PlayableSong>& weak_player, ::music::MusicEvent event) {
|
||||||
|
2
shared
2
shared
@ -1 +1 @@
|
|||||||
Subproject commit c532266cb8b1ba577e063c6ed14a810374c8c84f
|
Subproject commit ba80cbb229a4a22d9ddcf73a5a0e51bb3600b50d
|
Loading…
Reference in New Issue
Block a user