Bug - Fixed The warProgress property is only changed when viewing the Island with relay browser

Theraze

Active member
I'd normally mark this as a Feature, but since coinmasters use this property, I think it qualifies as a bug.

Basically, when you finish the war, mafia doesn't mark the war as done unless you look at the island in the relay browser again manually. Since I usually click on the council link, mafia often gets confused about whether or not the war is continuing, sometimes well into aftercore. :) Finally decided to track through this, and it appears that warProgress only gets set to unstarted (in ValhallaManager) and all other setting is done as a part of webui/IslandDecorator.

Mafia should mark the war as finished when the Man or Big Lebowski are defeated. The choice adventure that starts the war should mark the war as started. By having these as the war started/finished points, it should detect both through relay browser play as well as through automated adventuring, and coinmasters and zones should be properly marked as available.
 

Theraze

Active member
Track opening and finishing the Island War

The problem occurs because apparently mafia either can't or doesn't recognize that the war has started until you actually adventure in the battlefield, or (as I just found out) you visit the island in the relay browser. So, it seems this isn't a problem with CC but only happened because of the way mafia tracks the status of the war.

Mafia does most of its tracking of war stats in the relay decorator, which means that when you finish the war, it's not really finished until after you open the relay browser and look at the island. It's caused some... odd results for me in the past. Just note that since some things are tracked in relay, that often visiting stuff in the browser will magically make problems go away. :)

In this case, it could/should start the war when you take the appropriate choice option to do so. It can't assume that you started the war while in KoLmafia, so it checks when you visit in the relay browser, but if it actually WATCHES you start the war, there should be no problem.

I suggest a bug report.

So the two parts to this would be, when getting the choice adventure that starts the war and choosing to begin, mark the war as started. When you finish killing the Man or Wisniewski, mark the war as finished.
 

Bale

Minion
I just needed to check get_property("questL12War") == "unstarted" to solve the problem.

Should this really just duplicate functionality?
 
Last edited:

Theraze

Active member
If you can get find_demons, safetower, UR, Wossname, and anything else that uses warProgress from before questL12War existed to update, then you could depreciate warProgress. Until warProgress is removed though, it should probably be right if we can do it relatively easily, not just updated when we visit in the relay browser.
 

Veracity

Developer
Staff member
Near as I can tell, both settings - questL12War and warProgress are already set when you beat the war boss. The choice adventure to start the war was setting only the first one.

Revision 12970

It also is a major refactoring of the code to handle the Big Island, both during and after the war:

IslandManager maintains the state of the island
IslandRequest handles making request of the NPCs on the island
IslandDecorator does the Relay Browser decorations.

IslandArenaRequest and PyroRequest are no more; they use IslandRequest to interact with the arena and the lighthouse keeper. IslandRequest also interacts with the farmer and the nunnery for the breakfast and nuns command, rather than forcing those commands to go to GenericRequest.

It was pretty much just moving existing code around but it wouldn't surprise me if I introduced bugs. And I know that there is (still) unnecessary logging when you simply visit a location on the island. I'll fix that, by and by.
 

Fluxxdog

Active member
Found one bug. Fighting as a frat boy and I'm getting this after doing 4 frat boy side quests:
Code:
1 hippy defeated; 195 down, 805 left.
A streaking frat boy runs past a nearby funk of hippies. One look at him makes the hippies have to go ponder their previous belief that the naked human body is a beautiful, wholesome thing.
My count is really boned. Eh, wasn't going for the Wossname, but considering we get alerts for access and war heroes, probably a big deal. I captured a debug log if it helps.
 

Attachments

  • DEBUG_20131027.zip
    242.6 KB · Views: 43

Fluxxdog

Active member
I may have another one. Clicked the button in Daily Deeds and noticed it didn't grey out afterward.
Code:
> concert Elvish

Visiting the Mysterious Island Arena...
You acquire an effect: Elvish (duration: 20 Adventures)
A music lover is you.

> concert Elvish

Visiting the Mysterious Island Arena...
You can only visit the Mysterious Island Arena once a day.
Still clickable.
 

ungawa

Member
Found one bug. Fighting as a frat boy and I'm getting this after doing 4 frat boy side quests:
Code:
1 hippy defeated; 195 down, 805 left.
A streaking frat boy runs past a nearby funk of hippies. One look at him makes the hippies have to go ponder their previous belief that the naked human body is a beautiful, wholesome thing.
My count is really boned. Eh, wasn't going for the Wossname, but considering we get alerts for access and war heroes, probably a big deal. I captured a debug log if it helps.

I'm seeing the same behavior as Fluxxdog. I'm running r12972.

Also, after the first time I visited the lighthouse after starting the war, it was marked with an "F" when I returned to the Island map, even though I hadn't fought any lobterfrogmen.
 

Veracity

Developer
Staff member
Found one bug. Fighting as a frat boy and I'm getting this after doing 4 frat boy side quests:
What do you have for the following:

get sidequestArenaCompleted
get sidequestFarmCompleted
get sidequestJunkyardCompleted
get sidequestLighthouseCompleted
get sidequestNunsCompleted
get sidequestOrchardCompleted

I may have another one. Clicked the button in Daily Deeds and noticed it didn't grey out afterward.
Easily fixed. Will submit soon.
 

ungawa

Member
What do you have for the following:

get sidequestArenaCompleted
get sidequestFarmCompleted
get sidequestJunkyardCompleted
get sidequestLighthouseCompleted
get sidequestNunsCompleted
get sidequestOrchardCompleted

I didn't do the farm and it returns "none". I did the other 5 quests and they return "fratboy" and are marked with a red "F". The comment at the end of combat still only thought 1 hippy had been defeated.
 

Veracity

Developer
Staff member
Also, after the first time I visited the lighthouse after starting the war, it was marked with an "F" when I returned to the Island map, even though I hadn't fought any lobterfrogmen.
Revision 12974 fixes this.
 

Veracity

Developer
Staff member
Revision 12976 hopefully fixes the bugs I introduced by converting certain indexOf() calls incorrectly to contains() calls. In other words, indexOf() == -1 needs to go to !contains(), not to contains().
Sorry for the inconvenience.
 
Last edited:

Veracity

Developer
Staff member
You can do either indexOf() or contains() on a String, but a StringBuffer only allows indexOf.
For that matter, sometimes you really do need the index, to decide where to insert something, say.

It is ( indexOf() != -1) and (indexOf() == -1) for Strings that are being changed to contains() or !contains(), respectively.
 

lostcalpolydude

Developer
Staff member
Java 1.4 didn't support contains(), so it wasn't an option in mafia until about a year ago (it's probably been longer than that, I don't really know any more). It isn't worth going through everything just to change stuff like that, but when the code is already open, and you have to read it and understand it anyway, it makes sense to update it to be clearer.
 
Top