zanix wrote:Updated svn[1792]
It does appear that DS was going to query an item db for info, but all I see is comments about it
....
DS is/was right.
If an item has is “isSocketable”, then this can be easily detected as long as there is a non-occupied.
This is detected with the preg_match ['tooltip_preg_emptysocket'] filter. It will dig up the socket color.
But the very moment a socket is equipped with a gem, then that the socket colour information is lost.
So, it’s not possible anymore to detect if the colour of the inserted gem(s) meet the “Socket Bonus” requirements.
What does this mean?
A solution might be scanning the item table to see if the same item exists without any gems inserted. I consider this chance to small.
Well, the item name is known, as is the item number – the only solution is, as DS already stated: we’ll have to make a request to an external database.
This concept isn’t new. For myself, I’m using already a site-addon like itemstats that does this quiet well – it includes “search by number” and “search by name” for many WoW public item database.
When the item is found, it should be stored in a local table. Next time the tooltip is being generated, the “empty item info” would be found immediately.
In the beginning, this solution, the roster would make some “foreign database calls”, but this will nearly stop, as not everyone loots Socketable items every day.
This solution won’t be ready for the WowRoster 2.0 – it isn’t even on it's roadmap. But it would be a nice thing to include, because pretty straight forward to code.
I'll have try to make a version of item.php that uses this solution.
If it works, the installer should install 'yet another table',
The CP should include a section to shut down (option by default) this solution.
One function should be written that and inserted that the last two occurrences of $this->isSocketable = true;
Remember, all this to decide if the Socket Bonus for an item applies, when the gem colour condition is met, or not.