Обновление протокола звонков без авторизации с сохранением защиты
This commit is contained in:
@@ -15,6 +15,8 @@ export class PacketWebRTC extends Packet {
|
||||
|
||||
private signalType: WebRTCSignalType = WebRTCSignalType.OFFER;
|
||||
private sdpOrCandidate: string = "";
|
||||
private publicKey: string = "";
|
||||
private deviceId: string = "";
|
||||
|
||||
public getPacketId(): number {
|
||||
return 27;
|
||||
@@ -23,6 +25,8 @@ export class PacketWebRTC extends Packet {
|
||||
public _receive(stream: Stream): void {
|
||||
this.signalType = stream.readInt8();
|
||||
this.sdpOrCandidate = stream.readString();
|
||||
this.publicKey = stream.readString();
|
||||
this.deviceId = stream.readString();
|
||||
}
|
||||
|
||||
public _send(): Promise<Stream> | Stream {
|
||||
@@ -30,6 +34,8 @@ export class PacketWebRTC extends Packet {
|
||||
stream.writeInt16(this.getPacketId());
|
||||
stream.writeInt8(this.signalType);
|
||||
stream.writeString(this.sdpOrCandidate);
|
||||
stream.writeString(this.publicKey);
|
||||
stream.writeString(this.deviceId);
|
||||
return stream;
|
||||
}
|
||||
|
||||
@@ -49,4 +55,20 @@ export class PacketWebRTC extends Packet {
|
||||
return this.sdpOrCandidate;
|
||||
}
|
||||
|
||||
public setPublicKey(key: string) {
|
||||
this.publicKey = key;
|
||||
}
|
||||
|
||||
public getPublicKey(): string {
|
||||
return this.publicKey;
|
||||
}
|
||||
|
||||
public setDeviceId(id: string) {
|
||||
this.deviceId = id;
|
||||
}
|
||||
|
||||
public getDeviceId(): string {
|
||||
return this.deviceId;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user