Browse Source

Update Jupiter submodule; minor cleanup

master
Jessica James 3 years ago
parent
commit
adc42bd10c
  1. 2
      src/Jupiter
  2. 3
      src/Plugins/RenX/RenX.Core/RenX_BanDatabase.h
  3. 1
      src/Plugins/RenX/RenX.Core/RenX_Core.cpp
  4. 21
      src/Plugins/RenX/RenX.Relay/RenX_Relay.cpp

2
src/Jupiter

@ -1 +1 @@
Subproject commit 77762980cce5bda4035b15cc552ec8a4c5b2175e
Subproject commit eaef6bf23f0c03430b7ede8feda83880efaadcb5

3
src/Plugins/RenX/RenX.Core/RenX_BanDatabase.h

@ -21,6 +21,7 @@
#include <cstdint>
#include <unordered_map>
#include "jessilib/unicode.hpp"
#include "Jupiter/Database.h"
#include "RenX.h"
@ -77,7 +78,7 @@ namespace RenX
*/
struct RENX_API Entry
{
using VarDataTableType = std::unordered_map<std::string, std::string, Jupiter::default_hash_function, std::equal_to<>>;
using VarDataTableType = std::unordered_map<std::string, std::string, jessilib::text_hash, jessilib::text_equal>;
fpos_t pos; /** Position of the entry in the database */
uint16_t flags /** Flags affecting this ban entry (See below for flags) */ = 0x00;

1
src/Plugins/RenX/RenX.Core/RenX_Core.cpp

@ -198,6 +198,7 @@ extern "C" JUPITER_EXPORT Jupiter::Plugin *getPlugin()
// Unload
extern "C" JUPITER_EXPORT void unload(void) {
// TODO: Are plugins which link to RenX.Core absorbing this and providing in dlsym?
auto& plugins = pluginInstance.getPlugins();
while (!plugins.empty()) {
Jupiter::Plugin::free(plugins.back());

21
src/Plugins/RenX/RenX.Relay/RenX_Relay.cpp

@ -16,15 +16,18 @@
#include <charconv>
#include "jessilib/split.hpp"
#include "jessilib/word_split.hpp"
#include "jessilib/unicode.hpp"
#include "Jupiter/IRC.h"
#include "RenX_Functions.h"
#include "RenX_Server.h"
#include "RenX_PlayerInfo.h"
using namespace std::literals;
// String literal redefinition of RenX::DelimC
#define RX_DELIM "\x02"
static constexpr std::string_view Rx_Delim = "\x02"sv;
using namespace std::literals;
constexpr const char g_blank_steamid[] = "0x0000000000000000";
constexpr std::chrono::steady_clock::duration g_reconnect_delay = std::chrono::seconds{15 }; // game server: 120s
constexpr std::chrono::steady_clock::duration g_activity_timeout = std::chrono::seconds{ 120 }; // game server: 120s
@ -637,19 +640,9 @@ void RenX_RelayPlugin::upstream_connected(RenX::Server& in_server, upstream_serv
in_server_info.m_last_activity = in_server_info.m_last_connect_attempt;
// New format: 004 | Game Version Number | Game Version
const auto& version_str = in_server.getGameVersion();
std::string version_message = "v004";
version_message += RenX::DelimC;
version_message += std::to_string(in_server.getGameVersionNumber());
version_message += RenX::DelimC;
version_message.append(version_str.data(), version_str.size());
version_message += '\n';
// Tack on username auth
const auto& rcon_username = get_upstream_rcon_username(in_server_info, in_server);
version_message += 'a';
version_message += rcon_username;
version_message += '\n';
std::string version_message = jessilib::join<std::string>(
"v004"sv, Rx_Delim, std::to_string(in_server.getGameVersionNumber()), Rx_Delim, in_server.getGameVersion(), // Version string
"\na"sv, get_upstream_rcon_username(in_server_info, in_server), "\n"sv); // Newline & auth message
send_upstream(in_server_info, version_message, in_server);
}

Loading…
Cancel
Save