Search found 114 matches
- Tue Jan 07, 2020 11:52 am
- Forum: Plugin Development Support
- Topic: Server crash on @EntityPreHook
- Replies: 11
- Views: 24091
Re: Server crash on @EntityPreHook
For CS:GO, that function's prototype appears to be: Vector Weapon_ShootPosition(Vector &vecOut); def make_function(pointer): return pointer.make_virtual_function(290, Convention.THISCALL, (DataType.POINTER, DataType.POINTER), DataType.POINTER) @EntityPreHook(...
- Tue Jan 07, 2020 2:16 am
- Forum: Plugin Development Support
- Topic: Server crash on @EntityPreHook
- Replies: 11
- Views: 24091
Server crash on @EntityPreHook
from entities.hooks import EntityPreHook from entities.hooks import EntityCondition from memory import Convention from memory import DataType def make_function(pointer): return pointer.make_virtual_function(290, Convention.THISCALL, (DataType.POINTER, ), DataType.POINTER) @E...
- Sat Jan 04, 2020 7:31 am
- Forum: Plugin Development Support
- Topic: [ANY] Prevent user name changes
- Replies: 10
- Views: 13355
Re: [ANY] Prevent user name changes
@PreEvent('player_changename') def pre_player_changename(gevent): player = Player.from_userid(gevent['userid']) # Update scoreboard. player.set_name(gevent['oldname']) gevent['newname'] = gevent['oldname'] return EventAction.BL...
- Fri Jan 03, 2020 7:23 pm
- Forum: Plugin Development Support
- Topic: [ANY] Prevent user name changes
- Replies: 10
- Views: 13355
Re: [ANY] Prevent user name changes
Sam wrote:
- Fri Jan 03, 2020 6:50 pm
- Forum: Plugin Development Support
- Topic: [ANY] Prevent user name changes
- Replies: 10
- Views: 13355
Re: [ANY] Prevent user name changes
Sam wrote:I understand correctly?
void CBaseClient::SetName:
Syntax: Select all
m_ConVars->SetString( "name", m_Name );
m_Server->UserInfoChanged( m_nClientSlot );
Yes, you are right, didn't notice the simple function
- Fri Jan 03, 2020 6:14 pm
- Forum: Plugin Development Support
- Topic: CheckBoxInPVS / CheckOriginInPVS
- Replies: 0
- Views: 13123
CheckBoxInPVS / CheckOriginInPVS
Source.Python: .def("check_origin_in_pvs", &IVEngineServer::CheckOriginInPVS, "Check whether the specified origin is inside the PVS", args("org", "checkpvs", "checkpvssize") ) .def("check_box_in_pvs", &IVEngineSe...
- Thu Jan 02, 2020 1:31 am
- Forum: Plugin Development Support
- Topic: [ANY] Prevent user name changes
- Replies: 10
- Views: 13355
Re: [ANY] Prevent user name changes
L'In20Cible @PreHook(get_virtual_function(engine_server, 'ClientCommand')) def _pre_client_command(args): """Block name changes started by the server. Pre-hook on IVEngineServer::ClientCommand to block the name changes. """ if args[2] ==...
- Thu Jan 02, 2020 12:49 am
- Forum: Code examples / Cookbook
- Topic: *DELETED*
- Replies: 14
- Views: 70005
Re: [DEV] Algorithm for checking a point in a cube
Jesus... WHAT??? What you gave us is really bad. I wouldn't include this in any Cookbook. I just thought of a better alternative. And without it I suppose someone will use yours instead of the normal way. I respect your imagination of course but do not be impudent accepting your algorithm as the on...
- Thu Jan 02, 2020 12:43 am
- Forum: Code examples / Cookbook
- Topic: Perfect PlayerDictionary and Player
- Replies: 4
- Views: 44357
Re: Perfect PlayerDictionary and Player
Okay I'm a little bent about iterating over all players in method of one player, but one PlayerDictionary for a whole plugin which will be updated on player connect or disconnect alongside list with all players for iterating over, it is awesome. I'm even scared to do benchmark with PlayerGenerator e...
- Tue Dec 31, 2019 9:03 pm
- Forum: Code examples / Cookbook
- Topic: *DELETED*
- Replies: 14
- Views: 70005
Re: [DEV] Algorithm for checking a point in a cube
Also if you have a representation of a cube in 2 points (lower and upper corners) you should determine mins and maxs points. But I too recommend using standard Source.Python function because it takes care for it. Source.Python core: static bool IsWithinBox(Vector& point, Vector& corner1,...
- Tue Dec 31, 2019 6:50 pm
- Forum: Code examples / Cookbook
- Topic: Perfect PlayerDictionary and Player
- Replies: 4
- Views: 44357
Re: Perfect PlayerDictionary and Player
I'm honestly not sure why you think this is better than the current implementation. Read to the end. Removing all the functionality of Entity seems like a horrible idea to me... PlayerMixin inhreted from BaseEntity . That's enough. And I just created a class with just the needed functions for my pl...
- Tue Dec 31, 2019 11:39 am
- Forum: Code examples / Cookbook
- Topic: Perfect PlayerDictionary and Player
- Replies: 4
- Views: 44357
Perfect PlayerDictionary and Player
Perfect PlayerDictionary must have the following properties: 1. It should be one for the whole plugin. 2. It should add and remove player instances when client connect to the server and disconnects from the server respectively. 3. It should if necessary contains functions related to many players. A...
- Mon Dec 30, 2019 8:57 am
- Forum: Plugin Development Support
- Topic: PlayerDictionary vs CachedPlayer
- Replies: 36
- Views: 29999
Re: PlayerDictionary vs CachedPlayer
Of course I can't do it myself, but I still want to try making a Lua bindings.
- Mon Dec 30, 2019 8:40 am
- Forum: Plugin Development Support
- Topic: PlayerDictionary vs CachedPlayer
- Replies: 36
- Views: 29999
Re: PlayerDictionary vs CachedPlayer
Edit: Found better variant PyPy(in 4x-6x) faster than Cython with CFFI for c++ bindings.
I just know.a one person who doesn't want to try Source.Python because it is really slow by him opinion.
I just know.a one person who doesn't want to try Source.Python because it is really slow by him opinion.
- Mon Dec 30, 2019 8:24 am
- Forum: Plugin Development Support
- Topic: PlayerDictionary vs CachedPlayer
- Replies: 36
- Views: 29999
Re: PlayerDictionary vs CachedPlayer
By the way I noticed that there exists pybind11, and maybe we can replace Boost.Python to pybind 11. Quote from stackoverfow I would recommend PyBind11. I am using it for similar use-case where Python modules calls C++ to perform operations which are costlier and performance extensive. Boost Python ...
- Mon Dec 30, 2019 8:11 am
- Forum: Plugin Development Support
- Topic: PlayerDictionary vs CachedPlayer
- Replies: 36
- Views: 29999
Re: PlayerDictionary vs CachedPlayer
In first, what if there will be cache in C++ side classes like CBasePlayer, CBaseEntity and on Python side we will simple retrieve them through BasePlayer(1), BaseEntity(1) respectively. So it will be really standard classes cached by default in C++ and nothing more for fast access. But what about c...
- Sun Dec 29, 2019 12:50 pm
- Forum: Plugin Development Support
- Topic: PlayerDictionary vs CachedPlayer
- Replies: 36
- Views: 29999
Re: PlayerDictionary vs CachedPlayer
I've come up with something. What if we will have the global cache like L'In20Cible suggested, but very very global. I mean caching at low-level CBaseEntity, CBasePlayer, PlayerMixin in C++ and maybe Python with standard attributes and functions from Source-SDK. And nothing more won't be available t...
- Sun Dec 29, 2019 11:02 am
- Forum: Plugin Development Support
- Topic: PlayerDictionary vs CachedPlayer
- Replies: 36
- Views: 29999
Re: PlayerDictionary vs CachedPlayer
Entity.cache isn't even connected with EntityDictionary and this is completely new which located in Entity.class but repeats the EntityDictionary behavior. I still doubt this decision because you answer unconvincingly. I can't avoid using Player.cache even with caching=False because every time when ...
- Sat Dec 28, 2019 3:39 pm
- Forum: Plugin Development Support
- Topic: Beam Effects
- Replies: 2
- Views: 4208
Re: Beam Effects
Noticed that the TempEntity.create takes a delay before creating the effect and maybe you can simply do this and behavior will be different: sparks = TempEntity('BeamPoints') sparks.alpha = 255 sparks.blue = 255 sparks.green = 208 sparks.red = 113 #... for i in range(1, 11): ...
- Sat Dec 28, 2019 11:51 am
- Forum: API Design
- Topic: My thoughts, questions and wishes
- Replies: 25
- Views: 123084
Re: My thoughts, questions and wishes
2. I'm against moving them. This would break all existing codes that currently import them from there and since they are primarily to use in conjunction of the buttons listeners, having them there really just regroup your imports. Sooner or later you'll have to break existing codes for the best. 4....