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

关于业务逻辑的热更思考 #916

Open
chanayy123 opened this issue Mar 27, 2024 · 1 comment
Open

关于业务逻辑的热更思考 #916

chanayy123 opened this issue Mar 27, 2024 · 1 comment

Comments

@chanayy123
Copy link

最新版本的example里面有手动热更和自动热更的例子,都是针对remote和handler,简单测过都没问题,关于业务逻辑这块,通过app注册自己的管理类,也能动态修改变量和简单的方法,如果碰到一些方法里面引用了很多其他模块,这个感觉就没法热更修改了,比如类似这样的,里面引用了RoomProto,Code等其他模块:
public userLeaveRoomRequest(uid) {
let user = this.userArr[uid];
if (user) {
if (this.gameStarted && (user.userStatus & RoomProto.userStatusEnum.PLAYING) !== 0 ) {
this.sendPopDialogContent(Code.GAME.CAN_NOT_LEAVE_ROOM, [user.chairId]);
let response = RoomProto.userLeaveRoomResponse(user.chairId);
this.sendRoomDataToAll(response);
} else {
this.userLeaveRoom(uid);
}
}
};
能想到的最笨的办法就是把可能需要修改的类都注册进app,这样需要热更修复的时候 外部模块都用app来引用,不知道大家有没有更好的办法?

@whtiehack
Copy link
Member

#19

@whtiehack whtiehack reopened this Mar 28, 2024
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

2 participants