Browse Source

Updated Jupiter; each plugin config is now rehashed with the plugin

Added a few missing 'override' specifiers for explicitness and consistency
pull/3/head
Jessica James 9 years ago
parent
commit
fb7bc0db70
  1. 2
      ChannelRelay/ChannelRelay.cpp
  2. 2
      Jupiter
  3. BIN
      Release/Bot.lib
  4. BIN
      Release/Plugins/RenX.Core.lib
  5. 2
      RenX.Announcements/RenX_Announcements.cpp
  6. 2
      RenX.Announcements/RenX_Announcements.h
  7. 1
      RenX.Commands/RenX_Commands.cpp
  8. 2
      RenX.Core/RenX_Server.h
  9. 1
      RenX.ExcessiveHeadshots/ExcessiveHeadshots.cpp
  10. 3
      RenX.ExtraLogging/RenX_ExtraLogging.cpp
  11. 2
      RenX.Greetings/RenX_Greetings.cpp
  12. 2
      RenX.IRCJoin/RenX_IRCJoin.cpp
  13. 9
      RenX.Ladder.Web/RenX_Ladder_Web.cpp
  14. 2
      RenX.Ladder.Web/RenX_Ladder_Web.h
  15. 2
      RenX.Listen/RenX_Listen.cpp
  16. 1
      RenX.Logging/RenX_Logging.cpp
  17. 2
      RenX.Medals/RenX_Medals.cpp
  18. 2
      RenX.ModSystem/RenX_ModSystem.cpp
  19. 2
      RenX.ModSystem/RenX_ModSystem.h
  20. 1
      RenX.Warn/RenX_Warn.cpp

2
ChannelRelay/ChannelRelay.cpp

@ -40,6 +40,8 @@ bool ChannelRelayPlugin::initialize()
int ChannelRelayPlugin::OnRehash() int ChannelRelayPlugin::OnRehash()
{ {
Jupiter::Plugin::OnRehash();
ChannelRelayPlugin::types.erase(); ChannelRelayPlugin::types.erase();
return this->initialize() ? 0 : -1; return this->initialize() ? 0 : -1;
} }

2
Jupiter

@ -1 +1 @@
Subproject commit b990d5d27facfd283ad4d36c70105d682a283cdc Subproject commit 1b697ec73adfc406e4ad5244aae8d24978fa36d8

BIN
Release/Bot.lib

Binary file not shown.

BIN
Release/Plugins/RenX.Core.lib

Binary file not shown.

2
RenX.Announcements/RenX_Announcements.cpp

@ -64,6 +64,8 @@ void RenX_AnnouncementsPlugin::announce(unsigned int)
int RenX_AnnouncementsPlugin::OnRehash() int RenX_AnnouncementsPlugin::OnRehash()
{ {
RenX::Plugin::OnRehash();
RenX_AnnouncementsPlugin::timer->kill(); RenX_AnnouncementsPlugin::timer->kill();
RenX_AnnouncementsPlugin::announcementsFile.unload(); RenX_AnnouncementsPlugin::announcementsFile.unload();
return this->initialize() ? 0 : -1; return this->initialize() ? 0 : -1;

2
RenX.Announcements/RenX_Announcements.h

@ -34,7 +34,7 @@ public:
public: // Jupiter::Plugin public: // Jupiter::Plugin
virtual bool initialize() override; virtual bool initialize() override;
int OnRehash(); int OnRehash() override;
~RenX_AnnouncementsPlugin(); ~RenX_AnnouncementsPlugin();
private: private:

1
RenX.Commands/RenX_Commands.cpp

@ -80,6 +80,7 @@ bool RenX_CommandsPlugin::initialize()
int RenX_CommandsPlugin::OnRehash() int RenX_CommandsPlugin::OnRehash()
{ {
RenX::Plugin::OnRehash();
return this->initialize() ? 0 : -1; return this->initialize() ? 0 : -1;
} }

2
RenX.Core/RenX_Server.h

@ -73,7 +73,7 @@ namespace RenX
* *
* @return 0. * @return 0.
*/ */
virtual int OnRehash(); virtual int OnRehash() override;
/** /**
* @brief Fires when a non-zero value is returned by an object during a call to rehash(). * @brief Fires when a non-zero value is returned by an object during a call to rehash().

1
RenX.ExcessiveHeadshots/ExcessiveHeadshots.cpp

@ -38,6 +38,7 @@ bool RenX_ExcessiveHeadshotsPlugin::initialize()
int RenX_ExcessiveHeadshotsPlugin::OnRehash() int RenX_ExcessiveHeadshotsPlugin::OnRehash()
{ {
RenX::Plugin::OnRehash();
return this->initialize() ? 0 : -1; return this->initialize() ? 0 : -1;
} }

3
RenX.ExtraLogging/RenX_ExtraLogging.cpp

@ -35,8 +35,11 @@ RenX_ExtraLoggingPlugin::~RenX_ExtraLoggingPlugin()
int RenX_ExtraLoggingPlugin::OnRehash() int RenX_ExtraLoggingPlugin::OnRehash()
{ {
RenX::Plugin::OnRehash();
if (RenX_ExtraLoggingPlugin::file != nullptr) if (RenX_ExtraLoggingPlugin::file != nullptr)
fclose(RenX_ExtraLoggingPlugin::file); fclose(RenX_ExtraLoggingPlugin::file);
return this->initialize() ? 0 : -1; return this->initialize() ? 0 : -1;
} }

2
RenX.Greetings/RenX_Greetings.cpp

@ -62,6 +62,8 @@ void RenX_GreetingsPlugin::RenX_OnJoin(RenX::Server *server, const RenX::PlayerI
int RenX_GreetingsPlugin::OnRehash() int RenX_GreetingsPlugin::OnRehash()
{ {
RenX::Plugin::OnRehash();
RenX_GreetingsPlugin::greetingsFile.unload(); RenX_GreetingsPlugin::greetingsFile.unload();
return RenX_GreetingsPlugin::initialize() ? 0 : -1; return RenX_GreetingsPlugin::initialize() ? 0 : -1;
} }

2
RenX.IRCJoin/RenX_IRCJoin.cpp

@ -105,6 +105,8 @@ void RenX_IRCJoinPlugin::OnPart(Jupiter::IRC::Client *source, const Jupiter::Rea
int RenX_IRCJoinPlugin::OnRehash() int RenX_IRCJoinPlugin::OnRehash()
{ {
RenX::Plugin::OnRehash();
return RenX_IRCJoinPlugin::initialize() ? 0 : -1; return RenX_IRCJoinPlugin::initialize() ? 0 : -1;
} }

9
RenX.Ladder.Web/RenX_Ladder_Web.cpp

@ -34,7 +34,7 @@ bool RenX_Ladder_WebPlugin::initialize()
RenX_Ladder_WebPlugin::web_hostname = this->config.get(Jupiter::ReferenceString::empty, "Hostname"_jrs, ""_jrs); RenX_Ladder_WebPlugin::web_hostname = this->config.get(Jupiter::ReferenceString::empty, "Hostname"_jrs, ""_jrs);
RenX_Ladder_WebPlugin::web_path = this->config.get(Jupiter::ReferenceString::empty, "Path"_jrs, "/"_jrs); RenX_Ladder_WebPlugin::web_path = this->config.get(Jupiter::ReferenceString::empty, "Path"_jrs, "/"_jrs);
this->OnRehash(); this->init();
/** Initialize content */ /** Initialize content */
Jupiter::HTTP::Server &server = getHTTPServer(); Jupiter::HTTP::Server &server = getHTTPServer();
@ -68,7 +68,7 @@ RenX_Ladder_WebPlugin::~RenX_Ladder_WebPlugin()
server.remove(RenX_Ladder_WebPlugin::web_hostname, RenX_Ladder_WebPlugin::web_path, RenX_Ladder_WebPlugin::profile_page_name); server.remove(RenX_Ladder_WebPlugin::web_hostname, RenX_Ladder_WebPlugin::web_path, RenX_Ladder_WebPlugin::profile_page_name);
} }
int RenX_Ladder_WebPlugin::OnRehash() void RenX_Ladder_WebPlugin::init()
{ {
FILE *file; FILE *file;
int chr; int chr;
@ -155,7 +155,12 @@ int RenX_Ladder_WebPlugin::OnRehash()
fclose(file); fclose(file);
} }
} }
}
int RenX_Ladder_WebPlugin::OnRehash()
{
RenX::Plugin::OnRehash();
this->init();
return 0; return 0;
} }

2
RenX.Ladder.Web/RenX_Ladder_Web.h

@ -53,6 +53,8 @@ public: // Jupiter::Plugin
int OnRehash() override; int OnRehash() override;
private: private:
void init();
/** Configuration variables */ /** Configuration variables */
size_t entries_per_page; size_t entries_per_page;
size_t min_search_name_length; size_t min_search_name_length;

2
RenX.Listen/RenX_Listen.cpp

@ -53,6 +53,8 @@ int RenX_ListenPlugin::think()
int RenX_ListenPlugin::OnRehash() int RenX_ListenPlugin::OnRehash()
{ {
RenX::Plugin::OnRehash();
uint16_t port = this->config.getInt(Jupiter::ReferenceString::empty, STRING_LITERAL_AS_REFERENCE("Port"), 21337); uint16_t port = this->config.getInt(Jupiter::ReferenceString::empty, STRING_LITERAL_AS_REFERENCE("Port"), 21337);
const Jupiter::ReadableString &address = this->config.get(Jupiter::ReferenceString::empty, STRING_LITERAL_AS_REFERENCE("Address"), STRING_LITERAL_AS_REFERENCE("0.0.0.0")); const Jupiter::ReadableString &address = this->config.get(Jupiter::ReferenceString::empty, STRING_LITERAL_AS_REFERENCE("Address"), STRING_LITERAL_AS_REFERENCE("0.0.0.0"));
RenX_ListenPlugin::serverSection = this->config.get(Jupiter::ReferenceString::empty, STRING_LITERAL_AS_REFERENCE("ServerSection"), this->getName()); RenX_ListenPlugin::serverSection = this->config.get(Jupiter::ReferenceString::empty, STRING_LITERAL_AS_REFERENCE("ServerSection"), this->getName());

1
RenX.Logging/RenX_Logging.cpp

@ -2257,6 +2257,7 @@ void RenX_LoggingPlugin::RenX_OnOther(RenX::Server *server, char token, const Ju
int RenX_LoggingPlugin::OnRehash() int RenX_LoggingPlugin::OnRehash()
{ {
RenX::Plugin::OnRehash();
return this->initialize() ? 0 : -1; return this->initialize() ? 0 : -1;
} }

2
RenX.Medals/RenX_Medals.cpp

@ -264,6 +264,8 @@ void RenX_MedalsPlugin::RenX_OnDestroy(RenX::Server *server, const RenX::PlayerI
int RenX_MedalsPlugin::OnRehash() int RenX_MedalsPlugin::OnRehash()
{ {
RenX::Plugin::OnRehash();
RenX_MedalsPlugin::medalsFile.sync(RenX_MedalsPlugin::medalsFileName); RenX_MedalsPlugin::medalsFile.sync(RenX_MedalsPlugin::medalsFileName);
RenX_MedalsPlugin::medalsFile.flushData(); RenX_MedalsPlugin::medalsFile.flushData();
init(); init();

2
RenX.ModSystem/RenX_ModSystem.cpp

@ -407,6 +407,8 @@ void RenX_ModSystemPlugin::RenX_OnAdminLogout(RenX::Server *server, const RenX::
int RenX_ModSystemPlugin::OnRehash() int RenX_ModSystemPlugin::OnRehash()
{ {
RenX::Plugin::OnRehash();
RenX_ModSystemPlugin::modsFile.flushData(); RenX_ModSystemPlugin::modsFile.flushData();
while (RenX_ModSystemPlugin::groups.size() != 0) while (RenX_ModSystemPlugin::groups.size() != 0)
delete RenX_ModSystemPlugin::groups.remove(0U); delete RenX_ModSystemPlugin::groups.remove(0U);

2
RenX.ModSystem/RenX_ModSystem.h

@ -102,7 +102,7 @@ public: // RenX::Plugin
void RenX_OnAdminLogout(RenX::Server *server, const RenX::PlayerInfo *player) override; void RenX_OnAdminLogout(RenX::Server *server, const RenX::PlayerInfo *player) override;
public: // Jupiter::Plugin public: // Jupiter::Plugin
int OnRehash(); int OnRehash() override;
Jupiter::INIFile &modsFile = Jupiter::Plugin::config; Jupiter::INIFile &modsFile = Jupiter::Plugin::config;
private: private:

1
RenX.Warn/RenX_Warn.cpp

@ -30,6 +30,7 @@ bool RenX_WarnPlugin::initialize()
int RenX_WarnPlugin::OnRehash() int RenX_WarnPlugin::OnRehash()
{ {
RenX::Plugin::OnRehash();
return this->initialize() ? 0 : -1; return this->initialize() ? 0 : -1;
} }

Loading…
Cancel
Save