Feature - Implemented Less ambiguous error messages from the speakeasy

Currently it appears that when you tell mafia to drink any speakeasy drink and it fails, the error message will always be "The <drink> is not currently available in your clan" . This message will appear even if the drink is in fact available, but you're simply at your 3-drink limit for the day. I would like to request an additional error message for when you've already had 3 drinks, something along the lines of "You've already had 3 drinks from here today". The current message should probably take priority for when the drink is in fact still locked in the current clan.

I'd like this because I just went down a row of clans I'm whitelisted to, trying to drink a sloppy jalopy (because my home clan is about 5% of the way there) without realizing that the counter tracker had already drunk 3 lindys. I didn't realize the issue until someone added me to a clan they knew had it, and I used the relay browser to actually see the list for myself.
 
I'm not sure what you're asking, since I don't seem to be able to drink speakeasy drinks through the KoL chat, and when using the relay browser it simply grays out all the "Drink!" buttons if you're at your limit. I tried working together a /goto that would attempt to drink one, but couldn't get anything other than "Huh?" out of it.
 

Darzil

Developer
Ok, in that case we'll have to work it out via setting debug logging, then trying to drink. Basically we need to be able to work out which failure is the true failure from the response. If I remember I'll change my diet today to involve 3 Speakeasy drinks and do some clan changing.
 

Terion

Member
It's possible that "Huh?" is the response to both those situations; the wiki just shows "Huh?" for "Attempting to purchase an invalid drink or a drink that does not exist". But, as I couldn't figure out how to alter a URL or use /goto to force an unallowed drink attempt yesterday, I'll leave that to more capable fingers.

The solution may be to base the error off of what Mafia knows about the state of your clan's Speakeasy (which it checks when you log in or change clans, so it won't know if someone's unlocked a drink while you were in-clan, but how often does that happen?) It should know if the drink wasn't shown when it checked the speakeasy; if it thinks it's available, then a failure is likely due to already having had three drinks.
 
Would it be simpler to just store a variable for how many speakeasy drinks a character has had that day? That would leave the edge case of someone drinking without mafia then doing stuff in mafia, but it's probably ok since 'doing stuff outside of mafia' isn't really your job to cover.
 

Veracity

Developer
Staff member
'doing stuff outside of mafia' isn't really your job to cover.
It is one of our goals to detect and correct for such activity, however. So:

- save a setting with how many speakeasy drinks we have seen you drink today and save a server hit by refusing to drink a 4th one
- but also, detect when we think you have a drink available but KoL thinks you've reached your limit - and set "drinks drunk today" to 3 to save future server hits

That's how we do it in many many other places.
 

Darzil

Developer
Ok, I think I misunderstood, and I think I see the issue. In RestaurantCommand.java we check if the drink is available, and then we check if you've already drunk three drinks. However, if we have had three drinks, no drink is available. Swapping the order of the two should sort the issue. Will do this later.
 
Top