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

命名空间分析器 #579

Open
LiShengYang-yiyi opened this issue Mar 4, 2024 · 2 comments
Open

命名空间分析器 #579

LiShengYang-yiyi opened this issue Mar 4, 2024 · 2 comments

Comments

@LiShengYang-yiyi
Copy link
Contributor

model hotfix 中包涵了客户端与服务器的代码
使用文件夹隔离
客户端 = client
服务器 = server
公用 = share

但是在Unity中 特别是CS模式下 是同时存在的
难免会有人吧命名空间写错 调用错误 等运行时才发现问题
总有人用错 或者不注意引用到其他命名空间
建议使用分析器强制检查

在对应文件夹下

客户端 Client : 所有命名空间必须是ET.Client
并且不能出现任何ET.Server 命名空间

服务器 Server : 所有命名空间必须是ET.Server
并且不能出现任何ET.Client 命名空间

公用 Share : 所有命名空间必须是ET
并且不能出现任何ET.Server 命名空间
并且不能出现任何ET.Client 命名空间

ModelView : HotfixView
所有命名空间必须是 ET.Client
(因为有人在这2个下写命名空间就直接写ET)

(考虑到可能会有自己的命名空间 所以可以考虑不判断ET. 只要包涵对应的也行)

等等 更多关于命名空间检查相关的操作

以此来达到强制检查作用 还望采纳

@egametang
Copy link
Owner

这个不太需要了,只要定时分开编译一下就知道了,编译器已经能检查就不用写分析器了

@LiShengYang-yiyi
Copy link
Contributor Author

这个不太需要了,只要定时分开编译一下就知道了,编译器已经能检查就不用写分析器了

额 就是要分开编译的时候才知道 如果能早点就好了
还有关键一点是 比如在 client文件夹下 定义了 et的命名空间 或者et.server的命名空间这种并不会出错
所以还想限制的是编译也无法发现的问题 就是 比如 client文件夹下禁止出现 server这种命名空间

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