Page 1 of 1

TypedSayCommand after unloading/loading plugin

Posted: Thu Jan 11, 2018 12:07 pm
by battleweaver
Hello everyone!
I have, say, test.py.
Skipping imports, the code is:

Syntax: Select all

@TypedSayCommand('!myteam')
def cmd_on_myteam(command_info):
print('Showing team')
player = Player(command_info.index)
SayText2(f"Team is {player.team}").send(player.index)


I launch test.py through autoexec.cfg, where I wrote:

Code: Select all

sp plugin load test

Works fine unless I enter server console and execute following commands:

Code: Select all

sp plugin unload test
sp plugin load test

Every other line of code works fine after manipulations above, while there is no reaction on typing "!myteam" in chat.
Is this a bug or a feature?

Re: TypedSayCommand after unloading/loading plugin

Posted: Thu Jan 11, 2018 5:20 pm
by iPlayer
There's a bug in a command manager which causes an issue with similar effects, but that issue is related to chain decorations. You, however, used only one decorator here.

Re: TypedSayCommand after unloading/loading plugin

Posted: Thu Jan 11, 2018 5:54 pm
by Ayuto
Your code works fine on my machine (Windows/CS:S). Can you please post the output of "sp info".

battleweaver wrote:I have, say, test.py.
Skipping imports, the code is:

Syntax: Select all

@TypedSayCommand('!myteam')
def cmd_on_myteam(command_info):
print('Showing team')
player = Player(command_info.index)
SayText2(f"Team is {player.team}").send(player.index)
It would be great if people don't skip them. Otherwise I always have to write them down if I want to test their code. :wink:

Re: TypedSayCommand after unloading/loading plugin

Posted: Thu Jan 11, 2018 10:37 pm
by satoon101
Ayuto wrote:
battleweaver wrote:I have, say, test.py.
Skipping imports, the code is:

Syntax: Select all

@TypedSayCommand('!myteam')
def cmd_on_myteam(command_info):
print('Showing team')
player = Player(command_info.index)
SayText2(f"Team is {player.team}").send(player.index)
It would be great if people don't skip them. Otherwise I always have to write them down if I want to test their code. :wink:

I would definitely echo Ayuto's comment. I would also add that it is much more helpful to have a small plugin that can fully reproduce the issue without any other plugins loaded. I understand that it isn't working for you, but it could very well be another part of the larger plugin is causing you this issue. Without the full code to reproduce the issue, it's difficult for us to help you.

Re: TypedSayCommand after unloading/loading plugin

Posted: Fri Jan 12, 2018 8:54 am
by battleweaver
I am sory for this post.
I did not describe the problem correctly and i am not sure, that I am going to do this in near future.
Could you delete post?

Re: TypedSayCommand after unloading/loading plugin

Posted: Fri Jan 12, 2018 9:18 am
by La Muerte
Don't be sorry, those are simply some pointers to enable us to help you better, which happens to be exactly what we would like to do :)

Could you perhaps make a full test.py (with all the imports etc) and ensure that the issue still occures for you when trying this out with the complete test.py, so that we can easily reproduce the issue and help you out more accurately? Thanks in advance battleweaver!

Which version of Source.Python are you using?

Re: TypedSayCommand after unloading/loading plugin

Posted: Mon Jan 15, 2018 8:34 am
by battleweaver
The point is: the error happends only on my client side, while my neighbour's client connects to server and does not experience such error. Something tells me, it is too early to say that it's Sourcepython problem.

sp info

Date : 2018-01-15 08:33:24.382118
OS : Linux-4.4.0-109-generic-x86_64-with-debian-stretch-sid
Game : csgo
SP version : 621
Server plugins:
00: Source.Python, (C) 2012-2016, Source.Python Team.
SP plugins:
00: test