mirror of
https://github.com/MercuryWorkshop/adrift.git
synced 2025-05-13 06:10:01 -04:00
onmessage
This commit is contained in:
parent
e5d51e0868
commit
9692d3facf
1 changed files with 14 additions and 0 deletions
|
@ -75,6 +75,20 @@ export class Connection {
|
||||||
onopen();
|
onopen();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case S2CRequestTypes.WSDataText: {
|
||||||
|
const socketMeta = this.openSockets[requestID];
|
||||||
|
if (!socketMeta) return;
|
||||||
|
socketMeta.onmessage(new TextDecoder().decode(data.slice(cursor)));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case S2CRequestTypes.WSDataBinary: {
|
||||||
|
const socketMeta = this.openSockets[requestID];
|
||||||
|
if (!socketMeta) return;
|
||||||
|
socketMeta.onmessage(data.slice(cursor));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue