ClientRpc and ServerRpc decorators should give an error if attached to a non-NetworkBehaviour class method
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- csharp
- Ambito
- networking
Direzione di ricerca
La issue non indica file, test o punti di ingresso. Inizia individuando la gestione dei decorator ClientRpc e ServerRpc e il modo in cui viene verificata l’ereditarietà da NetworkBehaviour; definisci e testa una diagnostica per i metodi nelle classi che non derivano da NetworkBehaviour, incluso il comportamento richiesto a runtime o nell’editor.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- C#
- Stelle
- 2.3k
- Fork
- 461
- Merge medio
- 3g 16h
- PR unite (30g)
- 20
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Unity-Technologies/com.unity.netcode.gameobjects
-
stat:import type:bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
-
stat:reply-needed type:support
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
Unity-Technologies/com.unity.netcode.gameobjects#4095 · 10 commenti ·
-
stat:awaiting-triage stat:Investigating type:bug
Unity-Technologies/com.unity.netcode.gameobjects#3912 · 5 commenti · 1 assegnatario ·
-
Tracking type:feature-2.x
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
Unity-Technologies/com.unity.netcode.gameobjects#3870 · 5 commenti ·
-
Tracking type:feature
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
Unity-Technologies/com.unity.netcode.gameobjects#3830 · 7 commenti ·
Tutte le issue di Unity-Technologies/com.unity.netcode.gameobjects