network: OK

This commit is contained in:
GEEKiDoS
2024-01-08 20:18:22 +08:00
parent 4fd4c5c176
commit 1cf4b08c3f
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -1,14 +1,14 @@
import pug from 'pug';
import { to_bin } from "@kamyu/kbinxml";
export function kxml(templatePath: string): MethodDecorator {
export function kxml(templatePath: string, encoding: 'UTF-8' | 'SHIFT_JIS' = 'UTF-8'): MethodDecorator {
const template = pug.compileFile('templates/' + templatePath + '.pug');
return function (_target, _propertyKey, descriptor) {
const orig = descriptor.value as Function;
descriptor.value = async function (...args: any[]) {
const obj = await orig.apply(this, args);
const xml = '<?xml version="1.0" encoding="SHIFT_JIS"?>' + template(obj);
const xml = `<?xml version="1.0" encoding="${encoding}"?>` + template(obj);
console.log(xml);
const kxml = to_bin(xml);
+2 -2
View File
@@ -32,8 +32,8 @@ export default class implements ILaochanService {
},
portfw: {
globalIp: '127.0.0.1',
globalport: 5700,
privateport: 5700,
globalPort: 5700,
privatePort: 5700,
},
public: {
flag: 0,