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

增加拒绝外部直接访问 action 的路由权限 #47

Closed
iohao opened this issue Feb 15, 2023 · 2 comments
Closed

增加拒绝外部直接访问 action 的路由权限 #47

iohao opened this issue Feb 15, 2023 · 2 comments
Assignees
Labels
功能增强 功能增强

Comments

@iohao
Copy link
Owner

iohao commented Feb 15, 2023

有些 action 只能内部访问,比如增加金币、敏感数值的增加等。这些 action 是不能由外部直接访问的,这里说的外部指的连接的玩家。

@iohao iohao added the 功能增强 功能增强 label Feb 15, 2023
@iohao iohao self-assigned this Feb 15, 2023
@iohao
Copy link
Owner Author

iohao commented Mar 1, 2023

AccessAuthenticationHook 新增3个拒绝路由访问相关的方法

public interface AccessAuthenticationHook {
    ... ... 省略部分代码
    /**
     * 添加拒绝访问的主路由,这些主路由不能由外部直接访问
     * <pre>
     *     这里的外部指的是玩家
     * </pre>
     *
     * @param cmd 主路由
     * @return me
     */
    default AccessAuthenticationHook addRejectionCmd(int cmd) {
        return this;
    }

    /**
     * 添加拒绝访问的路由,这些路由不能由外部直接访问
     * <pre>
     *     这里的外部指的是玩家
     * </pre>
     *
     * @param cmd    主路由
     * @param subCmd 子路由
     * @return me
     */
    default AccessAuthenticationHook addRejectionCmd(int cmd, int subCmd) {
        return this;
    }

    /**
     * 拒绝访问的路由
     * <pre>
     *     当为 true 时,玩家不能访问此路由地址
     * </pre>
     *
     * @param cmdMerge 路由
     * @return true 表示玩家不能访问此路由
     */
    default boolean reject(int cmdMerge) {
        return false;
    }
}

iohao added a commit that referenced this issue Mar 2, 2023
[#47] 增加拒绝外部直接访问 action 的路由权限
[#45] 游戏对外服独立 UserSession 管理部份逻辑,做成单独的 Handler
[#54] 动态属性接口增加消费操作
@iohao
Copy link
Owner Author

iohao commented Mar 2, 2023

@iohao iohao closed this as completed Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
功能增强 功能增强
Projects
None yet
Development

No branches or pull requests

1 participant