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

Method StartBitBufMessage

core/UserMessages.cpp:188–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188bf_write *UserMessages::StartBitBufMessage(int msg_id, const cell_t players[], unsigned int playersNum, int flags)
189{
190#ifdef USE_PROTOBUF_USERMESSAGES
191 return NULL;
192#else
193 bf_write *buffer;
194
195 if (m_InExec || m_InHook)
196 {
197 return NULL;
198 }
199 if (msg_id < 0 || msg_id >= 255)
200 {
201 return NULL;
202 }
203
204 m_CellRecFilter.Initialize(players, playersNum);
205
206 m_CurFlags = flags;
207 if (m_CurFlags & USERMSG_INITMSG)
208 {
209 m_CellRecFilter.SetToInit(true);
210 }
211 if (m_CurFlags & USERMSG_RELIABLE)
212 {
213 m_CellRecFilter.SetToReliable(true);
214 }
215
216 m_InExec = true;
217
218 if (m_CurFlags & USERMSG_BLOCKHOOKS)
219 {
220#if SOURCE_ENGINE >= SE_LEFT4DEAD
221 buffer = ENGINE_CALL(UserMessageBegin)(static_cast<IRecipientFilter *>(&m_CellRecFilter), msg_id, g_SMAPI->GetUserMessage(msg_id));
222#else
223 buffer = ENGINE_CALL(UserMessageBegin)(static_cast<IRecipientFilter *>(&m_CellRecFilter), msg_id);
224#endif
225 } else {
226#if SOURCE_ENGINE >= SE_LEFT4DEAD
227 buffer = engine->UserMessageBegin(static_cast<IRecipientFilter *>(&m_CellRecFilter), msg_id, g_SMAPI->GetUserMessage(msg_id));
228#else
229 buffer = engine->UserMessageBegin(static_cast<IRecipientFilter *>(&m_CellRecFilter), msg_id);
230#endif
231 }
232
233 return buffer;
234#endif // USE_PROTOBUF_USERMESSAGES
235}
236
237google::protobuf::Message *UserMessages::StartProtobufMessage(int msg_id, const cell_t players[], unsigned int playersNum, int flags)
238{

Callers 7

smn_StartMessageFunction · 0.80
smn_StartMessageExFunction · 0.80
TextMsgMethod · 0.80
HintTextMsgMethod · 0.80
ShowVGUIMenuMethod · 0.80
UTIL_SendHudTextFunction · 0.80
Radio_RefreshMethod · 0.80

Calls 3

InitializeMethod · 0.45
SetToInitMethod · 0.45
SetToReliableMethod · 0.45

Tested by

no test coverage detected