Splamy / TS3AudioBot

Advanced Musicbot for Teamspeak 3
https://splamy.de/TSAudioBot/Home
Open Software License 3.0
692 stars 140 forks source link

Bot connection issues and localizations #332

Closed koznov closed 6 years ago

koznov commented 6 years ago

Hello! I've got some issues with connecting to server with latest build of bot. I've getting error connect_failed_banned: the command failed to execute: connection failed, you are banned

In FAQ I found that i need to clear identity or set option b_client_ignore_bans on Bot's group. In new version option for identity is in file Bots/bot_default.toml : [connect.identity] key "" but this doesn't help at all. Niether solution is to add b_client_ignore_bans on Bot group doesnt work because there is no record in User database on virtual server by hwid from Debug log .

koznov@vs-music-1:~/TS3AudioBot$ mono TS3AudioBot.exe
20:02:16.5774| INFO [============ TS3AudioBot started =============]
20:02:16.6297| INFO [=== Date/Time: Monday, July 23, 2018 8:02:16 PM
20:02:16.6361| INFO [=== Version: 0.9.0-alpha.74/develop/f29bc469
20:02:16.6361| INFO [=== Platform: Ubuntu 16.04.5 LTS (Xenial Xerus) (64bit)
20:02:16.6361| INFO [=== Runtime: Mono (5.12.0.226 (tarball Thu May  3 09:48:32 UTC 2018))
20:02:16.6361| INFO [=== Opus: libopus 1.1.2 (x64)
20:02:16.6387| INFO [==============================================]
20:02:17.1335| INFO Bot connecting...
20:02:17.3364|DEBUG DisconnectInternal wasExit:True error: oldStatus:Disconnected newStatus:
20:02:17.3401|DEBUG Trying to look up 'ts1.blah-blah.ru:10020'
20:02:17.4439|DEBUG [O] InitID: 0
20:02:17.4610|DEBUG [I] InitID: 1
20:02:17.4610|DEBUG [O] InitID: 2
20:02:17.4634|DEBUG [I] InitID: 3
20:02:17.4877|DEBUG [O] InitID: 4
20:02:17.5050|DEBUG [I] Type: Command   Flags: [ _ _ _ _ ]      Id: 0
  MAC: 6A D0 6B 39 3E FC 7E DC    Header: 00 00 02
  Data: 69 6E 69 74 69 76 65 78 70 61 6E 64 20 61 6C 70 68 61 3D 6D 4F 7A 38 4F 4A 70 64 35 33 38 43 4D 51 3D 3D 20 62 65 74 61 3D 4D 43 75 62 61 45 5A 52 57 69 76 6F 78 51 3D 3D 20 6F 6D 65 67 61 3D 4D 45 30 44 41 67 63 41 41 67 45 67 41 69 45 41 30 6C 57 56 6D 46 62 78 4C 53 4D 48 74 2B 49 5A 6D 34 48 55 78 51 4F 55 37 50 30 44 6F 58 74 58 66 75 4A 4A 6E 42 57 43 31 74 41 43 49 51 43 74 46 53 67 67 51 66 58 68 31 5C 2F 61 63 72 70 65 50 45 6B 47 31 56 6C 51 67 6B 70 44 74 56 4D 70 76 5A 73 41 47 67 4B 68 41 5A 67 3D 3D
20:02:17.5089|DEBUG [O] Acking Ack: 0
20:02:17.5615|DEBUG [O] clientinit client_nickname=BotVS client_version=3.1.10\s[Build:\s1528537615] client_platform=Linux client_input_hardware=1 client_output_hardware=1 client_default_channel=4209592 client_default_channel_password= client_server_password= client_meta_data= client_version_sign=jEfjYy09JfbJPZ+W3fwqygOu8uuc5raYTGpbJ5F8dHLHpqUfvmCyJVKoXRieMNkmPzeiylsUc9\/HiV+8bt8tDw== client_key_offset=545 client_nickname_phonetic= client_default_token= hwid=sTu7BE9\/u\/mXiNAvcJNB4gNppoQ=
20:02:17.5629|DEBUG [O] Type: Command   Flags: [ _ N _ _ ]      Id: 1
  MAC: 00 00 00 00 00 00 00 00    Header: 00 00 00 00 00
  Data: 63 6C 69 65 6E 74 69 6E 69 74 20 63 6C 69 65 6E 74 5F 6E 69 63 6B 6E 61 6D 65 3D 42 6F 74 56 53 20 63 6C 69 65 6E 74 5F 76 65 72 73 69 6F 6E 3D 33 2E 31 2E 31 30 5C 73 5B 42 75 69 6C 64 3A 5C 73 31 35 32 38 35 33 37 36 31 35 5D 20 63 6C 69 65 6E 74 5F 70 6C 61 74 66 6F 72 6D 3D 4C 69 6E 75 78 20 63 6C 69 65 6E 74 5F 69 6E 70 75 74 5F 68 61 72 64 77 61 72 65 3D 31 20 63 6C 69 65 6E 74 5F 6F 75 74 70 75 74 5F 68 61 72 64 77 61 72 65 3D 31 20 63 6C 69 65 6E 74 5F 64 65 66 61 75 6C 74 5F 63 68 61 6E 6E 65 6C 3D 34 32 30 39 35 39 32 20 63 6C 69 65 6E 74 5F 64 65 66 61 75 6C 74 5F 63 68 61 6E 6E 65 6C 5F 70 61 73 73 77 6F 72 64 3D 20 63 6C 69 65 6E 74 5F 73 65 72 76 65 72 5F 70 61 73 73 77 6F 72 64 3D 20 63 6C 69 65 6E 74 5F 6D 65 74 61 5F 64 61 74 61 3D 20 63 6C 69 65 6E 74 5F 76 65 72 73 69 6F 6E 5F 73 69 67 6E 3D 6A 45 66 6A 59 79 30 39 4A 66 62 4A 50 5A 2B 57 33 66 77 71 79 67 4F 75 38 75 75 63 35 72 61 59 54 47 70 62 4A 35 46 38 64 48 4C 48 70 71 55 66 76 6D 43 79 4A 56 4B 6F 58 52 69 65 4D 4E 6B 6D 50 7A 65 69 79 6C 73 55 63 39 5C 2F 48 69 56 2B 38 62 74 38 74 44 77 3D 3D 20 63 6C 69 65 6E 74 5F 6B 65 79 5F 6F 66 66 73 65 74 3D 35 34 35 20 63 6C 69 65 6E 74 5F 6E 69 63 6B 6E 61 6D 65 5F 70 68 6F 6E 65 74 69 63 3D 20 63 6C 69 65 6E 74 5F 64 65 66 61 75 6C 74 5F 74 6F 6B 65 6E 3D 20 68 77 69 64 3D 73 54 75 37 42 45 39 5C 2F 75 5C 2F 6D 58 69 4E 41 76 63 4A 4E 42 34 67 4E 70 70 6F 51 3D
20:02:17.5682|DEBUG [I] Acking: 1
20:02:17.5682|DEBUG RTT SRTT:00:00:00.8759430 RTTVAR:00:00:00.2170997 RTO:00:00:01.7443418
20:02:17.5707|DEBUG [I] Type: Command   Flags: [ _ _ _ _ ]      Id: 1
  MAC: E3 1A D0 C4 64 91 7D 50    Header: 00 01 02
  Data: 65 72 72 6F 72 20 69 64 3D 33 33 32 39 20 6D 73 67 3D 63 6F 6E 6E 65 63 74 69 6F 6E 5C 73 66 61 69 6C 65 64 2C 5C 73 79 6F 75 5C 73 61 72 65 5C 73 62 61 6E 6E 65 64 20 65 78 74 72 61 5F 6D 73 67 3D 66 6C 6F 6F 64 5C 73 70 72 65 76 65 6E 74 69 6F 6E 2C 5C 73 70 6C 65 61 73 65 5C 73 74 72 79 5C 73 61 67 61 69 6E 5C 73 6C 61 74 65 72
20:02:17.5707|DEBUG [O] Acking Ack: 1
20:02:17.5764|DEBUG DisconnectInternal wasExit:False error:connect_failed_banned: the command failed to execute: connection failed, you are banned oldStatus:Connecting newStatus:Disconnected
20:02:17.5814| WARN Could not connect: connect_failed_banned: the command failed to execute: connection failed, you are banned
20:02:17.5828| INFO Bot disconnecting.
20:02:17.5996| WARN Unknown Teamspeak Error. (Connection closed)
20:02:17.6064| WARN Could not save avatar: Unknown Teamspeak Error. (Connection closed)
20:02:17.6083|DEBUG DisconnectInternal wasExit:True error: oldStatus:Disconnected newStatus:
20:02:17.6083|DEBUG DisconnectInternal wasExit:True error: oldStatus:Disconnected newStatus:
20:02:17.6916|DEBUG DisconnectInternal wasExit:True error: oldStatus:Disconnected newStatus:Disconnected
koznov@vs-music-1:~/TS3AudioBot$

Also about localizations: I've added DLL to ru folder into Bot's folder , renamed it and changed option in ts3audiobot.toml to ru. Still no effect.

There is configs:

ts3audiobot.toml:

#! IMPORTANT !
#All config tables here starting with 'bot.*' will only be used as default values for each bot.
#To make bot-instance specific changes go to the 'Bots' folder (configs.bots_path) and set your configuration values in the desired bot config.
[bot]
#This field will be automatically set when you call '!bot setup'.
#The bot will use the specified group to set/update the required permissions and add himself into it.
#You can set this field manually if you already have a preexisting group the bot should add himself to.
bot_group_id = 0
#Tries to fetch a cover image when playing.
generate_status_avatar = true
#The language the bot should use to respond to users. (Make sure you have added the required language packs)
language = "ru"
#Defines how the bot tries to match your !commands. Possible types:
# - exact : Only when the command matches exactly.
# - substring : The shortest command starting with the given prefix.
# - ic3 : 'interleaved continuous character chain' A fuzzy algorithm similar to hamming distance but preferring characters at the start.
command_matcher = "ic3"

[bot.connect]
#The address, ip or nickname (and port; default: 9987) of the TeamSpeak3 server
address = ""
#Default channel when connecting. Use a channel path or '/<id>'.
#Examples: 'Home/Lobby', '/5', 'Home/Afk \/ Not Here'.
channel = ""
#The client badges. You can set a comma seperated string with max three GUID's. Here is a list: http://yat.qa/ressourcen/abzeichen-badges/
badges = ""
#Client nickname when connecting.
name = "TS3AudioBot"

#The server password. Leave empty for none.
[bot.connect.server_password]
pw = ""
hashed = false
autohash = false

#The default channel password. Leave empty for none.
[bot.connect.channel_password]
pw = ""
hashed = false
autohash = false

#Overrides the displayed version for the ts3 client. Leave empty for default.
[bot.connect.client_version]
build = ""
platform = ""
sign = ""

[bot.connect.identity]
#||| DO NOT MAKE THIS KEY PUBLIC ||| The client identity. You can import a teamspeak3 identity here too.
key = ""
#The client identity offset determining the security level.
offset = 0
#The client identity security level which should be calculated before connecting
#or -1 to generate on demand when connecting.
level = -1

[bot.audio]
#The maximum volume a normal user can request. Only user with the 'ts3ab.admin.volume' permission can request higher volumes.
max_user_volume = 30.0
#Specifies the bitrate (in kbps) for sending audio.
#Values between 8 and 98 are supported, more or less can work but without guarantees.
#Reference values: 16 - poor (~3KiB/s), 24 - okay (~4KiB/s), 32 - good (~5KiB/s), 48 - very good (~7KiB/s), 64 - not noticeably better than 48, stop wasting your bandwith, go back (~9KiB/s)
bitrate = 48
#How the bot should play music. Options are:
# - whisper : Whispers to the channel where the request came from. Other users can join with '!subscribe'.
# - voice : Sends via normal voice to the current channel. '!subscribe' will not work in this mode.
# - !... : A custom command. Use '!xecute (!a) (!b)' for example to execute multiple commands.
send_mode = "voice"

#When a new song starts the volume will be trimmed to between min and max.
#When the current volume already is between min and max nothing will happen.
#To completely or partially disable this feature, set min to 0 and/or max to 100.
[bot.audio.volume]
default = 10.0
min = 10.0
max = 50.0

[bot.playlists]
#Path to the folder where playlist files will be saved.
path = "Playlists"

[bot.history]
#Enable or disable history features completely to save resources.
enabled = true
#Whether or not deleted history ids should be filled up with new songs.
fill_deleted_ids = true

#You can create new subtables matching the bot config name to configure meta-settings for each bot.
#Current layout: { run:bool }
[bots]
default = { run = true }

[configs]
#Path to a folder where the configuration files for each bot template will be stored.
bots_path = "Bots"

[db]
#The path to the database file for persistent data.
path = "ts3audiobot.db"

[factories]

#The default path to look for local resources.
[factories.media]
path = ""

[tools]

#Path to the youtube-dl binary or local git repository.
[tools.youtube-dl]
path = "/usr/local/bin/youtube-dl"

#The path to ffmpeg.
[tools.ffmpeg]
path = "ffmpeg"

[rights]
#Path to the permission file. The file will be generated if it doesn't exist.
path = "rights.toml"

[plugins]
#The path to the plugins folder.
path = "Plugins"
#Write to .status files to store a plugin enable status persistently and restart them on launch.
write_status_files = false

[plugins.load]

[web]
#An array of all urls the web api should be possible to be accessed with.
hosts = ["localhost", "127.0.0.1"]
#The port for the web server.
port = 8180

[web.api]
#If you want to enable the web api.
enabled = false

[web.interface]
#If you want to enable the webinterface.
enabled = false
#The webinterface folder to host. Leave empty to let the bot look for default locations.
path = ""

Bots/bot_default.toml:

[connect]
#The address, ip or nickname (and port; default: 9987) of the TeamSpeak3 server
address = "ts1.blah-blah.ru:10020"
#Client nickname when connecting.
name = "BotVS"
#Default channel when connecting. Use a channel path or '/<id>'.
#Examples: 'Home/Lobby', '/5', 'Home/Afk \/ Not Here'.
channel = "4209592"

#The server password. Leave empty for none.
[connect.server_password]
pw = ""

#The default channel password. Leave empty for none.
[connect.channel_password]
pw = ""

#Overrides the displayed version for the ts3 client. Leave empty for default.
[connect.client_version]

[connect.identity]
#||| DO NOT MAKE THIS KEY PUBLIC ||| The client identity. You can import a teamspeak3 identity here too.
key = "MCkDAgbAAgEgAiBVCvkEcrmtbwzuc9/ovve8OwGYwYRFrMfL4jgb6sC4gA=="
#The client identity offset determining the security level.
offset = 545
#The client identity security level which should be calculated before connecting
#or -1 to generate on demand when connecting.
level = -1

[audio]
#Specifies the bitrate (in kbps) for sending audio.
#Values between 8 and 98 are supported, more or less can work but without guarantees.
#Reference values: 16 - poor (~3KiB/s), 24 - okay (~4KiB/s), 32 - good (~5KiB/s), 48 - very good (~7KiB/s), 64 - not noticeably better than 48, stop wasting your bandwith, go back (~9KiB/s)
bitrate = 92
#How the bot should play music. Options are:
# - whisper : Whispers to the channel where the request came from. Other users can join with '!subscribe'.
# - voice : Sends via normal voice to the current channel. '!subscribe' will not work in this mode.
# - !... : A custom command. Use '!xecute (!a) (!b)' for example to execute multiple commands.
send_mode = "voice"

#When a new song starts the volume will be trimmed to between min and max.
#When the current volume already is between min and max nothing will happen.
#To completely or partially disable this feature, set min to 0 and/or max to 100.
[audio.volume]

[playlists]

[history]

What additional info i can give to explore this issue?

koznov commented 6 years ago

Question with localisation is fixed with this comment after upload new version. But question with connect issues is up.

Splamy commented 6 years ago

Connect to server where the bot isnt banned. Copy the uid. Go to your server where the bot is banned. Select a group where b_client_ignore_bans is set. Click on the bottom right 'Add'. Add the uid.

hroost commented 6 years ago

What is the main reason of those bans? How to prevent it (except ignore ban or flushing secret uid)?

Splamy commented 6 years ago

Usually spamming connect costs a lot of flood points, and a few flood points for clientinfo/clientlist each !command.

CM2Walki commented 6 years ago

Maybe it would be a good idea to add b_client_ignore_bans to the default musicbot server group?

https://github.com/Splamy/TS3AudioBot/blob/000cea0f768f95dde6842cb132ddeca400e97739/TS3AudioBot/TeamspeakControl.cs#L257-L259

Since this issue appears quiet frequently, #199, #277.

(Just as a reference; I recently managed to get my bots banned even though the b_client_ignore_antiflood permission was set)

Splamy commented 6 years ago

Yes, might be a good idea. Though there seems to be a bug currently with the setup permission id's (see https://github.com/Splamy/TS3AudioBot/issues/325#issuecomment-406131001 .6)