Conversation
oli-obk
left a comment
There was a problem hiding this comment.
Yea this'll prevent most issues. I'm still curious where one would need comparisons between Peer and Me outside of render, but that likely just means checking the catalog games' sources and chatting with the authors
Probably nowhere. I just don't see an easy way to enforce "you can compare these two types but only when called from |
|
Yea considering this is usually a trivially noticeable bug in multiplayer and has lots of docs pointing ppl away from making such bugs, I don't think any "security" level kinds of protection are necessary |
get_mereturn a newMetype instead ofPeer.get_settingsor for equality comparison withPeer.While you can, if you really want, convert
MetoPeerby iterating overPeersand picking the one that equals toMe(or going throughinto_u8->from_u8), it would require deliberately going out of your way to shoot yourself in the foot. So, the change should prevent the most common pitfalls, likeread_pad(get_me()).See firefly-zero/firefly-runtime#9.