TypedSayCommand after unloading/loading plugin

Please post any questions about developing your plugin here. Please use the search function before posting!
battleweaver
Member
Posts: 43
Joined: Mon Oct 02, 2017 7:57 am
Location: Moscow
Contact:

TypedSayCommand after unloading/loading plugin

Postby battleweaver » Thu Jan 11, 2018 12:07 pm

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?
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: TypedSayCommand after unloading/loading plugin

Postby iPlayer » Thu Jan 11, 2018 5:20 pm

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.
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: TypedSayCommand after unloading/loading plugin

Postby Ayuto » Thu Jan 11, 2018 5:54 pm

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:
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: TypedSayCommand after unloading/loading plugin

Postby satoon101 » Thu Jan 11, 2018 10:37 pm

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.
Image
battleweaver
Member
Posts: 43
Joined: Mon Oct 02, 2017 7:57 am
Location: Moscow
Contact:

Re: TypedSayCommand after unloading/loading plugin

Postby battleweaver » Fri Jan 12, 2018 8:54 am

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?
User avatar
La Muerte
Administrator
Posts: 180
Joined: Sun Jul 15, 2012 1:48 pm
Location: Belgium
Contact:

Re: TypedSayCommand after unloading/loading plugin

Postby La Muerte » Fri Jan 12, 2018 9:18 am

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?
battleweaver
Member
Posts: 43
Joined: Mon Oct 02, 2017 7:57 am
Location: Moscow
Contact:

Re: TypedSayCommand after unloading/loading plugin

Postby battleweaver » Mon Jan 15, 2018 8:34 am

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

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 43 guests