mirror of
https://github.com/tribufu/node-gamedig
synced 2026-06-01 09:42:41 +00:00
More async
This commit is contained in:
parent
29ce0b82d0
commit
e937c725bb
20 changed files with 100 additions and 86 deletions
|
|
@ -2,6 +2,8 @@ const Core = require('./core');
|
|||
|
||||
class Teamspeak3 extends Core {
|
||||
async run(state) {
|
||||
const queryPort = this.options.teamspeakQueryPort || 10011;
|
||||
|
||||
await this.withTcp(async socket => {
|
||||
{
|
||||
const data = await this.sendCommand(socket, 'use port='+this.options.port, true);
|
||||
|
|
@ -31,7 +33,7 @@ class Teamspeak3 extends Core {
|
|||
const data = await this.sendCommand(socket, 'channellist -topic');
|
||||
state.raw.channels = data;
|
||||
}
|
||||
});
|
||||
}, queryPort);
|
||||
}
|
||||
|
||||
async sendCommand(socket,cmd,raw) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue