Bug in Photon.SocketServer.Mmo.BoundingBox.CreateFromPoints
edited February 2011
There's a bug in Photon.SocketServer.Mmo.BoundingBox.CreateFromPoints(). It ignores Z coordinate, and sets it to 0. This has an implication that when you create a GridWorld, then all calls to GetRegion(pos) fails where pos.Z != 0.
You are right. The problem is that GridWorld checks for BoundingBox.Contains - and this method checks Z although GridWorld wouldn't really need it. I'll upload a fix tomorrow.
To work around you can change the ExtensionMethods.ToVector(this float vector): Make case 2 the default.
I didn't test it, but it should work.
There was more than one bug, I apologize for any convenience that may have caused.
I attached the Photon.SocketServer.dll 2.4.6. that is not downloadable anywhere else yet.
It contains the following changes:
- FIXED: Mmo BoundingBox.CreateFromPoints, Vector.Min and Vector.Max ignored Vector.Z
- FIXED: Mmo GridWorld BoundingBox sets area BoundingBox.Min.Z to int.MinValue and Max.Z to int.MaxValue to allow any Z coordinate as GetRegion parameter. This fixes an issue where positions with Z != 0 would not subscribe to anything.
- FIXED: Mmo GridWorld.GetRegionsExcept did not work as intended which lead to unexpected interesta area subscribe behavior
To apply the update replace the dll in the 2.4.5 lib folder and recompile all projects.
Let me know if you still notice a weird subscribe/unsubscribe behavior.
I just uploaded a new SDK. The pre-built MMO application is up to date. If you compile your application logic yourself, make sure to update the Photon.Socketserver.dll (from the newest SDK) and recompile.