Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
0c3294c
Start of GMod support.
satoon101 Aug 21, 2016
c5f23eb
Patched memalloc.h
Aug 22, 2016
eae759e
Removed memalloc.h patch
Aug 25, 2016
cfc5a06
Patched ../game/shared/collisionproperty.h
Aug 25, 2016
86940a5
Fixed EmitSound
Aug 25, 2016
345fe04
Patched matlib.lib
Aug 25, 2016
fe98526
Added back _EngineServer.get_cluster_sound
Aug 25, 2016
dd8c3b5
Remove ../game/shared/collisionproperty.h patch
Aug 25, 2016
4ea2de5
Removed cluster_count from other engines now that it is supported in …
satoon101 Aug 25, 2016
3e2c385
Merge branch 'engine_gmod' of github.com:Source-Python-Dev-Team/Sourc…
satoon101 Aug 25, 2016
36633dc
Merge branch 'master' into engine_gmod
satoon101 Aug 26, 2016
6e5a09f
Added GetEntityFactoryDictionary to gmod.
satoon101 Aug 26, 2016
916480a
Merge branch 'master' into engine_gmod
satoon101 Aug 26, 2016
4332636
Added server_version and create_fake_client_ex to engine_server for g…
satoon101 Aug 26, 2016
858072c
Updated memory.manager to use GameConfigObj instead of ConfigObj.
Aug 26, 2016
e81ad56
Fixed OSError
Aug 26, 2016
b445360
Added BaseEntityOutput.fire_output data.
Aug 26, 2016
a2bdc0d
Fixed a NameError when unloading
Aug 26, 2016
bd1563d
Added data for CGlobalEntityList
Ayuto Aug 27, 2016
b2d8d6b
Added data for IServer
Ayuto Aug 27, 2016
d7d51d3
Fixed compiler and linker errors for GMod on Linux
Ayuto Aug 27, 2016
be0817d
Added data for CBaseClient
Ayuto Aug 28, 2016
c64f0fd
Merge branch 'master' into engine_gmod
satoon101 Aug 28, 2016
dc0581d
Added data for _WeaponDatabase
Ayuto Sep 3, 2016
c04fd31
Added _WeaponDatabase class
Ayuto Sep 3, 2016
3635121
Merge remote-tracking branch 'refs/remotes/origin/master' into engine…
Ayuto Sep 3, 2016
534ffd2
Added effects data
Ayuto Sep 3, 2016
47cde8e
Merge remote-tracking branch 'refs/remotes/origin/master' into engine…
Ayuto Sep 12, 2016
76ad0a0
Merge remote-tracking branch 'refs/remotes/origin/master' into engine…
Ayuto Sep 23, 2016
c8284da
Merge remote-tracking branch 'refs/remotes/origin/master' into engine…
Ayuto Nov 16, 2016
4c11dd1
Merge remote-tracking branch 'refs/remotes/origin/master' into engine…
Ayuto Jan 14, 2017
2850291
Merge remote-tracking branch 'refs/remotes/origin/master' into engine…
Ayuto Feb 3, 2017
051ff6c
Merge
Ayuto Jun 4, 2017
bafcf0e
Fixed missing engine specific export function for GMod
Ayuto Jun 4, 2017
0945dac
Fixed an error when loading GMod
Ayuto Jun 4, 2017
13fc9eb
Removed a redundant patch
Ayuto Jun 17, 2017
08a57ea
Merge remote-tracking branch 'refs/remotes/origin/master' into engine…
Ayuto Jun 19, 2017
a537a52
Fixed compiler errors due to output listener update
Ayuto Jun 19, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ../data/source-python/client/gmod/CBaseClient.ini

[virtual_function]
[[set_name]]
offset_linux = 56
offset_windows = 17
arguments = STRING
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ../effects/gmod/CTEAntlionDust.ini
# Temp Entity Name: AntlionDust

is_spawner_blocked = m_bBlockedSpawner
angles = m_vecAngles

[origin]
name = m_vecOrigin[0]
type = Vector
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ../effects/gmod/CTEConcussiveExplosion.ini
# Temp Entity Name: ConcussiveExplosion

scale = m_flScale
magnitude = m_nMagnitude
radius = m_nRadius
normal = m_vecNormal

[origin]
name = m_vecOrigin[0]
type = Vector
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# ../effects/gmod/CTEEffectDispatch.ini
# Temp Entity Name: EffectDispatch

entity_index = m_EffectData.entindex
particle_attachment = m_EffectData.m_ControlPoint1.m_eParticleAttachment
primary_color = m_EffectData.m_CustomColors.m_vecColor1
secondary_color = m_EffectData.m_CustomColors.m_vecColor2
control_point = m_EffectData.m_bControlPoint1
has_custom_colors = m_EffectData.m_bCustomColors
flags = m_EffectData.m_fFlags
magnitude = m_EffectData.m_flMagnitude
radius = m_EffectData.m_flRadius
scale = m_EffectData.m_flScale
effect_name_index = m_EffectData.m_iEffectName
attachment_index = m_EffectData.m_nAttachmentIndex
color = m_EffectData.m_nColor
damage_type = m_EffectData.m_nDamageType
hitbox = m_EffectData.m_nHitBox
material_index = m_EffectData.m_nMaterial
surface_prop = m_EffectData.m_nSurfaceProp
angles = m_EffectData.m_vAngles
normal = m_EffectData.m_vNormal
allow_override = m_bAllowOverride

[offset]
name = m_EffectData.m_ControlPoint1.m_vecOffset[0]
type = Vector

[origin]
name = m_EffectData.m_vOrigin[0]
type = Vector

[start]
name = m_EffectData.m_vStart[0]
type = Vector

[entity]
name = entity_index
type = Entity

[material]
name = material_index
type = Model
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ../effects/gmod/CTEHL2MPFireBullets.ini
# Temp Entity Name: Shotgun Shot

do_impacts = m_bDoImpacts
do_tracers = m_bDoTracers
spread = m_flSpread
ammo_id = m_iAmmoID
player_index = m_iPlayer
seed = m_iSeed
shots = m_iShots
direction = m_vecDir
origin = m_vecOrigin
tracer_type = m_TracerType

[player]
name = player_index
type = Player
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ../effects/gmod/CTEPhysicProp.ini
# Temp Entity Name: physicsprop

effects = m_nEffects
flags = m_nFlags
model_index = m_nModelIndex
skin = m_nSkin
origin = m_vecOrigin
velocity = m_vecVelocity

[rotation]
name = m_angRotation[0]
type = Vector

[model]
name = model_index
type = Model
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# ../effects/gmod/CTEPlayerAnimEvent.ini
# Temp Entity Name: PlayerAnimEvent

player_handle = m_hPlayer
event = m_iEvent
data = m_nData
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# ../data/source-python/entity_output/gmod/CBaseEntityOutput.ini

binary = server

[function]
[[fire_output]]
identifier_linux = _ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f
identifier_windows = 55 8B EC 81 EC 20 01 00 00 53 56 8B
arguments_linux = POINTER, POINTER, POINTER, FLOAT
arguments_windows = INT, INT, INT, INT, POINTER, POINTER, POINTER, FLOAT
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ../data/source-python/memory/gmod/global_pointers.ini

[CGlobalEntityList]
binary = server
identifier_linux = gEntList
identifier_windows = 55 8B EC 83 EC 08 56 57 8B 7D 08 6A 00 B9
offset_windows = 14
level_windows = 1

[IServer]
binary = bin/engine
identifier_linux = sv
identifier_windows = 55 8B EC 53 56 8B 75 0C 57 85 F6
offset_windows = 27
level_windows = 1

[CBaseTempEntity]
binary = server
identifier_linux = _ZN15CBaseTempEntity15s_pTempEntitiesE
identifier_windows = 56 8B 35 2A 2A 2A 2A 85 F6 74 2A EB 2A 8D 49 00 8B 06
offset_windows = 3
level_windows = 2
level_linux = 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ../data/source-python/weapons/scripts/gmod/global_pointers.ini

[_WeaponDatabase]
identifier_linux = _ZL20m_WeaponInfoDatabase
identifier_windows = 55 8B EC 81 EC 88 2A 2A 2A 56 8B 75 10 85 F6 75 07 32 C0 5E
offset_windows = 37
level_windows = 1
9 changes: 7 additions & 2 deletions addons/source-python/packages/source-python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
# =============================================================================
# >> IMPORTS
# =============================================================================
# Python Imports
# Context
from contextlib import suppress

# Source.Python Imports
# Loggers
from loggers import _sp_logger # It's save to import this here
Expand Down Expand Up @@ -286,8 +290,9 @@ def remove_entities_listener():
from _core import _sp_plugin
from memory.manager import manager

manager.get_global_pointer('GlobalEntityList').remove_entity_listener(
_sp_plugin)
with suppress(NameError):
manager.get_global_pointer('GlobalEntityList').remove_entity_listener(
_sp_plugin)


# =============================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def _pre_call_global_change_callbacks(args):
# >> Fix for issue #181.
# ============================================================================
# Get the function name to hook...
if SOURCE_ENGINE in ('bms', 'orangebox'):
if SOURCE_ENGINE in ('bms', 'orangebox', 'gmod'):
_hibernation_function_name = 'SetServerHibernation'
elif SOURCE_ENGINE in ('blade', 'csgo', 'l4d2'):
_hibernation_function_name = 'ServerHibernationUpdate'
Expand Down
14 changes: 6 additions & 8 deletions addons/source-python/packages/source-python/memory/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
# =============================================================================
# >> IMPORTS
# =============================================================================
# Site-Package Imports
# ConfigObj
from configobj import ConfigObj

# Source.Python Imports
# Core
from core import GameConfigObj
# Memory
from memory import Convention
from memory import DataType
Expand Down Expand Up @@ -294,7 +292,7 @@ def create_pipe(cls_dict):

def create_pipe_from_file(self, f):
"""Create a pipe from a file or URL."""
return self.create_pipe_from_dict(ConfigObj(f, file_error=True))
return self.create_pipe_from_dict(GameConfigObj(f))

def create_pipe_from_dict(self, raw_data):
"""Create a pipe from a dictionary."""
Expand Down Expand Up @@ -341,7 +339,7 @@ def pipe_function(
def create_type_from_file(self, type_name, f, bases=(CustomType,)):
"""Create and registers a new type from a file or URL."""
return self.create_type_from_dict(
type_name, ConfigObj(f, file_error=True), bases)
type_name, GameConfigObj(f), bases)

def create_type_from_dict(self, type_name, raw_data, bases=(CustomType,)):
"""Create and registers a new type from a dictionary."""
Expand Down Expand Up @@ -697,7 +695,7 @@ def make_function(ptr):
def create_function_typedefs_from_file(self, f):
"""Create function typedefs from a file."""
# Read the data
raw_data = ConfigObj(f, file_error=True)
raw_data = GameConfigObj(f)

# Prepare typedefs
typedefs = parse_data(
Expand Down Expand Up @@ -740,7 +738,7 @@ def create_global_pointers_from_file(self, f):
# Parse pointer data
pointers = parse_data(
self,
ConfigObj(f, file_error=True),
GameConfigObj(f),
(
(Key.BINARY, Key.as_str, NO_DEFAULT),
(Key.IDENTIFIER, Key.as_identifier, NO_DEFAULT),
Expand Down
48 changes: 48 additions & 0 deletions src/core/modules/cvars/gmod/cvars.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* =============================================================================
* 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 <http://www.gnu.org/licenses/>.
*
* 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_GMOD_H
#define _CVARS_GMOD_H

//-----------------------------------------------------------------------------
// Includes.
//-----------------------------------------------------------------------------
#include "icvar.h"


//-----------------------------------------------------------------------------
// ICVar extension class.
//-----------------------------------------------------------------------------
class ICVarExt
{
public:
static ConCommandBase* GetCommands(ICvar* pCvar)
{
return pCvar->GetCommands();
};
};

#endif // _CVARS_GMOD_H
54 changes: 54 additions & 0 deletions src/core/modules/effects/gmod/effects_base_wrap.h
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
*
* 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_GMOD_H
#define _EFFECTS_BASE_WRAP_GMOD_H

//-----------------------------------------------------------------------------
// Includes.
//-----------------------------------------------------------------------------
#include "game/shared/itempents.h"
#include "toolframework/itoolentity.h"
#include "game/server/basetempentity.h"


//-----------------------------------------------------------------------------
// External variables.
//-----------------------------------------------------------------------------
extern IServerTools *servertools;


//-----------------------------------------------------------------------------
// Exports CBaseTempEntity.
//-----------------------------------------------------------------------------
template<class T, class U>
void export_engine_specific_temp_entity(T _base, U TempEntity)
{
// Nothing specific to GMod...
}


#endif // _EFFECTS_BASE_WRAP_GMOD_H
10 changes: 5 additions & 5 deletions src/core/modules/engines/engines_server_wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,18 +565,18 @@ static void export_engine_server(scope _server)
args("benchmark_mode")
)

.add_property("cluster_count",
&IVEngineServer::GetClusterCount,
"Returns total number of clusters."
)

/*
.def("is_split_screen_player",
&IVEngineServer::SetDedicatedServerBenchmarkMode,
args("ent_num")
)
*/

.add_property("cluster_count",
&IVEngineServer::GetClusterCount,
"Returns total number of clusters."
)

/*
TODO: Create a wrapper that requires a list or tuple with bbox_t elements
.def("get_all_cluster_bounds",
Expand Down
Loading