jhakonen / wot-teamspeak-mod

Mod for integrating TeamSpeak into World of Tanks
GNU Lesser General Public License v2.1
36 stars 8 forks source link

ValueError in ts3.py #14

Closed psypanda closed 9 years ago

psypanda commented 9 years ago

Using latest version (v0.5.0) this exceptions keeps popping up in my python.log

[EXCEPTION] (src\mods\tessu_utils\ts3.py, 479):
Traceback (most recent call last):
  File "src\mods\tessu_utils\ts3.py", line 477, in found_terminator
  File "src\mods\tessu_utils\ts3.py", line 520, in _handle_in_data_actions
  File "src\mods\tessu_utils\ts3.py", line 376, in on_notifyclientleftview_ts3_event
ValueError: invalid literal for int() with base 10: '6|clid=37|clid=87|clid=110|clid=118'

Complete python.log can be found here

jhakonen commented 9 years ago

Thanks for the info!

Hmm, but I can't really think any situation where that kind of error could occur. Are you able to reproduce that error? If you are, maybe you could provide some more logs?

First turn on TessuMod's debug log level (log_level: 0 in tessu_mod.ini). That will make the mod output a lot more stuff to python.log, including timestamps for each log line.

When you get the exception, check the timestamp of it and then check TeamSpeak logs at %APPDATA%\TS3Client\chats[your unique id]\server.html and include what events have occured around the same time as the exception occured in python.log.

jhakonen commented 9 years ago

Oh, and what version of the TeamSpeak client you have?

psypanda commented 9 years ago

I'm using latest teamspeak client version 3.0.16 and this happened on a server running 3.0.10.3 on linux. Please give me a few days to provide a python.log using log_level: 0 and a teamspeak log. I'll report back once I have enough information.

jhakonen commented 9 years ago

Ok, great :)

You can send the logs to me by email to: joyer83 (at) gmail.com

As the logs might contain sensitive data.

psypanda commented 9 years ago

Sent you a debug python.log via mail. Had a quick look myself and searched the python.log for Traceback. The first error is at line number 960 at 17:34:31.

[DEBUG] (scripts/common/Lib/asynchat.py, 155): [17:34:31] collect_incoming_data(): << 'notifyclientleftview schandlerid=1 cfid=173 ctid=0 reasonid=2 clid=2|clid=19|clid=21|clid=22|clid=25|clid=26|clid=31|clid=40|clid=42|clid=49'
[EXCEPTION] (src\mods\tessu_utils\ts3.py, 479):
Traceback (most recent call last):
  File "src\mods\tessu_utils\ts3.py", line 477, in found_terminator
  File "src\mods\tessu_utils\ts3.py", line 520, in _handle_in_data_actions
  File "src\mods\tessu_utils\ts3.py", line 376, in on_notifyclientleftview_ts3_event
ValueError: invalid literal for int() with base 10: '2|clid=19|clid=21|clid=22|clid=25|clid=26|clid=31|clid=40|clid=42|clid=49'
[DEBUG] (src\mods\tessu_utils\statemachine.py, 77): [17:34:31] Handling event 'protocol_closed'
[DEBUG] (src\mods\tessu_utils\statemachine.py, 48): [17:34:31] Transition by event 'protocol_closed'
[NOTE] (src\mods\tessu_mod.py, 112): [17:34:31] Disconnected from TeamSpeak client
[DEBUG] (src\mods\tessu_utils\statemachine.py, 36): [17:34:31] Entering state 'Connecting to TS'
[DEBUG] (scripts/common/Lib/asynchat.py, 155): [17:34:31] collect_incoming_data(): << 'TS3 Client'
[NOTE] (src\mods\tessu_utils\ts3.py, 492): [17:34:31] TS client query protocol detected
[DEBUG] (scripts/common/Lib/asynchat.py, 155): [17:34:31] collect_incoming_data(): << 'Welcome to the TeamSpeak 3 ClientQuery interface, type "help" for a list of commands and "help <command>" for information on a specific command.'
[DEBUG] (scripts/common/Lib/asynchat.py, 155): [17:34:31] collect_incoming_data(): << 'selected schandlerid=1'
[DEBUG] (src\mods\tessu_utils\statemachine.py, 77): [17:34:31] Handling event 'protocol_ready'
[DEBUG] (src\mods\tessu_utils\statemachine.py, 48): [17:34:31] Transition by event 'protocol_ready'
[NOTE] (src\mods\tessu_mod.py, 107): [17:34:31] Connected to TeamSpeak client

I then checked the server.html for that time and found out that this error always happens when I switch channel.

<17:34:31> You switched from channel "AFK" to "EU - Platoon needed -"
<17:34:31> Channel group "Guest" was assigned to "psypanda" by "XXXXXXXX TS server".

Checked the rest of the log. The error is thrown whenever I switch from one channel to another.

I also noticed that when I switch from one channel to another the notification center says I disconnected from TS, but actually I just joined a different channel - shouldn't it say Disconnected from Channel XXX?. screenshot

jhakonen commented 9 years ago

Thanks a lot :)

I managed now to reproduce the bug as well. It is caused by Guest not being able to subscribe to channels. This means that you cannot see users who are on channels other than your own. It seems that Guests have ability to subscribe enabled by default. So, your server's admin has gone and removed that from Guests.

Easy workaround for you is to have some other, more permissive, group assigned for you which can subscribe.

On the other hand, the mod seems to recover succesfully from the error by first disconnecting from TS client and then reconnecting again to it (and that's why you get that notification spam in the screenshot). So, it shouldn't matter much. You'll get a few second delay, after switching channel, when the mod doesn't notice speaking players, but that's it (+ the spam).

I think this should be pretty easy to fix. Expect a fixed version in a day or two :)

psypanda commented 9 years ago

Glad you could work it out. You are right, on this particular server Guests are not able to subscribe to channels. This must be the cause. Looking forward to the new version - Great support for a great Mod!

jhakonen commented 9 years ago

Sorry, took a bit longer than expected. Here's a test release with a fix: https://dl.dropboxusercontent.com/u/37902077/wot/tessu_mod/TessuMod-0.5.0-with-subscribe-fix.zip

Can you verify that the fix works?

psypanda commented 9 years ago

After some testing TessuMod-0.5.0-with-subscribe-fix it seems like it is fixed - no more errors showing up in python.log

jhakonen commented 9 years ago

Ok, thanks for help! Another bug fixed :)

You can keep on using that test release for now. I don't have other changes incoming atm, so I think I'll make a new release with this fix when 0.9.5 comes out or when I can get next feature done, which ever comes first.