check remote version
This commit is contained in:
parent
725e8d3e54
commit
101bcbce9c
@ -9,6 +9,7 @@ def main():
|
||||
print('export const LANGS = {')
|
||||
for fn in glob.glob('../hbb/src/lang/*'):
|
||||
lang = os.path.basename(fn)[:-3]
|
||||
if lang == 'template': continue
|
||||
print(' %s: {'%lang)
|
||||
for ln in open(fn):
|
||||
ln = ln.strip()
|
||||
@ -62,4 +63,4 @@ def main():
|
||||
def removeComment(ln):
|
||||
return re.sub('\s+\/\/.*$', '', ln)
|
||||
|
||||
main()
|
||||
main()
|
||||
|
@ -98,6 +98,10 @@ export default class Connection {
|
||||
const phr = msg.punch_hole_response;
|
||||
const rr = msg.relay_response;
|
||||
if (phr) {
|
||||
if (phr?.other_failure) {
|
||||
this.msgbox("error", "Error", phr?.other_failure);
|
||||
return;
|
||||
}
|
||||
if (phr.failure != rendezvous.PunchHoleResponse_Failure.UNRECOGNIZED) {
|
||||
switch (phr?.failure) {
|
||||
case rendezvous.PunchHoleResponse_Failure.ID_NOT_EXIST:
|
||||
@ -109,13 +113,16 @@ export default class Connection {
|
||||
case rendezvous.PunchHoleResponse_Failure.LICENSE_MISMATCH:
|
||||
this.msgbox("error", "Error", "Key mismatch");
|
||||
break;
|
||||
default:
|
||||
if (phr?.other_failure) {
|
||||
this.msgbox("error", "Error", phr?.other_failure);
|
||||
}
|
||||
case rendezvous.PunchHoleResponse_Failure.LICENSE_OVERUSE:
|
||||
this.msgbox("error", "Error", "Key overuse");
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (rr) {
|
||||
if (!rr.version) {
|
||||
this.msgbox("error", "Error", "Remote version is low, not support web");
|
||||
return;
|
||||
}
|
||||
await this.connectRelay(rr);
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -110,7 +110,7 @@ export default class Websock {
|
||||
};
|
||||
this._websocket.onerror = (e: any) => {
|
||||
if (!this._status) {
|
||||
reject("Failed to connect to " + this._uri);
|
||||
reject("Failed to connect to " + (this._isRendezvous ? "rendezvous" : "relay") + " server");
|
||||
return;
|
||||
}
|
||||
this._status = e;
|
||||
|
Loading…
x
Reference in New Issue
Block a user