Quantcast
Channel: Photon Unity Networking (PUN) — Photon Engine
Viewing all articles
Browse latest Browse all 8947

Errors in NetworkPeer.cs

$
0
0
InvalidCastException: Cannot cast from source type to destination type.
NetworkingPeer.AlmostEquals (System.Object one, System.Object two) (at Assets/Modules/Photon/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:4397)
According to this error, should I keep the same data transfer each frame?

In my opinion this is critical bug. You are checking only current type of data, but don't check type of cached data. Even if I will keep data types and count same each sync, then your compress mechanism can change that (by changing cache length in comparasion to normal data length), and cause that error.
I have check that - Unreliable is ok, Unreliable on change is ok, Reliable delta compressed is not ok.
This is critical bug and it is not cause by me, I'm forced to modify your code...

Line 4364 in NetworkingPeer is also dangerous, because this isn't described in documentation.
Developer should know, that your code will use Equals method, to determine if data should be send - I have issue associated with this line, which I have alredy resolved, by overriding equals method.

I would also notice, that you are invoking RPC method on all registered monoBehaviours, which may cause a bug (execution of A.method and B.method).
If I have method M, with RPC attribute in class A and the same method in class B, on the same GameObject and I call it from A class, then it will affect also class B.
There is also no need, to iterate through all MonoBehaviours (not all have rpc, and not all are connected with photon view).

Viewing all articles
Browse latest Browse all 8947

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>