46
JavaOp Board / Re: greets/idles
« on: February 16, 2010, 02:41:30 pm »
In regards to #2, this can be accomplished by changing the delay in the simple events processor if I remember correctly.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Exception in Metacity for theme "Nodoka": Variable "mini_icon_width" not defined
... JUNK ...
[18:18:36.482] INFO: [BNET] Calculated. Sending version check..
[18:18:36.580] Login Exception:
[18:18:36.593] exceptions.LoginException: [BNET] Wrong product value for your CD Key
[18:18:36.595] packets.SidAuthCheck.checkIncoming(SidAuthCheck.java:153)
[18:18:36.595] PluginMain.processedPacket(PluginMain.java:268)
[18:18:36.610] pluginmanagers.PluginRegistration.processedIncomingPacket(PluginRegistration.java:698)
[18:18:36.617] bot.PacketThread.run(PacketThread.java:173)
CRITICAL: [BNET] Caught exception while validating CD-Keys: exceptions.LoginException: CDKey is not 24 characters!
I went with the method you posted and everything has been good so far(byte)Integer.parseInt should be in every way equivalent to Byte.parseByte...No; parseByte() will throw an NFE if the number is too big, but the cast will simply truncate the high 24 bits. This is probably where the problem lies, since he said parseByte() doesn't work, when that's clearly what he should be using.
I guess I knew that, but I didn't think it was relevant. Of course, by "in every way", I meant for there to be an implied "in this context...".
That still seems weird... why are you indexing the way you are? If you want to turn consecutive pairs into bytes, then you should be addressing hostCounter[2*i] and hostCounter[2*i+1]. With your code, if you have digits:
12345678
Your pairs are going to be:
(2,1), (3, 2), (5, 3), (7, 4)
I assume you want:
(1,2), (3,4), (5,6), (7,8)
(the digits within the pairs being reversed is a trivial variation, of course). You'll get exactly that if you index with 2*i and 2*i+1
It seems that the way you're turning the concatenated digits into a string is a bit off. The digits aren't going to form something in base-16. It's going to be in decimal (which is syntactically legal for base-16, but it's semantically decimal). Also, Byte.parseByte exists. Why not just use it instead of Integer.parseInt and cast to byte?
In the code you gave, you lose 3 of the last digits. You only index 0 - 4, and you repeat the characters in indexes 1-3.
byte[] processedHostCounter = new byte[4];
for(int i = 0; i < 4; i++) {
processedHostCounter[i] = (byte)Integer.parseInt(new String(new byte[] { hostCounter[2 * i + (i == 0 ? 1 : 0)], hostCounter[i] }), 16);
}
IIRC this value doesn't even have to be correct..