32 lines
753 B
TypeScript
32 lines
753 B
TypeScript
import Packet from "../packet";
|
|
import Stream from "../stream";
|
|
|
|
export class PacketRequestTransport extends Packet {
|
|
|
|
private transportServer: string = "";
|
|
|
|
public getPacketId(): number {
|
|
return 0x0F;
|
|
}
|
|
|
|
public _receive(stream: Stream): void {
|
|
this.transportServer = stream.readString();
|
|
}
|
|
|
|
public _send(): Promise<Stream> | Stream {
|
|
const stream = new Stream();
|
|
stream.writeInt16(this.getPacketId());
|
|
stream.writeString(this.transportServer);
|
|
return stream;
|
|
}
|
|
|
|
public getTransportServer(): string {
|
|
return this.transportServer;
|
|
}
|
|
|
|
public setTransportServer(transportServer: string): void {
|
|
this.transportServer = transportServer;
|
|
}
|
|
|
|
|
|
} |