Skip to content

Commit c1922ba

Browse files
committed
hotfix: 允许定制日志路径,以区分使用同一个 ID 登录多个站点的情景
1 parent d96fe68 commit c1922ba

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

framework/main.tin

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@ PaoTin++ © 2020~2022 的所有版权均由担子炮(dzp <[email protected]>)
2020
#return;
2121
};
2222

23-
#if { "@InitLog{$user[id]}" != "true" } {
24-
#echo {<110>创建日志目录 $gLog[PATH]/$user[id] 时遇到错误。<070>};
23+
#local log-path {$user[id]};
24+
#if { "$session[log_path]" != "" } {
25+
#local log-path {$session[log_path]};
26+
};
27+
28+
#if { "@InitLog{$log-path}" != "true" } {
29+
#echo {<110>创建日志目录 $gLog[PATH]/$log-path 时遇到错误。<070>};
2530
#echo {<130>请检查你的安装环境,或者参考使用手册重新安装本软件。<070>};
2631
#return;
2732
};

ids/DEFAULT

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ mudlib.Set {pkuxkx};
3030
#var session[reconnect_slow] 600; #nop 维护模式下的间隔;
3131
#var session[remote_maint] false; #nop 维护模式开关;
3232

33+
#nop 日志相对路径,留空则使用 user[id] 的值;
34+
#nop 如果有同一个 ID 连接不同站点的需求,就应当在 ID 配置文件里定制它;
35+
#var session[log_path] {};
36+
3337
#nop 可以通过触发来开启维护模式;
3438
#action {^%*(%*)告诉你:开启远程维护$} {#var session[remote_maint] {true}};
3539

ids/EXAMPLE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ PaoTin++ © 2020~2022 的所有版权均由担子炮(dzp <[email protected]>)
2424
#var user[passwd] bar;
2525

2626
#nop XXX: 所有 ids/DEFAULT 里的内容都可以在这里定制;
27+
#nop 这里为了简单起见没有全部列出,如有更多需求请参考 ids/DEFAULT 定制;
2728

2829
#nop 用户上线之后想要自动执行的代码写这里;
2930
#alias {user-online} {

ids/EXAMPLE-xyj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ mudlib.Set thuxyj;
2929
#var user[passwd] bar;
3030

3131
#nop XXX: 所有 ids/DEFAULT 里的内容都可以在这里定制;
32+
#nop 这里为了简单起见没有全部列出,如有更多需求请参考 ids/DEFAULT 定制;
3233

3334
#nop 用户上线之后想要自动执行的代码写这里;
3435
#alias {user-online} {

0 commit comments

Comments
 (0)