mirror of
https://github.com/MercuryWorkshop/adrift.git
synced 2025-05-13 06:10:01 -04:00
tiny WIP client fixes
This commit is contained in:
parent
d264774923
commit
cf5d378147
1 changed files with 8 additions and 5 deletions
|
@ -72,11 +72,11 @@ export class AdriftBareClient extends Client {
|
||||||
let { send, close } = this.connection.wsconnect(
|
let { send, close } = this.connection.wsconnect(
|
||||||
remote,
|
remote,
|
||||||
() => {
|
() => {
|
||||||
onReadyState(WebSocketFields.OPEN);
|
onReadyState(WebSocket.OPEN);
|
||||||
ws.dispatchEvent(new Event("open"));
|
ws.dispatchEvent(new Event("open"));
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
onReadyState(WebSocketFields.CLOSED);
|
onReadyState(WebSocket.CLOSED);
|
||||||
ws.dispatchEvent(new Event("close"));
|
ws.dispatchEvent(new Event("close"));
|
||||||
},
|
},
|
||||||
(data) => {
|
(data) => {
|
||||||
|
@ -95,9 +95,12 @@ export class AdriftBareClient extends Client {
|
||||||
// i can probably fix later but this is fine for now -CE
|
// i can probably fix later but this is fine for now -CE
|
||||||
(ws as any).__defineSetter__("send", () => {});
|
(ws as any).__defineSetter__("send", () => {});
|
||||||
|
|
||||||
(ws as any).__defineGetter__("close", (code?: number, reason?: string) => {
|
(ws as any).__defineGetter__(
|
||||||
close(code, reason);
|
"close",
|
||||||
});
|
() => (code?: number, reason?: string) => {
|
||||||
|
close(code, reason);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
return ws;
|
return ws;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue