Browse Source

Added remaining events; fixed RenX_OnKill() killer-victim order.

pull/3/head
JustinAJ 10 years ago
parent
commit
6f2ecfe992
  1. BIN
      Release/Plugins/RenX.Core.lib
  2. 50
      RenX.Core/RenX_Plugin.cpp
  3. 10
      RenX.Core/RenX_Plugin.h
  4. 37
      RenX.Core/RenX_Server.cpp

BIN
Release/Plugins/RenX.Core.lib

Binary file not shown.

50
RenX.Core/RenX_Plugin.cpp

@ -205,6 +205,56 @@ void RenX::Plugin::RenX_OnUnsubscribe(Server *, const Jupiter::ReadableString &)
return; return;
} }
void RenX::Plugin::RenX_OnBlock(Server *, const Jupiter::ReadableString &, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnConnect(Server *, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnAuthenticate(Server *, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnBan(Server *, const Jupiter::ReadableString &, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnInvalidPassword(Server *, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnDrop(Server *, const Jupiter::ReadableString &, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnDisconnect(Server *, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnStopListen(Server *, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnResumeListen(Server *, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnWarning(Server *, const Jupiter::ReadableString &)
{
return;
}
void RenX::Plugin::RenX_OnRCON(Server *, const Jupiter::ReadableString &) void RenX::Plugin::RenX_OnRCON(Server *, const Jupiter::ReadableString &)
{ {
return; return;

10
RenX.Core/RenX_Plugin.h

@ -83,6 +83,16 @@ namespace RenX
virtual void RenX_OnExecute(Server *server, const Jupiter::ReadableString &user, const Jupiter::ReadableString &command); virtual void RenX_OnExecute(Server *server, const Jupiter::ReadableString &user, const Jupiter::ReadableString &command);
virtual void RenX_OnSubscribe(Server *server, const Jupiter::ReadableString &user); virtual void RenX_OnSubscribe(Server *server, const Jupiter::ReadableString &user);
virtual void RenX_OnUnsubscribe(Server *server, const Jupiter::ReadableString &user); virtual void RenX_OnUnsubscribe(Server *server, const Jupiter::ReadableString &user);
virtual void RenX_OnBlock(Server *server, const Jupiter::ReadableString &user, const Jupiter::ReadableString &message);
virtual void RenX_OnConnect(Server *server, const Jupiter::ReadableString &user);
virtual void RenX_OnAuthenticate(Server *server, const Jupiter::ReadableString &user);
virtual void RenX_OnBan(Server *server, const Jupiter::ReadableString &user, const Jupiter::ReadableString &message);
virtual void RenX_OnInvalidPassword(Server *server, const Jupiter::ReadableString &user);
virtual void RenX_OnDrop(Server *server, const Jupiter::ReadableString &user, const Jupiter::ReadableString &message);
virtual void RenX_OnDisconnect(Server *server, const Jupiter::ReadableString &user);
virtual void RenX_OnStopListen(Server *server, const Jupiter::ReadableString &message);
virtual void RenX_OnResumeListen(Server *server, const Jupiter::ReadableString &message);
virtual void RenX_OnWarning(Server *server, const Jupiter::ReadableString &message);
virtual void RenX_OnRCON(Server *server, const Jupiter::ReadableString &raw); virtual void RenX_OnRCON(Server *server, const Jupiter::ReadableString &raw);
/** Admin Type Logs */ /** Admin Type Logs */

37
RenX.Core/RenX_Server.cpp

@ -964,9 +964,9 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line)
} }
else else
kID = kIDToken.asInt(); kID = kIDToken.asInt();
RenX::PlayerInfo *victim = getPlayerOrAdd(kName, kID, vTeam, kIsBot, 0, Jupiter::ReferenceString::empty); RenX::PlayerInfo *killer = getPlayerOrAdd(kName, kID, vTeam, kIsBot, 0, Jupiter::ReferenceString::empty);
for (size_t i = 0; i < xPlugins.size(); i++) for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnKill(this, player, victim, damageType); xPlugins.get(i)->RenX_OnKill(this, killer, player, damageType);
} }
} }
else if (type.equals("died by")) else if (type.equals("died by"))
@ -1246,42 +1246,75 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line)
else if (subHeader.equals("Blocked;")) else if (subHeader.equals("Blocked;"))
{ {
// User | Reason="(Denied by IP Policy)" / "(Not on Whitelist)" // User | Reason="(Denied by IP Policy)" / "(Not on Whitelist)"
Jupiter::ReferenceString user = buff.getToken(2, RenX::DelimC);
Jupiter::ReferenceString message = buff.gotoToken(3, RenX::DelimC);
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnBlock(this, user, message);
} }
else if (subHeader.equals("Connected;")) else if (subHeader.equals("Connected;"))
{ {
// User // User
Jupiter::ReferenceString user = buff.getToken(2, RenX::DelimC);
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnConnect(this, user);
} }
else if (subHeader.equals("Authenticated;")) else if (subHeader.equals("Authenticated;"))
{ {
// User // User
Jupiter::ReferenceString user = buff.getToken(2, RenX::DelimC);
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnAuthenticate(this, user);
} }
else if (subHeader.equals("Banned;")) else if (subHeader.equals("Banned;"))
{ {
// User | "reason" | Reason="(Too many password attempts)" // User | "reason" | Reason="(Too many password attempts)"
Jupiter::ReferenceString user = buff.getToken(2, RenX::DelimC);
Jupiter::ReferenceString message = buff.gotoToken(4, RenX::DelimC);
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnBan(this, user, message);
} }
else if (subHeader.equals("InvalidPassword;")) else if (subHeader.equals("InvalidPassword;"))
{ {
// User // User
Jupiter::ReferenceString user = buff.getToken(2, RenX::DelimC);
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnInvalidPassword(this, user);
} }
else if (subHeader.equals("Dropped;")) else if (subHeader.equals("Dropped;"))
{ {
// User | "reason" | Reason="(Auth Timeout)" // User | "reason" | Reason="(Auth Timeout)"
Jupiter::ReferenceString user = buff.getToken(2, RenX::DelimC);
Jupiter::ReferenceString message = buff.gotoToken(4, RenX::DelimC);
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnDrop(this, user, message);
} }
else if (subHeader.equals("Disconnected;")) else if (subHeader.equals("Disconnected;"))
{ {
// User // User
Jupiter::ReferenceString user = buff.getToken(2, RenX::DelimC);
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnDisconnect(this, user);
} }
else if (subHeader.equals("StoppedListen;")) else if (subHeader.equals("StoppedListen;"))
{ {
// Reason="(Reached Connection Limit)" // Reason="(Reached Connection Limit)"
Jupiter::ReferenceString message = buff.gotoToken(2, RenX::DelimC);
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnStopListen(this, message);
} }
else if (subHeader.equals("ResumedListen;")) else if (subHeader.equals("ResumedListen;"))
{ {
// Reason="(No longer at Connection Limit)" // Reason="(No longer at Connection Limit)"
Jupiter::ReferenceString message = buff.gotoToken(2, RenX::DelimC);
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnResumeListen(this, message);
} }
else if (subHeader.equals("Warning;")) else if (subHeader.equals("Warning;"))
{ {
// Warning="(Hit Max Attempt Records - You should investigate Rcon attempts and/or decrease prune time)" // Warning="(Hit Max Attempt Records - You should investigate Rcon attempts and/or decrease prune time)"
Jupiter::ReferenceString message = buff.gotoToken(2, RenX::DelimC);
for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnWarning(this, message);
} }
else else
{ {

Loading…
Cancel
Save