ClientRpc and ServerRpc decorators should give an error if attached to a non-NetworkBehaviour class method
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- csharp
- Lĩnh vực
- networking
Hướng nghiên cứu
Issue không nêu tên các tệp, bài kiểm thử hoặc entry point. Hãy bắt đầu bằng việc xác định phần xử lý decorator ClientRpc và ServerRpc cũng như cách kiểm tra việc kế thừa NetworkBehaviour; định nghĩa và kiểm thử một chẩn đoán cho các phương thức trong những lớp không kế thừa từ NetworkBehaviour, bao gồm cả hành vi runtime hoặc editor được yêu cầu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe.
I'm finding it easy to accidentally add [ClientRpc] or [ServerRpc] methods to MonoBehaviour-derived classes, where clearly they won't do anything. This leads to a bunch of confusion while I try to figure out what's wrong with the networking only to do the forehead-slap when I notice that the class hasn't been switched to NetworkBehaviour.
Describe the solution you'd like
At a minimum, a runtime error with a descriptive error message would be helpful. Something like "FooClientRpc was added to a class that doesn't derive from NetworkBehaviour - as a result, FooClientRpc will never be called."
Better would be a similar error logged when in the editor. Compile-time errors would be ideal if possible, of course.
Describe alternatives you've considered
Beyond "vigilance" (which can be assumed doesn't work), if it becomes a more serious issue then I'd have to rig some sort of linting rule to catch this.
- Ngôn ngữ chính
- C#
- Star
- 2.3k
- Fork
- 461
- Merge trung bình
- 3 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 20
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Unity-Technologies/com.unity.netcode.gameobjects
-
stat:import type:bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
-
stat:reply-needed type:support
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Unity-Technologies/com.unity.netcode.gameobjects#4095 · 10 bình luận ·
-
stat:awaiting-triage stat:Investigating type:bug
Unity-Technologies/com.unity.netcode.gameobjects#3912 · 5 bình luận · 1 người được giao ·
-
Tracking type:feature-2.x
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Unity-Technologies/com.unity.netcode.gameobjects#3870 · 5 bình luận ·
-
Please error, or at least warn, when a managed type is included in INetworkSerializeByMemcpy Đang mởTracking type:feature
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Unity-Technologies/com.unity.netcode.gameobjects#3830 · 7 bình luận ·
Tất cả issue của Unity-Technologies/com.unity.netcode.gameobjects
Issue tương tự
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
sillsdev/languageforge-lexbox#2665 ·
-
bug documentation frontend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
azurenoops/spin_agent#975 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
SubtitleEdit/subtitleedit#15108 · 1 bình luận ·