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