Skip to content

Commit 7f69407

Browse files
committed
Removed unecessary MRecipientFilter wrap
1 parent 2dd04ad commit 7f69407

13 files changed

+41
-189
lines changed

src/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,10 @@ Set(SOURCEPYTHON_PLAYERS_MODULE_SOURCES
261261
# ------------------------------------------------------------------
262262
Set(SOURCEPYTHON_RECIPIENTFILTER_MODULE_HEADERS
263263
core/modules/recipientfilters/mrecipientfilter.h
264-
core/modules/recipientfilters/mrecipientfilter_wrap.h
265264
)
266265

267266
Set(SOURCEPYTHON_RECIPIENTFILTER_MODULE_SOURCES
268267
core/modules/recipientfilters/mrecipientfilter.cpp
269-
core/modules/recipientfilters/mrecipientfilter_wrap.cpp
270268
core/modules/recipientfilters/mrecipientfilter_wrap_python.cpp
271269
)
272270

src/core/modules/recipientfilters/mrecipientfilter_wrap.cpp

Lines changed: 0 additions & 84 deletions
This file was deleted.

src/core/modules/recipientfilters/mrecipientfilter_wrap.h

Lines changed: 0 additions & 53 deletions
This file was deleted.

src/core/modules/recipientfilters/mrecipientfilter_wrap_python.cpp

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -28,78 +28,69 @@
2828
*/
2929

3030
#include "modules/export_main.h"
31-
#include "mrecipientfilter_wrap.h"
32-
33-
//---------------------------------------------------------------------------------
34-
// Namespaces to use
35-
//---------------------------------------------------------------------------------
36-
using namespace boost::python;
37-
38-
//---------------------------------------------------------------------------------
39-
// Exposer functions.
40-
//---------------------------------------------------------------------------------
41-
void export_mrecipientfilter_interface();
31+
#include "mrecipientfilter.h"
4232

4333
//---------------------------------------------------------------------------------
4434
// Exposes the engine module.
4535
//---------------------------------------------------------------------------------
36+
void export_mrecipientfilter();
37+
4638
DECLARE_SP_MODULE(recipientfilter_c)
4739
{
48-
export_mrecipientfilter_interface();
40+
export_mrecipientfilter();
4941
}
5042

51-
void export_mrecipientfilter_interface()
43+
void export_mrecipientfilter()
5244
{
53-
BOOST_CLASS_NOCOPY( CMRecipientFilter )
54-
55-
CLASS_METHOD(CMRecipientFilter,
56-
is_reliable,
45+
// TODO: Rename class
46+
class_<MRecipientFilter, boost::noncopyable>("CMRecipientFilter")
47+
.def("is_reliable",
48+
&MRecipientFilter::IsReliable,
5749
"Whether this recipient filter will be network reliable (sent in-order)"
5850
)
5951

60-
CLASS_METHOD(CMRecipientFilter,
61-
is_init_message,
52+
.def("is_init_message",
53+
&MRecipientFilter::IsInitMessage,
6254
"Whether the message has been initialised?"
6355
)
6456

65-
CLASS_METHOD(CMRecipientFilter,
66-
get_recipient_count,
57+
.def("get_recipient_count",
58+
&MRecipientFilter::GetRecipientCount,
6759
"Obtain the amount of clients in this filter"
6860
)
6961

70-
CLASS_METHOD(CMRecipientFilter,
71-
get_recipient_index,
62+
.def("get_recipient_index",
63+
&MRecipientFilter::GetRecipientIndex,
7264
"Obtains the player index at the slot in the filter",
7365
args("slot")
7466
)
7567

76-
CLASS_METHOD(CMRecipientFilter,
77-
add_all_players,
68+
.def("add_all_players",
69+
&MRecipientFilter::AddAllPlayers,
7870
"Adds all the players on the server to the filter"
7971
)
8072

81-
CLASS_METHOD(CMRecipientFilter,
82-
add_recipient,
73+
.def("add_recipient",
74+
&MRecipientFilter::AddRecipient,
8375
"Adds the index of the player to the filter",
8476
args("iPlayer")
8577
)
8678

87-
CLASS_METHOD(CMRecipientFilter,
88-
remove_all_players,
79+
.def("remove_all_players",
80+
&MRecipientFilter::RemoveAllPlayers,
8981
"Removes all the players on the server from the filter"
9082
)
9183

92-
CLASS_METHOD(CMRecipientFilter,
93-
remove_recipient,
84+
.def("remove_recipient",
85+
&MRecipientFilter::RemoveRecipient,
9486
"Removes the index of the player from the filter",
9587
args("iPlayer")
9688
)
9789

98-
CLASS_METHOD(CMRecipientFilter,
99-
has_recipient,
90+
.def("has_recipient",
91+
&MRecipientFilter::HasRecipient,
10092
"Returns true if the given index is in the recipient, false otherwise.",
10193
args("iPlayer")
10294
)
103-
104-
BOOST_END_CLASS()
95+
;
10596
}

src/core/modules/usermessage/csgo/usermessage_implementation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "public/game/shared/csgo/protobuf/cstrike15_usermessages.pb.h"
3131
#include "public/game/shared/csgo/protobuf/cstrike15_usermessage_helpers.h"
3232

33-
CUserMessageImplementation::CUserMessageImplementation( const CMRecipientFilter &recipient_filter, const char *message_name ) :
33+
CUserMessageImplementation::CUserMessageImplementation( const MRecipientFilter &recipient_filter, const char *message_name ) :
3434
IUsermessageImplementationBase(recipient_filter, message_name),
3535
m_message(NULL)
3636
{
@@ -50,7 +50,7 @@ void CUserMessageImplementation::send_message_internal()
5050
{
5151
if (m_message != NULL && m_message_index != -1)
5252
{
53-
engine->SendUserMessage(const_cast<CMRecipientFilter&>(m_recipient_filter), m_message_index, *m_message);
53+
engine->SendUserMessage(const_cast<MRecipientFilter&>(m_recipient_filter), m_message_index, *m_message);
5454
}
5555
else
5656
{

src/core/modules/usermessage/csgo/usermessage_implementation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
class CUserMessageImplementation : public IUsermessageImplementationBase
3636
{
3737
public:
38-
CUserMessageImplementation( const CMRecipientFilter &recipient_filter, const char *message_name);
38+
CUserMessageImplementation( const MRecipientFilter &recipient_filter, const char *message_name);
3939

4040
// Pure-virtual methods which must be inherited and overwritten in the inherited
4141
// classes

src/core/modules/usermessage/ob/usermessage_implementation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@
2626

2727
#include "usermessage_implementation.h"
2828

29-
CUserMessageImplementation::CUserMessageImplementation(const CMRecipientFilter &recipient_filter, const char *message_name ) :
29+
CUserMessageImplementation::CUserMessageImplementation(const MRecipientFilter &recipient_filter, const char *message_name ) :
3030
IUsermessageImplementationBase(recipient_filter, message_name)
3131
{
3232
// Set the message index.
3333
set_message_index();
3434

3535
// TODO - Check if we should pass this as a non-const so we don't have to const-cast it. I'm sure I saw a constructor
3636
// somewhere requiring this to be passed as a const-ref somewhere
37-
m_buffer = engine->UserMessageBegin(&const_cast<CMRecipientFilter&>(recipient_filter), m_message_index);
37+
m_buffer = engine->UserMessageBegin(&const_cast<MRecipientFilter&>(recipient_filter), m_message_index);
3838
}
3939

4040
void CUserMessageImplementation::send_message_internal()

src/core/modules/usermessage/ob/usermessage_implementation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ extern IServerGameDLL *servergamedll;
3636
class CUserMessageImplementation : public IUsermessageImplementationBase
3737
{
3838
public:
39-
CUserMessageImplementation(const CMRecipientFilter &recipient_filter, const char *message_name);
39+
CUserMessageImplementation(const MRecipientFilter &recipient_filter, const char *message_name);
4040

4141
// Pure-virtual methods which must be inherited and overwritten in the inherited
4242
// classes

src/core/modules/usermessage/usermessage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#include "usermessage.h"
2828

29-
CUserMessage::CUserMessage(const CMRecipientFilter &recipient_filter, const char *message_name ) :
29+
CUserMessage::CUserMessage(const MRecipientFilter &recipient_filter, const char *message_name ) :
3030
CUserMessageImplementation(recipient_filter, message_name),
3131
m_sent(false)
3232
{
@@ -61,7 +61,7 @@ const int CUserMessage::get_message_index() const
6161
return m_message_index;
6262
}
6363

64-
const CMRecipientFilter & CUserMessage::get_recipient_filter() const
64+
const MRecipientFilter & CUserMessage::get_recipient_filter() const
6565
{
6666
return m_recipient_filter;
6767
}

src/core/modules/usermessage/usermessage.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@
3636
class CUserMessage : public CUserMessageImplementation
3737
{
3838
public:
39-
CUserMessage(const CMRecipientFilter &recipient_filter, const char *message_name);
39+
CUserMessage(const MRecipientFilter &recipient_filter, const char *message_name);
4040
~CUserMessage();
4141

4242
virtual void send_message();
4343

4444
const char *get_message_name() const;
4545
const int get_message_index() const;
46-
const CMRecipientFilter &get_recipient_filter() const;
46+
const MRecipientFilter &get_recipient_filter() const;
4747
bool has_been_sent() const;
4848

4949
// Virtual function call override (calls to base class)

0 commit comments

Comments
 (0)