Skip to content
This repository has been archived by the owner on Nov 25, 2022. It is now read-only.

Teamspeak v3.7.0 - { id: 513, msg: 'nickname is already in use' } #29

Open
Forge-Media opened this issue Mar 26, 2019 · 6 comments
Open

Comments

@Forge-Media
Copy link

Forge-Media commented Mar 26, 2019

Nickname error

I've just updated my Teamspeak 3 to version 3.7.0
I can no longer get Steam-TS to start. Each time I get the following error:

{ id: 513, msg: 'nickname is already in use' }

I'm currently having to rename the bot in the launchteamspeak.js file each time, i.e: Steam-Bot1, Steam-Bot2.

This works, but only as long as the bot does not crash. As as soon as it does, and PM2 restarts it, it gets the above error that the bot's nickname is already in use.

Unfortunately, the Steam-TS bot crashes quite a lot, hence why I launch it via PM2. The cause of the crashing appears to be:

Random Crashes

Seeing the same error as above, even after the fix #9b3a358

Error: Callback was already called.
    at /home/ts3bot/steam-ts/node_modules/async/dist/async.js:837:34
    at Object.cb (/home/ts3bot/steam-ts/lib/queryusers.js:49:29)
    at LineInputStream.<anonymous> (/home/ts3bot/steam-ts/node_modules/node-teamspeak/index.js:170:35)
    at LineInputStream.emit (events.js:182:13)
    at LineInputStream.line (/home/ts3bot/steam-ts/node_modules/line-input-stream/lib/line-input-stream.js:8:8)
    at Array.forEach (<anonymous>)
    at Socket.<anonymous> (/home/ts3bot/steam-ts/node_modules/line-input-stream/lib/line-input-stream.js:36:9)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:264:11)

PM2 lists this error 7 times, and also shows it's restarted the steam-ts bot 7 times, so concluding that this error is causing it to crash.

@Forge-Media Forge-Media changed the title Teamspeak 3.7.0 - { id: 513, msg: 'nickname is already in use' } Teamspeak v3.7.0 - { id: 513, msg: 'nickname is already in use' } Mar 26, 2019
@Forge-Media
Copy link
Author

I noticed you've made some updates recently so I reinstalled the bot with the latest version.

Unfortunately I'm noticing the same error as above.

Launch the bot once: npm start and then stop the bot, then try restart it and I get:

{ id: 513, msg: 'nickname is already in use' }

Even though no user has that nickname.

@Forge-Media
Copy link
Author

For now I've solved this by the following "hack" change to launchteamspeak.js :

function (teamspeakClient, callback) {
            console.log("Using virtual server " + config.q_vserverid + " now.");
            var rnum = Math.floor(Math.random() * Math.floor(1000));
            teamspeakClient.send("clientupdate", {client_nickname: "FGN-Steambot"+rnum}, function (err) {
                if (typeof err !== "undefined") {
                    callback(err);
                } else {
                    console.log("Changed query client name.");
                    callback(null, teamspeakClient);
                }
            })
        }

This avoids the error by effectively giving the bot a unique nickname every-time it connects. But it's a rather inelegant solution, and I'm not exactly sure why its required in the first place.

Interestingly I'm not noticing this issue on another bot, one I've personally created. However, in that case it's using a different Teamspeak 3 NodeJS library (TS3-NodeJS-Library), from the one used in this project (node-teamspeak)

Forge-Media added a commit to Forge-Media/steam-ts that referenced this issue Mar 27, 2019
Forge-Media added a commit to Forge-Media/steam-ts that referenced this issue Mar 27, 2019
@Bealze
Copy link
Contributor

Bealze commented Apr 9, 2019

yes broken with latest ts server version

@Forge-Media
Copy link
Author

@Bealze I've fixed this in a more elegant way than my above "hack random name" code.

You can find the code changes I've made here: 3e900e7

@Bealze
Copy link
Contributor

Bealze commented Apr 14, 2019 via email

@MagicD3VIL
Copy link

@Bealze I suggest downloading Forge-Media's whole fork. I just tested it out and it's working fine without any errors! https://github.com/Forge-Media/steam-ts

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants