1.1 --- a/core/smn_usermsgs.h Mon Jan 07 09:09:14 2013 -0500
1.2 +++ b/core/smn_usermsgs.h Tue Jan 22 21:43:12 2013 -0500
1.3 @@ -32,9 +32,14 @@
1.4 #ifndef _INCLUDE_SOURCEMOD_CMSGLISTENERWRAPPER_H_
1.5 #define _INCLUDE_SOURCEMOD_CMSGLISTENERWRAPPER_H_
1.6
1.7 -extern int g_MsgPlayers[256];
1.8 +#include "UserMessages.h"
1.9
1.10 -class MsgListenerWrapper : public IUserMessageListener
1.11 +class MsgListenerWrapper
1.12 +#ifdef USE_PROTOBUF_USERMESSAGES
1.13 + : public IProtobufUserMessageListener
1.14 +#else
1.15 + : public IBitBufUserMessageListener
1.16 +#endif
1.17 {
1.18 public:
1.19 void Initialize(int msgid, IPluginFunction *hook, IPluginFunction *notify, bool intercept);
1.20 @@ -43,8 +48,13 @@
1.21 IPluginFunction *GetHookedFunction() const;
1.22 IPluginFunction *GetNotifyFunction() const;
1.23 public: //IUserMessageListener
1.24 +#ifdef USE_PROTOBUF_USERMESSAGES
1.25 + void OnUserMessage(int msg_id, protobuf::Message *msg, IRecipientFilter *pFilter);
1.26 + ResultType InterceptUserMessage(int msg_id, protobuf::Message *msg, IRecipientFilter *pFilter);
1.27 +#else
1.28 void OnUserMessage(int msg_id, bf_write *bf, IRecipientFilter *pFilter);
1.29 ResultType InterceptUserMessage(int msg_id, bf_write *bf, IRecipientFilter *pFilter);
1.30 +#endif
1.31 void OnPostUserMessage(int msg_id, bool sent);
1.32 private:
1.33 size_t _FillInPlayers(int *pl_array, IRecipientFilter *pFilter);
1.34 @@ -56,4 +66,8 @@
1.35 int m_MsgId;
1.36 };
1.37
1.38 +extern HandleType_t g_WrBitBufType;
1.39 +extern HandleType_t g_RdBitBufType;
1.40 +extern HandleType_t g_ProtobufType;
1.41 +
1.42 #endif //_INCLUDE_SOURCEMOD_CMSGLISTENERWRAPPER_H_