Search found 1256 matches

by L'In20Cible
Tue Aug 22, 2023 4:50 am
Forum: Plugin Development Support
Topic: [CS:S] Forcing players fire weapon when they are secondaries
Replies: 1
Views: 2555

Re: [CS:S] Forcing players fire weapon when they are secondaries

It does not work because pistols are not automatic so the attack button must be released before it can shoot again.

Syntax: Select all

if user_cmd.buttons & PlayerButtons.ATTACK:
user_cmd.buttons &= ~PlayerButtons.ATTACK
else:
user_cmd.buttons |= PlayerButtons.ATTACK
by L'In20Cible
Sat Aug 19, 2023 10:10 am
Forum: Plugin Development Support
Topic: GameThread slow
Replies: 32
Views: 5502

Re: GameThread slow

decompile wrote:Is there any update about this?
I don't plan on iterating on this further at this time but progress (if any) can be followed into #491.
by L'In20Cible
Mon Aug 07, 2023 4:18 am
Forum: Plugin Development Support
Topic: GameThread slow
Replies: 32
Views: 5502

Re: GameThread slow

Added support for Linux and CS:GO: 1wAeyyUgdGSAENV80BeWSIN0Sy3w4W5Jb
by L'In20Cible
Thu Aug 03, 2023 6:14 pm
Forum: Plugin Development Support
Topic: CSGO: Bot waypoints real time manipulation
Replies: 11
Views: 8215

Re: CSGO: Bot waypoints real time manipulation

// CCSBot::MoveTo (CSGO/Linux) \x55\x89\xE5\x8B\x55\x0C\x8B\x45\x08\xF3\x0F\x10\x02\xF3\x0F\x11\x80\x2A\x2A\x2A\x2A\xF3\x0F\x10\x42\x04\xF3\x0F\x11\x80\x2A\x2A\x2A\x2A\xF3\x0F\x10\x42\x08\x8B\x55\x10\xF3\x0F\x11\x80\x2A\x2A\x2A\x2A\x89\x90\x2A\x2A\x2A\x2A\x8D\x90\x2A\x2A\x2A\x2A\x89\x55\x0C\x5D\xE9...
by L'In20Cible
Thu Aug 03, 2023 12:01 am
Forum: Plugin Development Support
Topic: GameThread slow
Replies: 32
Views: 5502

Re: GameThread slow

Hey, I tried it out and it feels as good as before. Is the change noticeable? Let's take for example a server with default 67 tickrate. Each tick would be at ~15ms interval. If running the frame takes 5ms, it then goes to sleep for 10ms. The previous workaround was going to sleep an extra 1ms on to...
by L'In20Cible
Tue Aug 01, 2023 8:50 pm
Forum: Plugin Development Support
Topic: GameThread slow
Replies: 32
Views: 5502

Re: GameThread slow

Try this: 1wAeyyUgdGSAENV80BeWSIN0Sy3w4W5Jb It should not only be faster but overall smoother. Basically, instead of yielding an extra 1ms every frame and exceed the intended interval, it now yields the entire time the main thread goes inactive after it's done running the frame. You can see how many...
by L'In20Cible
Thu Jul 27, 2023 4:18 am
Forum: Plugin Development Support
Topic: GameThread slow
Replies: 32
Views: 5502

Re: GameThread slow

Just noticed this here when unloading my test.py from yesterday. AttributeError: _target Thanks, will get that fixed. The server and gameplay is now smooth without any lags or tickrate loss. What about execution time? Did you notice any difference in timing? On my side, I just timed the following: ...
by L'In20Cible
Wed Jul 26, 2023 10:47 am
Forum: Plugin Development Support
Topic: GameThread slow
Replies: 32
Views: 5502

Re: GameThread slow

d6580e1 should address the issue. It also add some utilities (have a look at ../threads.py for examples). You will also need to edit your core_settings.ini to enable the yielding. Test build (Windows): 834f711 For your use case here, you could simply use queued without having to worry about managin...
by L'In20Cible
Wed Jul 26, 2023 9:16 am
Forum: Plugin Development Support
Topic: GameThread slow
Replies: 32
Views: 5502

Re: GameThread slow

You can replicate it yourself by using: I was able to reproduce it with (which I believe reproduce your tickrate_enabler plugin): from memory import * from memory.hooks import * from engines.server import * @PreHook( get_object_pointer(server_game_dll).make_virtual_function( 10, # G...
by L'In20Cible
Tue Jul 25, 2023 7:59 pm
Forum: Plugin Development Support
Topic: GameThread slow
Replies: 32
Views: 5502

Re: GameThread slow

I'm simply just starting srcds, wait until the map is loaded and load my snippet from here by typing sp plugin load mysql , which then caps the tickrate / fps to 10.00. If I would reload the plugin several times in the same session, then there would be indeed several threads running, but the output...
by L'In20Cible
Tue Jul 25, 2023 5:36 am
Forum: Plugin Development Support
Topic: GameThread slow
Replies: 32
Views: 5502

Re: GameThread slow

but it somehow changes the server tickrate to exactly 10.00. Are you running multiple threads that execute CPU-bound routines at the same time (e.g. by reloading your plugin while the current one is still running)? If so, then that's likely your issue. For example, Thread would also suffer from thi...
by L'In20Cible
Mon Jul 24, 2023 11:54 pm
Forum: Plugin Development Support
Topic: GameThread slow
Replies: 32
Views: 5502

Re: GameThread slow

With 21d3dff you could simply do something like this to handle queued calls: from functools import partial from listeners.tick import InfiniteThread class Queued(list): def __call__(self, func, *args, **kwargs): self.append(partial(func, *args, **kwargs)) def process&...
by L'In20Cible
Mon Jul 24, 2023 11:46 pm
Forum: Plugin Development Support
Topic: GameThread slow
Replies: 32
Views: 5502

Re: GameThread slow

decompile wrote:How is while ThreadPoker(): properly used in my example?

It should be with, not while. I'm about to push something that should make your life easier.
by L'In20Cible
Mon Jul 24, 2023 10:16 pm
Forum: Plugin Development Support
Topic: GameThread slow
Replies: 32
Views: 5502

Re: GameThread slow

99.9% sure you should remove the self.queue.task_done() call. IIRC, this join to the main thread. EDIT: This also does not look quite right: while ThreadPoker(): In any case, I think you are making it overly hard to maintain with a single class that tries to be them all (an infinite thread, ...
by L'In20Cible
Mon Jul 24, 2023 12:39 am
Forum: Plugin Development Support
Topic: GameThread slow
Replies: 32
Views: 5502

Re: GameThread slow

So I could just import: from _listeners._tick import ThreadPoker You can import it from listeners.tick . and update the run function to: (??) def run(self): with ThreadPoker(): while self.connected: while not self.queue.empty(): callback, args, kwargs = self.queue.get_nowait...
by L'In20Cible
Sun Jul 23, 2023 4:39 pm
Forum: Plugin Development Support
Topic: GameThread slow
Replies: 32
Views: 5502

Re: GameThread slow

decompile wrote:However, when wrapping the GameThread class, the slow process is sadly back..
You override GameThread.run but never super'call the original. Therefore, the bear is never poked. Just create your own poker: ../listeners/tick.py#L73
by L'In20Cible
Sun Jul 23, 2023 6:24 am
Forum: Plugin Development Support
Topic: GameThread slow
Replies: 32
Views: 5502

Re: GameThread slow

decompile wrote:This is huge!

os.system is quite heavy so I implemented that on the c++ side instead and patched GameThread directly.

Test build: css-d2fe149.zip
by L'In20Cible
Sat Jul 22, 2023 8:28 am
Forum: Plugin Development Support
Topic: GameThread slow
Replies: 32
Views: 5502

Re: GameThread slow

My first guess would be that the execution is not necessarily slow, but rather the GIL is more than likely deadlocked. For instance, does calling do_thread from the main thread resume the threaded call? thread = threading.Thread(target=do_thread) thread.start() do_thread() ED...
by L'In20Cible
Sun May 14, 2023 4:09 pm
Forum: Plugin Development Support
Topic: Pose parameter
Replies: 3
Views: 4887

Re: Pose parameter

Technically, you could get it by reading CBaseAnimating::m_pStudioHdr : entity.get_pointer( entity.datamap.find('OnIgnite').offset + get_size(BaseEntityOutput) + 4 ) However, it needs to be locked by CBaseAnimating::LockStudioHdr first for it to be defined. Therefore,...
by L'In20Cible
Fri May 12, 2023 4:29 pm
Forum: Plugin Requests
Topic: HL2DM: Bots on and off
Replies: 11
Views: 3880

Re: HL2DM: Bots on and off

My first guess would be that your bots plugin is loaded prior SP and its callbacks do their things before the variable is enabled. Try to load SP first.

Go to advanced search