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

Method SendFile

extensions/sdktools/hooks.cpp:547–585  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

545bool CHookManager::SendFile(const char *filename, unsigned int transferID, bool isReplayDemo)
546#else
547bool CHookManager::SendFile(const char *filename, unsigned int transferID)
548#endif
549{
550 if (m_netFileSendFwd->GetFunctionCount() == 0)
551 {
552 RETURN_META_VALUE(MRES_IGNORED, false);
553 }
554
555 INetChannel *pNetChannel = META_IFACEPTR(INetChannel);
556 if (pNetChannel == NULL)
557 {
558 RETURN_META_VALUE(MRES_IGNORED, false);
559 }
560
561 int userid = 0;
562 IClient *pClient = (IClient *)pNetChannel->GetMsgHandler();
563 if (pClient != NULL)
564 {
565 userid = pClient->GetUserID();
566 }
567
568 cell_t res = Pl_Continue;
569 m_netFileSendFwd->PushCell(playerhelpers->GetClientOfUserId(userid));
570 m_netFileSendFwd->PushString(filename);
571 m_netFileSendFwd->Execute(&res);
572
573 if (res != Pl_Continue)
574 {
575 /* Mimic the Engine. */
576#if (SOURCE_ENGINE >= SE_ALIENSWARM || SOURCE_ENGINE == SE_LEFT4DEAD || SOURCE_ENGINE == SE_LEFT4DEAD2)
577 pNetChannel->DenyFile(filename, transferID, isReplayDemo);
578#else
579 pNetChannel->DenyFile(filename, transferID);
580#endif
581 RETURN_META_VALUE(MRES_SUPERCEDE, false);
582 }
583
584 RETURN_META_VALUE(MRES_IGNORED, false);
585}
586
587#if !defined CLIENTVOICE_HOOK_SUPPORT
588bool CHookManager::ProcessVoiceData(CLC_VoiceData *msg)

Callers

nothing calls this directly

Calls 5

GetFunctionCountMethod · 0.80
PushCellMethod · 0.80
GetClientOfUserIdMethod · 0.80
PushStringMethod · 0.80
ExecuteMethod · 0.45

Tested by

no test coverage detected