| 304 | void MsgListenerWrapper::OnUserMessage(int msg_id, protobuf::Message *msg, IRecipientFilter *pFilter) |
| 305 | #else |
| 306 | void MsgListenerWrapper::OnUserMessage(int msg_id, bf_write *bf, IRecipientFilter *pFilter) |
| 307 | #endif |
| 308 | { |
| 309 | cell_t res; |
| 310 | Handle_t hndl; |
| 311 | size_t size = _FillInPlayers(g_MsgPlayers, pFilter); |
| 312 | |
| 313 | #ifdef USE_PROTOBUF_USERMESSAGES |
| 314 | hndl = handlesys->CreateHandle(g_ProtobufType, new SMProtobufMessage(msg), NULL, g_pCoreIdent, NULL); |
| 315 | #else |
| 316 | g_ReadBitBuf.StartReading(bf->GetBasePointer(), bf->GetNumBytesWritten()); |
| 317 | hndl = g_ReadBufHandle; |
| 318 | #endif |
| 319 | |
| 320 | m_Hook->PushCell(msg_id); |
| 321 | m_Hook->PushCell(hndl); |
| 322 | m_Hook->PushArray(g_MsgPlayers, size); |
| 323 | m_Hook->PushCell(size); |
| 324 | m_Hook->PushCell(pFilter->IsReliable()); |
| 325 | m_Hook->PushCell(pFilter->IsInitMessage()); |
| 326 | m_Hook->Execute(&res); |
| 327 | |
| 328 | #ifdef USE_PROTOBUF_USERMESSAGES |
| 329 | HandleSecurity sec; |
| 330 | sec.pIdentity = g_pCoreIdent; |
| 331 | handlesys->FreeHandle(hndl, &sec); |
| 332 | #endif |
| 333 | } |
| 334 | |
| 335 | #ifdef USE_PROTOBUF_USERMESSAGES |
| 336 | ResultType MsgListenerWrapper::InterceptUserMessage(int msg_id, protobuf::Message *msg, IRecipientFilter *pFilter) |
no test coverage detected