Exemplo n.º 1
0
void MsgListenerWrapper::OnUserMessage(int msg_id, bf_write *bf, IRecipientFilter *pFilter)
{
	cell_t res;
	size_t size = _FillInPlayers(g_MsgPlayers, pFilter);

	g_ReadBitBuf.StartReading(bf->GetBasePointer(), bf->GetNumBytesWritten());

	m_Hook->PushCell(msg_id);
	m_Hook->PushCell(g_ReadBufHandle);
	m_Hook->PushArray(g_MsgPlayers, size);
	m_Hook->PushCell(size);
	m_Hook->PushCell(pFilter->IsReliable());
	m_Hook->PushCell(pFilter->IsInitMessage());
	m_Hook->Execute(&res);
}
Exemplo n.º 2
0
ResultType MsgListenerWrapper::InterceptUserMessage(int msg_id, bf_write *bf, IRecipientFilter *pFilter)
{
	cell_t res = static_cast<cell_t>(Pl_Continue);
	size_t size = _FillInPlayers(g_MsgPlayers, pFilter);

	g_ReadBitBuf.StartReading(bf->GetBasePointer(), bf->GetNumBytesWritten());

	m_Intercept->PushCell(msg_id);
	m_Intercept->PushCell(g_ReadBufHandle);
	m_Intercept->PushArray(g_MsgPlayers, size);
	m_Intercept->PushCell(size);
	m_Intercept->PushCell(pFilter->IsReliable());
	m_Intercept->PushCell(pFilter->IsInitMessage());
	m_Intercept->Execute(&res);

	return static_cast<ResultType>(res);
}