-
Notifications
You must be signed in to change notification settings - Fork 13
fix: 修复 revbotservice Web 路径加载失败并增强 bothost 远端 PHP 报错可见性 #219
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
Merged
amarillonmc
merged 2 commits into
nouveau
from
codex/create-bot-control-system-in-bothost-gsrgdp
Feb 8, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,15 @@ | ||
| <?php | ||
|
|
||
| define('CURSCRIPT', 'revbotservice'); | ||
| include './include/common.inc.php'; | ||
| include GAME_ROOT . './include/game.func.php'; | ||
| include GAME_ROOT . './bot/revbot.func.php'; | ||
|
|
||
| $gameRoot = dirname(__DIR__).DIRECTORY_SEPARATOR; | ||
| if(is_dir($gameRoot)) { | ||
| chdir($gameRoot); | ||
| } | ||
|
|
||
| require_once $gameRoot.'include/common.inc.php'; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| require_once GAME_ROOT.'./include/game.func.php'; | ||
| require_once GAME_ROOT.'./bot/revbot.func.php'; | ||
|
|
||
| # 注意:因为进程锁的存在,运行bot脚本时必须确保游戏处于未开始状态 | ||
| # 否则请先中止游戏,并手动清空lock目录下所有文件,然后确保游戏正处于未开始状态下运行脚本 | ||
|
|
@@ -11,6 +18,9 @@ | |
| bot_prepare_flag: | ||
| $id = 0; | ||
| $dir = GAME_ROOT.'./bot/lock/'; | ||
| if(!is_dir($dir)) { | ||
| mkdir($dir, 0777, true); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
| $scdir = scandir($dir); | ||
| # 为进程创建对应编号的进程锁 | ||
| $process_id = $scdir ? count($scdir)+1 : 1; | ||
|
|
@@ -67,7 +77,7 @@ | |
| { | ||
| $flag = bot_acts($id); | ||
| if ($flag == 0) { | ||
| unset($gamevars['botid'][array_search($botid, $gamevars['botid'])]); | ||
| unset($gamevars['botid'][array_search($id, $gamevars['botid'])]); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| save_gameinfo(); | ||
| save_combatinfo(); | ||
| if (empty($gamevars['botid'])) break; | ||
|
|
@@ -81,4 +91,4 @@ | |
| { | ||
| goto bot_prepare_flag; | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(无法在本次 review 中锚定到新增文件行,先在此备注)
bothost/main.py里拼接查询参数使用full_url += "?" + urlencode(...),当revbotservice_url本身已包含?时会生成无效 URL(...?a=b?c=d),可能导致连接目标不符合配置预期。Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.