Skip to content

Commit

Permalink
Minor fix AC-1-4
Browse files Browse the repository at this point in the history
  • Loading branch information
William-Shi233 committed Oct 20, 2023
1 parent 830b497 commit 5edfcd3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/Volume4/AC-1-4.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ RuntimeDataManager.addRestrictUUID(player.getUniqueId());

所以,我们要判断的不是玩家所在位置(脚部的中心,一个一维的点)是否处于传送门中,而是玩家的长方体碰撞箱有没有碰到传送门。通俗地说,玩家脚部的中心也许没碰到传送门,但是玩家的脚尖可能碰到了传送门。这时候,玩家仍然打不开聊天栏。

经过一番思考,代码决定改成下面这样子。
经过一番思考,编者决定把代码改成下面这样:

```java
// Check if player can log in here
Expand Down Expand Up @@ -390,7 +390,7 @@ IDEA 还有许多方便的调试功能,读者可以自行探索。这段内容
<div id='solution1' style='display:none;'>

::: info <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' transform='scale(0.6)' fill='%23fff'%3E%3Cpath d='M9.1 0C10.2 0 10.7 0.7 10.7 1.6 10.7 2.6 9.8 3.6 8.6 3.6 7.6 3.6 7 3 7 2 7 1.1 7.7 0 9.1 0Z'/%3E%3Cpath d='M5.8 16C5 16 4.4 15.5 5 13.2L5.9 9.1C6.1 8.5 6.1 8.2 5.9 8.2 5.7 8.2 4.6 8.6 3.9 9.1L3.5 8.4C5.6 6.6 7.9 5.6 8.9 5.6 9.8 5.6 9.9 6.6 9.5 8.2L8.4 12.5C8.2 13.2 8.3 13.5 8.5 13.5 8.7 13.5 9.6 13.2 10.4 12.5L10.9 13.2C8.9 15.2 6.7 16 5.8 16Z'/%3E%3C/svg%3E" style="background-color:#0B87DA; clip-path: circle();" width="24px" height="24px"> **谜底**
HarmonyAuth SMART 有一套命令白名单系统,防止玩家在未登录情况下随便执行命令。该系统使用 `String#startsWith` 方法判断命令是否在白名单内。登录命令是 `/l`。于是所有以 l 开头的命令,都被加进了白名单里,于是玩家在未登录时也可以执行 `/locate` 之类的命令了。在真实的服务器中,玩家可能会执行 `/luckperms` 等敏感命令,使得服务器的权限管理系统瞬间瓦解。
HarmonyAuth SMART 有一套命令白名单系统,防止未登录的玩家随便执行命令(否则玩家可以用管理员的游戏 ID 加入服务器,在未登录情况下输入 `/op` 等指令,那太糟糕了)。该系统使用 `String#startsWith` 方法判断命令是否在白名单内。登录命令是 `/l`,自然要加进白名单里。于是所有满足 `startsWith("l")` 的命令,都被加进了白名单里。玩家在未登录时也可以执行 `/locate` 之类的命令了。在真实的服务器中,可能会有玩家尝试 `/luckperms` 等敏感命令,使得服务器的权限管理系统瞬间瓦解。
:::

</div>
Expand Down

0 comments on commit 5edfcd3

Please sign in to comment.