Browse Source

Update submodule; adjust as needed

master
Jessica James 3 years ago
parent
commit
874c369b69
  1. 2
      src/Jupiter
  2. 4
      src/Plugins/RenX/RenX.Commands/RenX_Commands.cpp
  3. 15
      src/Plugins/RenX/RenX.Core/RenX_Server.cpp
  4. 4
      src/Plugins/RenX/RenX.Ladder.Web/RenX_Ladder_Web.cpp
  5. 2
      src/Plugins/RenX/RenX.ServerList/RenX_ServerList.cpp

2
src/Jupiter

@ -1 +1 @@
Subproject commit 65e0d4fab9ad862f4ef258c4acf1db150c36a671 Subproject commit 0dea1de9e086ee86f31dd6f92a0f35bd46862f5c

4
src/Plugins/RenX/RenX.Commands/RenX_Commands.cpp

@ -1990,7 +1990,7 @@ void BanSearchIRCCommand::trigger(IRC_Bot *source, std::string_view channel, std
types = " NULL;"_jrs; types = " NULL;"_jrs;
else else
{ {
types.erase(); types.clear();
if (entry->is_rdns_ban()) if (entry->is_rdns_ban())
types += " rdns"_jrs; types += " rdns"_jrs;
if (entry->is_type_game()) if (entry->is_type_game())
@ -2566,7 +2566,7 @@ void ExemptionSearchIRCCommand::trigger(IRC_Bot *source, std::string_view channe
types = " NULL;"_jrs; types = " NULL;"_jrs;
else else
{ {
types.erase(); types.clear();
if (entry->is_type_kick()) if (entry->is_type_kick())
types += " kick"_jrs; types += " kick"_jrs;
if (entry->is_type_ban()) if (entry->is_type_ban())

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

@ -20,6 +20,7 @@
#include "jessilib/split.hpp" #include "jessilib/split.hpp"
#include "jessilib/word_split.hpp" #include "jessilib/word_split.hpp"
#include "jessilib/unicode.hpp" #include "jessilib/unicode.hpp"
#include "jessilib/unicode_sequence.hpp"
#include "Jupiter/String.hpp" #include "Jupiter/String.hpp"
#include "ServerManager.h" #include "ServerManager.h"
#include "IRC_Bot.h" #include "IRC_Bot.h"
@ -1307,7 +1308,6 @@ void RenX::PlayerInfo::resolve_rdns(std::string in_ip, std::shared_ptr<std::stri
void RenX::PlayerInfo::start_resolve_rdns() { void RenX::PlayerInfo::start_resolve_rdns() {
rdns_pending = true; rdns_pending = true;
std::string player_ip = ip;
auto rdns_string = std::make_shared<std::string>(); auto rdns_string = std::make_shared<std::string>();
m_rdns_ptr = rdns_string; m_rdns_ptr = rdns_string;
std::thread(resolve_rdns, ip, std::move(rdns_string)).detach(); std::thread(resolve_rdns, ip, std::move(rdns_string)).detach();
@ -1321,11 +1321,9 @@ struct parsed_player_token {
bool isPlayer{}; // i.e: they appear on the player list; not "ai" bool isPlayer{}; // i.e: they appear on the player list; not "ai"
}; };
// TODO: replace me! // TODO: consider a simplified & more specific parser for RCON escape sequences
void process_escape_sequences(std::string& out_string) { void process_escape_sequences(std::string& out_string) {
Jupiter::StringS temp = out_string; jessilib::apply_cpp_escape_sequences(out_string);
temp.processEscapeSequences();
out_string = temp;
} }
void RenX::Server::processLine(std::string_view line) { void RenX::Server::processLine(std::string_view line) {
@ -1338,8 +1336,9 @@ void RenX::Server::processLine(std::string_view line) {
std::vector<Jupiter::StringS> tokens; std::vector<Jupiter::StringS> tokens;
for (auto& token : tokens_view) { for (auto& token : tokens_view) {
tokens.push_back(Jupiter::StringS{std::string(token)}); // TODO: remove this extraneous copy std::string parsed_token = std::string(token);
tokens.back().processEscapeSequences(); process_escape_sequences(parsed_token);
tokens.push_back(std::move(parsed_token));
} }
// Safety checker for getting a token at an index // Safety checker for getting a token at an index
@ -3155,7 +3154,7 @@ void RenX::Server::processLine(std::string_view line) {
plugin->RenX_OnAdminLogout(*this, *player); plugin->RenX_OnAdminLogout(*this, *player);
} }
player->adminType.erase(); player->adminType.clear();
} }
else if (subHeader == "Granted;"sv) else if (subHeader == "Granted;"sv)
{ {

4
src/Plugins/RenX/RenX.Ladder.Web/RenX_Ladder_Web.cpp

@ -87,8 +87,8 @@ void RenX_Ladder_WebPlugin::init() {
RenX::sanitizeTags(RenX_Ladder_WebPlugin::entry_profile_previous); RenX::sanitizeTags(RenX_Ladder_WebPlugin::entry_profile_previous);
RenX::sanitizeTags(RenX_Ladder_WebPlugin::entry_profile_next); RenX::sanitizeTags(RenX_Ladder_WebPlugin::entry_profile_next);
RenX_Ladder_WebPlugin::header.erase(); RenX_Ladder_WebPlugin::header.clear();
RenX_Ladder_WebPlugin::footer.erase(); RenX_Ladder_WebPlugin::footer.clear();
RenX_Ladder_WebPlugin::entry_profile.erase(); RenX_Ladder_WebPlugin::entry_profile.erase();
RenX_Ladder_WebPlugin::ladder_table_header.erase(); RenX_Ladder_WebPlugin::ladder_table_header.erase();
RenX_Ladder_WebPlugin::ladder_table_footer.erase(); RenX_Ladder_WebPlugin::ladder_table_footer.erase();

2
src/Plugins/RenX/RenX.ServerList/RenX_ServerList.cpp

@ -473,7 +473,7 @@ void RenX_ServerListPlugin::addServerToServerList(RenX::Server &server) {
} }
m_server_list_json += server_json_block; m_server_list_json += server_json_block;
m_server_list_json += ']'; m_server_list_json += ']';
server_json_block.erase(); server_json_block.clear();
// Also update metadata so it reflects the now added server // Also update metadata so it reflects the now added server
updateMetadata(); updateMetadata();

Loading…
Cancel
Save