item names issues

You might have seen stuff in the system (deposit, shop) where the name of the item has been missing. This was because of the quite annoying switch in minecraft from item IDs (numbers, 0 for air, 1 for stone etc) to item names (“air”, “stone” etc). Since Mojang decided to move (which in general is a good idea since you can read code easier), there has been some confusions:

  1. I had to change all the code that deals with stuff – which is quite a lot and update all the databases
  2. The new item names have changed over time (“ink_sack” is now “dye” etc).
  3. Websend, one of the major plugins that we use, is using different names (I could not really find out why) so I had to write code that alerts me when there is a name incoming from websend that is unknown and then add that to a translation table.

Because of those issues, the tables (requests, deposit, offers) have started to contain item names that were not recognizable and therefore showed up empty. So I now wrote a function that takes the current names from the minecraft wiki, checks them against the internal code and then finds out if there are any entries in the tables that do not match. Then I get alerts and can fix 100% of all occurrences of the bad names.

So there are still 2 issues remaining:

  1. I did not have the time to check for 100% of all items where websend uses a different name than the standard. I found 50 items and will get an alert each time someone has something in their inventory that was not recognized by the code, so this should fix itself eventually.
  2. If there are new changes in the minecraft code in future versions. I have to run the above check again to make sure everything is OK. If you see any item in the shop that does not have a proper name, please let me know immediately. Otherwise you risk losing the stock of that item.

Dibs on lot enabled!

I have finished programming and enabled the dibs function now.
You can now go to the lot manager and call dibs on a lot on the bottom of the list.
The lots you have dibs on will be listed also on the bottom of the list.
You can select and action (none or reset) on transfer and cancel the dibs call anytime.

ToDo:

  • Write the actual function that transfers the lot to you after it’s been abandoned. This is a part of the lot reset process fix.
  • Make it somehow / somewhere visible how many people have dibs on a lot.

Dibs on a lot – v2

What some people described in the comments  on the last post is pretty much how I planned it anyhow. Not sure why it did not come out in the text above, but let me describe the process here in more detail (this is a draft):

  • You can reserve (or call dibs) on a currently occupied lot – no matter which world.
  • You will get the lot if the previous owner abandons it (then it will be reset in any case) or when the user expires (then it’s up to you if you want to reset it).
  • If several people want to have the same lot, the first who reserved it will get it. The others stay in the queue until they either withdraw the reservation or until they are in line to get the lot.
  • It does not matter if you are next door or not.
  • You need to have the right to get that lot (i.e. you will not increase your overall maximum lot count when you get that lot) or the money to afford it.
  • You should have the option to reset the lot if you want to. (That’s a good idea I got from the comments).
  • Several people can reserve a lot. If someone reserves first, they get it when it’s free.

The big question that I have now is this: Either we make it super-strict or very opportunistic.

  • Super strict: You can only reserve a lot if you can afford it or have a free slot. Once you reserved one lot, and you have only one free slot, you cannot even get a free lot unless you revoke your reservation. You total lots would always be your lots + your reservations. No reservations and not lots unless you you give up a lot or a reservation. If a lot costs money, it’s gone until you withdraw your reservation.
  • Opportunistic: You can reserve anything you like. 20 people could try to reserve the same lot. One person can reserve 20 lots in empire. First come first serve once it becomes free. It would show how desirable a lot is and also build some reputation for the builder. However, once it becomes free, the person first person in line who has the money and available free lots can actually get it.

Both have advantages and disadvantages, mostly psychological though. The end result would be pretty much the same except that the strict option would force people to think about it more often and switch around their reservations as lots are given to someone else further up the queue. The opportunistic option would favor older players and create a kind of rating for the user. I think there is not a lot of bad in the opportunistic way. People have to be careful that their account is not drained once they get a lot they are not prepared to pay for, and empire lots are not easy to get rid of once you have one.

So I am more on the opportunistic path which is also much easier to implement since I do not have to add all the checks in many places. I would like to hear from all of you if you see a fundamental flaw in the system however.

Calling dibs on a lot?

There is again and again the issue that a user has disappeared but the lot is of interest for other people. Be it that someone got upgraded and would like to get the lot next door or that a user built something on the lot of another user and does not want to lose the work.

I have been thinking about enabling a “calling dibs” for lots that are about to expire (for example from 10 days on before the expiry date). It would be on a first-come-first-serve base. Once the lot is due for reset, it’s checked if a user has called dibs on it and then the system tries to give the lot to the user who called first. It’s checked if the user has the free lots/money to get it and if successful transfers the lot instead of resetting it. If we want to do it fancy (and if I have the time) we could progress to the next in line in case the first candidate fails to get it.

The concern here is that this would give quite an advantage to people who have the cash for a kingdom lot, since one could get dibs for a lot, get it, deconstruct all what is there, sell the stuff and then refund the lot.

I would be happy to get some feedback from all of you if you think this would be an unfair process in any kind or if you think that this is something we should do. Should we ask a higher price (2x, 10x?) for a kingdom lot? Since empire lots cannot be refunded, I do not see the issue so much there, but for kingdom lots, this is different.

User online time and date registered fixed

I fixed now for the 2nd time the online time and registered date. While I did this already once, there was an older process that ran on the table that reset the data. I used the other process to track username changes and did not anticipate that it would delete existing data.

The fallout is that user online time since the upgrade is lost, but we should be calculating correctly from now on. Please let me know ASAP if you see any suspicious data in this aspect.

Bannerworks done!

I have submitted several bug reports to the author of Websend (the plugin that does all the interface with the website, shop, deposit etc) which have all been fixed now, and a new version of Websend was released. I have installed it and I am currently working on enabling the handling of Banners in-game.

The issue is that they need to be stored in the tables and I want to use the field that is also used for enchantments so I do not have to create another field in each table that I am using. So I have to go through the code and change the way enchantments are handled and rather convert code that was specific for enchantments to a rather unspecific ‘extra data’ type of process. There are more than 370 places in the code where enchantments are handled, so there is a bit of work ahead.

On top of that I am on a business trip, so I hope I can finish it soon, but no ETA yet. I found some time tonight and finished it, so Banners can now be offered in the shop, but just display as “x-layered banner”. Deposits should also work fine (same display though). If anyone has an idea how do display banners in an easy way, please let me know (custom names won’t work).

I am planning to integrate an online banner generator like this one into the website. If anyone of you knows JavaScript to help me there, please let me know.

Region flags messy – but fixed

Ok, so I tried today to fix the issue that one cannot use buttons & doors on other user’s lots. When I did that, suddenly everyone could access all chests. When I tried to fix that, everyone was able to break blocks everywhere.

So the current version of WorldGuard has some bugs that we have to live with. Otherwise I have to do an extremely messy downgrade to the last version which would roll back lot changes (i.e. new users etc) since the upgrade.

I managed now to fix it by assigning region flags for allowing buttons use and denying chest access for all 6700 lots individually. I was hoping to fix that with 1 flag per world, but there are currently bugs in the system that prevent that.

1.8 Update: We are live!

Status (watch this space, I am updating it as I change stuff):

  • Disabled items (will try to re-enable as possible):
    • Minecart Mania
    • Region breed limits (don’t abuse this please)
  • Bugs that most likely need updates by someone else (e.g. plugins, spigot etc)
    • Hunger & eating seems to work sometimes, sometimes not fixed!
    • /home & /homes commands cannot be fixed, please set new homes
    • bouncing on slime blocks fixed!
    • Enchantement costs too much XP (30XP for lvl 30 enchanting instead of 3 as per 1.8 specs) was never broken
    • The 3D map fixed!
    • Log of block changes & Last login info I wrote my own last login & online time function now
    • Banners – Do not keep banners in inventory when chaning worlds, do not deposit or try to sell.  Fixed selling & buying & deposit!
  • Updating the code: Since Worldguard upgrades to UUIDs from usernames a lot of code broke:
    • The lot manager
    • The user list
    • Lot resets
    • Karma
    • The 2D map
    • User voting
    • The settler test (tested!)
    • Flying piston Engines. I tested that now and confirmed that those will not cross lot borders. I do not know how to fix abuse in the darklands however. I might block placing slime blocks there to make sure.