|
|
@ -43,31 +43,11 @@ export class SwitchServerStore
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this._gangplankWs.Connect(true, 1000);
|
|
|
|
this._gangplankWs.Connect(true, 1000);
|
|
|
|
begin(this._gangplankWs, this._gangplankWs.OnLinkEvent, (islink: boolean) =>
|
|
|
|
begin(this._gangplankWs, this._gangplankWs.OnLinkEvent, (islink: boolean) =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.islink = islink;
|
|
|
|
this.islink = islink;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
begin(this._gangplankWs, this._gangplankWs.OnMessageEvent, async (e: MessageEvent) =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let res = e.data;
|
|
|
|
|
|
|
|
res = JSON.parse(res);
|
|
|
|
|
|
|
|
if (res.type === 'getip')
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (res.type === 'scan')
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
this.aliveServersList = new Set(res.ips);
|
|
|
|
|
|
|
|
this.searching = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (res.type === 'remote')
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
console.log(e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async ConnectRemote(ip: string, test = false)
|
|
|
|
async ConnectRemote(ip: string, test = false)
|
|
|
|