idz: Split/fix loadServerList encoder

This commit is contained in:
BemaniWitch
2021-02-03 23:43:44 +00:00
committed by Tau
parent eb358e3547
commit 122cb51ed9
2 changed files with 35 additions and 5 deletions
+31 -1
View File
@@ -1,6 +1,6 @@
import { LoadServerListResponse } from "../response/loadServerList";
export function loadServerList(res: LoadServerListResponse) {
export function loadServerList1(res: LoadServerListResponse) {
const buf = Buffer.alloc(0x04b0);
buf.writeInt16LE(0x0007, 0x0000);
@@ -29,3 +29,33 @@ export function loadServerList(res: LoadServerListResponse) {
return buf;
}
export function loadServerList2(res: LoadServerListResponse) {
const buf = Buffer.alloc(0x04b0);
buf.writeInt16LE(0x0007, 0x0000);
buf.writeInt16LE(res.status, 0x0004);
buf.write(res.userDb.addr, 0x0006);
buf.writeInt16LE(res.userDb.tcp, 0x0086);
buf.writeInt16LE(res.userDb.http, 0x0088);
buf.write(res.matchAddr, 0x008a);
buf.writeInt16LE(res.matchPort.tcp, 0x010a);
buf.writeInt16LE(res.matchPort.udpSend, 0x010c);
buf.writeInt16LE(res.matchPort.udpRecv, 0x010e);
buf.writeInt16LE(res.tagMatchPort.tcp, 0x0110);
buf.writeInt16LE(res.tagMatchPort.udpSend, 0x0112);
buf.writeInt16LE(res.tagMatchPort.udpRecv, 0x0114);
buf.write(res.event.addr, 0x0116);
buf.writeInt16LE(res.event.tcp, 0x0196);
buf.write(res.screenshot.addr, 0x019a);
buf.writeInt16LE(res.screenshot.tcp, 0x021a);
buf.write(res.pingReturn, 0x021e);
buf.write(res.echo1.addr, 0x029e);
buf.write(res.echo2.addr, 0x031e);
buf.writeInt16LE(res.echo1.udp, 0x39e);
buf.writeInt16LE(res.echo2.udp, 0x3a0);
buf.write(res.newsUrl, 0x03a2);
buf.write(res.reportErrorUrl, 0x0426);
return buf;
}