Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

玩家加入时无法重置计时器 #8

Open
bbz-233 opened this issue Mar 20, 2024 · 12 comments
Open

玩家加入时无法重置计时器 #8

bbz-233 opened this issue Mar 20, 2024 · 12 comments

Comments

@bbz-233
Copy link

bbz-233 commented Mar 20, 2024

服务端版本
MCDR2.12.3+Fabric1.20.4

HibernateR版本
1.2.0

问题描述
在没设置黑名单的情况下,无论玩家是否进入,计时器都不会重置,而且可能会提前休眠服务器

日志文件

[MCDR] [2024-03-20 14:45:51] [Thread-116/INFO] [hibernate_r]: 伪装服务端已启动
[MCDR] [2024-03-20 14:45:51] [Thread-116/INFO] [hibernate_r]: 开始监听端口
[MCDR] [2024-03-20 14:45:51] [Thread-116/INFO] [hibernate_r]: 伪装服务器收到了一次ping: b'\x14\x00\xfd\x05\rr.rainplay.cnO\xe8\x01'
[MCDR] [2024-03-20 14:45:53] [Thread-116/INFO] [hibernate_r]: 伪装服务器收到了一次连接请求: b'\x14\x00\xfd\x05\rr.rainplay.cnO\xe8\x02'
[MCDR] [2024-03-20 14:45:53] [Thread-116/INFO] [hibernate_r]: 启动服务器
[MCDR] [2024-03-20 14:45:53] [Thread-116/INFO]: 正在启动服务端,启动参数为 ""D:\Zulu\zulu-21\bin\java.exe" -Xmx4G -jar fabric-server-launch.jar nogui"
[MCDR] [2024-03-20 14:45:53] [Thread-116/INFO]: 服务端正在以 PID 3808 运行中
[MCDR] [2024-03-20 14:45:53] [TaskExecutor/INFO] [prime_backup]: Server startup detected, enable the online player counter
[MCDR] [2024-03-20 14:46:31] [Thread-139 (on_server_startup)/INFO] [hibernate_r]: 事件:服务器启动
[MCDR] [2024-03-20 14:46:33] [Thread-140 (on_player_joined)/INFO] [hibernate_r]: 事件:玩家加入
[MCDR] [2024-03-20 14:46:37] [Thread-139 (on_server_startup)/INFO] [hibernate_r]: 休眠倒计时开始
[MCDR] [2024-03-20 14:46:38] [Thread-140 (on_player_joined)/INFO] [hibernate_r]: 休眠倒计时取消
[MCDR] [2024-03-20 14:48:46] [Thread-125/INFO] [hibernate_r]: 倒计时结束,关闭服务器
[MCDR] [2024-03-20 14:48:46] [Thread-143 (on_player_left)/INFO] [hibernate_r]: 事件:玩家退出
[MCDR] [2024-03-20 14:48:47] [MainThread/INFO]: 服务端进程返回代码: 0
[MCDR] [2024-03-20 14:48:47] [MainThread/INFO]: 服务端已关闭
[MCDR] [2024-03-20 14:48:48] [Thread-143 (on_player_left)/INFO] [hibernate_r]: 当前在线玩家数量:0,黑名单玩家:[]
[MCDR] [2024-03-20 14:48:48] [Thread-143 (on_player_left)/INFO] [hibernate_r]: 休眠倒计时开始
[MCDR] [2024-03-20 14:48:58] [Thread-125/INFO] [hibernate_r]: 伪装服务端已启动
[MCDR] [2024-03-20 14:48:58] [Thread-125/INFO] [hibernate_r]: 开始监听端口
[MCDR] [2024-03-20 14:55:41] [Thread-137/INFO] [hibernate_r]: 倒计时结束,关闭服务器
[MCDR] [2024-03-20 14:55:41] [Thread-137/WARNING]: 服务端不能在关闭时再次关闭

如有什么其他需要的信息,我可以积极提供

@HIM049
Copy link
Owner

HIM049 commented Jul 12, 2024

这个问题貌似是没有安装 Online Player API 导致的

@bbz-233
Copy link
Author

bbz-233 commented Jul 12, 2024

是吗我先关了issue之后试下吧
好像没看到说要OnlinePlayerAPI做前置来着

@bbz-233 bbz-233 closed this as completed Jul 12, 2024
@J4ckTh3R1pper
Copy link

安装了Online Player API依然会关闭
MCDR版本2.13,minecraft版本1.20.1-forge-47.2.6

@HIM049
Copy link
Owner

HIM049 commented Jul 15, 2024

插件在关服前显示的在线玩家数量仍然是 0 吗?

@J4ckTh3R1pper
Copy link

插件在关服前显示的在线玩家数量仍然是 0 吗?

是的,玩家加入或退出都不会触发插件的计数,计时器会一直运行直到触发关服

@HIM049
Copy link
Owner

HIM049 commented Jul 15, 2024

我本地使用 MCDR 2.12.3 + Fabric 1.20.4 测试无法复现问题。可能是没有为 MCDR 设置正确的服务端 handler,导致 online player api 没有正常工作。

@CNSCSQ
Copy link

CNSCSQ commented Jul 16, 2024

我也是同样的问题用的也是Fabric MCDR是2.13.0 同样会提前超时关闭 handler用的也是正确的

image

@J4ckTh3R1pper
Copy link

我本地使用 MCDR 2.12.3 + Fabric 1.20.4 测试无法复现问题。可能是没有为 MCDR 设置正确的服务端 handler,导致 online player api 没有正常工作。

handler设置没有错误,是forge_handler

@HIM049 HIM049 reopened this Jul 16, 2024
@HIM049
Copy link
Owner

HIM049 commented Sep 17, 2024

今天优化了一下逻辑,可以使用最新版本试试看。我在开发环境下测试是没有遇到过这个问题的。不知道类似的问题是否还有出现。
这个计时器的控制是由MCDR事件触发的,当 MCDR 识别到玩家进入就会取消计时器。理论上只要 MCDR 配置正确就不会有问题。

@J4ckTh3R1pper
Copy link

换了最新版本,有时候还是会自动关闭,有时候又不会

@HIM049
Copy link
Owner

HIM049 commented Oct 1, 2024

有完整的服务端日志吗?我自己这边测试没有遇到问题。

@J4ckTh3R1pper
Copy link

没注意,最开始会自动关闭,现在不会了,等遇到了再回复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants