Looks alright, definitely not the way I would've done it. Might be worth revising later with cleaner code (ie. no matcher) but otherwise I'd say if it works, it works.
Hiya folks. My first post in the forum. I've been following the problem today, and I got the patch file you prepared, but I am not sure how to apply it. Could you point me in the right direction (my search efforts only returned instructions on how NOT to patch KolMafia during Crimbo). Thanks...
No need, http://builds.kolmafia.us/ will soon have 11172. If you want to know how to deal with patches for general use, you first need to follow the directions on the wiki to have a setup where a patch can be applied.
Ah? out of curiosity, how come? I'm not a java developer at all, so happy to learn better ways. I figured the pattern matching was more "future proof", although to be fair, the format of a HTTP cookie is standard. I.e., if the kol devs do go and send the cookies on one line, then it's a relatively simple tweak to the pattern to match multiple groups and be done.
Revision 11172.
I am not happy about how this was handled - a server-side change dumped on us a few minutes after rollover with no advance warning whatsoever. It feels like a kick in the stomach. It was incredibly discourteous and exactly the way I have NOT come to expect CDM to treat me.
I better go to bed before I say something incredibly discourteous.
I believe this was unintentional.
I am not happy about how this was handled - a server-side change dumped on us a few minutes after rollover with no advance warning whatsoever. It feels like a kick in the stomach. It was incredibly discourteous and exactly the way I have NOT come to expect CDM to treat me.
Thanks IronTetsubo. Today you get to be the hero.
On the main forum Pantsless says that CDM hadn't anticipated the damage to mafia. Maybe CDM really just assumed that mafia was robust enough to handle the cookie change.
I don't know why, either.I would've future proofed it by handling all cookies (I don't know why we drop the path cookie anyway).
if ( !cookie.startsWith( "appserver" ) && !cookie.startsWith( "PHPSESSID" ) )
{
continue;
}
int semi = cookie.indexOf( ";" );
if ( semi != -1 )
{
cookie = cookie.substring( 0, semi );
}
I've been following this minisaga, and it was fascinating as a non-programmer to get a peek behind the scenes. And thanks so much for the quick fix!
I don't know why, either.
We could remove the following lines:
To make it use every cookie, including "path" which is glommed onto the PHPSESSID.Code:if ( !cookie.startsWith( "appserver" ) && !cookie.startsWith( "PHPSESSID" ) ) { continue; } int semi = cookie.indexOf( ";" ); if ( semi != -1 ) { cookie = cookie.substring( 0, semi ); }