From 0c1b6bb096c9aa7e4b8740aaf6df81a599e077a0 Mon Sep 17 00:00:00 2001 From: Bartek Bok Date: Tue, 31 May 2011 17:34:08 +0200 Subject: [PATCH] Some messages are useful --- .../plNetClient/plNetClientMsgScreener.cpp | 10 ++++--- .../plNetCommon/plNetMsgScreener.cpp | 27 ++----------------- 2 files changed, 8 insertions(+), 29 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgScreener.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgScreener.cpp index aa9528ba..af34573d 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgScreener.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgScreener.cpp @@ -144,13 +144,11 @@ bool plNetClientMsgScreener::AllowIncomingMessage(const plMessage* msg) const bool plNetClientMsgScreener::IScreenIncoming(const plMessage* msg) const { - // Why would you EVER send a RefMsg accross the network??? - if (plFactory::DerivesFrom(CLASS_INDEX_SCOPED(plRefMsg), msg->ClassIndex())) - return false; - // Blacklist some obvious hacks here... switch (msg->ClassIndex()) { + case CLASS_INDEX_SCOPED(plAttachMsg): + return true; case CLASS_INDEX_SCOPED(plAudioSysMsg): // This message has a flawed read/write return false; @@ -170,4 +168,8 @@ bool plNetClientMsgScreener::IScreenIncoming(const plMessage* msg) const // might break something that we really shouldn't... return true; } + + // Toss non-attach plRefMsgs + if (plFactory::DerivesFrom(CLASS_INDEX_SCOPED(plRefMsg), msg->ClassIndex())) + return false; } diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetMsgScreener.cpp b/Sources/Plasma/PubUtilLib/plNetCommon/plNetMsgScreener.cpp index ba49e33c..4afe7e2a 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetMsgScreener.cpp +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetMsgScreener.cpp @@ -90,18 +90,6 @@ void plNetMsgScreener::IRejectLogMsg(const plMessage* msg, const char* desc, con // plNetMsgScreener::Answer plNetMsgScreener::IAllowMessageType(int16_t classIndex, const plNetGameMember* gm) const { - // Check based on baseclass - if (plFactory::DerivesFrom(plCCRMessage::Index(), classIndex)) - { - ILogCCRMessage(classIndex, gm); - Answer ans=IIsSenderCCR(gm) ? kYes : kNo; - if (ans==kNo) - { - IRejectLogMsg(classIndex, "Not a CCR", gm); - } - return ans; - } - // Check based on exact type switch(classIndex) { @@ -129,19 +117,8 @@ plNetMsgScreener::Answer plNetMsgScreener::IAllowMessageType(int16_t classIndex, case CLASS_INDEX_SCOPED(plLinkToAgeMsg): case CLASS_INDEX_SCOPED(plSubWorldMsg): return kYes; - - // definitely yes or no (based on whether sender is a CCR) - case CLASS_INDEX_SCOPED(plWarpMsg): - { - Answer ans=IIsSenderCCR(gm) ? kYes : kNo; - if (ans==kNo) - { - IRejectLogMsg(classIndex, "Not a CCR", gm); - } - return ans; - } - - // conditionally yes, requires further validation of msg contents + + // conditionally yes, requires further validation of msg contents case CLASS_INDEX_SCOPED(plAnimCmdMsg): case CLASS_INDEX_SCOPED(pfKIMsg): case CLASS_INDEX_SCOPED(plAvTaskMsg):