Update 2010-01-06
2010-01-06
- Fixed major bug with the YardStairs. This update will cause any stairs to be deleted...but considering the bug and lack of people informing me of it, I doubt many will have problems with that.
- Yard items are now linked to the player's house as well as the player. When a house is removed, it will cause the items to be refunded...in time (described below).
- Setting to allow or disallow placing items in other player's houses. This does not have any effect on other player's 'Yard' areas. It simply makes it so players cannot place inside other player's houses.
- Updated YardGates to be a single class instead of a separate class for each gate. This causes old gates to become obsolete, but I have included code to automatically update the old gates to the new ones. If, for some reason, you want to make sure they updated, run the [UpdateOldGates command to manually update all gates. More on this in the notes section below.
Files Changed
Almost all.
To Update
Extract files in rar, overwriting your current files.
Loading the server that contains YardStairs will ask you to delete them, as the update changes things structurally in this class.
Loading the server that contains Yard Gates (YardIronGate, YardShortIronGate, etc) will give you a message for each gate, informing you that the server is updating the gate to the new version.
Notes
YardSettings.cs contains 2 more variables...SecondsToCleanup and AllowOtherHouses. The first has to do with cleanup of items that do not have houses (the house has been removed), the second has to do with placing items.
The new Cleanup feature is ran after a world save. Each Yard Item that does not have a current House will add itself to the cleanup array. <SecondsToCleanup> seconds after the save, the cleanup function runs. This loops through all items in the array and tries to find a house owned by the placer of that item within 20 spaces of the item; if a house is found, it assigns the House to that item and moves on. If no house is found, it refunds the item. <SecondsToCleanup> should be more than it takes for your world to save.
The system looks at <AllowOtherHouses> to see if it will allow players to place in other houses. Any access level greater than player can place regardless. I am aware that this method will not work well with a Save and Shut Down/Restart, but it's the best I could think of at this point in time (without modifying distro files, which is what I'm all about). I have ideas on fixing this further, but I wanted to get a working, tested update out for people.
The update code for yard gates is not exact, partly due to old code and partly due to how the new code works. It adds the correct gates, but they may be facing or open the wrong direction.
The reason I have not worried about changing the YardStairs and causing you to delete all of them is because I have not heard anyone bring the bug to my attention, which means not many stairs have been created...with the old code, I neglected to assign the player to the stair but, more importantly, I neglected to move the item to where the player targeted. So, deleting any stairs will simply delete stairs that are currently un-owned as well as on the internal map, not in the real world.