Skip to content

Commit 087150b

Browse files
committed
- Base files for other listeners
- Added listener.h for easy inclusion of all listener headers - Only networkid and tick are currently implemented in sp_addon.cpp/sp_main.cpp
1 parent 333930d commit 087150b

29 files changed

+1334
-41
lines changed

src/CMakeLists.txt

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,16 +249,41 @@ Set(SOURCEPYTHON_PLAYERS_MODULE_SOURCES
249249
# Listener module
250250
# ------------------------------------------------------------------
251251
Set(SOURCEPYTHON_LISTENERS_MODULE_HEADERS
252+
core/modules/listeners/listeners.h
252253
core/modules/listeners/listenermanager.h
253-
core/modules/listeners/tick_listeners_wrap.h
254+
# Listeners
255+
core/modules/listeners/client_active_listeners_wrap.h
256+
core/modules/listeners/client_disconnect_listeners_wrap.h
257+
core/modules/listeners/client_fully_connect_listeners_wrap.h
258+
core/modules/listeners/client_put_in_server_listeners_wrap.h
259+
core/modules/listeners/client_settings_changed_listeners_wrap.h
260+
core/modules/listeners/level_init_listeners_wrap.h
261+
core/modules/listeners/level_shutdown_listeners_wrap.h
254262
core/modules/listeners/networkid_validated_listeners_wrap.h
263+
core/modules/listeners/on_edict_allocated_listeners_wrap.h
264+
core/modules/listeners/on_edict_freed_listeners_wrap.h
265+
core/modules/listeners/on_query_cvar_value_finished_listeners_wrap.h
266+
core/modules/listeners/server_activate_listeners_wrap.h
267+
core/modules/listeners/tick_listeners_wrap.h
255268
)
256269

257270
Set(SOURCEPYTHON_LISTENERS_MODULE_SOURCES
258271
core/modules/listeners/listenermanager.cpp
259-
core/modules/listeners/tick_listeners_wrap.cpp
260-
core/modules/listeners/networkid_validated_listeners_wrap.cpp
261272
core/modules/listeners/listeners_wrap_python.cpp
273+
# Listeners
274+
core/modules/listeners/client_active_listeners_wrap.cpp
275+
core/modules/listeners/client_disconnect_listeners_wrap.cpp
276+
core/modules/listeners/client_fully_connect_listeners_wrap.cpp
277+
core/modules/listeners/client_put_in_server_listeners_wrap.cpp
278+
core/modules/listeners/client_settings_changed_listeners_wrap.cpp
279+
core/modules/listeners/level_init_listeners_wrap.cpp
280+
core/modules/listeners/level_shutdown_listeners_wrap.cpp
281+
core/modules/listeners/networkid_validated_listeners_wrap.cpp
282+
core/modules/listeners/on_edict_allocated_listeners_wrap.cpp
283+
core/modules/listeners/on_edict_freed_listeners_wrap.cpp
284+
core/modules/listeners/on_query_cvar_value_finished_listeners_wrap.cpp
285+
core/modules/listeners/server_activate_listeners_wrap.cpp
286+
core/modules/listeners/tick_listeners_wrap.cpp
262287
)
263288

264289
# ------------------------------------------------------------------

src/core/addons/sp_addon.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
#include "filesystem.h"
3434
#include "core/sp_gamedir.h"
3535
#include "utility/wrap_macros.h"
36-
#include "modules/listeners/tick_listeners_wrap.h"
37-
#include "modules/listeners/networkid_validated_listeners_wrap.h"
36+
#include "modules/listeners/listeners.h"
3837

3938
//---------------------------------------------------------------------------------
4039
// External variables
@@ -72,7 +71,7 @@ void CAddonManager::GameFrame()
7271
}
7372

7473
//---------------------------------------------------------------------------------
75-
// Calls tick listener.
74+
// Calls network id validated listeners.
7675
//---------------------------------------------------------------------------------
7776
void CAddonManager::NetworkIDValidated( const char *pszUserName, const char *pszNetworkID )
7877
{
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* =============================================================================
3+
* Source Python
4+
* Copyright (C) 2012-2013 Source Python Development Team. All rights reserved.
5+
* =============================================================================
6+
*
7+
* This program is free software; you can redistribute it and/or modify it under
8+
* the terms of the GNU General Public License, version 3.0, as published by the
9+
* Free Software Foundation.
10+
*
11+
* This program is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14+
* details.
15+
*
16+
* You should have received a copy of the GNU General Public License along with
17+
* this program. If not, see <http://www.gnu.org/licenses/>.
18+
*
19+
* As a special exception, the Source Python Team gives you permission
20+
* to link the code of this program (as well as its derivative works) to
21+
* "Half-Life 2," the "Source Engine," and any Game MODs that run on software
22+
* by the Valve Corporation. You must obey the GNU General Public License in
23+
* all respects for all other code used. Additionally, the Source.Python
24+
* Development Team grants this exception to all derivative works.
25+
*/
26+
27+
//-----------------------------------------------------------------------------
28+
// Includes
29+
//-----------------------------------------------------------------------------
30+
#include "client_active_listeners_wrap.h"
31+
32+
//-----------------------------------------------------------------------------
33+
// Static singletons.
34+
//-----------------------------------------------------------------------------
35+
static CClientActiveListenerManager s_ClientActiveListenerManager;
36+
37+
//-----------------------------------------------------------------------------
38+
// TickListenerManager accessor.
39+
//-----------------------------------------------------------------------------
40+
CClientActiveListenerManager* get_client_active_listener_manager()
41+
{
42+
return &s_ClientActiveListenerManager;
43+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* =============================================================================
3+
* Source Python
4+
* Copyright (C) 2013 Source Python Development Team. All rights reserved.
5+
* =============================================================================
6+
*
7+
* This program is free software; you can redistribute it and/or modify it under
8+
* the terms of the GNU General Public License, version 3.0, as published by the
9+
* Free Software Foundation.
10+
*
11+
* This program is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14+
* details.
15+
*
16+
* You should have received a copy of the GNU General Public License along with
17+
* this program. If not, see <http://www.gnu.org/licenses/>.
18+
*
19+
* As a special exception, the Source Python Team gives you permission
20+
* to link the code of this program (as well as its derivative works) to
21+
* "Half-Life 2," the "Source Engine," and any Game MODs that run on software
22+
* by the Valve Corporation. You must obey the GNU General Public License in
23+
* all respects for all other code used. Additionally, the Source.Python
24+
* Development Team grants this exception to all derivative works.
25+
*/
26+
27+
#ifndef _CLIENT_ACTIVE_LISTENER_MANAGER_H
28+
#define _CLIENT_ACTIVE_LISTENER_MANAGER_H
29+
30+
31+
//-----------------------------------------------------------------------------
32+
// Includes
33+
//-----------------------------------------------------------------------------
34+
#include "listenermanager.h"
35+
36+
//-----------------------------------------------------------------------------
37+
// CClientActiveListenerManager class
38+
//-----------------------------------------------------------------------------
39+
class CClientActiveListenerManager: public CListenerManager
40+
{
41+
};
42+
43+
CClientActiveListenerManager* get_client_active_listener_manager();
44+
45+
#endif // _CLIENT_ACTIVE_LISTENER_MANAGER_H
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* =============================================================================
3+
* Source Python
4+
* Copyright (C) 2012-2013 Source Python Development Team. All rights reserved.
5+
* =============================================================================
6+
*
7+
* This program is free software; you can redistribute it and/or modify it under
8+
* the terms of the GNU General Public License, version 3.0, as published by the
9+
* Free Software Foundation.
10+
*
11+
* This program is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14+
* details.
15+
*
16+
* You should have received a copy of the GNU General Public License along with
17+
* this program. If not, see <http://www.gnu.org/licenses/>.
18+
*
19+
* As a special exception, the Source Python Team gives you permission
20+
* to link the code of this program (as well as its derivative works) to
21+
* "Half-Life 2," the "Source Engine," and any Game MODs that run on software
22+
* by the Valve Corporation. You must obey the GNU General Public License in
23+
* all respects for all other code used. Additionally, the Source.Python
24+
* Development Team grants this exception to all derivative works.
25+
*/
26+
27+
//-----------------------------------------------------------------------------
28+
// Includes
29+
//-----------------------------------------------------------------------------
30+
#include "client_disconnect_listeners_wrap.h"
31+
32+
//-----------------------------------------------------------------------------
33+
// Static singletons.
34+
//-----------------------------------------------------------------------------
35+
static CClientDisconnectListenerManager s_ClientDisconnectListenerManager;
36+
37+
//-----------------------------------------------------------------------------
38+
// ClientDisconnectListenerManager accessor.
39+
//-----------------------------------------------------------------------------
40+
CClientDisconnectListenerManager* get_client_disconnect_listener_manager()
41+
{
42+
return &s_ClientDisconnectListenerManager;
43+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* =============================================================================
3+
* Source Python
4+
* Copyright (C) 2013 Source Python Development Team. All rights reserved.
5+
* =============================================================================
6+
*
7+
* This program is free software; you can redistribute it and/or modify it under
8+
* the terms of the GNU General Public License, version 3.0, as published by the
9+
* Free Software Foundation.
10+
*
11+
* This program is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14+
* details.
15+
*
16+
* You should have received a copy of the GNU General Public License along with
17+
* this program. If not, see <http://www.gnu.org/licenses/>.
18+
*
19+
* As a special exception, the Source Python Team gives you permission
20+
* to link the code of this program (as well as its derivative works) to
21+
* "Half-Life 2," the "Source Engine," and any Game MODs that run on software
22+
* by the Valve Corporation. You must obey the GNU General Public License in
23+
* all respects for all other code used. Additionally, the Source.Python
24+
* Development Team grants this exception to all derivative works.
25+
*/
26+
27+
#ifndef _CLIENT_DISCONNECT_LISTENER_MANAGER_H
28+
#define _CLIENT_DISCONNECT_LISTENER_MANAGER_H
29+
30+
31+
//-----------------------------------------------------------------------------
32+
// Includes
33+
//-----------------------------------------------------------------------------
34+
#include "listenermanager.h"
35+
36+
//-----------------------------------------------------------------------------
37+
// CClientDisconnectListenerManager class
38+
//-----------------------------------------------------------------------------
39+
class CClientDisconnectListenerManager: public CListenerManager
40+
{
41+
};
42+
43+
CClientDisconnectListenerManager* get_client_disconnect_listener_manager();
44+
45+
#endif // _CLIENT_DISCONNECT_LISTENER_MANAGER_H
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* =============================================================================
3+
* Source Python
4+
* Copyright (C) 2012-2013 Source Python Development Team. All rights reserved.
5+
* =============================================================================
6+
*
7+
* This program is free software; you can redistribute it and/or modify it under
8+
* the terms of the GNU General Public License, version 3.0, as published by the
9+
* Free Software Foundation.
10+
*
11+
* This program is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14+
* details.
15+
*
16+
* You should have received a copy of the GNU General Public License along with
17+
* this program. If not, see <http://www.gnu.org/licenses/>.
18+
*
19+
* As a special exception, the Source Python Team gives you permission
20+
* to link the code of this program (as well as its derivative works) to
21+
* "Half-Life 2," the "Source Engine," and any Game MODs that run on software
22+
* by the Valve Corporation. You must obey the GNU General Public License in
23+
* all respects for all other code used. Additionally, the Source.Python
24+
* Development Team grants this exception to all derivative works.
25+
*/
26+
27+
//-----------------------------------------------------------------------------
28+
// Includes
29+
//-----------------------------------------------------------------------------
30+
#include "client_fully_connect_listeners_wrap.h"
31+
32+
//-----------------------------------------------------------------------------
33+
// Static singletons.
34+
//-----------------------------------------------------------------------------
35+
static CClientFullyConnectListenerManager s_ClientFullyConnectListenerManager;
36+
37+
//-----------------------------------------------------------------------------
38+
// ClientFullyConnectListenerManager accessor.
39+
//-----------------------------------------------------------------------------
40+
CClientFullyConnectListenerManager* get_client_fully_connect_listener_manager()
41+
{
42+
return &s_ClientFullyConnectListenerManager;
43+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* =============================================================================
3+
* Source Python
4+
* Copyright (C) 2013 Source Python Development Team. All rights reserved.
5+
* =============================================================================
6+
*
7+
* This program is free software; you can redistribute it and/or modify it under
8+
* the terms of the GNU General Public License, version 3.0, as published by the
9+
* Free Software Foundation.
10+
*
11+
* This program is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14+
* details.
15+
*
16+
* You should have received a copy of the GNU General Public License along with
17+
* this program. If not, see <http://www.gnu.org/licenses/>.
18+
*
19+
* As a special exception, the Source Python Team gives you permission
20+
* to link the code of this program (as well as its derivative works) to
21+
* "Half-Life 2," the "Source Engine," and any Game MODs that run on software
22+
* by the Valve Corporation. You must obey the GNU General Public License in
23+
* all respects for all other code used. Additionally, the Source.Python
24+
* Development Team grants this exception to all derivative works.
25+
*/
26+
27+
#ifndef _CLIENT_FULLY_CONNECT_LISTENER_MANAGER_H
28+
#define _CLIENT_FULLY_CONNECT_LISTENER_MANAGER_H
29+
30+
31+
//-----------------------------------------------------------------------------
32+
// Includes
33+
//-----------------------------------------------------------------------------
34+
#include "listenermanager.h"
35+
36+
//-----------------------------------------------------------------------------
37+
// CClientFullyConnectListenerManager class
38+
//-----------------------------------------------------------------------------
39+
class CClientFullyConnectListenerManager: public CListenerManager
40+
{
41+
};
42+
43+
CClientFullyConnectListenerManager* get_client_fully_connect_listener_manager();
44+
45+
#endif // _CLIENT_FULLY_CONNECT_LISTENER_MANAGER_H

0 commit comments

Comments
 (0)