Browse Source

Added support for new HWID log

Revised nBab's pull request
Removed compiled .lib files
pull/4/head
Jessica James 8 years ago
parent
commit
6901c90279
  1. BIN
      Release/Bot.lib
  2. BIN
      Release/Plugins/RenX.Core.lib
  3. 124
      RenX.Core/RenX_Functions.cpp
  4. 5
      RenX.Core/RenX_Plugin.cpp
  5. 1
      RenX.Core/RenX_Plugin.h
  6. 19
      RenX.Core/RenX_Server.cpp

BIN
Release/Bot.lib

Binary file not shown.

BIN
Release/Plugins/RenX.Core.lib

Binary file not shown.

124
RenX.Core/RenX_Functions.cpp

@ -92,6 +92,9 @@ Jupiter::ReferenceString translated_Vehicle_StealthTank = STRING_LITERAL_AS_REFE
Jupiter::ReferenceString translated_Vehicle_Chinook_Nod = STRING_LITERAL_AS_REFERENCE("Nod Chinook"); Jupiter::ReferenceString translated_Vehicle_Chinook_Nod = STRING_LITERAL_AS_REFERENCE("Nod Chinook");
Jupiter::ReferenceString translated_Vehicle_Apache = STRING_LITERAL_AS_REFERENCE("Apache"); Jupiter::ReferenceString translated_Vehicle_Apache = STRING_LITERAL_AS_REFERENCE("Apache");
Jupiter::ReferenceString translated_Vehicle_ReconBike = STRING_LITERAL_AS_REFERENCE("Recon Bike");
Jupiter::ReferenceString translated_Vehicle_TickTank = STRING_LITERAL_AS_REFERENCE("Tick Tank");
/** GDI Vehicles */ /** GDI Vehicles */
Jupiter::ReferenceString translated_Vehicle_Harvester_GDI = STRING_LITERAL_AS_REFERENCE("GDI Harvester"); Jupiter::ReferenceString translated_Vehicle_Harvester_GDI = STRING_LITERAL_AS_REFERENCE("GDI Harvester");
Jupiter::ReferenceString translated_Vehicle_Humvee = STRING_LITERAL_AS_REFERENCE("Humvee"); Jupiter::ReferenceString translated_Vehicle_Humvee = STRING_LITERAL_AS_REFERENCE("Humvee");
@ -102,6 +105,10 @@ Jupiter::ReferenceString translated_Vehicle_MammothTank = STRING_LITERAL_AS_REFE
Jupiter::ReferenceString translated_Vehicle_Chinook_GDI = STRING_LITERAL_AS_REFERENCE("GDI Chinook"); Jupiter::ReferenceString translated_Vehicle_Chinook_GDI = STRING_LITERAL_AS_REFERENCE("GDI Chinook");
Jupiter::ReferenceString translated_Vehicle_Orca = STRING_LITERAL_AS_REFERENCE("Orca"); Jupiter::ReferenceString translated_Vehicle_Orca = STRING_LITERAL_AS_REFERENCE("Orca");
Jupiter::ReferenceString translated_Vehicle_HoverMRLS = STRING_LITERAL_AS_REFERENCE("Hover MRLS");
Jupiter::ReferenceString translated_Vehicle_Titan = STRING_LITERAL_AS_REFERENCE("Titan");
Jupiter::ReferenceString translated_Vehicle_Wolverine = STRING_LITERAL_AS_REFERENCE("Wolverine");
/** Other Vehicles */ /** Other Vehicles */
Jupiter::ReferenceString translated_Vehicle_A10_DmgType_GattlingGun = STRING_LITERAL_AS_REFERENCE("A10 Thunderbolt Gattling Gun"); Jupiter::ReferenceString translated_Vehicle_A10_DmgType_GattlingGun = STRING_LITERAL_AS_REFERENCE("A10 Thunderbolt Gattling Gun");
Jupiter::ReferenceString translated_Vehicle_A10_DmgType_Bomb = STRING_LITERAL_AS_REFERENCE("A10 Thunderbolt Bomb"); Jupiter::ReferenceString translated_Vehicle_A10_DmgType_Bomb = STRING_LITERAL_AS_REFERENCE("A10 Thunderbolt Bomb");
@ -260,6 +267,9 @@ Jupiter::ReferenceString translated_DmgType_StealthTank = STRING_LITERAL_AS_REFE
Jupiter::ReferenceString translated_DmgType_Chinook_Nod = STRING_LITERAL_AS_REFERENCE("Nod Chinook"); Jupiter::ReferenceString translated_DmgType_Chinook_Nod = STRING_LITERAL_AS_REFERENCE("Nod Chinook");
Jupiter::ReferenceString translated_DmgType_Apache = STRING_LITERAL_AS_REFERENCE("Apache"); Jupiter::ReferenceString translated_DmgType_Apache = STRING_LITERAL_AS_REFERENCE("Apache");
Jupiter::ReferenceString translated_Vehicle_ReconBike_DmgType = STRING_LITERAL_AS_REFERENCE("Recon Bike");
Jupiter::ReferenceString translated_Vehicle_TickTank_DmgType = STRING_LITERAL_AS_REFERENCE("Tick Tank");
/** GDI Vehicles */ /** GDI Vehicles */
Jupiter::ReferenceString translated_DmgType_Harvester_GDI = STRING_LITERAL_AS_REFERENCE("GDI Harvester"); Jupiter::ReferenceString translated_DmgType_Harvester_GDI = STRING_LITERAL_AS_REFERENCE("GDI Harvester");
Jupiter::ReferenceString translated_DmgType_Humvee = STRING_LITERAL_AS_REFERENCE("Humvee"); Jupiter::ReferenceString translated_DmgType_Humvee = STRING_LITERAL_AS_REFERENCE("Humvee");
@ -270,6 +280,10 @@ Jupiter::ReferenceString translated_DmgType_MammothTank = STRING_LITERAL_AS_REFE
Jupiter::ReferenceString translated_DmgType_Chinook_GDI = STRING_LITERAL_AS_REFERENCE("GDI Chinook"); Jupiter::ReferenceString translated_DmgType_Chinook_GDI = STRING_LITERAL_AS_REFERENCE("GDI Chinook");
Jupiter::ReferenceString translated_DmgType_Orca = STRING_LITERAL_AS_REFERENCE("Orca"); Jupiter::ReferenceString translated_DmgType_Orca = STRING_LITERAL_AS_REFERENCE("Orca");
Jupiter::ReferenceString translated_Vehicle_HoverMRLS_DmgType = STRING_LITERAL_AS_REFERENCE("Hover MRLS");
Jupiter::ReferenceString translated_Vehicle_Titan_DmgType = STRING_LITERAL_AS_REFERENCE("Titan");
Jupiter::ReferenceString translated_Vehicle_Wolverine_DmgType = STRING_LITERAL_AS_REFERENCE("Wolverine");
/** Other Vehicles */ /** Other Vehicles */
Jupiter::ReferenceString translated_DmgType_A10_Missile = STRING_LITERAL_AS_REFERENCE("A10 Missile"); Jupiter::ReferenceString translated_DmgType_A10_Missile = STRING_LITERAL_AS_REFERENCE("A10 Missile");
@ -335,30 +349,6 @@ Jupiter::ReferenceString translated_IonCannonBeacon = STRING_LITERAL_AS_REFERENC
Jupiter::ReferenceString translated_NukeBeacon = STRING_LITERAL_AS_REFERENCE("Nuclear Strike Beacon"); Jupiter::ReferenceString translated_NukeBeacon = STRING_LITERAL_AS_REFERENCE("Nuclear Strike Beacon");
Jupiter::ReferenceString translated_KillZDamageType = STRING_LITERAL_AS_REFERENCE("Kill Zone"); Jupiter::ReferenceString translated_KillZDamageType = STRING_LITERAL_AS_REFERENCE("Kill Zone");
/*****************************
* TIBERIAN SUN TRANSLATIONS
*****************************/
/** Nod Tiberian Sun Vehicles */
Jupiter::ReferenceString translated_TS_Vehicle_Buggy = STRING_LITERAL_AS_REFERENCE("TS Buggy");
Jupiter::ReferenceString translated_TS_Vehicle_ReconBike = STRING_LITERAL_AS_REFERENCE("Recon Bike");
Jupiter::ReferenceString translated_TS_Vehicle_TickTank = STRING_LITERAL_AS_REFERENCE("Tick-Tank");
/** GDI Tiberian Sun Vehicles */
Jupiter::ReferenceString translated_TS_Vehicle_HoverMRLS = STRING_LITERAL_AS_REFERENCE("Hover MRLS");
Jupiter::ReferenceString translated_TS_Vehicle_Titan = STRING_LITERAL_AS_REFERENCE("Titan");
Jupiter::ReferenceString translated_TS_Vehicle_Wolverine = STRING_LITERAL_AS_REFERENCE("Wolverine");
/** Nod Tiberian Sun Vehicle Damage Types */
Jupiter::ReferenceString translated_TS_Vehicle_Buggy_DmgType = STRING_LITERAL_AS_REFERENCE("TS Buggy");
Jupiter::ReferenceString translated_TS_Vehicle_ReconBike_DmgType = STRING_LITERAL_AS_REFERENCE("Recon Bike");
Jupiter::ReferenceString translated_TS_Vehicle_TickTank_DmgType = STRING_LITERAL_AS_REFERENCE("Tick-Tank");
/** GDI Tiberian Sun Vehicle Damage Types*/
Jupiter::ReferenceString translated_TS_Vehicle_HoverMRLS_DmgType = STRING_LITERAL_AS_REFERENCE("Hover MRLS");
Jupiter::ReferenceString translated_TS_Vehicle_Titan_DmgType = STRING_LITERAL_AS_REFERENCE("Titan");
Jupiter::ReferenceString translated_TS_Vehicle_Wolverine_DmgType = STRING_LITERAL_AS_REFERENCE("Wolverine");
RenX::TeamType RenX::getTeam(int teamNum) RenX::TeamType RenX::getTeam(int teamNum)
{ {
switch (teamNum) switch (teamNum)
@ -507,85 +497,13 @@ const Jupiter::ReferenceString RenX::translateName(const Jupiter::ReadableString
Jupiter::ReferenceString object = obj; Jupiter::ReferenceString object = obj;
if (object.find(STRING_LITERAL_AS_REFERENCE("TS_")) == 0)
{
object.shiftRight(3);
if (object.find(STRING_LITERAL_AS_REFERENCE("Vehicle_")) == 0)
{
object.shiftRight(8);
/** Nod Tiberian Sun Vehicles */
if (object.equals(STRING_LITERAL_AS_REFERENCE("Buggy"))) return translated_TS_Vehicle_Buggy;
if (object.equals(STRING_LITERAL_AS_REFERENCE("ReconBike"))) return translated_TS_Vehicle_ReconBike;
if (object.equals(STRING_LITERAL_AS_REFERENCE("TickTank"))) return translated_TS_Vehicle_TickTank;
/** GDI Tiberian Sun Vehicles */
if (object.equals(STRING_LITERAL_AS_REFERENCE("HoverMRLS"))) return translated_TS_Vehicle_HoverMRLS;
if (object.equals(STRING_LITERAL_AS_REFERENCE("Titan"))) return translated_TS_Vehicle_Titan;
if (object.equals(STRING_LITERAL_AS_REFERENCE("Wolverine"))) return translated_TS_Vehicle_Wolverine;
/** Nod Tiberian Sun Vehicle Damage Types */
if (object.equals(STRING_LITERAL_AS_REFERENCE("Buggy_DmgType"))) return translated_TS_Vehicle_Buggy_DmgType;
if (object.equals(STRING_LITERAL_AS_REFERENCE("ReconBike_DmgType"))) return translated_TS_Vehicle_ReconBike_DmgType;
if (object.equals(STRING_LITERAL_AS_REFERENCE("TickTank_DmgType"))) return translated_TS_Vehicle_TickTank_DmgType;
/** GDI Tiberian Sun Vehicle Damage Types */
if (object.equals(STRING_LITERAL_AS_REFERENCE("HoverMRLS_DmgType"))) return translated_TS_Vehicle_HoverMRLS_DmgType;
if (object.equals(STRING_LITERAL_AS_REFERENCE("Titan_DmgType"))) return translated_TS_Vehicle_Titan_DmgType;
if (object.equals(STRING_LITERAL_AS_REFERENCE("Wolverine_DmgType"))) return translated_TS_Vehicle_Wolverine_DmgType;
}
return object;
}
/** Fort Vehicles */
if (object.find(STRING_LITERAL_AS_REFERENCE("nBab_")) == 0) if (object.find(STRING_LITERAL_AS_REFERENCE("nBab_")) == 0)
{ object.shiftRight(5);
object.shiftRight(3);
if (object.find(STRING_LITERAL_AS_REFERENCE("TS_")) == 0)
{
object.shiftRight(3);
if (object.find(STRING_LITERAL_AS_REFERENCE("Vehicle_")) == 0)
{
object.shiftRight(8);
/** Nod Tiberian Sun Vehicles */
if (object.equals(STRING_LITERAL_AS_REFERENCE("Buggy"))) return translated_TS_Vehicle_Buggy;
}
}
else if (object.find(STRING_LITERAL_AS_REFERENCE("Vehicle_")) == 0)
{
object.shiftRight(8);
/** Nod Tiberian Sun Vehicles */
if (object.equals(STRING_LITERAL_AS_REFERENCE("ReconBike"))) return translated_TS_Vehicle_ReconBike;
if (object.equals(STRING_LITERAL_AS_REFERENCE("TickTank"))) return translated_TS_Vehicle_TickTank;
/** GDI Tiberian Sun Vehicles */
if (object.equals(STRING_LITERAL_AS_REFERENCE("HoverMRLS"))) return translated_TS_Vehicle_HoverMRLS;
if (object.equals(STRING_LITERAL_AS_REFERENCE("Titan"))) return translated_TS_Vehicle_Titan;
if (object.equals(STRING_LITERAL_AS_REFERENCE("Wolverine"))) return translated_TS_Vehicle_Wolverine;
/** Nod Vehicles */
if (object.equals(STRING_LITERAL_AS_REFERENCE("Harvester_Nod"))) return translated_Vehicle_Harvester_Nod;
if (object.equals(STRING_LITERAL_AS_REFERENCE("Buggy"))) return translated_Vehicle_Buggy;
if (object.equals(STRING_LITERAL_AS_REFERENCE("Artillery"))) return translated_Vehicle_Artillery;
if (object.equals(STRING_LITERAL_AS_REFERENCE("APC_Nod"))) return translated_Vehicle_APC_Nod;
if (object.equals(STRING_LITERAL_AS_REFERENCE("LightTank"))) return translated_Vehicle_LightTank;
if (object.equals(STRING_LITERAL_AS_REFERENCE("FlameTank"))) return translated_Vehicle_FlameTank;
if (object.equals(STRING_LITERAL_AS_REFERENCE("StealthTank"))) return translated_Vehicle_StealthTank;
/** GDI Vehicles */
if (object.equals(STRING_LITERAL_AS_REFERENCE("Harvester_GDI"))) return translated_Vehicle_Harvester_GDI;
if (object.equals(STRING_LITERAL_AS_REFERENCE("Humvee"))) return translated_Vehicle_Humvee;
if (object.equals(STRING_LITERAL_AS_REFERENCE("MRLS"))) return translated_Vehicle_MRLS;
if (object.equals(STRING_LITERAL_AS_REFERENCE("APC_GDI"))) return translated_Vehicle_APC_GDI;
if (object.equals(STRING_LITERAL_AS_REFERENCE("MediumTank"))) return translated_Vehicle_MediumTank;
if (object.equals(STRING_LITERAL_AS_REFERENCE("MammothTank"))) return translated_Vehicle_MammothTank;
}
return object;
}
if (object.find(STRING_LITERAL_AS_REFERENCE("Rx_")) == 0) if (object.find(STRING_LITERAL_AS_REFERENCE("Rx_")) == 0)
object.shiftRight(3); object.shiftRight(3);
else if (object.find(STRING_LITERAL_AS_REFERENCE("TS_")) == 0)
object.shiftRight(3);
if (object.find(STRING_LITERAL_AS_REFERENCE("Vehicle_")) == 0) if (object.find(STRING_LITERAL_AS_REFERENCE("Vehicle_")) == 0)
{ {
@ -602,6 +520,9 @@ const Jupiter::ReferenceString RenX::translateName(const Jupiter::ReadableString
if (object.equals(STRING_LITERAL_AS_REFERENCE("Chinook_Nod"))) return translated_Vehicle_Chinook_Nod; if (object.equals(STRING_LITERAL_AS_REFERENCE("Chinook_Nod"))) return translated_Vehicle_Chinook_Nod;
if (object.equals(STRING_LITERAL_AS_REFERENCE("Apache"))) return translated_Vehicle_Apache; if (object.equals(STRING_LITERAL_AS_REFERENCE("Apache"))) return translated_Vehicle_Apache;
if (object.equals(STRING_LITERAL_AS_REFERENCE("ReconBike"))) return translated_Vehicle_ReconBike;
if (object.equals(STRING_LITERAL_AS_REFERENCE("TickTank"))) return translated_Vehicle_TickTank;
/** GDI Vehicles */ /** GDI Vehicles */
if (object.equals(STRING_LITERAL_AS_REFERENCE("Harvester_GDI"))) return translated_Vehicle_Harvester_GDI; if (object.equals(STRING_LITERAL_AS_REFERENCE("Harvester_GDI"))) return translated_Vehicle_Harvester_GDI;
if (object.equals(STRING_LITERAL_AS_REFERENCE("Humvee"))) return translated_Vehicle_Humvee; if (object.equals(STRING_LITERAL_AS_REFERENCE("Humvee"))) return translated_Vehicle_Humvee;
@ -612,6 +533,10 @@ const Jupiter::ReferenceString RenX::translateName(const Jupiter::ReadableString
if (object.equals(STRING_LITERAL_AS_REFERENCE("Chinook_GDI"))) return translated_Vehicle_Chinook_GDI; if (object.equals(STRING_LITERAL_AS_REFERENCE("Chinook_GDI"))) return translated_Vehicle_Chinook_GDI;
if (object.equals(STRING_LITERAL_AS_REFERENCE("Orca"))) return translated_Vehicle_Orca; if (object.equals(STRING_LITERAL_AS_REFERENCE("Orca"))) return translated_Vehicle_Orca;
if (object.equals(STRING_LITERAL_AS_REFERENCE("HoverMRLS"))) return translated_Vehicle_HoverMRLS;
if (object.equals(STRING_LITERAL_AS_REFERENCE("Titan"))) return translated_Vehicle_Titan;
if (object.equals(STRING_LITERAL_AS_REFERENCE("Wolverine"))) return translated_Vehicle_Wolverine;
/** Other Vehicles */ /** Other Vehicles */
if (object.equals(STRING_LITERAL_AS_REFERENCE("A10_DmgType_GattlingGun"))) return translated_Vehicle_A10_DmgType_GattlingGun; if (object.equals(STRING_LITERAL_AS_REFERENCE("A10_DmgType_GattlingGun"))) return translated_Vehicle_A10_DmgType_GattlingGun;
if (object.equals(STRING_LITERAL_AS_REFERENCE("A10_DmgType_Bomb"))) return translated_Vehicle_A10_DmgType_Bomb; if (object.equals(STRING_LITERAL_AS_REFERENCE("A10_DmgType_Bomb"))) return translated_Vehicle_A10_DmgType_Bomb;
@ -813,7 +738,6 @@ const Jupiter::ReferenceString RenX::translateName(const Jupiter::ReadableString
else if (object.find(STRING_LITERAL_AS_REFERENCE("CapturableMCT_")) == 0) else if (object.find(STRING_LITERAL_AS_REFERENCE("CapturableMCT_")) == 0)
{ {
object.shiftRight(14); object.shiftRight(14);
/** Fort structures */
if (object.equals(STRING_LITERAL_AS_REFERENCE("Fort"))) return translated_CapturableMCT_Fort; if (object.equals(STRING_LITERAL_AS_REFERENCE("Fort"))) return translated_CapturableMCT_Fort;
if (object.equals(STRING_LITERAL_AS_REFERENCE("MC"))) return translated_CapturableMCT_MC; if (object.equals(STRING_LITERAL_AS_REFERENCE("MC"))) return translated_CapturableMCT_MC;
if (object.equals(STRING_LITERAL_AS_REFERENCE("Fort_Internals"))) return translated_CapturableMCT_Fort_Internals; if (object.equals(STRING_LITERAL_AS_REFERENCE("Fort_Internals"))) return translated_CapturableMCT_Fort_Internals;

5
RenX.Core/RenX_Plugin.cpp

@ -111,6 +111,11 @@ void RenX::Plugin::RenX_OnTeamChange(Server *, const PlayerInfo *, const TeamTyp
return; return;
} }
void RenX::Plugin::RenX_OnHWID(Server *, const PlayerInfo *)
{
return;
}
void RenX::Plugin::RenX_OnIDChange(Server *, const PlayerInfo *, int) void RenX::Plugin::RenX_OnIDChange(Server *, const PlayerInfo *, int)
{ {
return; return;

1
RenX.Core/RenX_Plugin.h

@ -61,6 +61,7 @@ namespace RenX
virtual void RenX_OnKick(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &reason); virtual void RenX_OnKick(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &reason);
virtual void RenX_OnNameChange(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &newPlayerName); virtual void RenX_OnNameChange(Server *server, const PlayerInfo *player, const Jupiter::ReadableString &newPlayerName);
virtual void RenX_OnTeamChange(Server *server, const PlayerInfo *player, const TeamType &oldTeam); virtual void RenX_OnTeamChange(Server *server, const PlayerInfo *player, const TeamType &oldTeam);
virtual void RenX_OnHWID(Server *server, const PlayerInfo *player);
virtual void RenX_OnIDChange(Server *server, const PlayerInfo *player, int oldID); virtual void RenX_OnIDChange(Server *server, const PlayerInfo *player, int oldID);
virtual void RenX_OnRank(Server *server, const PlayerInfo *player); virtual void RenX_OnRank(Server *server, const PlayerInfo *player);
virtual void RenX_OnDev(Server *server, const PlayerInfo *player); virtual void RenX_OnDev(Server *server, const PlayerInfo *player);

19
RenX.Core/RenX_Server.cpp

@ -2664,6 +2664,22 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line)
xPlugins.get(i)->RenX_OnTeamChange(this, player, oldTeam); xPlugins.get(i)->RenX_OnTeamChange(this, player, oldTeam);
} }
} }
else if (subHeader.equals("HWID;"))
{
// ["player" |] Player | "hwid" | HWID
size_t offset = 0;
if (tokens.getToken(2).equals("player"))
offset = 1;
RenX::PlayerInfo *player = parseGetPlayerOrAdd(tokens.getToken(2 + offset));
player->hwid = tokens.getToken(4 + offset);
if (player->isBot == false)
this->banCheck(player);
for (size_t index = 0; index < xPlugins.size(); ++index)
xPlugins.get(index)->RenX_OnHWID(this, player);
}
else if (subHeader.equals("Exit;")) else if (subHeader.equals("Exit;"))
{ {
// Player // Player
@ -2709,13 +2725,16 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line)
if (player != nullptr) if (player != nullptr)
{ {
player->id = tokens.getToken(3).asInt(); player->id = tokens.getToken(3).asInt();
if (player->isBot == false) if (player->isBot == false)
this->banCheck(player); this->banCheck(player);
if (this->devBot && player->global_rank != 0U) if (this->devBot && player->global_rank != 0U)
{ {
if (this->rconVersion >= 4) if (this->rconVersion >= 4)
this->sendData(Jupiter::StringS::Format("dset_rank %d %d\n", player->id, player->global_rank)); this->sendData(Jupiter::StringS::Format("dset_rank %d %d\n", player->id, player->global_rank));
} }
for (size_t i = 0; i < xPlugins.size(); i++) for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnIDChange(this, player, oldID); xPlugins.get(i)->RenX_OnIDChange(this, player, oldID);
} }

Loading…
Cancel
Save