MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / OnMessageEnd_Pre

Method OnMessageEnd_Pre

core/UserMessages.cpp:708–835  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

706}
707
708void UserMessages::OnMessageEnd_Pre()
709{
710 if (!m_InHook)
711 {
712 UM_RETURN_META(MRES_IGNORED);
713 }
714
715 MsgList *pList;
716 MsgIter iter;
717 ListenerInfo *pInfo;
718
719 ResultType res;
720 bool intercepted = false;
721 bool handled = false;
722
723 pList = &m_msgIntercepts[m_CurId];
724 for (iter=pList->begin(); iter!=pList->end(); )
725 {
726 pInfo = (*iter);
727 pInfo->IsHooked = true;
728#ifdef USE_PROTOBUF_USERMESSAGES
729 res = pInfo->Callback->InterceptUserMessage(m_CurId, m_InterceptBuffer, m_CurRecFilter);
730#else
731 res = pInfo->Callback->InterceptUserMessage(m_CurId, &m_InterceptBuffer, m_CurRecFilter);
732#endif
733
734 intercepted = true;
735
736 switch (res)
737 {
738 case Pl_Stop:
739 {
740 if (pInfo->KillMe)
741 {
742 pList->erase(iter);
743 m_FreeListeners.push(pInfo);
744 _DecRefCounter();
745 goto supercede;
746 }
747 pInfo->IsHooked = false;
748 goto supercede;
749 }
750 case Pl_Handled:
751 {
752 handled = true;
753 if (pInfo->KillMe)
754 {
755 iter = pList->erase(iter);
756 m_FreeListeners.push(pInfo);
757 _DecRefCounter();
758 continue;
759 }
760 break;
761 }
762 default:
763 {
764 if (pInfo->KillMe)
765 {

Callers

nothing calls this directly

Calls 7

NewMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
InterceptUserMessageMethod · 0.45
eraseMethod · 0.45
pushMethod · 0.45
OnUserMessageMethod · 0.45

Tested by

no test coverage detected