Search found 168 matches

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: 120

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: 120

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: 120

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: 120

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: 365

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: 635

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: 524

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: 524

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()
by Doldol
Tue Apr 11, 2017 8:19 pm
Forum: Plugin Development Support
Topic: How do I use the KeyValues class?
Replies: 6
Views: 501

Re: How do I use the KeyValues class?

That's fast. & Supporting nested dicts out of the box, I like the implementation.
by Doldol
Tue Apr 11, 2017 6:17 pm
Forum: Plugin Development Support
Topic: How do I use the KeyValues class?
Replies: 6
Views: 501

Re: How do I use the KeyValues class?

Thanks! I understand how it works now.

Ayuto wrote:I think it makes sense to add a 'from_dict' method to construct a KeyValues class from a dictionary.


Yes please!
by Doldol
Tue Apr 11, 2017 4:46 pm
Forum: Custom Packages
Topic: MOTDPlayer v2
Replies: 5
Views: 848

Re: MOTDPlayer v2

Does anybody know of a way to sensibly immitate uWSGI on a windows machine? If not looks like I am going to have to work with Ubuntu again :P Well uWSGI can run with Cygwin :3 Or you could try using django-channels instead, but it will require you to rewrite the Flask application into a django proj...
by Doldol
Tue Apr 11, 2017 11:11 am
Forum: Plugin Development Support
Topic: How do I use the KeyValues class?
Replies: 6
Views: 501

How do I use the KeyValues class?

It isn't very clear to me how to best use this class. Let's say I'm trying to write this to a file (I don't care about newlines/whitespace), how would I construct this best using the KeyValues class? (Or is there a better way?) "Admins" { "Admin1" { "auth" "steam&q...
by Doldol
Tue Apr 04, 2017 3:04 pm
Forum: Whatever
Topic: Hello everyone! i didn't know where to post so here i am!
Replies: 7
Views: 698

Re: Hello everyone! i didn't know where to post so here i am!

Don't forget that when python is to slow you can write a C (C++) extension for it easily. You also have Cython . Web applications use caching smartly to great effect. I use Source.Python to connect to a webserver (Django/Daphne) using websockets, which works great: it's very secure (You don't have t...
by Doldol
Tue Feb 14, 2017 11:59 pm
Forum: Module/Package Submissions
Topic: Threaded MySQL
Replies: 16
Views: 1845

Re: Threaded MySQL

Actually, this isn't really threaded as Delay and Repeat are used, which are executed in the same thread. So, this will probably just delay the lag. You need to utilize GameThread to create real threads. First of all, it will prevent lag 100%. Delaying every single query is a good solution because ...
by Doldol
Mon Jan 23, 2017 10:39 pm
Forum: Plugin Requests
Topic: Skin Chooser
Replies: 16
Views: 1602

Re: Skin Chooser

L'In20Cible wrote:http://blog.counter-strike.net/index.php/server_guidelines/


Guys, read that again, especially the bolded, and now struck through text.
by Doldol
Mon Jan 23, 2017 10:21 pm
Forum: Plugin Development Support
Topic: post json data lag
Replies: 12
Views: 1103

Re: post json data lag

No need to handle the tick listener yourself, simply inherit from GameThread . I haven't found __del__ to be very reliable, especially while working with threads. http://stackoverflow.com/a/1481512 I saw bootstrap_inner, but I prefer the finer grained control writing the logic myself gives me while...
by Doldol
Mon Jan 23, 2017 10:17 pm
Forum: Plugin Development Support
Topic: post json data lag
Replies: 12
Views: 1103

Re: post json data lag

Be careful, starting a Python thread can introduce lag too. (if someone were to spam !postd, 100% guaranteed the server will start to lag.). My solution would be to create one thread when your plugin starts that you can pass functions to call to, like this: import time import threading import queue...
by Doldol
Mon Jan 23, 2017 10:12 pm
Forum: Plugin Releases
Topic: [CS:GO] AdPurge
Replies: 3
Views: 697

Re: [CS:GO] AdPurge

Neat!
by Doldol
Fri Oct 07, 2016 6:48 pm
Forum: General Discussion
Topic: New CS:GO Update broke plugin(s)?
Replies: 16
Views: 1961

Re: New CS:GO Update broke plugin(s)?

I can confirm SP loads without errors on Ubuntu Server 14 LTS with the new CSGO update

sp version:
Current Source.Python version: 346
by Doldol
Thu Sep 29, 2016 6:06 pm
Forum: General Discussion
Topic: Using CS:S Model Size in CS:GO
Replies: 24
Views: 2500

Re: Using CS:S Model Size in CS:GO

Why don't try and convert the base CSS player models to CSGO? Or edit some CSGO models to be the appropriate size?

Go to advanced search