[mod] add code for writing packets to file (but disable it)
This commit is contained in:
parent
33255f2d1b
commit
895194d576
1 changed files with 17 additions and 3 deletions
|
|
@ -28,10 +28,24 @@ export class KafkatorioPacketEmitter {
|
|||
private static emitPacket<T extends KafkatorioPacket>(packet: T) {
|
||||
const data = game.table_to_json(packet)
|
||||
// print(`KafkatorioPacket::: ${data}`)
|
||||
const encoded = game.encode_string(data)
|
||||
print(`KafkatorioPacket encoded::: ${encoded}`)
|
||||
const encodedData = game.encode_string(data)
|
||||
if (encodedData != null) {
|
||||
print(`KafkatorioPacket encoded::: ${encodedData}`)
|
||||
// rcon.print(`KafkatorioPacket: ${data}`)
|
||||
// this.appendToFile(encodedData)
|
||||
}
|
||||
}
|
||||
|
||||
// private static appendToFile(encodedData: string) {
|
||||
// // change log files every hour:
|
||||
// const perHour = game.tick / (60 * 60 * 60)
|
||||
// game.write_file(
|
||||
// `kafkatorio/packets_${perHour}.txt`,
|
||||
// `${encodedData}\n`,
|
||||
// true,
|
||||
// 0, // server only
|
||||
// )
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue