diff --git a/addons/source-python/packages/site-packages/sphinx/pycode/Grammar-py3-sphinx1.4.pickle b/addons/source-python/packages/site-packages/sphinx/pycode/Grammar-py3-sphinx1.4.pickle new file mode 100644 index 000000000..5cce105b4 Binary files /dev/null and b/addons/source-python/packages/site-packages/sphinx/pycode/Grammar-py3-sphinx1.4.pickle differ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 80cbfdc98..c099fd65f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -287,7 +287,6 @@ Set(SOURCEPYTHON_KEYVALUES_MODULE_HEADERS Set(SOURCEPYTHON_KEYVALUES_MODULE_SOURCES core/modules/keyvalues/keyvalues_wrap.cpp - ${SOURCESDK}/tier1/KeyValues.cpp ) # ------------------------------------------------------------------ diff --git a/src/core/modules/bitbuffers/bitbuffers_wrap.cpp b/src/core/modules/bitbuffers/bitbuffers_wrap.cpp index 03ae053d9..cbc3d3b0b 100644 --- a/src/core/modules/bitbuffers/bitbuffers_wrap.cpp +++ b/src/core/modules/bitbuffers/bitbuffers_wrap.cpp @@ -91,7 +91,7 @@ void export_bf_write(scope _bitbuffers) "Writes an unsigned integer with variable bit length." ) -#ifdef ENGINE_CSGO +#if defined(ENGINE_CSGO) || defined(ENGINE_BMS) || defined(ENGINE_SDK2013) .def("write_var_int32", &bf_write::WriteVarInt32 ) diff --git a/src/core/modules/cvars/sdk2013/cvars.h b/src/core/modules/cvars/sdk2013/cvars.h new file mode 100644 index 000000000..9ce96806e --- /dev/null +++ b/src/core/modules/cvars/sdk2013/cvars.h @@ -0,0 +1,50 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2012-2015 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ + +#ifndef _CVARS_SDK2013_H +#define _CVARS_SDK2013_H + +//----------------------------------------------------------------------------- +// Includes. +//----------------------------------------------------------------------------- +#include "icvar.h" + + +//----------------------------------------------------------------------------- +// ICVar extension class. +//----------------------------------------------------------------------------- +class ICVarExt +{ +public: + static ConCommandBase* GetCommands(ICvar* pCvar) + { + ICvar::Iterator iter(pCvar); + iter.SetFirst(); + return iter.Get(); + }; +}; + +#endif // _CVARS_SDK2013_H diff --git a/src/core/modules/effects/sdk2013/effects_base_wrap.h b/src/core/modules/effects/sdk2013/effects_base_wrap.h new file mode 100644 index 000000000..442b40097 --- /dev/null +++ b/src/core/modules/effects/sdk2013/effects_base_wrap.h @@ -0,0 +1,54 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2012-2015 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ + +#ifndef _EFFECTS_BASE_WRAP_SDK2013_H +#define _EFFECTS_BASE_WRAP_SDK2013_H + +//----------------------------------------------------------------------------- +// Includes. +//----------------------------------------------------------------------------- +#include "game/shared/itempents.h" +#include "toolframework/itoolentity.h" +#include "game/server/basetempentity.h" + + +//----------------------------------------------------------------------------- +// External variables. +//----------------------------------------------------------------------------- +extern IServerTools *servertools; + + +//----------------------------------------------------------------------------- +// Exports CBaseTempEntity. +//----------------------------------------------------------------------------- +template +void export_engine_specific_temp_entity(T _effects, U TempEntity) +{ + _effects.attr("_first_temp_entity") = object(ptr(servertools->GetTempEntList())); +} + + +#endif // _EFFECTS_BASE_WRAP_SDK2013_H diff --git a/src/core/modules/engines/sdk2013/engines.h b/src/core/modules/engines/sdk2013/engines.h new file mode 100644 index 000000000..5f69a88af --- /dev/null +++ b/src/core/modules/engines/sdk2013/engines.h @@ -0,0 +1,96 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2012-2015 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ + +#ifndef _ENGINES_SDK2013_H +#define _ENGINES_SDK2013_H + +//----------------------------------------------------------------------------- +// Includes. +//----------------------------------------------------------------------------- +#include "engine/IEngineSound.h" +#include "eiface.h" + + +//----------------------------------------------------------------------------- +// IVEngineServer extension class. +//----------------------------------------------------------------------------- +class GameIVEngineServerExt +{ +public: + static bool IsMapValid(IVEngineServer* pServer, const char* map_name) + { + int iLength = strlen(map_name) + 10; + char* szMapName = new char[iLength]; + V_snprintf(szMapName, iLength, "maps/%s.bsp", map_name); + bool result = pServer->IsMapValid(szMapName); + delete szMapName; + return result; + } +}; + + +//----------------------------------------------------------------------------- +// IEngineSound extension class. +//----------------------------------------------------------------------------- +class IEngineSoundExt +{ +public: + static void EmitSound(IEngineSound* pEngineSound, IRecipientFilter& filter, int iEntIndex, int iChannel, const char *pSample, + float flVolume, float flAttenuation, int iFlags, int iPitch, const Vector *pOrigin, const Vector *pDirection, + tuple origins, bool bUpdatePositions, float soundtime, int speakerentity) + { + CUtlVector *pUtlVecOrigins = NULL; + CUtlVector vecOrigins; + if (len(origins) > 0) + { + pUtlVecOrigins = &vecOrigins; + for(int i=0; i < len(origins); i++) + { + vecOrigins.AddToTail(extract(origins[i])); + } + } + + pEngineSound->EmitSound(filter, iEntIndex, iChannel, pSample, flVolume, flAttenuation, iFlags, iPitch, 0, pOrigin, + pDirection, pUtlVecOrigins, bUpdatePositions, soundtime, speakerentity); + } + + static void StopSound(IEngineSound* pEngineSound, int iEntIndex, int iChannel, const char *pSample) + { + pEngineSound->StopSound(iEntIndex, iChannel, pSample); + } +}; + + +//--------------------------------------------------------------------------------- +// IEngineTrace +//--------------------------------------------------------------------------------- +inline int GetPointContents(const Vector &vecAbsPosition, IHandleEntity** ppEntity) +{ + return enginetrace->GetPointContents(vecAbsPosition, ppEntity); +} + + +#endif // _ENGINES_SDK2013_H diff --git a/src/core/modules/engines/sdk2013/engines_wrap.h b/src/core/modules/engines/sdk2013/engines_wrap.h new file mode 100644 index 000000000..e55adc956 --- /dev/null +++ b/src/core/modules/engines/sdk2013/engines_wrap.h @@ -0,0 +1,120 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2012-2015 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ + +#ifndef _ENGINES_WRAP_SDK2013_H +#define _ENGINES_WRAP_SDK2013_H + +//--------------------------------------------------------------------------------- +// Includes. +//--------------------------------------------------------------------------------- +#include "eiface.h" +#include "engine/IEngineSound.h" +#include "engine/IEngineTrace.h" + + +//--------------------------------------------------------------------------------- +// External variables. +//--------------------------------------------------------------------------------- +extern IEngineTrace* enginetrace; + + +//--------------------------------------------------------------------------------- +// IVEngineServer visitor function. +//--------------------------------------------------------------------------------- +template +T IVEngineServer_Visitor(T cls) +{ + cls + .add_property("game_server_steamid", + make_function( + &IVEngineServer::GetGameServerSteamID, + reference_existing_object_policy() + ), + "Returns the SteamID of the game server." + ) + + .add_property("server_version", + &IVEngineServer::GetServerVersion, + "Returns the version of the server." + ) + + .def("multiplayer_end_game", + &IVEngineServer::MultiplayerEndGame, + "Matchmaking" + ) + + .def("create_fake_client_ex", + &IVEngineServer::CreateFakeClientEx, + reference_existing_object_policy() + ) + + .add_property("server", + make_function( + &IVEngineServer::GetIServer, + reference_existing_object_policy() + ) + ) + + .add_property("achievement_mgr", + make_function( + &IVEngineServer::GetAchievementMgr, + reference_existing_object_policy() + ), + &IVEngineServer::SetAchievementMgr, + "Return the achievement manager." + ) + ; + + return cls; +} + + +//--------------------------------------------------------------------------------- +// IEngineSound visitor function. +//--------------------------------------------------------------------------------- +template +T IEngineSound_Visitor(T cls) +{ + return cls; +} + + +//----------------------------------------------------------------------------- +// Exports IServerGameDLL. +//----------------------------------------------------------------------------- +template +void export_engine_specific_server_game_dll(T _server, U ServerGameDLL) +{ + // Methods... + ServerGameDLL.def("set_server_hibernation", &IServerGameDLL::SetServerHibernation); + + // Class info... + BEGIN_CLASS_INFO(IServerGameDLL) + FUNCTION_INFO(SetServerHibernation) + END_CLASS_INFO() +} + +#endif // _ENGINES_WRAP_SDK2013_H diff --git a/src/core/modules/entities/sdk2013/entities.h b/src/core/modules/entities/sdk2013/entities.h new file mode 100644 index 000000000..e54e5e87c --- /dev/null +++ b/src/core/modules/entities/sdk2013/entities.h @@ -0,0 +1,76 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2012-2015 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ + +#ifndef _ENTITIES_SDK2013_H +#define _ENTITIES_SDK2013_H + +//----------------------------------------------------------------------------- +// Includes. +//----------------------------------------------------------------------------- +#include "dt_send.h" +#include "game/shared/ehandle.h" +#include "isaverestore.h" +#include "datamap.h" +#include "game/shared/takedamageinfo.h" + + +//----------------------------------------------------------------------------- +// CTakeDamageInfo wrapper class. +//----------------------------------------------------------------------------- +class TakeDamageInfoWrapper: public TakeDamageInfoBaseWrapper +{ +public: + int get_penetrated() + { + return m_iPlayerPenetrationCount; + } + + void set_penetrated(int iPenetrated) + { + m_iPlayerPenetrationCount = iPenetrated; + } +}; + + +//----------------------------------------------------------------------------- +// CTakeDamageInfo extension class. +//----------------------------------------------------------------------------- +class TakeDamageInfoExt +{ +public: + static int get_penetrated(CTakeDamageInfo *pTakeDamageInfo) + { + return ((TakeDamageInfoWrapper *)pTakeDamageInfo)->get_penetrated(); + } + + static void set_penetrated(CTakeDamageInfo *pTakeDamageInfo, int iPenetrated) + { + ((TakeDamageInfoWrapper *)pTakeDamageInfo)->set_penetrated(iPenetrated); + } +}; + + +#endif // _ENTITIES_SDK2013_H diff --git a/src/core/modules/entities/sdk2013/entities_constants_wrap.h b/src/core/modules/entities/sdk2013/entities_constants_wrap.h new file mode 100644 index 000000000..88c37e312 --- /dev/null +++ b/src/core/modules/entities/sdk2013/entities_constants_wrap.h @@ -0,0 +1,104 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2012-2015 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ + +#ifndef _ENTITIES_CONSTANTS_SDK2013_WRAP_H +#define _ENTITIES_CONSTANTS_SDK2013_WRAP_H + +//----------------------------------------------------------------------------- +// Includes. +//----------------------------------------------------------------------------- +#include "utilities/wrap_macros.h" + + +//----------------------------------------------------------------------------- +// Exports damage types. +//----------------------------------------------------------------------------- +template +void export_engine_specific_damage_types(T _constants) +{ + // Nothing specific to SDK2013... +} + + +//----------------------------------------------------------------------------- +// Exports SolidFlags_t. +//----------------------------------------------------------------------------- +template +void export_engine_specific_solid_flags(T _constants, U SolidFlags) +{ + // Nothing specific to SDK2013... +} + + +//----------------------------------------------------------------------------- +// Exports entity effects. +//----------------------------------------------------------------------------- +template +void export_engine_specific_entity_effects(T _constants) +{ + // Nothing specific to SDK2013... +} + + +//----------------------------------------------------------------------------- +// Exports RenderMode_t. +//----------------------------------------------------------------------------- +template +void export_engine_specific_render_mode(T _constants, U RenderEffects) +{ + // Nothing specific to SDK2013... +} + + +//----------------------------------------------------------------------------- +// Exports RenderFx_t. +//----------------------------------------------------------------------------- +template +void export_engine_specific_render_effects(T _constants, U RenderEffects) +{ + RenderEffects.value("DISTORT", kRenderFxDistort); + RenderEffects.value("HOLOGRAM", kRenderFxHologram); + RenderEffects.value("EXPLODE", kRenderFxExplode); + RenderEffects.value("CLAMP_MIN_SCALE", kRenderFxClampMinScale); + RenderEffects.value("ENV_RAIN", kRenderFxEnvRain); + RenderEffects.value("ENV_SNOW", kRenderFxEnvSnow); + RenderEffects.value("SPOTLIGHT", kRenderFxSpotlight); + RenderEffects.value("RAGDOLL", kRenderFxRagdoll); + RenderEffects.value("PULSE_FAST_WIDER", kRenderFxPulseFastWider); +} + + +//----------------------------------------------------------------------------- +// Exports Collision_Group_t. +//----------------------------------------------------------------------------- +template +void export_engine_specific_collision_group(T _constants, U CollisionGroup) +{ + // Nothing specific to SDK2013... +} + + +#endif // _ENTITIES_CONSTANTS_SDK2013_WRAP_H diff --git a/src/core/modules/entities/sdk2013/entities_datamaps.h b/src/core/modules/entities/sdk2013/entities_datamaps.h new file mode 100644 index 000000000..412d247a6 --- /dev/null +++ b/src/core/modules/entities/sdk2013/entities_datamaps.h @@ -0,0 +1,54 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2014 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ + +#ifndef _ENTITIES_DATAMAPS_SDK2013_H +#define _ENTITIES_DATAMAPS_SDK2013_H + +//----------------------------------------------------------------------------- +// Includes. +//----------------------------------------------------------------------------- +#include "datamap.h" + + +//----------------------------------------------------------------------------- +// typedescription_t extension class. +//----------------------------------------------------------------------------- +class TypeDescriptionExt +{ +public: + static int get_offset(const typedescription_t& pTypeDesc) + { + return pTypeDesc.fieldOffset[TD_OFFSET_NORMAL]; + } + + static int get_packed_offset(const typedescription_t& pTypeDesc) + { + return pTypeDesc.fieldOffset[TD_OFFSET_PACKED]; + } +}; + + +#endif // _ENTITIES_DATAMAPS_SDK2013_H diff --git a/src/core/modules/entities/sdk2013/entities_datamaps_wrap.h b/src/core/modules/entities/sdk2013/entities_datamaps_wrap.h new file mode 100644 index 000000000..114508e05 --- /dev/null +++ b/src/core/modules/entities/sdk2013/entities_datamaps_wrap.h @@ -0,0 +1,68 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2012-2015 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ + +#ifndef _ENTITIES_DATAMAPS_WRAP_SDK2013_H +#define _ENTITIES_DATAMAPS_WRAP_SDK2013_H + +//----------------------------------------------------------------------------- +// Includes. +//----------------------------------------------------------------------------- +#include "entities_datamaps.h" + + +//----------------------------------------------------------------------------- +// Exports datamap_t. +//----------------------------------------------------------------------------- +template +void export_engine_specific_datamap(T _datamaps, U DataMap) +{ + DataMap.def_readonly("chains_validated", &datamap_t::chains_validated); + DataMap.def_readonly("packed_offsets_computed", &datamap_t::packed_offsets_computed); + DataMap.def_readonly("packed_size", &datamap_t::packed_size); +} + + +//----------------------------------------------------------------------------- +// Exports typedescription_t. +//----------------------------------------------------------------------------- +template +void export_engine_specific_type_description(T _datamaps, U TypeDescription) +{ + TypeDescription.add_property("packed_offset", &TypeDescriptionExt::get_packed_offset) ; +} + + +//----------------------------------------------------------------------------- +// Exports fieldtype_t. +//----------------------------------------------------------------------------- +template +void export_engine_specific_field_types(T _datamaps, U FieldTypes) +{ + // Nothing specific to SDK2013... +} + + +#endif // _ENTITIES_DATAMAPS_WRAP_SDK2013_H diff --git a/src/core/modules/entities/sdk2013/entities_factories_wrap.h b/src/core/modules/entities/sdk2013/entities_factories_wrap.h new file mode 100644 index 000000000..856fd08f6 --- /dev/null +++ b/src/core/modules/entities/sdk2013/entities_factories_wrap.h @@ -0,0 +1,56 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2012-2015 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ + +#ifndef _ENTITIES_FACTORIES_WRAP_SDK2013_H +#define _ENTITIES_FACTORIES_WRAP_SDK2013_H + +//----------------------------------------------------------------------------- +// Includes. +//----------------------------------------------------------------------------- +#include "utilities/wrap_macros.h" +#include "toolframework/itoolentity.h" +#include "utilities/conversions.h" +#include "modules/memory/memory_tools.h" + + +//----------------------------------------------------------------------------- +// External variables. +//----------------------------------------------------------------------------- +extern IServerTools *servertools; + + +//----------------------------------------------------------------------------- +// Exports CEntityFactoryDictionary. +//----------------------------------------------------------------------------- +template +void export_engine_specific_entity_factory_dictionary(T _factories, U EntityFactoryDictionary) +{ + // Singleton... + _factories.attr("factory_dictionary") = object(ptr((CEntityFactoryDictionary *)servertools->GetEntityFactoryDictionary())); +} + + +#endif // _ENTITIES_FACTORIES_WRAP_SDK2013_H diff --git a/src/core/modules/entities/sdk2013/entities_props.h b/src/core/modules/entities/sdk2013/entities_props.h new file mode 100644 index 000000000..464229c64 --- /dev/null +++ b/src/core/modules/entities/sdk2013/entities_props.h @@ -0,0 +1,32 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2012-2015 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ + +#ifndef _ENTITIES_PROPS_SDK2013_H +#define _ENTITIES_PROPS_SDK2013_H + +// Nothing specific to SDK2013... + +#endif // _ENTITIES_PROPS_SDK2013_H diff --git a/src/core/modules/entities/sdk2013/entities_props_wrap.h b/src/core/modules/entities/sdk2013/entities_props_wrap.h new file mode 100644 index 000000000..e42bfadcc --- /dev/null +++ b/src/core/modules/entities/sdk2013/entities_props_wrap.h @@ -0,0 +1,79 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2012-2015 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ + +#ifndef _ENTITIES_PROPS_WRAP_SDK2013_H +#define _ENTITIES_PROPS_WRAP_SDK2013_H + +//----------------------------------------------------------------------------- +// Includes. +//----------------------------------------------------------------------------- +#include "dt_send.h" +#include "server_class.h" +#include "entities_props.h" + + +//----------------------------------------------------------------------------- +// Expose ServerClass. +//----------------------------------------------------------------------------- +template +void export_engine_specific_server_class(T _props, U ServerClass_) +{ + // Properties... + ServerClass_.def_readonly("name", &ServerClass::m_pNetworkName); +} + + +//----------------------------------------------------------------------------- +// Expose SendProp. +//----------------------------------------------------------------------------- +template +void export_engine_specific_send_prop(T _props, U SendProp_) +{ + // Nothing specific to SDK2013... +} + + +//----------------------------------------------------------------------------- +// Expose SendPropType. +//----------------------------------------------------------------------------- +template +void export_engine_specific_send_prop_types(T _props, U SendPropType_) +{ + // Nothing specific to SDK2013... +} + + +//----------------------------------------------------------------------------- +// Expose SendPropVariant. +//----------------------------------------------------------------------------- +template +void export_engine_specific_send_prop_variant(T _props, U SendPropVariant) +{ + // Nothing specific to SDK2013... +} + + +#endif // _ENTITIES_PROPS_WRAP_SDK2013_H diff --git a/src/core/modules/entities/sdk2013/entities_wrap.h b/src/core/modules/entities/sdk2013/entities_wrap.h new file mode 100644 index 000000000..11e1c1f8e --- /dev/null +++ b/src/core/modules/entities/sdk2013/entities_wrap.h @@ -0,0 +1,48 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2012-2015 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ + +#ifndef _ENTITIES_WRAP_SDK2013_H +#define _ENTITIES_WRAP_SDK2013_H + +//----------------------------------------------------------------------------- +// Includes. +//----------------------------------------------------------------------------- +#include "entities.h" + + +//----------------------------------------------------------------------------- +// Exports CTakeDamageInfo. +//----------------------------------------------------------------------------- +template +void export_engine_specific_take_damage_info(T _entities, U TakeDamageInfo) +{ + TakeDamageInfo.add_property("penetrated", &TakeDamageInfoExt::get_penetrated, + &TakeDamageInfoExt::set_penetrated + ); +} + + +#endif // _ENTITIES_WRAP_SDK2013_H diff --git a/src/core/modules/globals/sdk2013/globals_wrap.h b/src/core/modules/globals/sdk2013/globals_wrap.h new file mode 100644 index 000000000..21f410b9c --- /dev/null +++ b/src/core/modules/globals/sdk2013/globals_wrap.h @@ -0,0 +1,56 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2012-2015 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ + +#ifndef _GLOBALS_WRAP_SDK2013_H +#define _GLOBALS_WRAP_SDK2013_H + +//----------------------------------------------------------------------------- +// Includes. +//----------------------------------------------------------------------------- +#include "edict.h" + + +//----------------------------------------------------------------------------- +// CGlobalVarsBase visitor method. +//----------------------------------------------------------------------------- +template +T GlobalsBase_Visitor(T cls) +{ + return cls; +} + + +//----------------------------------------------------------------------------- +// CGlobalVars visitor method. +//----------------------------------------------------------------------------- +template +T Globals_Visitor(T cls) +{ + return cls; +} + + +#endif // _GLOBALS_WRAP_SDK2013_H diff --git a/src/core/modules/keyvalues/keyvalues_wrap.cpp b/src/core/modules/keyvalues/keyvalues_wrap.cpp index adadaae34..5c146debf 100644 --- a/src/core/modules/keyvalues/keyvalues_wrap.cpp +++ b/src/core/modules/keyvalues/keyvalues_wrap.cpp @@ -144,7 +144,7 @@ void export_keyvalues(scope _keyvalues) .add_property("next_key", make_function( - &KeyValues::GetNextKey, + GET_METHOD(KeyValues *, KeyValues, GetNextKey, void), reference_existing_object_policy() ), &KeyValues::SetNextKey, @@ -317,7 +317,7 @@ void export_keyvalues_types(scope _keyvalues) KeyValuesType.value("COLOR", KeyValues::TYPE_COLOR); KeyValuesType.value("UNINT64", KeyValues::TYPE_UINT64); -#ifdef ENGINE_CSGO +#if defined(ENGINE_CSGO) || defined(ENGINE_BLADE) // TODO: Move this to a engine specific file KeyValuesType.value("COMPILED_INT_BYTE", KeyValues::TYPE_COMPILED_INT_BYTE); KeyValuesType.value("COMPILED_INT_0", KeyValues::TYPE_COMPILED_INT_0); diff --git a/src/core/modules/players/sdk2013/players_constants_wrap.h b/src/core/modules/players/sdk2013/players_constants_wrap.h new file mode 100644 index 000000000..87572fc7b --- /dev/null +++ b/src/core/modules/players/sdk2013/players_constants_wrap.h @@ -0,0 +1,56 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2015 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ + +#ifndef _PLAYERS_CONSTANTS_SDK2013_WRAP_H +#define _PLAYERS_CONSTANTS_SDK2013_WRAP_H + +//----------------------------------------------------------------------------- +// Includes. +//----------------------------------------------------------------------------- +#include "utilities/wrap_macros.h" + + +//----------------------------------------------------------------------------- +// Exports DamageTypes. +//----------------------------------------------------------------------------- +template +void export_engine_specific_player_buttons(T _constants) +{ + // Nothing specific to SDK2013... +} + + +//----------------------------------------------------------------------------- +// Exports HideHudFlags +//----------------------------------------------------------------------------- +template +void export_engine_specific_hide_hud_flags(T _constants) +{ + // Nothing specific to SDK2013... +} + + +#endif // _PLAYERS_CONSTANTS_SDK2013_WRAP_H diff --git a/src/core/modules/players/sdk2013/players_wrap.h b/src/core/modules/players/sdk2013/players_wrap.h new file mode 100644 index 000000000..2a3341b11 --- /dev/null +++ b/src/core/modules/players/sdk2013/players_wrap.h @@ -0,0 +1,39 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2012-2015 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ + +#ifndef _PLAYERS_WRAP_SDK2013_H +#define _PLAYERS_WRAP_SDK2013_H + + +//----------------------------------------------------------------------------- +// IPlayerInfo extension class +//----------------------------------------------------------------------------- +template +void export_engine_specific_user_cmd(scope _players, T UserCmd) +{ +} + +#endif // _PLAYERS_WRAP_SDK2013_H diff --git a/src/core/modules/steam/sdk2013/steam_wrap.h b/src/core/modules/steam/sdk2013/steam_wrap.h new file mode 100644 index 000000000..18e658ab6 --- /dev/null +++ b/src/core/modules/steam/sdk2013/steam_wrap.h @@ -0,0 +1,47 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2012-2015 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ + +#ifndef _STEAM_WRAP_SDK2013_H +#define _STEAM_WRAP_SDK2013_H + +template +void export_engine_specific_steamid(scope _steam, T SteamID) +{ +} + +template +void export_engine_specific_universe(scope _steam, T Universe) +{ + // Nothing specific to SDK2013... +} + +template +void export_engine_specific_account_type(scope _steam, T AccountType) +{ + AccountType.value("CONSOLE_USER", k_EAccountTypeConsoleUser); +} + +#endif // _STEAM_WRAP_SDK2013_H diff --git a/src/core/modules/weapons/sdk2013/weapons_constants_wrap.h b/src/core/modules/weapons/sdk2013/weapons_constants_wrap.h new file mode 100644 index 000000000..649e12ab5 --- /dev/null +++ b/src/core/modules/weapons/sdk2013/weapons_constants_wrap.h @@ -0,0 +1,40 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2012-2015 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ + +#ifndef _WEAPONS_CONSTANTS_SDK2013_WRAP_H +#define _WEAPONS_CONSTANTS_SDK2013_WRAP_H + +//----------------------------------------------------------------------------- +// Exports WeaponSound_t. +//----------------------------------------------------------------------------- +template +void export_engine_specific_weapon_sound(T _constants, U WeaponSound) +{ + // Nothing specific to SDK2013... +} + + +#endif // _WEAPONS_CONSTANTS_SDK2013_WRAP_H diff --git a/src/core/modules/weapons/sdk2013/weapons_scripts.h b/src/core/modules/weapons/sdk2013/weapons_scripts.h new file mode 100644 index 000000000..ad3f8b00e --- /dev/null +++ b/src/core/modules/weapons/sdk2013/weapons_scripts.h @@ -0,0 +1,61 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2015 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ + +#ifndef _WEAPONS_SCRIPTS_SDK2013_H +#define _WEAPONS_SCRIPTS_SDK2013_H + +//----------------------------------------------------------------------------- +// Includes. +//----------------------------------------------------------------------------- +#include "datamap.h" +#include "game/shared/weapon_parse.h" +#include "tier1/utldict.h" +#include "utilities/wrap_macros.h" + + +//----------------------------------------------------------------------------- +// WeaponDataBase_t declaration. +//----------------------------------------------------------------------------- +typedef CUtlDict WeaponDataBase_t; + + +//----------------------------------------------------------------------------- +// WeaponDataBase_t extension class. +//----------------------------------------------------------------------------- +class WeaponDataBaseExt +{ +public: + static CPointer *_find(WeaponDataBase_t *pWeaponDataBase, WEAPON_FILE_INFO_HANDLE uiIndex) + { + if (uiIndex >= pWeaponDataBase->Count()) + BOOST_RAISE_EXCEPTION(PyExc_IndexError, "Index out of range."); + + return new CPointer((unsigned long)(void *)pWeaponDataBase->Element(uiIndex)); + } +}; + + +#endif // _WEAPONS_SCRIPTS_SDK2013_H diff --git a/src/core/modules/weapons/sdk2013/weapons_scripts_wrap.h b/src/core/modules/weapons/sdk2013/weapons_scripts_wrap.h new file mode 100644 index 000000000..44cc2ef31 --- /dev/null +++ b/src/core/modules/weapons/sdk2013/weapons_scripts_wrap.h @@ -0,0 +1,54 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2012-2015 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ + +#ifndef _WEAPONS_SCRIPTS_SDK2013_WRAP_H +#define _WEAPONS_SCRIPTS_SDK2013_WRAP_H + +//----------------------------------------------------------------------------- +// Includes. +//----------------------------------------------------------------------------- +#include "weapons_scripts.h" + + +//----------------------------------------------------------------------------- +// Expose WeaponDataBase_t. +//----------------------------------------------------------------------------- +template +void export_engine_specific_weapon_database(T _scripts) +{ + class_ _WeaponDatabase("_WeaponDatabase", no_init); + + // Methods... + _WeaponDatabase.def("_find", &WeaponDataBaseExt::_find, manage_new_object_policy()); + + // Properties... + _WeaponDatabase.add_property("_length", &WeaponDataBase_t::Count); + + // Add memory tools... + _WeaponDatabase ADD_MEM_TOOLS(WeaponDataBase_t); +} + +#endif // _WEAPONS_SCRIPTS_SDK2013_WRAP_H diff --git a/src/core/patches/sdk2013/patches.cpp b/src/core/patches/sdk2013/patches.cpp new file mode 100644 index 000000000..239d5cc3e --- /dev/null +++ b/src/core/patches/sdk2013/patches.cpp @@ -0,0 +1,25 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2012-2015 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ diff --git a/src/core/patches/sdk2013/undefined_symbols.h b/src/core/patches/sdk2013/undefined_symbols.h new file mode 100644 index 000000000..80f6f91f4 --- /dev/null +++ b/src/core/patches/sdk2013/undefined_symbols.h @@ -0,0 +1,63 @@ +/** +* ============================================================================= +* Source Python +* Copyright (C) 2012-2015 Source Python Development Team. All rights reserved. +* ============================================================================= +* +* This program is free software; you can redistribute it and/or modify it under +* the terms of the GNU General Public License, version 3.0, as published by the +* Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +* details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see . +* +* As a special exception, the Source Python Team gives you permission +* to link the code of this program (as well as its derivative works) to +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software +* by the Valve Corporation. You must obey the GNU General Public License in +* all respects for all other code used. Additionally, the Source.Python +* Development Team grants this exception to all derivative works. +*/ + +#ifndef UNDEFINED_SYMBOLS_SDK2013_H +#define UNDEFINED_SYMBOLS_SDK2013_H + +//----------------------------------------------------------------------------- +// Includes. +//----------------------------------------------------------------------------- +#include "dt_send.h" +#include "game/shared/ehandle.h" +#include "isaverestore.h" +#include "datamap.h" +#include "game/shared/takedamageinfo.h" + + +//----------------------------------------------------------------------------- +// CTakeDamageInfo constructor declaration. +//----------------------------------------------------------------------------- +CTakeDamageInfo::CTakeDamageInfo() +{ + m_hInflictor = NULL; + m_hAttacker = NULL; + m_hWeapon = NULL; + m_flDamage = 0.0f; + m_flBaseDamage = BASEDAMAGE_NOT_SPECIFIED; + m_bitsDamageType = 0; + m_iDamageCustom = 0; + m_flMaxDamage = 0.0f; + m_vecDamageForce = vec3_origin; + m_vecDamagePosition = vec3_origin; + m_vecReportedPosition = vec3_origin; + m_iAmmoType = -1; + m_iDamagedOtherPlayers = 0; + m_iPlayerPenetrationCount = 0; + m_flDamageBonus = 0.0f; + m_bForceFriendlyFire = false; +} + +#endif // _UNDEFINED_SYMBOLS_SDK2013_H diff --git a/src/core/sp_main.cpp b/src/core/sp_main.cpp index 3e966daf3..ccbf6eb54 100644 --- a/src/core/sp_main.cpp +++ b/src/core/sp_main.cpp @@ -187,7 +187,7 @@ bool GetInterfaces( InterfaceHelper_t* pInterfaceList, CreateInterfaceFn factory //----------------------------------------------------------------------------- // Server output hook. //----------------------------------------------------------------------------- -#if defined(ENGINE_ORANGEBOX) || defined(ENGINE_BMS) || defined(ENGINE_GMOD) +#if defined(ENGINE_ORANGEBOX) || defined(ENGINE_BMS) || defined(ENGINE_GMOD) || defined(ENGINE_SDK2013) SpewRetval_t SP_SpewOutput( SpewType_t spewType, const tchar *pMsg ) { extern CListenerManager* GetOnServerOutputListenerManager(); @@ -269,7 +269,7 @@ CSourcePython::CSourcePython() m_iClientCommandIndex = 0; m_pOldMDLCacheNotifier = NULL; -#if defined(ENGINE_ORANGEBOX) || defined(ENGINE_BMS) || defined(ENGINE_GMOD) +#if defined(ENGINE_ORANGEBOX) || defined(ENGINE_BMS) || defined(ENGINE_GMOD) || defined(ENGINE_SDK2013) m_pOldSpewOutputFunc = NULL; #endif } @@ -326,7 +326,7 @@ bool CSourcePython::Load( CreateInterfaceFn interfaceFactory, CreateInterfaceFn return false; } -#if defined(ENGINE_ORANGEBOX) || defined(ENGINE_BMS) || defined(ENGINE_GMOD) +#if defined(ENGINE_ORANGEBOX) || defined(ENGINE_BMS) || defined(ENGINE_GMOD) || defined(ENGINE_SDK2013) DevMsg(1, MSG_PREFIX "Retrieving old output function...\n"); m_pOldSpewOutputFunc = GetSpewOutputFunc(); @@ -376,7 +376,7 @@ void CSourcePython::Unload( void ) DevMsg(1, MSG_PREFIX "Unhooking all functions...\n"); GetHookManager()->UnhookAllFunctions(); -#if defined(ENGINE_ORANGEBOX) || defined(ENGINE_BMS) || defined(ENGINE_GMOD) +#if defined(ENGINE_ORANGEBOX) || defined(ENGINE_BMS) || defined(ENGINE_GMOD) || defined(ENGINE_SDK2013) if (m_pOldSpewOutputFunc) { DevMsg(1, MSG_PREFIX "Restoring old output function...\n"); @@ -586,7 +586,7 @@ void CSourcePython::ClientFullyConnect( edict_t *pEntity ) } #endif -#if defined(ENGINE_CSGO) || defined(ENGINE_BMS) || defined(ENGINE_BLADE) +#if defined(ENGINE_CSGO) || defined(ENGINE_BMS) || defined(ENGINE_BLADE) || defined(ENGINE_SDK2013) void CSourcePython::OnEdictAllocated( edict_t *edict ) { unsigned int iEntityIndex; diff --git a/src/core/sp_main.h b/src/core/sp_main.h index ba6fba73a..84457682c 100644 --- a/src/core/sp_main.h +++ b/src/core/sp_main.h @@ -83,7 +83,7 @@ class CSourcePython: public IServerPluginCallbacks, public IEntityListener, publ virtual void ClientFullyConnect( edict_t *pEntity ); #endif -#if defined(ENGINE_CSGO) || defined(ENGINE_BMS) || defined(ENGINE_BLADE) +#if defined(ENGINE_CSGO) || defined(ENGINE_BMS) || defined(ENGINE_BLADE) || defined(ENGINE_SDK2013) virtual void OnEdictAllocated( edict_t *edict ); virtual void OnEdictFreed( const edict_t *edict ); #endif @@ -126,7 +126,7 @@ class CSourcePython: public IServerPluginCallbacks, public IEntityListener, publ int m_iClientCommandIndex; IMDLCacheNotify* m_pOldMDLCacheNotifier; -#if defined(ENGINE_ORANGEBOX) || defined(ENGINE_BMS) || defined(ENGINE_GMOD) +#if defined(ENGINE_ORANGEBOX) || defined(ENGINE_BMS) || defined(ENGINE_GMOD) || defined(ENGINE_SDK2013) SpewOutputFunc_t m_pOldSpewOutputFunc; #endif }; diff --git a/src/core/utilities/conversions/edict_from.cpp b/src/core/utilities/conversions/edict_from.cpp index b44f9e5be..7901477b5 100644 --- a/src/core/utilities/conversions/edict_from.cpp +++ b/src/core/utilities/conversions/edict_from.cpp @@ -39,7 +39,7 @@ bool EdictFromIndex( unsigned int iEntityIndex, edict_t*& output ) return false; edict_t* pEdict; -#if defined(ENGINE_ORANGEBOX) || defined(ENGINE_BMS) || defined(ENGINE_GMOD) +#if defined(ENGINE_ORANGEBOX) || defined(ENGINE_BMS) || defined(ENGINE_GMOD) || defined(ENGINE_SDK2013) pEdict = engine->PEntityOfEntIndex(iEntityIndex); #else pEdict = (edict_t *)(gpGlobals->pEdicts + iEntityIndex); diff --git a/src/core/utilities/conversions/index_from.cpp b/src/core/utilities/conversions/index_from.cpp index d13972b97..95faf38c3 100644 --- a/src/core/utilities/conversions/index_from.cpp +++ b/src/core/utilities/conversions/index_from.cpp @@ -39,7 +39,7 @@ bool IndexFromEdict( edict_t *pEdict, unsigned int& output ) return false; int iEntityIndex; -#if defined(ENGINE_ORANGEBOX) || defined(ENGINE_BMS) || defined(ENGINE_GMOD) +#if defined(ENGINE_ORANGEBOX) || defined(ENGINE_BMS) || defined(ENGINE_GMOD) || defined(ENGINE_SDK2013) iEntityIndex = engine->IndexOfEdict(pEdict); #else iEntityIndex = pEdict - gpGlobals->pEdicts; diff --git a/src/loader/loader_main.cpp b/src/loader/loader_main.cpp index e1736219a..98cd66dfc 100644 --- a/src/loader/loader_main.cpp +++ b/src/loader/loader_main.cpp @@ -455,7 +455,7 @@ void CSourcePython::ClientFullyConnect( edict_t *pEntity ) } #endif -#if defined(ENGINE_CSGO) || defined(ENGINE_BMS) || defined(ENGINE_BLADE) +#if defined(ENGINE_CSGO) || defined(ENGINE_BMS) || defined(ENGINE_BLADE) || defined(ENGINE_SDK2013) void CSourcePython::OnEdictAllocated( edict_t *edict ) { if (m_pCorePlugin != NULL) diff --git a/src/loader/loader_main.h b/src/loader/loader_main.h index 8882cd011..18f7b68d5 100644 --- a/src/loader/loader_main.h +++ b/src/loader/loader_main.h @@ -76,7 +76,7 @@ class CSourcePython: public IServerPluginCallbacks virtual void ClientFullyConnect( edict_t *pEntity ); #endif -#if defined(ENGINE_CSGO) || defined(ENGINE_BMS) || defined(ENGINE_BLADE) +#if defined(ENGINE_CSGO) || defined(ENGINE_BMS) || defined(ENGINE_BLADE) || defined(ENGINE_SDK2013) virtual void OnEdictAllocated( edict_t *edict ); virtual void OnEdictFreed( const edict_t *edict ); #endif diff --git a/src/makefiles/branch/sdk2013.cmake b/src/makefiles/branch/sdk2013.cmake new file mode 100644 index 000000000..8a8a3c68e --- /dev/null +++ b/src/makefiles/branch/sdk2013.cmake @@ -0,0 +1,14 @@ +# ------------------------------------------------------------------ +# File: src/makefiles/branch/sdk2013.cmake +# Purpose: This is the CMake file for the sdk2013 branch. +# ------------------------------------------------------------------ + +# TODO: Update SDK instead +#Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \ +#-DINTERFACEVERSION_SERVERGAMEDLL=\"ServerGameDLL010\"") + +# ------------------------------------------------------------------ +# Set the engine version. +# ------------------------------------------------------------------ +Set(SOURCE_ENGINE "sdk2013") +add_definitions(-DENGINE_SDK2013) diff --git a/src/makefiles/linux/linux.base.cmake b/src/makefiles/linux/linux.base.cmake index 215b76b65..3fa62fd0f 100644 --- a/src/makefiles/linux/linux.base.cmake +++ b/src/makefiles/linux/linux.base.cmake @@ -41,7 +41,7 @@ Set(SOURCEPYTHON_LINK_LIBRARIES ) -If(SOURCE_ENGINE MATCHES "bms") +If(SOURCE_ENGINE MATCHES "bms" OR SOURCE_ENGINE MATCHES "sdk2013") Set(SOURCEPYTHON_LINK_LIBRARIES "${SOURCEPYTHON_LINK_LIBRARIES}" ${SOURCESDK_LIB}/public/linux32/mathlib.a @@ -95,12 +95,12 @@ EndIf() # General definitions Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LINUX -DPOSIX -DLINUX -DGNUC -DCOMPILER_GCC") -if(SOURCE_ENGINE MATCHES "orangebox" OR SOURCE_ENGINE MATCHES "bms" OR SOURCE_ENGINE MATCHES "gmod") +if(SOURCE_ENGINE MATCHES "orangebox" OR SOURCE_ENGINE MATCHES "bms" OR SOURCE_ENGINE MATCHES "gmod" OR SOURCE_ENGINE MATCHES "sdk2013") Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNO_MALLOC_OVERRIDE") Endif() # Function alias -If(NOT SOURCE_ENGINE MATCHES "bms") +If(NOT SOURCE_ENGINE MATCHES "bms" AND NOT SOURCE_ENGINE MATCHES "sdk2013") Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp") Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dstrnicmp=strncasecmp -D_snprintf=snprintf") Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp") diff --git a/src/patches/sdk2013/lib/public/tier1.lib b/src/patches/sdk2013/lib/public/tier1.lib new file mode 100644 index 000000000..6e4e8b5bb Binary files /dev/null and b/src/patches/sdk2013/lib/public/tier1.lib differ pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy