• Welcome to Valhalla Legends Archive.
 

Icons.bni

Started by Camel, August 20, 2007, 12:49 PM

Previous topic - Next topic

Camel

A couple of months ago, I implemented icons.bni reading. It was hundreds of times easier than I thought it would be to implement, and now I'm disgusted by bots that don't do it.

http://bnubot.googlecode.com/svn/trunk/BNUBot/src/net/bnubot/bot/gui/icons/IconsDotBniReader.java

Hdx

http://www.x86labs.org/forum/index.php/topic,9269.0.html
I got lazy and never finished support for other tga formats.
But ya, it's easy.
~Hdx

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Camel

I like my code better because it isn't rittled with warnings. :)

Other than that, it looks like your solution is very similar to mine, from a glance.

Hdx

Warnings? My code compiles on 1.6.0 without any warnings. I haven't bothered to try it on any other vers because I was lazy when I wrote it.
But ya, there basically the same.
~Hdx

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Camel

For starters, ArrayLists should be parametarized.

ArrayList x = new ArrayList();

Will cause a warning, at least in Java 1.5.

ArrayList<Object> x = new ArrayList<Object>();

Don't even get me started on the warnings in JBLS. :P

Hdx

#5
QuoteC:\Documents and Settings\Hdx\Desktop\Crap\Coding\JBLS>..\jdk1.6.0\bin\javac -cp .;./JBLS .\JBLS\Main.java .\JBLS\util\*.java .\JBLS\BNLSProtocol\*.java .\JBLS\Hashing\*.java .\JBLS\HTTP\*.java
C:\Documents and Settings\Hdx\Desktop\Crap\Coding\JBLS>
No warnings in JBLS, I pride myself on that, so yes, get started.

You're code has warnings as well, you just suppress them (from first glance):
@SuppressWarnings("serial")
~Hdx

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Camel

#6
Serial warnings are the only ones I suppress except for maybe one or two cases where I felt justified for some reason there as well, and I do that instead of specifying a serial id because those classes will never, ever be serialized.

There are 17 warnings in my workspace, all of them come from JBLS. There used to be more - 23 to be exact - but a few of them were simply poor Java style, so I fixed them. Perhaps you just have your warnings turned down below the defaults.

I don't want to bash your code, but there are a number of things that I would consider to be wrong with it. For example, you don't have your own unique package root. What will you do if you need to link in another tool that has a fully qualified class name collision with yours? Not likely, since JBLS is the only project I've ever seen that does this, but still, you should refactor everything to org.jbls. In the interest of keeping the thread civil, I'll stop here. :D

[edit] I'm using Java 5, not 6

Camel

Just compiled both projects against Java 6, same 17 warnings.

Hdx

#8
naw this is what the forum is here for.
if your main complaint is my coding habits, then just skip over it.
I'm pretty sure I don't have the warnings disabled by default as if I deliberately do something that would issue a warning (hashtables for example) it does so.

As for the namespace. to be honest.. I don't really like it. JBLS was built to be stand alone. not use in other projects. I actually have a core package (Hdx.IRC.*, Hdx.BNCS.*. Hdx.utils.*, etc.. etc.. depends on what I am making)
I have seen many projects that do not use a root package. Never seen a collision.
I don't make things that the stupid should use :P (they can, and many do, but still)

I'll find a java 4/5 workspace somewhere to test with (mind uploading the JSDK5 as a .zip for me? c:\program files\java\jsdk1.5.0_11\). But just for a note, JBLS has been built against 1.6.0_01 since 2.8.
Hehe, anyways, take advantage of the situation, I'm in a really good mood, My best friend is coming back into town for a few days!

Camel., quote me the warnings, because the screen shot is annoyingly small. Anyways, you're using an outdated version of JBLS, JBLS\Admin no linger exists.

Thats the problem with using things I make in your projects. I'm ever changing them. Especially JBLS
~Hdx

[edit] Just built 3.1 against 4.2, 5 and 6. No errors/warnings.
~Hdx

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Camel

Create a Google Code project, and host your code there.  Or, at least, get your CVS server back up, or publish its address if it is up.

I can't give you a Windows JVM because I'm using Linux. You don't need an old JVM anyways, just compile your code in compatibility mode for the release you want.

While you're at it, just go download Eclipse. I don't care what you're using; I've seen them all. Eclipse wins, period. Sure, it's an opinion, but it's the correct opinion to have. :D

Camel

Severity and Description Path Resource Location Creation Time Id
The field InPacketBuffer.pLength is never read locally JBLS/BNLSProtocol InPacketBuffer.java line 27 1187671672227 4006
The local variable bannerExt is never read JBLS/util BNFTP.java line 66 1187671670804 4000
The local variable bannerID is never read JBLS/util BNFTP.java line 65 1187671670803 3999
The local variable contents is never read JBLS/Admin AdminList.java line 19 1187671673060 4013
The local variable contents is never read JBLS/BNLSProtocol BNLSlist.java line 23 1187671672273 4007
The local variable padNumber is never read JBLS/Hashing BrokenSHA1.java line 52 1187671671976 4003
The local variable ret is never read JBLS/Hashing BrokenSHA1.java line 23 1187671671976 4002
The local variable sName is never read JBLS/util BNFTP.java line 68 1187671670804 4001
The local variable verHash is never read JBLS/Admin AdminParse.java line 159 1187671673027 4010
The method GetPath(String) from the type AdminParse is never used locally JBLS/Admin AdminParse.java line 281 1187671673028 4012
The method hex(int) from the type HTTPParse is never used locally JBLS/HTTP HTTPParse.java line 363 1187671672190 4005
The method sendHashFile(String, String[]) from the type HTTPParse is never used locally JBLS/HTTP HTTPParse.java line 284 1187671672189 4004
The static method Broadcast(String, String) from the type BNLSServer should be accessed in a static way JBLS/Admin AdminParse.java line 136 1187671673026 4008
The static method destroyAllConnections() from the type BNLSServer should be accessed in a static way JBLS/Admin AdminParse.java line 140 1187671673027 4009
The static method destroyAllConnections() from the type BNLSServer should be accessed in a static way JBLS/Admin AdminParse.java line 268 1187671673028 4011
The static method destroyAllConnections() from the type BNLSServer should be accessed in a static way JBLS/util Controller.java line 33 1187671670581 3997
This method has a constructor name JBLS/util BNFTP.java line 15 1187671670802 3998

Hdx

ssh -> vim ftw
I compile in compatibility mode, But i'm still not getting any of these warnings you speak of. (I looked at each of those lines in your SS, they were either completely gone or changed)
And I don't like using a CVS, mainly because i'm the only one working on it. And i use my jump drive for it so I never need a CVS. :P

I've tried all the JVMs 4.2-6 on both windows and linux. So I have to go with: you're using a way old version of JBLS, before I gave a shit how it compiled as long as it worked.

Also, breaking tables + double posting is EWWWWWWWWWWWWWWWWW
So, fix the table breakin, update to JBLS 3.0 and try again.
~Hdx

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Camel

I don't see any broken tables. Maybe your browser sucks?

Where are you hosting JBLS? I don't see any links on your website to download it like there used to be.

Hdx

Yes.. Firefox does suck.....
Actually I'm using the dark blue theam of the forum which does not automatically wrap long code boxes.
It's a theam problem not a browser problem.  But this is the only theam I like, so it's staying.
http://jbls.org/downloads/JBLS.jar
same place it's always been.
~Hdx

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Camel

Increase your screen resolution. :D

Just imported your new code. Now there are 88 warnings.

Seriously, I would strongly suggest using Eclipse.

Severity and Description Path Resource Location Creation Time Id
The field BNLSParse.BNLS_RESERVED0 is never read locally JBLS/BNLSProtocol BNLSParse.java line 71 1187675579565 4155
The field BNLSParse.BNLS_RESERVED1 is never read locally JBLS/BNLSProtocol BNLSParse.java line 72 1187675579565 4156
The field BNLSParse.BNLS_RESERVED2 is never read locally JBLS/BNLSProtocol BNLSParse.java line 73 1187675579565 4157
The field BNLSParse.BNLS_RESERVED3 is never read locally JBLS/BNLSProtocol BNLSParse.java line 75 1187675579566 4158
The field BNLSParse.BNLSUsername is never read locally JBLS/BNLSProtocol BNLSParse.java line 34 1187675579564 4154
The field BNLSParse.PRODUCT_BROODWAR is never read locally JBLS/BNLSProtocol BNLSParse.java line 80 1187675579566 4160
The field BNLSParse.PRODUCT_DIABLO is never read locally JBLS/BNLSProtocol BNLSParse.java line 87 1187675579569 4167
The field BNLSParse.PRODUCT_DIABLO2 is never read locally JBLS/BNLSProtocol BNLSParse.java line 82 1187675579567 4162
The field BNLSParse.PRODUCT_DIABLOSHAREWARE is never read locally JBLS/BNLSProtocol BNLSParse.java line 88 1187675579569 4168
The field BNLSParse.PRODUCT_JAPANSTARCRAFT is never read locally JBLS/BNLSProtocol BNLSParse.java line 84 1187675579568 4164
The field BNLSParse.PRODUCT_LORDOFDESTRUCTION is never read locally JBLS/BNLSProtocol BNLSParse.java line 83 1187675579567 4163
The field BNLSParse.PRODUCT_STARCRAFT is never read locally JBLS/BNLSProtocol BNLSParse.java line 79 1187675579566 4159
The field BNLSParse.PRODUCT_STARCRAFTSHAREWARE is never read locally JBLS/BNLSProtocol BNLSParse.java line 89 1187675579569 4169
The field BNLSParse.PRODUCT_THEFROZENTHRONE is never read locally JBLS/BNLSProtocol BNLSParse.java line 86 1187675579568 4166
The field BNLSParse.PRODUCT_WAR2BNE is never read locally JBLS/BNLSProtocol BNLSParse.java line 81 1187675579567 4161
The field BNLSParse.PRODUCT_WARCRAFT3 is never read locally JBLS/BNLSProtocol BNLSParse.java line 85 1187675579568 4165
The field BotNet.PACKET_BROADCASTMESSAGE is never read locally JBLS/util BotNet.java line 29 1187675581299 4214
The field BotNet.PACKET_CHATDROPOPTIONS is never read locally JBLS/util BotNet.java line 35 1187675581300 4215
The field BotNet.PACKET_CYCLE is never read locally JBLS/util BotNet.java line 26 1187675581299 4213
The field BotNet.PACKET_DATABASE is never read locally JBLS/util BotNet.java line 24 1187675581298 4211
The field BotNet.PACKET_MESSAGE is never read locally JBLS/util BotNet.java line 25 1187675581299 4212
The field BotNet.password is never read locally JBLS/util BotNet.java line 40 1187675581300 4216
The field InPacketBuffer.pLength is never read locally JBLS/BNLSProtocol InPacketBuffer.java line 23 1187675579636 4175
The import BNLSProtocol.BNLSlist is never used JBLS Main.java line 46 1187675581081 4206
The import Hashing is never used JBLS/Hashing CheckRevisionV3.java line 7 1187675580656 4184
The import Hashing.SRP is never used JBLS Main.java line 38 1187675581080 4204
The import java.io is never used JBLS/BNLSProtocol BNLSlist.java line 4 1187675579625 4172
The import java.io is never used JBLS/util cSettings.java line 3 1187675582102 4237
The import java.io is never used JBLS/util/PEFiles ImportAddressManager.java line 2 1187675581914 4232
The import java.io.File is never used JBLS/Hashing HashMain.java line 2 1187675580778 4200
The import java.io.IOException is never used JBLS/BNLSProtocol BNLSParse.java line 17 1187675579564 4153
The import java.lang is never used JBLS/HTTP HTTPParse.java line 4 1187675579858 4176
The import java.lang is never used JBLS/HTTP HTTPSendFile.java line 3 1187675579880 4179
The import java.lang.Integer is never used JBLS/BNLSProtocol BNLSlist.java line 5 1187675579626 4173
The import java.lang.NullPointerException is never used JBLS/BNLSProtocol BNLSServer.java line 14 1187675579601 4170
The import java.net is never used JBLS/HTTP HTTPSendFile.java line 4 1187675579881 4180
The import java.util is never used JBLS/HTTP HTTPSendFile.java line 5 1187675579881 4181
The import java.util.Calendar is never used JBLS/Hashing HashMain.java line 5 1187675580778 4201
The import java.util.Date is never used JBLS/Hashing HashMain.java line 6 1187675580779 4202
The import java.util.Date is never used JBLS/util Out.java line 16 1187675581561 4231
The import java.util.NoSuchElementException is never used JBLS/util cSettings.java line 7 1187675582103 4240
The import java.util.StringTokenizer is never used JBLS/BNLSProtocol BNLSlist.java line 6 1187675579626 4174
The import java.util.StringTokenizer is never used JBLS/util cSettings.java line 5 1187675582103 4239
The import util.BigIntegerEx is never used JBLS Main.java line 39 1187675581081 4205
The import util.Buffer is never used JBLS/util/PEFiles PEFile.java line 3 1187675581978 4236
The import util.Out is never used JBLS/BNLSProtocol BNLSlist.java line 3 1187675579625 4171
The import util.Out is never used JBLS/util cSettings.java line 4 1187675582102 4238
The local variable action is never read JBLS/util BotNet.java line 183 1187675581302 4221
The local variable bannerExt is never read JBLS/util BNFTP.java line 85 1187675581139 4209
The local variable bannerID is never read JBLS/util BNFTP.java line 84 1187675581138 4208
The local variable buff is never read JBLS/Hashing lockdown_SHA1.java line 65 1187675581013 4203
The local variable database is never read JBLS/util BotNet.java line 141 1187675581301 4218
The local variable DataDirectory_Imports is never read JBLS/Hashing CheckRevisionV3.java line 155 1187675580657 4185
The local variable DataDirectory_Reloc is never read JBLS/Hashing CheckRevisionV3.java line 155 1187675580657 4186
The local variable dir1 is never read JBLS/Hashing CheckRevisionV3.java line 155 1187675580657 4187
The local variable dir2 is never read JBLS/Hashing CheckRevisionV3.java line 155 1187675580658 4188
The local variable edx is never read JBLS/Hashing CheckRevisionV3.java line 156 1187675580658 4189
The local variable extra is never read JBLS/util BotNet.java line 167 1187675581301 4220
The local variable fndHdr is never read JBLS/util Ini.java line 83 1187675581510 4230
The local variable goodLen is never read JBLS/util BotNet.java line 166 1187675581301 4219
The local variable lower_offset is never read JBLS/Hashing CheckRevisionV3.java line 281 1187675580660 4194
The local variable padNumber is never read JBLS/Hashing BrokenSHA1.java line 52 1187675579945 4183
The local variable protocol is never read JBLS/util BotNet.java line 61 1187675581300 4217
The local variable ret is never read JBLS/Hashing BrokenSHA1.java line 23 1187675579944 4182
The local variable sName is never read JBLS/util BNFTP.java line 87 1187675581139 4210
The local variable upper_offset is never read JBLS/Hashing CheckRevisionV3.java line 282 1187675580660 4195
The method hex(int) from the type HTTPParse is never used locally JBLS/HTTP HTTPParse.java line 351 1187675579858 4178
The method sendHashFile(String, String[]) from the type HTTPParse is never used locally JBLS/HTTP HTTPParse.java line 272 1187675579858 4177
The static field PEFile.EXPORT_TABLE should be accessed in a static way JBLS/util/PEFiles ImportAddressManager.java line 31 1187675581915 4233
The static field PEFile.EXPORT_TABLE should be accessed in a static way JBLS/util/PEFiles ImportAddressManager.java line 44 1187675581915 4234
The static field PEFile.EXPORT_TABLE should be accessed in a static way JBLS/util/PEFiles ImportAddressManager.java line 45 1187675581916 4235
The static field PEFile.IMAGE_NT_OPTIONAL_HDR32_MAGIC should be accessed in a static way JBLS/Hashing CheckRevisionV3.java line 168 1187675580659 4191
The static field PEFile.IMAGE_NT_SIGNATURE should be accessed in a static way JBLS/Hashing CheckRevisionV3.java line 166 1187675580658 4190
The static field PEFile.IMPORT_TABLE should be accessed in a static way JBLS/Hashing CheckRevisionV3.java line 177 1187675580659 4192
The static field PEFile.IMPORT_TABLE should be accessed in a static way JBLS/Hashing CheckRevisionV3.java line 354 1187675580661 4198
The static field PEFile.IMPORT_TABLE should be accessed in a static way JBLS/Hashing CheckRevisionV3.java line 355 1187675580661 4199
The static field PEFile.RELOC_TABLE should be accessed in a static way JBLS/Hashing CheckRevisionV3.java line 184 1187675580659 4193
The static field PEFile.RELOC_TABLE should be accessed in a static way JBLS/Hashing CheckRevisionV3.java line 312 1187675580660 4196
The static field PEFile.RELOC_TABLE should be accessed in a static way JBLS/Hashing CheckRevisionV3.java line 313 1187675580660 4197
The static method destroyAllConnections() from the type BNLSServer should be accessed in a static way JBLS/util BotNet.java line 263 1187675581302 4223
The static method destroyAllConnections() from the type BNLSServer should be accessed in a static way JBLS/util BotNet.java line 266 1187675581303 4224
The static method destroyAllConnections() from the type BNLSServer should be accessed in a static way JBLS/util Controller.java line 26 1187675581434 4226
The static method destroyAllConnections() from the type BNLSServer should be accessed in a static way JBLS/util Controller.java line 50 1187675581435 4227
The static method destroyAllConnections() from the type BNLSServer should be accessed in a static way JBLS/util Controller.java line 81 1187675581435 4228
The static method destroyAllConnections() from the type BNLSServer should be accessed in a static way JBLS/util Controller.java line 86 1187675581436 4229
The static method destroyAllConnections() from the type HTTPServer should be accessed in a static way JBLS/util BotNet.java line 262 1187675581302 4222
The static method destroyAllConnections() from the type HTTPServer should be accessed in a static way JBLS/util BotNet.java line 269 1187675581303 4225
This method has a constructor name JBLS/util BNFTP.java line 33 1187675581138 4207