mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-30 01:06:44 +00:00
Temporarily use a whitelist for scripts instead of a blacklist
This commit is contained in:
parent
621faf368e
commit
05cfc918f5
2 changed files with 39 additions and 3 deletions
|
@ -282,9 +282,6 @@ void Networking::ProcessPlayerPacket(RakNet::Packet *packet)
|
|||
|
||||
player->resetLastAttacker();
|
||||
|
||||
printf("Time since last attack time for %i: %i\n", player->GetID(),
|
||||
secondsSinceLastAttacker);
|
||||
|
||||
player->CreatureStats()->mDead = true;
|
||||
myPacket->Send(player, true);
|
||||
|
||||
|
|
|
@ -230,6 +230,35 @@ void Main::PressedKey(int key)
|
|||
// should be ignored because of their potential for spam
|
||||
bool Main::isValidPacketScript(std::string script)
|
||||
{
|
||||
static const int validPacketScriptsCount = 21;
|
||||
static const std::string validPacketScripts[validPacketScriptsCount] = {
|
||||
// Ghostgate buttons
|
||||
"GG_OpenGate1", // coc Ghostgate
|
||||
"GG_OpenGate2",
|
||||
// Dwemer ruin cranks
|
||||
"Arkn_doors", // coe 0, -2
|
||||
"nchuleftingthWrong1", // coc "Nchuleftingth, Test of Pattern"
|
||||
"nchuleftingthWrong2",
|
||||
"nchulfetingthRight",
|
||||
"Akula_innerdoors", // coc "Akulakhan's Chamber"
|
||||
"Dagoth_doors", // coe 2, 8
|
||||
// Sotha Sil levers
|
||||
"SothaLever1", // coc "Sotha Sil, Outer Flooded Halls"
|
||||
"SothaLever2",
|
||||
"SothaLever3",
|
||||
"SothaLever4",
|
||||
"SothaLever5",
|
||||
"SothaLever6",
|
||||
"SothaLever7",
|
||||
"SothaLever8",
|
||||
"SothaLever9",
|
||||
"SothaLever10",
|
||||
"SothaLever11",
|
||||
"SothaOilLever", // coc "Sotha Sil, Dome of Udok"
|
||||
// Generic state script
|
||||
"LocalState"
|
||||
};
|
||||
|
||||
static const int invalidPacketScriptsCount = 17;
|
||||
static const std::string invalidPacketScripts[invalidPacketScriptsCount] = {
|
||||
// Spammy shorts
|
||||
|
@ -255,6 +284,15 @@ bool Main::isValidPacketScript(std::string script)
|
|||
"ouch_wraithguard"
|
||||
};
|
||||
|
||||
for (int i = 0; i < validPacketScriptsCount; i++)
|
||||
{
|
||||
if (Misc::StringUtils::ciEqual(script, validPacketScripts[i]))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
/* Switch over to this when using a blacklist system
|
||||
for (int i = 0; i < invalidPacketScriptsCount; i++)
|
||||
{
|
||||
if (Misc::StringUtils::ciEqual(script, invalidPacketScripts[i]))
|
||||
|
@ -262,4 +300,5 @@ bool Main::isValidPacketScript(std::string script)
|
|||
}
|
||||
|
||||
return true;
|
||||
*/
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue