Search found 241 matches
- Wed Nov 25, 2015 10:41 pm
- Forum: Plugin Development Support
- Topic: Database connection closed in unload(), still closed after the next load()
- Replies: 2
- Views: 2923
Apparently every time I reload the plugin, I get one more error (although the exact same error) from player_spawn, and always one player_spawn succeeds. So first time I load the plugin -> player_spawn succeeds. Second load -> one player_spawn succeeds and one error is raised due to connection being ...
- Wed Nov 25, 2015 3:24 pm
- Forum: Plugin Development Support
- Topic: Database connection closed in unload(), still closed after the next load()
- Replies: 2
- Views: 2923
Database connection closed in unload(), still closed after the next load()
I've been working on a new Hero-Wars based Warcraft mod for CS:GO with Predz. I took an approach where I create a Database class which connects to the SQL database in its __init__ . The database object is initialized in the plugin's load() function. In the unload() function, I call t...
- Wed Nov 25, 2015 3:02 pm
- Forum: General Discussion
- Topic: Weird behaviour during warmup
- Replies: 7
- Views: 6463
- Wed Nov 25, 2015 12:48 pm
- Forum: General Discussion
- Topic: Weird behaviour during warmup
- Replies: 7
- Views: 6463
- Tue Nov 24, 2015 11:52 pm
- Forum: General Discussion
- Topic: Weird behaviour during warmup
- Replies: 7
- Views: 6463
Weird behaviour during warmup
I'm using the following plugin to test this with the latest release at this time : from events import Event from players.entity import Player from players.helpers import index_from_userid @Event('player_death', 'player_spawn', 'player_disconnect', 'player_activate'...
- Sat Nov 21, 2015 1:20 am
- Forum: Plugin Development Support
- Topic: Restart the round
- Replies: 30
- Views: 18987
- Fri Nov 20, 2015 4:35 pm
- Forum: News & Announcements
- Topic: Updated conversion functions
- Replies: 8
- Views: 29911
- Thu Nov 19, 2015 11:37 pm
- Forum: News & Announcements
- Topic: Updated conversion functions
- Replies: 8
- Views: 29911
- Thu Nov 19, 2015 10:28 pm
- Forum: News & Announcements
- Topic: Updated conversion functions
- Replies: 8
- Views: 29911
I think I'm with Doldol here, I'd prefer an error with try/except way more than getting None. If I'm trying to convert an userid to an index and it fails, I expect and exception to be raised instead of getting None. It's not like int('hi') returns None either. I agree that getting rid of the extra a...
- Fri Nov 13, 2015 11:11 pm
- Forum: Plugin Development Support
- Topic: Getting a team's player count without iterating?
- Replies: 12
- Views: 8530
Since there's no performance issues yet, I would just go with the len(PlayerIter(team)) solution. Today's computers are way faster than you can even understand, the duration is barely milliseconds. If you end up with performance issues, that's when you figure out the bottleneck and start improving t...
- Sun Nov 08, 2015 7:53 pm
- Forum: News & Announcements
- Topic: Changes to filters package and Entity classes
- Replies: 1
- Views: 20160
- Wed Nov 04, 2015 3:25 pm
- Forum: Plugin Development Support
- Topic: How to get weapon's max ammo?
- Replies: 5
- Views: 4589
How to get weapon's max ammo?
Say I want to give player ammo every time he jumps, if he doesn't have full ammo already: from entities.helpers import index_from_inthandle from events import Event from players.entity import PlayerEntity from players.helpers import index_from_userid from weapons.entity import WeaponEntity @Event de...
- Mon Nov 02, 2015 12:06 pm
- Forum: API Design
- Topic: Time to get rid of the GameEvent objects and move to dictionaries?
- Replies: 27
- Views: 38090
I went ahead an removed the first event_test branch. I won't be home for a few days, so please feel free to test this out and let us know if you find any issues or if it works perfectly fine. Once we get confirmation, it looks good enough for me to merge into master. I've spent 5+ hours with the ne...
- Sun Nov 01, 2015 8:41 pm
- Forum: Plugin Releases
- Topic: Bomb Effects (Quality of Life Plugin)
- Replies: 4
- Views: 6110
Nice release! Few improvements to the Python code: global _smokestack _smokestack = None You don't need the global keyword here, as it's already global. You do need the keyword when you're setting it on line 42 though, since we're in a function by then. The way you're getting the bomb (conditionless...
- Sun Nov 01, 2015 8:09 pm
- Forum: Custom Packages
- Topic: EasyPlayer
- Replies: 15
- Views: 43575
Again new release is out, version 1.1: https://github.com/MarkusMeskanen/EasyPlayer/releases/tag/v1.1 I've switched to useing userIDs for caching instead of the entities' indexes, since userIDs cannot be reused like indexes can. Thanks to Ayuto for pointing this out. Also, EasyPlayer's method shift_...
- Sat Oct 31, 2015 9:48 pm
- Forum: API Design
- Topic: Time to get rid of the GameEvent objects and move to dictionaries?
- Replies: 27
- Views: 38090
I have created a new branch for the __getitem__ implementation. https://github.com/Source-Python-Dev-Team/Source.Python/commit/06658ab791b3db65cd83356798d5ac5f86f7fb21 I think the event system is the same on all branches. Some weeks ago I checked the offset of the KeyValues object and it was the sa...
- Sat Oct 31, 2015 9:16 am
- Forum: API Design
- Topic: Time to get rid of the GameEvent objects and move to dictionaries?
- Replies: 27
- Views: 38090
The plan is to implement __getitem__ and __setitem__. If we still keep the get_<type>/set_<type> methods it's absolutely backwards compatible, because it's just an addition. Sounds really good, perfect not to say. Hopefully you'll also add some kind of to_dict() method or a way of iterating over th...
- Sat Oct 31, 2015 7:38 am
- Forum: API Design
- Topic: Time to get rid of the GameEvent objects and move to dictionaries?
- Replies: 27
- Views: 38090
- Wed Oct 28, 2015 11:30 pm
- Forum: API Design
- Topic: Time to get rid of the GameEvent objects and move to dictionaries?
- Replies: 27
- Views: 38090
If we are going to make any changes, it should be so that they are the correct type. Making it just like ES where everything is a string value and we have to typecast anyway seems pointless to me, which is the main reason this was never done in the first place. Honestly, I am going to test the play...
- Wed Oct 28, 2015 10:47 pm
- Forum: API Design
- Topic: Time to get rid of the GameEvent objects and move to dictionaries?
- Replies: 27
- Views: 38090
Do we really want to convert them automatically? That's a yes from me, if it has any weight! I like automatic conversion, but if we do that we should do it consistently. For example we do not provide a Entity.get_property method, but Entity.get_property_<type>, although we know the types in that ca...