PUN RaiseEvent: Why only up to 199 and what can I do to get around this restriction?
Options
In the docs, it says PUN uses RaiseEvent under the hood for all communications.
I'm guessing PunRPC also uses RaiseEvent so how can I make the "eventCode" be any value I want and not just 0-199?
I'm guessing PunRPC also uses RaiseEvent so how can I make the "eventCode" be any value I want and not just 0-199?
0
Comments
-
The Photon event code is of type
byte
. So possible values are from0
to255
. Higher values are reserved because used for Photon's internal events.
I doubt you need more values than that.
If so you can just add the event type or code in the event data itself.0 -
So what I ended up doing is having an enum whose underlying type is byte and use that for my event codes. Then, since the ID I need to send could be large, I send it as part of the event data in an object[] that is casted as object before being sent in RaiseEvent. I then compare the ID to see if it's OK to proceed with the event. It's basically PunRPC all over again except I crafted this system to work with multiple components of the same type on the same GameObject.0