Browse Source

`RenX::Server::banCheck` now actually uses `ban_from_str`

release/0.19
Jessica James 5 years ago
parent
commit
c2df63fd5c
  1. 20
      src/Plugins/RenX/RenX.Core/RenX_Server.cpp

20
src/Plugins/RenX/RenX.Core/RenX_Server.cpp

@ -581,9 +581,9 @@ void RenX::Server::banCheck(RenX::PlayerInfo &player)
strftime(timeStr, sizeof(timeStr), "%b %d %Y at %H:%M:%S", localtime(&current_time)); strftime(timeStr, sizeof(timeStr), "%b %d %Y at %H:%M:%S", localtime(&current_time));
this->mute(player); this->mute(player);
if (last_to_expire[1]->length == std::chrono::seconds::zero()) if (last_to_expire[1]->length == std::chrono::seconds::zero())
this->sendMessage(player, Jupiter::StringS::Format("You were permanently muted on this server on %s for: %.*s", timeStr, last_to_expire[1]->reason.size(), last_to_expire[1]->reason.ptr())); this->sendMessage(player, Jupiter::StringS::Format("You were permanently muted from %.*s on %s for: %.*s", ban_from_str.size(), ban_from_str.ptr(), timeStr, last_to_expire[1]->reason.size(), last_to_expire[1]->reason.ptr()));
else else
this->sendMessage(player, Jupiter::StringS::Format("You are muted on this server until %s for: %.*s", timeStr, last_to_expire[1]->reason.size(), last_to_expire[1]->reason.ptr())); this->sendMessage(player, Jupiter::StringS::Format("You are muted from %.*s until %s for: %.*s", ban_from_str.size(), ban_from_str.ptr(), timeStr, last_to_expire[1]->reason.size(), last_to_expire[1]->reason.ptr()));
player.ban_flags |= RenX::BanDatabase::Entry::FLAG_TYPE_BOT; // implies FLAG_TYPE_BOT player.ban_flags |= RenX::BanDatabase::Entry::FLAG_TYPE_BOT; // implies FLAG_TYPE_BOT
} }
@ -592,18 +592,18 @@ void RenX::Server::banCheck(RenX::PlayerInfo &player)
time_t current_time = std::chrono::system_clock::to_time_t(last_to_expire[2]->timestamp + last_to_expire[2]->length); time_t current_time = std::chrono::system_clock::to_time_t(last_to_expire[2]->timestamp + last_to_expire[2]->length);
strftime(timeStr, sizeof(timeStr), "%b %d %Y at %H:%M:%S", localtime(&current_time)); strftime(timeStr, sizeof(timeStr), "%b %d %Y at %H:%M:%S", localtime(&current_time));
if (last_to_expire[2]->length == std::chrono::seconds::zero()) if (last_to_expire[2]->length == std::chrono::seconds::zero())
this->sendMessage(player, Jupiter::StringS::Format("You were permanently bot-muted on this server on %s for: %.*s", timeStr, last_to_expire[2]->reason.size(), last_to_expire[2]->reason.ptr())); this->sendMessage(player, Jupiter::StringS::Format("You were permanently bot-muted from %.*s on %s for: %.*s", ban_from_str.size(), ban_from_str.ptr(), timeStr, last_to_expire[2]->reason.size(), last_to_expire[2]->reason.ptr()));
else else
this->sendMessage(player, Jupiter::StringS::Format("You are bot-muted on this server until %s for: %.*s", timeStr, last_to_expire[2]->reason.size(), last_to_expire[2]->reason.ptr())); this->sendMessage(player, Jupiter::StringS::Format("You are bot-muted from %.*s until %s for: %.*s", ban_from_str.size(), ban_from_str.ptr(), timeStr, last_to_expire[2]->reason.size(), last_to_expire[2]->reason.ptr()));
} }
if (last_to_expire[3] != nullptr) // Vote ban if (last_to_expire[3] != nullptr) // Vote ban
{ {
time_t current_time = std::chrono::system_clock::to_time_t(last_to_expire[3]->timestamp + last_to_expire[3]->length); time_t current_time = std::chrono::system_clock::to_time_t(last_to_expire[3]->timestamp + last_to_expire[3]->length);
strftime(timeStr, sizeof(timeStr), "%b %d %Y at %H:%M:%S", localtime(&current_time)); strftime(timeStr, sizeof(timeStr), "%b %d %Y at %H:%M:%S", localtime(&current_time));
if (last_to_expire[3]->length == std::chrono::seconds::zero()) if (last_to_expire[3]->length == std::chrono::seconds::zero())
this->sendMessage(player, Jupiter::StringS::Format("You were permanently vote-muted on this server on %s for: %.*s", timeStr, last_to_expire[3]->reason.size(), last_to_expire[3]->reason.ptr())); this->sendMessage(player, Jupiter::StringS::Format("You were permanently vote-muted from %.*s on %s for: %.*s", ban_from_str.size(), ban_from_str.ptr(), timeStr, last_to_expire[3]->reason.size(), last_to_expire[3]->reason.ptr()));
else else
this->sendMessage(player, Jupiter::StringS::Format("You are vote-muted on this server until %s for: %.*s", timeStr, last_to_expire[3]->reason.size(), last_to_expire[3]->reason.ptr())); this->sendMessage(player, Jupiter::StringS::Format("You are vote-muted from %.*s until %s for: %.*s", ban_from_str.size(), ban_from_str.ptr(), timeStr, last_to_expire[3]->reason.size(), last_to_expire[3]->reason.ptr()));
} }
if (last_to_expire[4] != nullptr) // Mine ban if (last_to_expire[4] != nullptr) // Mine ban
{ {
@ -611,18 +611,18 @@ void RenX::Server::banCheck(RenX::PlayerInfo &player)
this->mineBan(player); this->mineBan(player);
strftime(timeStr, sizeof(timeStr), "%b %d %Y at %H:%M:%S", localtime(&current_time)); strftime(timeStr, sizeof(timeStr), "%b %d %Y at %H:%M:%S", localtime(&current_time));
if (last_to_expire[4]->length == std::chrono::seconds::zero()) if (last_to_expire[4]->length == std::chrono::seconds::zero())
this->sendMessage(player, Jupiter::StringS::Format("You were permanently mine-banned on this server on %s for: %.*s", timeStr, last_to_expire[4]->reason.size(), last_to_expire[4]->reason.ptr())); this->sendMessage(player, Jupiter::StringS::Format("You were permanently mine-banned from %.*s on %s for: %.*s", ban_from_str.size(), ban_from_str.ptr(), timeStr, last_to_expire[4]->reason.size(), last_to_expire[4]->reason.ptr()));
else else
this->sendMessage(player, Jupiter::StringS::Format("You are mine-banned on this server until %s for: %.*s", timeStr, last_to_expire[4]->reason.size(), last_to_expire[4]->reason.ptr())); this->sendMessage(player, Jupiter::StringS::Format("You are mine-banned from %.*s until %s for: %.*s", ban_from_str.size(), ban_from_str.ptr(), timeStr, last_to_expire[4]->reason.size(), last_to_expire[4]->reason.ptr()));
} }
if (last_to_expire[5] != nullptr) // Ladder ban if (last_to_expire[5] != nullptr) // Ladder ban
{ {
time_t current_time = std::chrono::system_clock::to_time_t(last_to_expire[5]->timestamp + last_to_expire[5]->length); time_t current_time = std::chrono::system_clock::to_time_t(last_to_expire[5]->timestamp + last_to_expire[5]->length);
strftime(timeStr, sizeof(timeStr), "%b %d %Y at %H:%M:%S", localtime(&current_time)); strftime(timeStr, sizeof(timeStr), "%b %d %Y at %H:%M:%S", localtime(&current_time));
if (last_to_expire[5]->length == std::chrono::seconds::zero()) if (last_to_expire[5]->length == std::chrono::seconds::zero())
this->sendMessage(player, Jupiter::StringS::Format("You were permanently ladder-banned on this server on %s for: %.*s", timeStr, last_to_expire[5]->reason.size(), last_to_expire[5]->reason.ptr())); this->sendMessage(player, Jupiter::StringS::Format("You were permanently ladder-banned from %.*s on %s for: %.*s", ban_from_str.size(), ban_from_str.ptr(), timeStr, last_to_expire[5]->reason.size(), last_to_expire[5]->reason.ptr()));
else else
this->sendMessage(player, Jupiter::StringS::Format("You are ladder-banned on this server until %s for: %.*s", timeStr, last_to_expire[5]->reason.size(), last_to_expire[5]->reason.ptr())); this->sendMessage(player, Jupiter::StringS::Format("You are ladder-banned from %.*s until %s for: %.*s", ban_from_str.size(), ban_from_str.ptr(), timeStr, last_to_expire[5]->reason.size(), last_to_expire[5]->reason.ptr()));
} }
if (last_to_expire[6] != nullptr) // Alert if (last_to_expire[6] != nullptr) // Alert
{ {

Loading…
Cancel
Save