Closed Frag1337 closed 2 years ago
Hey,
I was just checking my logs and found this in here:
Client "🖤🇺🇦МÐ�ШÐ�🇺🇦ðŸ–" connected (X.XXX.XXX.XXX:27005). [Source.Python] [SP] Caught an Exception: Traceback (most recent call last): File "../addons/source-python/packages/source-python/messages/hooks.py", line 278, in _pre_message_end data = impl.read(buffer_read) File "../addons/source-python/packages/source-python/messages/impl.py", line 113, in read return cls.read_bitbuffer(buffer) File "../addons/source-python/packages/source-python/messages/impl.py", line 159, in read_bitbuffer param1=buffer.read_string(), UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 28-30: unexpected end of data
Is this sp related or something else?
Hi, I think it is, i have been getting those errors sometimes aswell, only thought when special name player joins, like chinese name player have
Yes, this seems to be an issue with our user message hook.
Which user message hooka are you using? The issue shouldn't occur if no SP plugin is loaded.
Yes, this seems to be an issue with our user message hook.
Which user message hooka are you using? The issue shouldn't occur if no SP plugin is loaded.
I use it only in:
@HookUserMessage('SayText2') def _saytext2_hook(recipients, data): if data['index'] == 0: return True recipients.remove_all_players()
I'm also using SayText2 hook.
Yes, this seems to be an issue with our user message hook. Which user message hooka are you using? The issue shouldn't occur if no SP plugin is loaded.
I use it only in:
@HookUserMessage('SayText2') def _saytext2_hook(recipients, data): if data['index'] == 0: return True recipients.remove_all_players()
I'm using SayText2 hook aswell.
param1=buffer.read_string()
Sounds like it's related to #27 and #186. Based on these issues, this exception can be reproduced for param1
with:
from messages.hooks import HookUserMessage
from players.entity import Player
@HookUserMessage('SayText2')
def _(recipients, data):
...
pl = Player(1)
pl.say('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa£')
And for param2
with:
from messages.hooks import HookUserMessage
from players.entity import Player
@HookUserMessage('SayText2')
def _(recipients, data):
...
pl = Player(1)
pl.name = '┼ N‡GH†MΔƦΣ CRΣ3PƦ ⺠'
pl.say('...')
These should now be fixed into https://github.com/Source-Python-Dev-Team/Source.Python/commit/9d17a696f93a681a1bf7830b72a714ee25fb47f1.
Just tested the fix in my linux server, when i used that code, it still showed different kind error.
[2022-08-26 13:47:08]: [SP] Loading plugin 'test' [2022-08-26 13:47:08]: Could not find steamerrorreporter binary. Any minidumps will be uploaded in-processUnicodeDecodeError: 'utf-8' codec can't decode byte 0xc2 in position 139: invalid continuation byte [2022-08-26 13:47:08]: [Bots] Seth: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa� [2022-08-26 13:47:08]: [SP] Successfully loaded plugin 'test`
position 139
The first reproducible code above should raise at location 126
. The fact it shows 139
for you means the message is already formatted and include [Bots] Seth:
. What is the complete traceback? What game? Output of sp info
? Are you sure you properly updated your core.so
and impl.py
?
Okay, I was able to reproduce it. It's caused by OnServerOutput
.
EDIT: Should be fixed into https://github.com/Source-Python-Dev-Team/Source.Python/commit/fec03ca4919936f4eae15168c30059efea694d09.
I can confirm that the latest commit fixed the error
Hey,
I was just checking my logs and found this in here:
Is this sp related or something else?