Browse Source

Forgot to update submodule; change a couple function names for clarity

master
Jessica James 3 years ago
parent
commit
78d32a60ca
  1. 2
      src/Jupiter
  2. 14
      src/Plugins/RenX/RenX.ServerList/RenX_ServerList.cpp
  3. 4
      src/Plugins/RenX/RenX.ServerList/RenX_ServerList.h

2
src/Jupiter

@ -1 +1 @@
Subproject commit f33d8b740d18fe4e5a0465db3b052428552d5eab Subproject commit 703aa97c533ab7d942d6d9ef07bbfc8c0d0dfb35

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

@ -531,11 +531,11 @@ void RenX_ServerListPlugin::updateMetadata() {
player_count, server_count); player_count, server_count);
} }
void RenX_ServerListPlugin::markStale(RenX::Server& in_server) { void RenX_ServerListPlugin::markDetailsStale(RenX::Server& in_server) {
in_server.varData[this->name].remove("j"_jrs); in_server.varData[this->name].remove("j"_jrs);
} }
void RenX_ServerListPlugin::touch(RenX::Server& in_server) { void RenX_ServerListPlugin::touchDetails(RenX::Server& in_server) {
auto& server_varData = in_server.varData[this->name]; auto& server_varData = in_server.varData[this->name];
if (server_varData.get("j"_jrs).isEmpty()) { if (server_varData.get("j"_jrs).isEmpty()) {
auto server_json_block = server_as_server_details_json(in_server); auto server_json_block = server_as_server_details_json(in_server);
@ -596,23 +596,23 @@ void RenX_ServerListPlugin::RenX_OnServerFullyConnected(RenX::Server &server) {
void RenX_ServerListPlugin::RenX_OnServerDisconnect(RenX::Server &server, RenX::DisconnectReason) { void RenX_ServerListPlugin::RenX_OnServerDisconnect(RenX::Server &server, RenX::DisconnectReason) {
this->updateServerList(); this->updateServerList();
markStale(server); markDetailsStale(server);
} }
void RenX_ServerListPlugin::RenX_OnJoin(RenX::Server& server, const RenX::PlayerInfo &) { void RenX_ServerListPlugin::RenX_OnJoin(RenX::Server& server, const RenX::PlayerInfo &) {
markStale(server); markDetailsStale(server);
this->updateServerList(); this->updateServerList();
} }
void RenX_ServerListPlugin::RenX_OnPart(RenX::Server &server, const RenX::PlayerInfo &) { void RenX_ServerListPlugin::RenX_OnPart(RenX::Server &server, const RenX::PlayerInfo &) {
if (server.isTravelling() == false || server.isSeamless()) { if (server.isTravelling() == false || server.isSeamless()) {
markStale(server); markDetailsStale(server);
this->updateServerList(); this->updateServerList();
} }
} }
void RenX_ServerListPlugin::RenX_OnMapLoad(RenX::Server &server, const Jupiter::ReadableString &map) { void RenX_ServerListPlugin::RenX_OnMapLoad(RenX::Server &server, const Jupiter::ReadableString &map) {
markStale(server); markDetailsStale(server);
this->updateServerList(); this->updateServerList();
} }
@ -689,7 +689,7 @@ Jupiter::ReadableString *handle_server_page(const Jupiter::ReadableString &query
} }
// return server data // return server data
pluginInstance.touch(*server); pluginInstance.touchDetails(*server);
return new Jupiter::ReferenceString(server->varData[pluginInstance.getName()].get("j"_jrs)); return new Jupiter::ReferenceString(server->varData[pluginInstance.getName()].get("j"_jrs));
} }

4
src/Plugins/RenX/RenX.ServerList/RenX_ServerList.h

@ -42,8 +42,8 @@ public: // RenX_ServerListPlugin
void addServerToServerList(RenX::Server &server); void addServerToServerList(RenX::Server &server);
void updateServerList(); void updateServerList();
void updateMetadata(); void updateMetadata();
void markStale(RenX::Server& in_server); void markDetailsStale(RenX::Server& in_server);
void touch(RenX::Server& in_server); void touchDetails(RenX::Server& in_server);
Jupiter::ReferenceString getListServerAddress(const RenX::Server& server); Jupiter::ReferenceString getListServerAddress(const RenX::Server& server);
ListServerInfo getListServerInfo(const RenX::Server& server); ListServerInfo getListServerInfo(const RenX::Server& server);
Jupiter::StringS server_as_json(const RenX::Server &server); Jupiter::StringS server_as_json(const RenX::Server &server);

Loading…
Cancel
Save