Need help finding my way around the source files

Winterbay

Active member
I think I may have found an oddity in Mafia, but before I go and make a report I'd like to see if this is intended behaviour. In order to do this I'd like to look at the code (I mean I could ask but it's a lot more fun finding out for oneself), but I have no idea how I shall find what where.

As far as I can see there is no way to search in the code via Sourceforge. Is this correct? If not, where is that feature?
I have the code on my computer, but I can't seem to find what I'm looking for with my limited knowledge.

So, can anyone tell me where the code that autocreates things (badass belt, talisman o nam and so on) is located?

Edit: I think I found it in ResultProcessor.java and I can't see any reason for my problem.

So: Is there any circumstance under which Mafia would not auto-create the badass belt? The last two ascensions I've done I've had to make it myself since the parts just sit in my inventory.
 
Last edited:

Veracity

Developer
Staff member
session/ResultProcessor.java.
Look in ResultProcessor.gainItem() and see the calls to ResultProcessor.autoCreate().
 

Winterbay

Active member
Any chance you've disabled the "autoCraft" preference? That's listed in there...

Yep, apparently so. I wonder how that happened. Good thing I didn't make a bug report then :)

Also, I did look in the code for preferences that might control that but forgot to actually check the autoCreate-function...
 

Theraze

Active member
findstr /s /i /c:"<phrase>" *.java
is what I often use. When I'm not going back to Norton Utilities Text Search. But that's not really supported well in anything newer than Windows 3.1, though I still like it.

Anyways, dissecting that... /s means to check subdirectories, /i means case insensitive (so your capitalization doesn't need to be quite as precise), /c means you're searching for a phrase.
 

Winterbay

Active member
To search mafia code I use Windows Grep.

Yep, I remembered that you had linked to that in an earlier thread and that was what made me actually able to find the part when I did find it.

is what I often use. When I'm not going back to Norton Utilities Text Search. But that's not really supported well in anything newer than Windows 3.1, though I still like it.

Anyways, dissecting that... /s means to check subdirectories, /i means case insensitive (so your capitalization doesn't need to be quite as precise), /c means you're searching for a phrase.

I tried that first, didn't work for some reason. It just stood there doing nothing.

That's probably the best advertisement for Windows7 I've heard. I'm still using Windows XP.

I'm going to upgrade when I get a new computer, not before then since there us really no need.
 

Theraze

Active member
It doesn't work if you forget to give it text to search through... if you just do
findstr /i /s /c:"something"
it will wait for you to finish giving it the text to search through, because it figures that you want to type it all out. If you do it with the *.java at the end, it should be fine... note that unlike many Windows commands, order does matter. :)
 

Winterbay

Active member
Very possible, but I must say I like the wingrep-route more. It has a proper window to type things into and everything :)
 

Winterbay

Active member
You should switch to something Unix-based. Then you don't even need an external program for grep!

But then you would have to run a windows emulator to play most games and that is annoying and prone to errors... Also, command line systems are a lot more frustrating than non-command line based ones, especially if you don't know all the commands and how to use them.
 

roippi

Developer
You should switch to something Unix-based. Then you don't even need an external program for grep!

Developing on *nix -is- a lot of fun. I love piping things between head, tail, cut, grep, sed, cat, less.

Alas, I need windows for other stuff.
 

Veracity

Developer
Staff member
Mac OS X is Unix-based. That doesn't change your "windows emulator" comment, but it nullifies your "command line system vs.non-command line system" comment.
 

roippi

Developer
Mac OS X is Unix-based. That doesn't change your "windows emulator" comment, but it nullifies your "command line system vs.non-command line system" comment.

Heck, even with ubuntu nowadays you don't ever need to see a CLI if you don't want to.
 

Winterbay

Active member
Mac OS X is Unix-based. That doesn't change your "windows emulator" comment, but it nullifies your "command line system vs.non-command line system" comment.

That is true, it instead adds my incredible loathing of anything Apple-based :)
I really hate the Mac and assorted iProduct interfaces and have never been able to understand what people like so much about them, they just annoy me until I walk away in frustration.
 

Veracity

Developer
Staff member
That is true, it instead adds my incredible loathing of anything Apple-based :)
I really hate the Mac and assorted iProduct interfaces and have never been able to understand what people like so much about them, they just annoy me until I walk away in frustration.
What a bizarre statement. Why did you decide to turn this into an "operating system war"? You just annoyed ME so much that I may just add you to my ignore list and let other people help you when you need help.

Sheesh.
 

Winterbay

Active member
What a bizarre statement. Why did you decide to turn this into an "operating system war"? You just annoyed ME so much that I may just add you to my ignore list and let other people help you when you need help.

Sheesh.

Sorry, it was not meant to be anything like that. It was a statement of my opinion, which I stand for. Everyone else is entitled to use whatever operating system they like, as long as I have the option to not use an Apple product...
I generally stay out of OS wars due to the fact that they are totally pointless...
 

fronobulax

Developer
Staff member
Given that games and work require me to run Windows on the hardware I have found that Cygwin or running a Linux [URL="http://www.vmware.com/products/server/overview.html]virtual machinel[/URL] with shared directories give me the tools I want for KoLmafia and other projects. Since what started this was a request for a search command I should note that most IDEs have very good ways to search source.
 
Top