This commit is contained in:
Freddie Wang
2021-04-19 14:29:43 +08:00
parent b905b5921b
commit ac2f0a24d6
3 changed files with 18 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import { core } from './Core';
import { EamusePlugin } from './EamusePlugin';
import { EamuseRootRouter } from './EamuseRootRouter';
import { Logger } from '../utils/Logger';
import { CONFIG } from '../utils/ArgConfig';
export const ROOT_CONTAINER = new EamuseRootRouter();
let initialized = false;
@@ -44,6 +45,8 @@ export const services = (port: number, plugins: EamusePlugin[]) => {
/* - Service */
ROOT_CONTAINER.add('services.get', async (info, data, send) => {
const ping_ip = CONFIG.ping_ip;
const services = {
'@attr': {
expire: 10800,
@@ -60,7 +63,7 @@ export const services = (port: number, plugins: EamusePlugin[]) => {
{
'@attr': {
name: 'keepalive',
url: `http://127.0.0.1/keepalive?pa=127.0.0.1&ia=127.0.0.1&ga=127.0.0.1&ma=127.0.0.1&t1=2&t2=10`,
url: `http://${ping_ip}/core/keepalive?pa=${ping_ip}&ia=${ping_ip}&ga=${ping_ip}&ma=${ping_ip}&t1=2&t2=10`,
},
},
],

View File

@@ -43,6 +43,12 @@ parser.addArgument(['--dev', '--console'], {
action: 'storeTrue',
});
parser.addArgument(['-pa', '--ping-addr'], {
help: 'Use an ICMP pingable target to make your games think they are online',
metavar: 'IP',
dest: 'ping_addr',
});
parser.addArgument(['--force-load-db'], {
help: 'Force load savedata and discard corrupted messages',
defaultValue: false,
@@ -93,6 +99,13 @@ function CoreConfig() {
needRestart: true,
});
CONFIG_MAP['core'].set('ping_ip', {
type: 'string',
default: '127.0.0.1',
needRestart: true,
desc: 'Use an ICMP pingable target to make your games think they are online',
});
CONFIG_MAP['core'].set('matching_port', {
type: 'integer',
range: [0, 65535],

View File

@@ -1,4 +1,4 @@
export const VERSION = 'v1.31b';
export const VERSION = 'v1.31c';
export const NAMES = [
'Akehiro',
'Akihiro',