Bug - Fixed gCLI use of csend misleading, session logging not human readable.

DoctorRotelle

Developer
"csend 1 meat to kolabuff" actually sends 1125 meat. No warning of any sort. The gCLI-log only shows:

> csend 1 meat to kolabuff
Sending kmail to kolabuff...
Message sent to kolabuff

Requested buff with a duration of 15 adv becomes a buff with duration of 300 adv. Using the GUI interface for the buffbots does bypass this odd switching activity. I certainly didn't need 300 adv of ode.

(Note: sell, send & csend could all do with explicit cli-logging of activities in the same way it appears in the sessionlogs. The lack of explicit details in just the gCLI requires one to check the session log to verify a desired action has actually happened, as expected. Sessionlogs could do with some cleanup mechanism to convert sendmessage.php?action=send&towho=1061817&message=Keep+the+contents+of+this+message+top-sekrit%2C+ultra+hush-hush.&sendmeat=1125&whichitem1=0&howmany1=1125 to something human readable.)

I know the first impression of this "bug report" is that hola made the non-philanthropic buffs do this... long ago. I just highly doubt bait-and-switch was the intent. With the loss of KoB, more and more issues will arise from this "feature". When the GUI interface for the buffbots was hanging, I'm sure lots of folks only had the option to use csend or KoL kmails in the relay browser.

If the documentation were amended to include the "price switching" mechanism, I'd be less apt to call it a "bug". As it stands, the help appears to be the same as for send, and thus no longer reflects the actual usage.

> help send
csend item [, item]... to recipient [ || message ] - send kmail
kmail item [, item]... to recipient [ || message ] - send kmail
send item [, item]... to recipient [ || message ] - send kmail

> send 1 meat to kolabuff
Please use 'csend' if you need to transfer meat.
 
Yeah.. That always did bother me. I understand why it's in there, but it still seems.. dumb? perhaps.

Especially since a lot of high level buffbots actually profit even off of the philanthropic buffs posted for 1-25 Meat in their profiles.

As for making the session log stuff human readable, it's encoded in URL format. So just throw it through a standard URL Decoder (like exists in the Java library) to see what it says.
 

DoctorRotelle

Developer
The URL shows in the session log (text file) only. The gCLI log shows nothing useful beyond "Message sent to"... It is the gCLI I am looking at when using gCLI commands (ie: "csend 1 meat to kolabuff"), though. Not tailing the log file in the sessions folder. I'm actually smart enough to read URL's that are present. I just thought it'd be nice to have info. Had the gCLI responded with "Sending 1125 meat to kolabuff..." I'd have been a lot more aware of what was going on and stopped the practice.
 

Bale

Minion
It would be nice if mafia alerted the user to the fact that it was sending over 1000 times the desired amount of meat. Or else if it just refused with an error message informing that philanthropic buffs may not be automated. Actually, I prefer the error message.

Doing something other than what was requested without even a notification is just screwy.
 

Grotfang

Developer
Quick perusal of the code suggests that it differentiates based on numbers of turns too. Any buff longer than 300 turns is considered to be non-philanthropic. The others are judged on a "closest match" basis. An abort may be inappropriate here, since it is quicker (and simpler to remember) buffs based on smaller integer values that follow a sensible sequence. However, a printed line would make sense.

Thoroughly untested, but would adding:

Code:
KoLmafia.updateDisplay( "Philanthropic request of " + amount + " meat changed to " + bestMatch.getPrice() + " meat." );

To line 227 of BuffBotDatabase.java (kolmafia\src\net\sourceforge\kolmafia\persistence\BuffBotDatabase.java) solve this issue?
 

jasonharper

Developer
r8535 adds a message when csend de-philanthropizes a buff request, as Grotfang suggested but with a bit more detail.
 

Zaranthos

Member
SendMessageCommand.java

remove this line:
meatAmount = BuffBotDatabase.getOffering( recipient, meatAmount );

Sorry, I know at least one developer will hate me for this but I've hated that code from day one and I run a buffbot. With more buffbots than ever before the reason for this code is obsolete. It can be bypassed by users with the relay browser anyway. It can stay in the public builds but I remove it from mine.
 

slyz

Developer
Sorry, I know at least one developer will hate me for this
It's not really a matter of a dev hating you, it's just that only users comfortable enough with code to modify and compile Mafia will do this, and they would have figured it out by themselves anyway if they wanted to avoid it.
 
Top