42 lines
962 B
TypeScript
42 lines
962 B
TypeScript
import Packet from "../packet";
|
|
import Stream from "../stream";
|
|
|
|
export class PacketGroupBan extends Packet {
|
|
|
|
private groupId: string = "";
|
|
private publicKey: string = "";
|
|
|
|
public getPacketId(): number {
|
|
return 0x16;
|
|
}
|
|
|
|
public _receive(stream: Stream): void {
|
|
this.groupId = stream.readString();
|
|
this.publicKey = stream.readString();
|
|
}
|
|
|
|
public _send(): Promise<Stream> | Stream {
|
|
const stream = new Stream();
|
|
stream.writeInt16(this.getPacketId());
|
|
stream.writeString(this.groupId);
|
|
stream.writeString(this.publicKey);
|
|
return stream;
|
|
}
|
|
|
|
public getGroupId(): string {
|
|
return this.groupId;
|
|
}
|
|
|
|
public getPublicKey(): string {
|
|
return this.publicKey;
|
|
}
|
|
|
|
public setGroupId(groupId: string): void {
|
|
this.groupId = groupId;
|
|
}
|
|
|
|
public setPublicKey(publicKey: string): void {
|
|
this.publicKey = publicKey;
|
|
}
|
|
|
|
} |