Bug - Not A Bug r16958 - No Item, Skill, Store managers

Darzil

Developer
Uploading picture of side-by-side comparison of the nonworking r16959 file and the working r16957 file, from the file properties. I deleted the nonworking r16958, so if you want a comparison with that one, you'll have to wait 2 hours for me to download it.
You do have the slowest download speed I've heard of in years. A 12 MB download is taking 2 hours? That's 1.75 kbps. Slower than a 90's modem.
 

xKiv

Active member
since it's a 1-2 hour download on my internet connection.

Owie. Presumably, you can't download somewhere else and carry on a stick drive?

In a case like this, it might be a good idea to set up a development environment (jdk, ant/eclipse, some svn client) and learn how to make your own builds. Incremental updates from svn are only like a few hundred KB, and you would have an automatic verification of the download's consistency (badly downloaded code almost definitely won't compile). The biggest downside to this is the big size of the aforementioned development tools.
(the build process itself should be just a matter of knowing which 7 things to click on, you don't have to understand java code at all)


You do have the slowest download speed I've heard of in years. A 12 MB download is taking 2 hours? That's 1.75 kbps. Slower than a 90's modem.

Faster than a basic GPRS cell phone connection here, without data package bought. (i.e. I can get about 0.5 kbps "for free", included with the cheap voice service I have)
 

VladYvhuce

Member
You do have the slowest download speed I've heard of in years. A 12 MB download is taking 2 hours? That's 1.75 kbps. Slower than a 90's modem.
1: I live out in the sticks.
2: I don't have a credit card.
3: Any high-speed internet services that service the area require credit cards and will cost more than I make per month.
4: Thus, I'm stuck with basic dial-up on poor quality phone lines.

Owie. Presumably, you can't download somewhere else and carry on a stick drive?
Not an option. No one I know will want me coming into their house at 10 pm.

In a case like this, it might be a good idea to set up a development environment (jdk, ant/eclipse, some svn client) and learn how to make your own builds. Incremental updates from svn are only like a few hundred KB, and you would have an automatic verification of the download's consistency (badly downloaded code almost definitely won't compile). The biggest downside to this is the big size of the aforementioned development tools.
(the build process itself should be just a matter of knowing which 7 things to click on, you don't have to understand java code at all)
I may look into this, if the problem persists. Usually, the downloads work right the first time.
 

Theraze

Active member
(the build process itself should be just a matter of knowing which 7 things to click on, you don't have to understand java code at all)

cd \kolmafia
ant update & ant
cd <mafiafolder>
copy /y \kolmafia\dist\kol[tab] <either . or standard mafia filename>
javaw -jar <jarfile>

No clicking required. Can be done as a simple batch file if preferred. Really not difficult. Course I prefer the command prompt over GUI, so there's that.
 

xKiv

Active member
Or that.
(or even have *everything* automated to the point where you just come home to an already built and started mafia (I don't do this))

I am mostly used to running things from an IDE (with immediate debugging available)
 

fronobulax

Developer
Staff member
FWIW, I got something very similar this morning with a jar I build locally. But I haven't parsed the log to see what might have happened and logging out and logging in resolved the problem.
 

VladYvhuce

Member
cd \kolmafia
ant update & ant
cd <mafiafolder>
copy /y \kolmafia\dist\kol[tab] <either . or standard mafia filename>
javaw -jar <jarfile>

No clicking required. Can be done as a simple batch file if preferred. Really not difficult. Course I prefer the command prompt over GUI, so there's that.
Or that.
(or even have *everything* automated to the point where you just come home to an already built and started mafia (I don't do this))

I am mostly used to running things from an IDE (with immediate debugging available)
OK... Now you people are taking WAY over my head.... I have no idea what 97% of all of that means.
 

xKiv

Active member
OK... Now you people are taking WAY over my head.... I have no idea what 97% of all of that means.

I suppose it's the kind of thing that's best learnt by doing. Once you see not just the (partial) instructions, but also what's happening at each step, it's easier.
 

VladYvhuce

Member
I know what a command prompt and a GUI are. The rest of the stuff mentioned is technobabble, to me.
Question 1: What exactly is a "batch file"? I've heard of the term, but no one's ever explained that to me.
Question 2: What does all of this stuff
cd \kolmafia
ant update & ant
cd <mafiafolder>
copy /y \kolmafia\dist\kol[tab] <either . or standard mafia filename>
javaw -jar <jarfile>
mean?
Question 3: What's an "IDE"?
 

Darzil

Developer
Answer 1 - A batch file is a sequence of command prompt commands, that can be run together.
Answer 2 - This is a batch file, it does : Change to directory kolmafia on the current drive (where presumably the build files sit). Update ant (a Java compiler), run ant (which compiles the build files into a jar file). Change to directory you run mafia from. Copy the compiled jar file from the build file location to the directory you run mafia from. Run java using the mafia jar file.
Answer 3 - A development environment, in this case for Java. Ant works file to compile mafia, but if you were making changes to it, being able to pause mafia and check internal variables at any time makes it a lot easier to make code work. I probably use an IDE for 10-20% of changes I commit.
 

xKiv

Active member
#1 - the most common purpose of a batch file is "I keep running this exact sequence of commands quite often, let's make a shortcut that will run them for me"
On windows, batch files have the extension .bat or .cmd; other systems have different conventions.
They are usually just literally the same commands you would use on a command prompt, in a text file, one on a line. They can also use some control flow commands (if/then, ...).


#2 - I think I should mention that this is more of a template for commands to run, rather than a complete batch file
- for one, you probably shouldn't put mafia's source code directly in the root directory (for most windows people, \kolmafia will be the same as c:\kolmafia); so you are expected to substitute the directory where the sources really are on your computer

- Ant is a program used to automate some developer/programmer tasks; somebody writes rules in a file (build.xml) and then ant knows how to do things.
Specifically with mafia's configuration:
-- "ant update" = get the newest kolmafia sources (from sourceforge's svn repository, which is where mafia's developers put it)
-- "ant" = does the default thing, which is "build the .jar file"
-- "&" on windows, "cmd1 & cmd2" means "run cmd1; stop if it failed, otherwise run cmd2" (on other systems it means other things; for example on unix it means "run cmd1 in the background, and meanwhile run cmd2" , which isn't what you want here)

- <something> - this is how we sometimes indicate "placeholders" - you would not literally type "cd <mafiafolder>", you would substitute your own choice of folder
-- this is obvious to some, but not to all: <mafiafolder> is the folder where you will be running the program; on windows this means that all the settings, scripts, logs, ... will be there (you already have this folder, it's the folder from which you are running the downloaded .jar file)
-- so for example this could actually be cd c:\games\kolmafia

(note that all these \ characters are backslashes, even though they look like pipe characters to me in this browser)

- copy /y \kolmafia\dist\kol[tab] <either . or standard mafia filename>
-- again, \kolmafia is the same folder where you put kolmafia's source, so use the same value as in the "cd" command for this part (but you still have to continue with \dist\kol)
-- [tab] is where you press the TAB key on your keyboard - this will "autocomplete", i.e. the command prompt will fill in the rest of the name (and it will even be correct, if there's only one possibility; on windows, you can press TAB multiple times to cycle through possibilities, other systems have different ways). This does not work in a batch file, you have to specify the full path explicitly ... or use wildacrds:
-- copy /y \kolmafia\dist\kol*.jar kolmafia.jar
---- note: this wouldn't work if there were several different .jar files in the dist folder - the copy command would take them all and paste them all right one after another, creating an invalid .jar file; but mafia's ant is configured to empty the dist folder before building, so there will only be one
-- the <. or standard mafia filename> placeholder asks you to choose: if you use ".", it will copy the entire name of the built .jar file, which will eventually change (the one I built just now on this machine is KolMafia-17.3.jar), and when it does change, you would have to change the last line of the batch file to run the new .jar
or you can use a non-changing name of your own choice (my choice here is "kolmafia.jar")

- javaw -jar <jarfile>
-- <jarfile> is placeholder for the file created by the previous "copy" command; so in my case it would just be "kolmafia.jar"
-- the "-jar" parameter is important. Without it, java will *not* understand that you want it to run a .jar file, it would try to do something very different, look for a different file, not find it, and complain (and the error message can be confusing)
-- javaw is one of java's way to run java programs - this one runs "in a windowed mode", which means that it won't tell you what went wrong when inevitably something goes wrong; on the other hand, it won't make you keep a command prompt window open (the command prompt is where you can see some thing that go wrong ... and some that go right)
(I would use "java -jar kolmafia.jar", at least until I was sure that everything works)
 

VladYvhuce

Member
Thanks for the clarification. This will indeed come in handy when I'm more confident in my ability to handle things this way.
 

Theraze

Active member
- for one, you probably shouldn't put mafia's source code directly in the root directory (for most windows people, \kolmafia will be the same as c:\kolmafia); so you are expected to substitute the directory where the sources really are on your computer

On some earlier version of TortoiseSVN, it used to note the entire path when generating patch files. That was nasty. I hope it doesn't happen anymore. I haven't really submitted many patch files since KoL added develling spoilers to not give mafia users an advantage after my devel tracking code was finally ready for primetime years ago. :) But that's why my mafia code folder lives on the root. It's also easy to just grant full/modify rights to that one folder and ignore it forevermore.
 
Top