Search found 114 matches

by InvisibleSoldiers
Fri Dec 27, 2019 9:21 pm
Forum: API Design
Topic: My thoughts, questions and wishes
Replies: 25
Views: 81616

Re: My thoughts, questions and wishes

2. Which place do you suggest? ButtonStatus to players.constants get_button_combination_status to players.helpers 3. Just added a wrapper property to the Player class. With the next release, you can simply do the following. from players.entity import Player player = Player(1) print(play...
by InvisibleSoldiers
Fri Dec 27, 2019 5:00 pm
Forum: API Design
Topic: My thoughts, questions and wishes
Replies: 25
Views: 81616

Re: My thoughts, questions and wishes

I didn't know about it, but looking for SourceMod, there is a special function https://sm.alliedmods.net/new-api/console/PrintToConsole , but it's probably wrong to compare Pawn and Python because Python it's all-around language, and Pawn is sort of embedding language like Lua and we're getting clo...
by InvisibleSoldiers
Fri Dec 27, 2019 4:44 pm
Forum: API Design
Topic: My thoughts, questions and wishes
Replies: 25
Views: 81616

Re: My thoughts, questions and wishes

13. Without my notes, I cannot help with this. Try to search for a way in API and what do you dislike about `TextMsg("Hell", HudDestination.CONSOLE).send()`? I didn't know about it, but looking for SourceMod, there is a special function https://sm.alliedmods.net/new-api/console/PrintToCon...
by InvisibleSoldiers
Fri Dec 27, 2019 4:37 pm
Forum: API Design
Topic: My thoughts, questions and wishes
Replies: 25
Views: 81616

Re: My thoughts, questions and wishes

9. If it can be installed on Python 3.8, then there is such a possibility. It happens that some cannot be installed. Like Lupa (Lua 5.3 for Python) it should be possible also in Python 3.8 because why would they lose their customer base, but we are on Python 3.6 if i remember, and i installed it wi...
by InvisibleSoldiers
Fri Dec 27, 2019 4:33 pm
Forum: API Design
Topic: My thoughts, questions and wishes
Replies: 25
Views: 81616

Re: My thoughts, questions and wishes

http://wiki.sourcepython.com/developing/modules/net_channel.html?highlight=netflow#net_channel.NetFlow Who's stopping you from rewriting the code? player.get_latency = engine_server.get_player_net_info( player.index ).get_latency # If you try, you can write better This is a little confusing for a s...
by InvisibleSoldiers
Fri Dec 27, 2019 4:27 pm
Forum: API Design
Topic: My thoughts, questions and wishes
Replies: 25
Views: 81616

Re: My thoughts, questions and wishes

3. from engines.server import engine_server pl_inf = engine_server.get_player_net_info( 1 ) # ARGS: Player Index print(f"Channel name = {pl_inf.name}") print(f"Net address of the player = {pl_inf.address}") print(f"Current net time = {pl_inf.time}") print(f"Amount...
by InvisibleSoldiers
Fri Dec 27, 2019 4:07 pm
Forum: API Design
Topic: My thoughts, questions and wishes
Replies: 25
Views: 81616

Re: My thoughts, questions and wishes

I can create a pull request with some features related to INetChannelnfo in Player class using only Python if you give me the go ahead so that I don't suffer for nothing.
by InvisibleSoldiers
Fri Dec 27, 2019 2:13 pm
Forum: API Design
Topic: My thoughts, questions and wishes
Replies: 25
Views: 81616

Re: My thoughts, questions and wishes

satoon101 wrote:For many of these items, you are more than welcome to create a Pull Request for each individually.

I don't know maybe API better to write only in C++, and my knowledge with it, is only reading source-sdk.
by InvisibleSoldiers
Fri Dec 27, 2019 8:08 am
Forum: API Design
Topic: My thoughts, questions and wishes
Replies: 25
Views: 81616

My thoughts, questions and wishes

⋅ I wish see PlayerIter which can yields custom Player entity from cache. ⋅ Can we put get_button_combination_status and ButtonStatus to other place? ⋅ Can wee wrap NetChannelInfo like SourceMod did it to Player class to get latency packets info and other stuff without...
by InvisibleSoldiers
Wed Dec 25, 2019 3:27 pm
Forum: Plugin Development Support
Topic: PlayerDictionary vs CachedPlayer
Replies: 36
Views: 20803

Re: PlayerDictionary vs CachedPlayer

Your version does not seem to reduce the number of lines by using classes, but by removing comments and blank lines that were added for readability. I thought your goal was to increase readability? :confused: Well, yes, it's debatable but that's not the point, point is that overall readability in m...
by InvisibleSoldiers
Tue Dec 24, 2019 6:15 am
Forum: Plugin Development Support
Topic: PlayerDictionary vs CachedPlayer
Replies: 36
Views: 20803

Re: PlayerDictionary vs CachedPlayer

Rewrote the plugin with given the fact that a parachute can be removed by a third-party way, that is, not this plugin, but someone else's or something else, that is, if I delete a parachute in this plugin, the error theoretically can not be because i can set a player's parachute again to None. I di...
by InvisibleSoldiers
Tue Dec 24, 2019 4:50 am
Forum: Plugin Development Support
Topic: PlayerDictionary vs CachedPlayer
Replies: 36
Views: 20803

Re: PlayerDictionary vs CachedPlayer

from entities.entity import Entity from events import Event from players.entity import Player from players.dictionary import PlayerDictionary players = PlayerDictionary() @Event('player_say') def player_say(game_event): text = game_event.get_string('text'...
by InvisibleSoldiers
Tue Dec 24, 2019 4:37 am
Forum: Plugin Development Support
Topic: PlayerDictionary vs CachedPlayer
Replies: 36
Views: 20803

Re: PlayerDictionary vs CachedPlayer

Rewrote the plugin with given the fact that a parachute can be removed by a third-party way, that is, not this plugin, but someone else's or something else, that is, if I delete a parachute in this plugin, the error theoretically can not be because i can set a player's parachute again to None. I did...
by InvisibleSoldiers
Tue Dec 24, 2019 2:39 am
Forum: Plugin Development Support
Topic: PlayerDictionary vs CachedPlayer
Replies: 36
Views: 20803

Re: PlayerDictionary vs CachedPlayer

Again, they are not aliases and have totally different use cases. The fact you are using a PlayerDictionary as a cache, doesn't means this is its main purpose. This is a container you can use to keep track of instances while not having to clean it up yourself. For example, look at my Parachute plug...
by InvisibleSoldiers
Mon Dec 23, 2019 10:31 pm
Forum: Plugin Development Support
Topic: PlayerDictionary vs CachedPlayer
Replies: 36
Views: 20803

Re: PlayerDictionary vs CachedPlayer

OK, i read carelessly, but then why you didn't link 'prop_dynamic_override' entity with a custom player object in this way:

Syntax: Select all

Player.parachute = Entity.create('prop_dynamic_override')

It's not sublass.
And why do you consider defending self point of view as hostility?
by InvisibleSoldiers
Mon Dec 23, 2019 9:40 pm
Forum: Plugin Development Support
Topic: PlayerDictionary vs CachedPlayer
Replies: 36
Views: 20803

Re: PlayerDictionary vs CachedPlayer

Again, they are not aliases and have totally different use cases. The fact you are using a PlayerDictionary as a cache, doesn't means this is its main purpose. This is a container you can use to keep track of instances while not having to clean it up yourself. For example, look at my Parachute plug...
by InvisibleSoldiers
Mon Dec 23, 2019 9:07 pm
Forum: Plugin Development Support
Topic: PlayerDictionary vs CachedPlayer
Replies: 36
Views: 20803

Re: PlayerDictionary vs CachedPlayer

I guess no one won't use PlayerDictionary with the default base, and the optimizations from you are not incomprehensible, because you are trying to make caching available for people who may not have wanted it or those who are just stupid. What is a good tone designing programs? Not to create aliases...
by InvisibleSoldiers
Mon Dec 23, 2019 8:37 pm
Forum: Plugin Development Support
Topic: PlayerDictionary vs CachedPlayer
Replies: 36
Views: 20803

Re: PlayerDictionary vs CachedPlayer

I guess no one won't use PlayerDictionary with default base, and the optimizations from you are not incomprehensible, because you are trying to make caching available to people who may not have wanted it or those who are just stupid. What is a good tone designing programs? Not to create aliases for ...
by InvisibleSoldiers
Mon Dec 23, 2019 7:58 pm
Forum: Plugin Development Support
Topic: PlayerDictionary vs CachedPlayer
Replies: 36
Views: 20803

Re: PlayerDictionary vs CachedPlayer

L'In20Cible wrote:
InvisibleSoldiers wrote:

Syntax: Select all

player = make_object(Player, stack[0])


Syntax: Select all

player = PLAYERS[index_from_pointer(stack[0])]
by InvisibleSoldiers
Mon Dec 23, 2019 6:33 pm
Forum: Plugin Development Support
Topic: PlayerDictionary vs CachedPlayer
Replies: 36
Views: 20803

Re: PlayerDictionary vs CachedPlayer

The behaviour is basically the same, but as you noted using a PlayerDictionary will be slightly faster. Which is to be expected, since you do not attempt to instantiate an instance but look up a cache directly. You are likely to get similar timing results using: Player.cache[1] it's a little weird ...

Go to advanced search