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

有待重构的内容 #77

Open
CuteReimu opened this issue Aug 23, 2024 · 0 comments
Open

有待重构的内容 #77

CuteReimu opened this issue Aug 23, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@CuteReimu
Copy link
Owner

现有问题

  1. 协议和客户端难以交流,基本是口口相传,换一个人基本就不知道协议每个字段是什么意思了。
  2. 协议混乱,比如房主和游戏双方看到的卡不同的情况下,都用同一个协议来修改状态,会出现极其混乱的逻辑。
  3. 逻辑代码中含有大量的存储、读数据的代码,应该把逻辑和存储的代码解耦。

重构思路

  1. 使用 JSON schema 做协议规范,不管是前端还是后端kotlin,都有易用的根据 JSON schema 生成类的工具,方便沟通。
  2. 拆解协议,将选卡、收卡等协议进行拆解,顺便把登录、进房等协议也拆解了。

暂不重构的内容

只重构协议和业务逻辑相关的内容,一些算法和其他功能不在此次重构考虑。

  • 随机符卡
  • 存储逻辑
  • 符卡收率统计

重构后的语言

根据大家的技术栈,明显应该继续使用 Kotlin

@CuteReimu CuteReimu added enhancement New feature or request help wanted Extra attention is needed and removed help wanted Extra attention is needed labels Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant