Search found 200 matches

by Doldol
Tue Feb 27, 2018 5:01 pm
Forum: API Design
Topic: Anti-spam on Typed*Command
Replies: 5
Views: 28384

Re: Anti-spam on Typed*Command

I like where you're going Ayuto, but the more I think about it, the more important I think it is to implement this on a per user basis. I'm of the opinion that Source game servers focus on providing an equal experience to all players, so imo it wouldn't be good design to let one player spam a comman...
by Doldol
Sun Feb 25, 2018 4:04 pm
Forum: API Design
Topic: Anti-spam on Typed*Command
Replies: 5
Views: 28384

Re: Anti-spam on Typed*Command

I noticed this: viewtopic.php?f=38&t=1198&p=7730&hilit=spam#p7730

However I think this is important enough to be implemented directly into SP.
by Doldol
Sun Feb 25, 2018 3:58 pm
Forum: API Design
Topic: Anti-spam on Typed*Command
Replies: 5
Views: 28384

Anti-spam on Typed*Command

Is that implemented? I can't find anything on that, so I'm guessing it's not? I think this would be a good feature to add because it is often something when not implemented that can lead to a DDoS vulnerability or unexpected results. Perhaps implement it as a kwarg in the decorator where the value w...
by Doldol
Mon Feb 19, 2018 1:07 pm
Forum: Plugin Development Support
Topic: [CSS]Exception when reading ammo key value
Replies: 4
Views: 4322

Re: [CSS]Exception when reading ammo key value

There still seems to be something funky going on [SP] Caught an Exception: Traceback (most recent call last): File "../addons/source-python/packages/source-python/plugins/command.py", line 162, in load_plugin plugin = self.manager.load(plugin_name) File "../addons/source-python/packag...
by Doldol
Sun Feb 18, 2018 11:37 am
Forum: Plugin Development Support
Topic: [CSS]Exception when reading ammo key value
Replies: 4
Views: 4322

Re: [CSS]Exception when reading ammo key value

Sounds good, thanks
by Doldol
Sun Feb 18, 2018 9:01 am
Forum: Plugin Development Support
Topic: [CSS]Exception when reading ammo key value
Replies: 4
Views: 4322

[CSS]Exception when reading ammo key value

I can set the ammo key value without any issues, and this works (gives the amount of reserve ammo the value is set to when I pick up the USP), but an exception gets raised when trying to read it. Also, "ammo" is not in weapon_usp.keyvalues. & Reading the kv after spawn doesn't work eit...
by Doldol
Thu Feb 15, 2018 6:45 pm
Forum: Plugin Development Support
Topic: Changing View Model
Replies: 9
Views: 7755

Re: Changing View Model

I've attempted this before and I think you're right, you need to copy at least some of those properties you mentioned from the normal onto your custom model (I figured this out looking at a SM plugin). I don't really remember the details and It was just an experiment for me. My code got never to the...
by Doldol
Mon Feb 05, 2018 11:49 pm
Forum: API Design
Topic: Changing returning hooks works + better documentation?
Replies: 5
Views: 27046

Re: Changing returning hooks works + better documentation?

It's really all just a suggestion (but I do really think it'd be cool to have documentation on how this all precisely works). I admit that I'm adding some boilerplate, and I really understand where you're coming from. Thinking about it more, you're probably right that it'd be unnecessary/detrimental...
by Doldol
Sun Feb 04, 2018 10:25 pm
Forum: API Design
Topic: Changing returning hooks works + better documentation?
Replies: 5
Views: 27046

Re: Changing returning hooks works + better documentation?

Your modifying example is correct, but you can also replace arguments. This is neccessary if the argument is not a pointer. # Assuming we hook: int multiply(int x, int y) def pre_multiply(args): # Replace passed value for x by 5 args[0] = 5 You blocking example is not quite correct....
by Doldol
Sun Feb 04, 2018 3:52 pm
Forum: API Design
Topic: Changing returning hooks works + better documentation?
Replies: 5
Views: 27046

Changing returning hooks works + better documentation?

As far as I know this is how a PreHook works (I couln't find any documentation on this) Modify argument C++ func gets called with import memory from entities import TakeDamageInfo from players.entity import Player from entities.hooks import EntityPreHook, EntityCondition @EntityPreHook(EntityCon...
by Doldol
Thu Feb 01, 2018 11:56 am
Forum: Plugin Development Support
Topic: Prevent Double Jump
Replies: 10
Views: 8282

Re:

Something like this? import memory from memory import Convention from memory import DataType from memory.hooks import PreHook from players.entity import Player server = memory.find_binary('server') CreateInterface = server['CreateInterface'].make_function( Convention.CDE...
by Doldol
Wed Jan 31, 2018 10:18 am
Forum: Plugin Development Support
Topic: Adding site-packages installed via pip automatically to SP
Replies: 7
Views: 6087

Re: Adding site-packages installed via pip automatically to SP

It's kind of offtopic, but have you tried JSON instead of xlsx/csv? Python has build in read/write support and JSON structures very closely represent Python datatypes.
by Doldol
Sun Dec 10, 2017 6:03 pm
Forum: Plugin Development Support
Topic: Unable to convert index from pointer in hook.
Replies: 5
Views: 4648

Re: Unable to convert index from pointer in hook.

This is the original code with some edits to match changed function names And all the imports removed :frown: I like copy and pastable code, because it's quite annoying to always write down the imports for someone else' plugin. The reason why the conversion fails is because you are now hooking &quo...
by Doldol
Sun Dec 10, 2017 3:47 pm
Forum: Plugin Development Support
Topic: Unable to convert index from pointer in hook.
Replies: 5
Views: 4648

Re: Unable to convert index from pointer in hook.

class WeaponDict(dict): def __init__(self): data = {weapon.name:"primary" for weapon in WeaponClassIter('primary')} data.update({weapon.name:"secondary" for weapon in WeaponClassIter('secondary')}) super().__init__&...
by Doldol
Sun Dec 10, 2017 3:32 pm
Forum: Plugin Development Support
Topic: Unable to convert index from pointer in hook.
Replies: 5
Views: 4648

Re: Unable to convert index from pointer in hook.

I should've clarified that I was using it as a pre-hook previously, I was using the posthook to test because the prehook was crashing. Edit: test code as prehook works now, I narrowed down to the wrong thing I guess urh, I'll need to figure out what else is wrong. I'll post if I need some more help,...
by Doldol
Sun Dec 10, 2017 2:28 pm
Forum: Plugin Development Support
Topic: Unable to convert index from pointer in hook.
Replies: 5
Views: 4648

Unable to convert index from pointer in hook.

This used to work in an older version of SP on Windows, migrated to a newer version of SP and linux, now I'm running into this issue, I checked the offsets but that're still good. I simplified everything to just the conversion to index and still have the issue. This is when trying to +USE on an AK/M...
by Doldol
Mon Jul 10, 2017 6:46 pm
Forum: Development Status Updates
Topic: Development status update (June 2017)
Replies: 2
Views: 5039

Re: Development status update (June 2017)

Yay, official GMod support!
by Doldol
Thu Apr 27, 2017 7:49 am
Forum: Plugin Development Support
Topic: Is current date between 2 dates
Replies: 9
Views: 7401

Re: Is current date between 2 dates

This is what I usually do if I only care about day precision # simple example from datetime import datetime start_date = (2, 20) end_date = (7, 1) now = (datetime.now().month, datetime.now().year) if start_date <= now <= end_date: True # in range else: False #...
by Doldol
Sun Apr 16, 2017 6:07 pm
Forum: Plugin Development Support
Topic: anyway that i can get IpAddress and Port etc in cs:go?
Replies: 6
Views: 5423

Re: anyway that i can get IpAddress and Port etc in cs:go?

I honestly don't like the idea of using ConVars, in this instance, because their values are easily changed. But, that does certainly work if you aren't worried about that issue. I feel the same way about querying a remote host for it, it could go down, possibly locking up your plugin, imo even wors...
by Doldol
Sun Apr 16, 2017 3:04 pm
Forum: Plugin Development Support
Topic: anyway that i can get IpAddress and Port etc in cs:go?
Replies: 6
Views: 5423

Re: anyway that i can get IpAddress and Port etc in cs:go?

I won't comment on the git issue, since it's about not using hostip, but using that's been the most robust way for me.

Syntax: Select all

ip = ipaddress.IPv4Address(ConVar("hostip").get_int() & 0xffffffff).exploded
host = ConVar("hostport").get_int()

Go to advanced search