Skip to content

Commit d331aa1

Browse files
committed
First SDK2013 commit.
Builds fine on Windows.
1 parent fcfe5b5 commit d331aa1

File tree

35 files changed

+2758
-8
lines changed

35 files changed

+2758
-8
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[virtual_function]
2+
3+
# _ZN20CBaseCombatCharacter13Weapon_SwitchEP17CBaseCombatWeaponi
4+
[[switch_weapon]]
5+
offset_linux = 265
6+
offset_windows = 264
7+
arguments = POINTER, INT
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[virtual_function]
2+
3+
# _ZN20CBaseCombatCharacter13Weapon_SwitchEP17CBaseCombatWeaponi
4+
[[switch_weapon]]
5+
offset_linux = 266
6+
offset_windows = 265
7+
arguments = POINTER, INT

src/core/modules/bitbuffers/bitbuffers_wrap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void export_bf_write(scope _bitbuffers)
9191
"Writes an unsigned integer with variable bit length."
9292
)
9393

94-
#ifdef ENGINE_CSGO
94+
#if defined(ENGINE_CSGO) || defined(ENGINE_BMS) || defined(ENGINE_SDK2013)
9595
.def("write_var_int32",
9696
&bf_write::WriteVarInt32
9797
)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/**
2+
* =============================================================================
3+
* Source Python
4+
* Copyright (C) 2012-2015 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 _CVARS_SDK2013_H
28+
#define _CVARS_SDK2013_H
29+
30+
//-----------------------------------------------------------------------------
31+
// Includes.
32+
//-----------------------------------------------------------------------------
33+
#include "icvar.h"
34+
35+
36+
//-----------------------------------------------------------------------------
37+
// ICVar extension class.
38+
//-----------------------------------------------------------------------------
39+
class ICVarExt
40+
{
41+
public:
42+
static ConCommandBase* GetCommands(ICvar* pCvar)
43+
{
44+
ICvar::Iterator iter(pCvar);
45+
iter.SetFirst();
46+
return iter.Get();
47+
};
48+
};
49+
50+
#endif // _CVARS_SDK2013_H
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* =============================================================================
3+
* Source Python
4+
* Copyright (C) 2012-2015 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 _EFFECTS_BASE_WRAP_SDK2013_H
28+
#define _EFFECTS_BASE_WRAP_SDK2013_H
29+
30+
//-----------------------------------------------------------------------------
31+
// Includes.
32+
//-----------------------------------------------------------------------------
33+
#include "game/shared/itempents.h"
34+
#include "toolframework/itoolentity.h"
35+
#include "game/server/basetempentity.h"
36+
37+
38+
//-----------------------------------------------------------------------------
39+
// External variables.
40+
//-----------------------------------------------------------------------------
41+
extern IServerTools *servertools;
42+
43+
44+
//-----------------------------------------------------------------------------
45+
// Exports CBaseTempEntity.
46+
//-----------------------------------------------------------------------------
47+
template<class T, class U>
48+
void export_engine_specific_temp_entity(T _effects, U TempEntity)
49+
{
50+
_effects.attr("_first_temp_entity") = object(ptr(servertools->GetTempEntList()));
51+
}
52+
53+
54+
#endif // _EFFECTS_BASE_WRAP_SDK2013_H
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
/**
2+
* =============================================================================
3+
* Source Python
4+
* Copyright (C) 2012-2015 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 _ENGINES_SDK2013_H
28+
#define _ENGINES_SDK2013_H
29+
30+
//-----------------------------------------------------------------------------
31+
// Includes.
32+
//-----------------------------------------------------------------------------
33+
#include "engine/IEngineSound.h"
34+
#include "eiface.h"
35+
36+
37+
//-----------------------------------------------------------------------------
38+
// IVEngineServer extension class.
39+
//-----------------------------------------------------------------------------
40+
class GameIVEngineServerExt
41+
{
42+
public:
43+
static bool IsMapValid(IVEngineServer* pServer, const char* map_name)
44+
{
45+
int iLength = strlen(map_name) + 10;
46+
char* szMapName = new char[iLength];
47+
V_snprintf(szMapName, iLength, "maps/%s.bsp", map_name);
48+
bool result = pServer->IsMapValid(szMapName);
49+
delete szMapName;
50+
return result;
51+
}
52+
};
53+
54+
55+
//-----------------------------------------------------------------------------
56+
// IEngineSound extension class.
57+
//-----------------------------------------------------------------------------
58+
class IEngineSoundExt
59+
{
60+
public:
61+
static void EmitSound(IEngineSound* pEngineSound, IRecipientFilter& filter, int iEntIndex, int iChannel, const char *pSample,
62+
float flVolume, float flAttenuation, int iFlags, int iPitch, const Vector *pOrigin, const Vector *pDirection,
63+
tuple origins, bool bUpdatePositions, float soundtime, int speakerentity)
64+
{
65+
CUtlVector<Vector> *pUtlVecOrigins = NULL;
66+
CUtlVector<Vector> vecOrigins;
67+
if (len(origins) > 0)
68+
{
69+
pUtlVecOrigins = &vecOrigins;
70+
for(int i=0; i < len(origins); i++)
71+
{
72+
vecOrigins.AddToTail(extract<Vector>(origins[i]));
73+
}
74+
}
75+
76+
pEngineSound->EmitSound(filter, iEntIndex, iChannel, pSample, flVolume, flAttenuation, iFlags, iPitch, 0, pOrigin,
77+
pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity);
78+
}
79+
80+
static void StopSound(IEngineSound* pEngineSound, int iEntIndex, int iChannel, const char *pSample)
81+
{
82+
pEngineSound->StopSound(iEntIndex, iChannel, pSample);
83+
}
84+
};
85+
86+
87+
//---------------------------------------------------------------------------------
88+
// IEngineTrace
89+
//---------------------------------------------------------------------------------
90+
inline int GetPointContents(const Vector &vecAbsPosition, IHandleEntity** ppEntity)
91+
{
92+
return enginetrace->GetPointContents(vecAbsPosition, ppEntity);
93+
}
94+
95+
96+
#endif // _ENGINES_SDK2013_H
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
/**
2+
* =============================================================================
3+
* Source Python
4+
* Copyright (C) 2012-2015 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 _ENGINES_WRAP_SDK2013_H
28+
#define _ENGINES_WRAP_SDK2013_H
29+
30+
//---------------------------------------------------------------------------------
31+
// Includes.
32+
//---------------------------------------------------------------------------------
33+
#include "eiface.h"
34+
#include "engine/IEngineSound.h"
35+
#include "engine/IEngineTrace.h"
36+
37+
38+
//---------------------------------------------------------------------------------
39+
// External variables.
40+
//---------------------------------------------------------------------------------
41+
extern IEngineTrace* enginetrace;
42+
43+
44+
//---------------------------------------------------------------------------------
45+
// IVEngineServer visitor function.
46+
//---------------------------------------------------------------------------------
47+
template<class T>
48+
T IVEngineServer_Visitor(T cls)
49+
{
50+
cls
51+
.add_property("game_server_steamid",
52+
make_function(
53+
&IVEngineServer::GetGameServerSteamID,
54+
reference_existing_object_policy()
55+
),
56+
"Returns the SteamID of the game server."
57+
)
58+
59+
.add_property("server_version",
60+
&IVEngineServer::GetServerVersion,
61+
"Returns the version of the server."
62+
)
63+
64+
.def("multiplayer_end_game",
65+
&IVEngineServer::MultiplayerEndGame,
66+
"Matchmaking"
67+
)
68+
69+
.def("create_fake_client_ex",
70+
&IVEngineServer::CreateFakeClientEx,
71+
reference_existing_object_policy()
72+
)
73+
74+
.add_property("server",
75+
make_function(
76+
&IVEngineServer::GetIServer,
77+
reference_existing_object_policy()
78+
)
79+
)
80+
81+
.add_property("achievement_mgr",
82+
make_function(
83+
&IVEngineServer::GetAchievementMgr,
84+
reference_existing_object_policy()
85+
),
86+
&IVEngineServer::SetAchievementMgr,
87+
"Return the achievement manager."
88+
)
89+
;
90+
91+
return cls;
92+
}
93+
94+
95+
//---------------------------------------------------------------------------------
96+
// IEngineSound visitor function.
97+
//---------------------------------------------------------------------------------
98+
template<class T>
99+
T IEngineSound_Visitor(T cls)
100+
{
101+
return cls;
102+
}
103+
104+
#endif // _ENGINES_WRAP_SDK2013_H

0 commit comments

Comments
 (0)