Project Refactoring

未关闭
#335 2 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
重构
描述清晰度
需要澄清
活跃度
冷清
技术栈
csharp

调研方向

首先查看 handlers_refactor 分支和消息层次结构,重点关注 issue 中列出的尚未移植的 Client、Player、PlayerCli 和 Submessages 组。完成意味着将剩余的 handler 逻辑从面向 parser 的结构迁移到面向消息的组织方式中,但 issue 没有指出具体的文件或测试。

由索引模型根据 Issue 内容生成。

描述

enhancement help wanted

Hi everyone,

as someone may know, together with @DDuarte, we started a process of general refactoring of WPP.
That's because this project has started to grow wildly in the latest years and since the increase in complexity of the protocols (and of the game in general) using this fundamental tool is becoming challenging.

Therefore we identified a couple of key steps in order to move to a more solid, efficient and manageable structure, so that we're able to satisfy the original feature request[1]:

1. Refactoring handlers

At the moment of this issue, the project is built upon a "parser-oriented" approach. This means that the interpretation logic is embedded in few and fat classes containing all the related methods, with multiple versions of the classes managing the different versions of the communication protocol.
We're planning to move to a "message-oriented" approach, in the sense that the interpretation logic is moved to many thin classes, of which everyone handles just a single opcode.
This step is really crucial: at the moment the handlers are heavily coupled and the whole logic of the program is built on side effects to objects, making the whole program almost impossible to test.
We have therefore structured a hierarchy of messages so that they are not put all together in one place but in small logical namespaces where updating one has no effects to the others.
Messages are divided into:

  • CliChat
  • Client
  • ClientConnection
  • Global
  • Other
  • Player
  • PlayerCli
  • Submessages
  • UserClient
  • UserRouterClient

As you can see, some of them have been already ported successfully, I've planned to complete all of them in the near future, except for "Client".. Since it is composed of nearly 1000 classes, help is really needed!!
Keep update on the handlers_refactor branch[2].

2. Abstracting serialization

Once obtained this change, we'll start exploiting it by building a more efficient parsing process that structures the data on a tree-based approach, in order to produce different, more mangeable outputs which will make it possible to filter and fast-search the packets needed, together with store the information in a more compact way (no more 1GB outputs). A reference can be found of the XML feature proposal [3].

3. Expanding Interfaces [to be extended]

Once the first two steps have been completed, more clear interfaces for input and outputs must be defined, in order to make this project exploitable by other programs, like web servers, databases, and classical cli programs.

4. Enhancing/Building UI [to be extended]

At the end of this very long journey, we expect to have a robust and efficient parser, which will be usable by developers to learn much more about how the game communication works and update the game much more frequently, maybe interacting by a GUI or a Web UI.

Comments and support are really appreciated. Updates will follow!


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

主要语言
C#
星标
522
派生
387
平均合并
3 天 6 小时
30 天内合并 PR
4

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TrinityCore/WowPacketParser 的其他 Issue

查看 TrinityCore/WowPacketParser 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。