Browse Source

Added "NeverSay" configurable option

pull/3/head
JustinAJ 10 years ago
parent
commit
bd31da4871
  1. BIN
      Release/Plugins/RenX.Core.lib
  2. 31
      RenX.Core/RenX_Server.cpp
  3. 18
      RenX.Core/RenX_Server.h

BIN
Release/Plugins/RenX.Core.lib

Binary file not shown.

31
RenX.Core/RenX_Server.cpp

@ -118,15 +118,27 @@ int RenX::Server::send(const Jupiter::ReadableString &command)
int RenX::Server::sendMessage(const Jupiter::ReadableString &message)
{
char *t = new char[message.size() + 6];
strcpy(t, "csay ");
for (size_t i = 0; i != message.size(); i++) t[i + 5] = message.get(i);
t[message.size() + 5] = '\n';
if (RenX::Server::profile->mustSanitize)
RenX::sanitizeString(t);
int r = RenX::Server::sock.send(t, message.size() + 6);
delete[] t;
return r;
int r = 0;
if (RenX::Server::neverSay)
{
if (RenX::Server::profile->privateMessages && RenX::Server::players.size() != 0)
for (Jupiter::DLList<RenX::PlayerInfo>::Node *node = RenX::Server::players.getNode(0); node != nullptr; node = node->next)
if (node->data->isBot == false)
r += RenX::Server::sendMessage(node->data, message);
return r;
}
else
{
char *t = new char[message.size() + 6];
strcpy(t, "csay ");
for (size_t i = 0; i != message.size(); i++) t[i + 5] = message.get(i);
t[message.size() + 5] = '\n';
if (RenX::Server::profile->mustSanitize)
RenX::sanitizeString(t);
r = RenX::Server::sock.send(t, message.size() + 6);
delete[] t;
return r;
}
}
int RenX::Server::sendMessage(RenX::PlayerInfo *player, const Jupiter::ReadableString &message)
@ -1022,6 +1034,7 @@ RenX::Server::Server(const Jupiter::ReadableString &configurationSection)
RenX::Server::delay = Jupiter::IRC::Client::Config->getInt(RenX::Server::configSection, STRING_LITERAL_AS_REFERENCE("ReconnectDelay"), 60);
RenX::Server::uuidMode = Jupiter::IRC::Client::Config->getInt(RenX::Server::configSection, STRING_LITERAL_AS_REFERENCE("UUIDMode"), 0);
RenX::Server::steamFormat = Jupiter::IRC::Client::Config->getInt(RenX::Server::configSection, STRING_LITERAL_AS_REFERENCE("SteamFormat"), 16);
RenX::Server::neverSay = Jupiter::IRC::Client::Config->getBool(RenX::Server::configSection, STRING_LITERAL_AS_REFERENCE("NeverSay"), false);
for (size_t i = 0; i < RenX::GameMasterCommandList->size(); i++)
RenX::Server::addCommand(RenX::GameMasterCommandList->get(i)->copy());

18
RenX.Core/RenX_Server.h

@ -470,22 +470,29 @@ namespace RenX
/** Private members */
private:
/** Tracking variables */
bool connected = false;
bool needsCList = false;
bool silenceParts = false;
bool silenceJoins = false;
bool firstGame = true;
bool firstKill = false;
bool firstDeath = false;
bool firstAction = false;
unsigned int rconVersion = 0;
time_t lastAttempt = 0;
Jupiter::String lastLine;
Jupiter::StringS gameVersion;
Jupiter::ArrayList<RenX::GameCommand> commands;
/** Configuration variables */
unsigned short port;
int logChanType;
int adminLogChanType;
time_t lastAttempt = 0;
time_t delay;
int steamFormat; /** 16 = hex, 10 = base 10, 8 = octal, -2 = SteamID 2, -3 = SteamID 3 */
unsigned int uuidMode; /** 0 = steam, 1 = nickname */
bool firstKill = false;
bool firstDeath = false;
bool firstAction = false;
bool neverSay;
Jupiter::TCPSocket sock;
Jupiter::CStringS clientHostname;
Jupiter::CStringS hostname;
@ -494,9 +501,6 @@ namespace RenX
Jupiter::StringS rules;
Jupiter::StringS IRCPrefix;
Jupiter::StringS CommandPrefix;
Jupiter::StringS gameVersion;
Jupiter::String lastLine;
Jupiter::ArrayList<RenX::GameCommand> commands;
};
}

Loading…
Cancel
Save