This commit is contained in:
手瓜一十雪
2024-11-14 13:07:10 +08:00
parent 1a1919bb15
commit c5d104b08b
8 changed files with 7 additions and 9 deletions

View File

@@ -7,12 +7,12 @@ export const int32ip2str = (ip: number) => {
return [ip & 0xff, (ip & 0xff00) >> 8, (ip & 0xff0000) >> 16, ((ip & 0xff000000) >> 24) & 0xff].join('.');
};
export const oidbIpv4s2HighwayIpv4s = (ipv4s: NapProtoEncodeStructType<typeof proto.IPv4>[]): NapProtoEncodeStructType<typeof proto.NTHighwayIPv4>[] =>{
export const oidbIpv4s2HighwayIpv4s = (ipv4s: NapProtoEncodeStructType<typeof proto.IPv4>[]): NapProtoEncodeStructType<typeof proto.NTHighwayIPv4>[] => {
return ipv4s.map((ip) => {
return {
domain: {
isEnable: true,
ip: int32ip2str(ip.outIP!),
ip: int32ip2str(ip.outIP ?? 0),
},
port: ip.outPort!
} as NapProtoEncodeStructType<typeof proto.NTHighwayIPv4>;

View File

@@ -82,7 +82,7 @@ export class PacketMsgConverter {
return SupportedElementTypes.includes(type);
}
private rawToPacketMsgConverters: ElementToPacketMsgConverters = {
private readonly rawToPacketMsgConverters: ElementToPacketMsgConverters = {
[ElementType.TEXT]: (element) => {
if (element.textElement?.atType) {
return new PacketMsgAtElement(element as SendTextElement);