Author Topic: War3 NumberFormatException on connect  (Read 4658 times)

0 Members and 2 Guests are viewing this topic.

Offline Crixus

  • Newbie
  • *
  • Posts: 3
    • View Profile
War3 NumberFormatException on connect
« on: July 12, 2007, 10:44:54 pm »
I get the following error when trying to connect most of the time. I'm using Core-42 and Plugins-42. I haven't looked at the code too much, but it appears that the string it's trying to parseInt on is too large to fit into a Java int. Could this be solved by changing it to use longs in CheckRevision? Or does that screw up the bitwise ops?

Code: [Select]
[21:37:39.173] INFO: Trying BNLS server: hdx.jbls.org
[21:37:39.323] INFO: Resolving ip for server: uswest.battle.net
[21:37:39.471] INFO: Resolves to 12 different addresses
[21:37:39.571] INFO: Choosing address 3 [uswest.battle.net/63.241.83.110]
[21:37:39.690] INFO: Attempting to connect
[21:37:39.856] INFO: Connected to /63.241.83.110:6112
[21:37:39.870] INFO: Trying BNLS server: hdx.jbls.org
[21:37:39.887] INFO: Connected to uswest.battle.net:6112
[21:37:39.934] INFO: Sending protocol byte (0x01).
[21:37:39.937] INFO: Switching to Binary protocol.
[21:37:39.939] INFO: Sending authorization.
[21:37:45.000] WARNING: BNLS server 'hdx.jbls.org' returned an error -- this means the server might not be running.
[21:37:45.015] WARNING: The error is: java.net.SocketException: Connection timed out
[21:37:45.083] INFO: Attempting to use next BNLS server.
[21:37:45.111] WARNING: Out of BNLS servers, defaulting to local hashing.
[21:37:45.119] INFO: Authorization sent, waiting for reply.
[21:37:45.127] INFO: Beginning to receive packets
[21:37:45.172] INFO: Checking server's signature...
[21:37:45.216] INFO: Server successfully authenticated -- it's Blizzard's
[21:37:45.268] java.lang.NumberFormatException: For input string: "3888226066"
[21:37:45.270] java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
[21:37:45.271] java.lang.Integer.parseInt(Integer.java:459)
[21:37:45.272] java.lang.Integer.parseInt(Integer.java:497)
[21:37:45.273] versioning.CheckRevision.checkRevision(CheckRevision.java:76)
[21:37:45.275] versioning.Game.checkRevision(Game.java:118)
[21:37:45.276] versioning.BNLSWrapper.getVersionCheck(BNLSWrapper.java:121)
[21:37:45.277] Login.getAuthCheck(Login.java:152)
[21:37:45.278] PluginMain.processedPacket(PluginMain.java:295)
[21:37:45.279] pluginmanagers.PluginRegistration.processedIncomingPacket(PluginRegistration.java:722)
[21:37:45.280] bot.PacketThread.run(PacketThread.java:179)

Offline Hdx

  • The Hdx!
  • Full Member
  • ***
  • Posts: 311
  • <3 Java/Cpp/VB/QB
    • View Profile
Re: War3 NumberFormatException on connect
« Reply #1 on: July 12, 2007, 11:58:00 pm »
Thats exactly what you would do to change it.
As for useing JBLS, it should be fine now. My host switched to a dedicated server, and was having trouble switching my account over.
So for now I got *.jbls.org pointing at my own box.
~Hdx
http://img140.exs.cx/img140/6720/hdxnew6lb.gif
09/08/05 - Clan SBs @ USEast
 [19:59:04.000] <DeadHelp> We don't like customers.
 [19:59:05.922] <DeadHelp> They're assholes
 [19:59:08.094] <DeadHelp> And they're never right.

Offline Crixus

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: War3 NumberFormatException on connect
« Reply #2 on: July 13, 2007, 05:53:20 am »
I initially used the method described at http://www.javaop.com/plugins.html to try and rebuild the BNetLogin jar after making changes to CheckRevision.java. However, I found that the changes to the source weren't being compiled (and thus not updated in the jar). I was under the impression that saving would automatically compile files, but it doesn't seem to want to update the .class file. I've also tried doing it from the command line with

Code: [Select]
javac -classpath ~/workspace/javaop2_pub/src/:~/workspace/BNetLogin/versioning/ CheckRevision.java
However, it insists that it can't find the GameData class

Code: [Select]
CheckRevision.java:50: cannot find symbol
symbol  : class GameData
location: class versioning.CheckRevision
        GameData gameData = new GameData();
        ^
CheckRevision.java:50: cannot find symbol
symbol  : class GameData
location: class versioning.CheckRevision
        GameData gameData = new GameData();
                                ^
Note: CheckRevision.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors

However, GameData.java and GameData.class are in ~/workspace/BNetLogin/versioning/ . Any tips on how to get this to compile?


Offline Hdx

  • The Hdx!
  • Full Member
  • ***
  • Posts: 311
  • <3 Java/Cpp/VB/QB
    • View Profile
Re: War3 NumberFormatException on connect
« Reply #3 on: July 13, 2007, 02:43:30 pm »
Code: [Select]
cd ~/workspace/BnetLogin/
javac -cp .;~/workspace/javaop2_pub/src ./versioning/CheckRevision.java
~Hdx
http://img140.exs.cx/img140/6720/hdxnew6lb.gif
09/08/05 - Clan SBs @ USEast
 [19:59:04.000] <DeadHelp> We don't like customers.
 [19:59:05.922] <DeadHelp> They're assholes
 [19:59:08.094] <DeadHelp> And they're never right.

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: War3 NumberFormatException on connect
« Reply #4 on: July 14, 2007, 02:50:05 am »
Don't you have to escape the ;? A \; perhaps?
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Hdx

  • The Hdx!
  • Full Member
  • ***
  • Posts: 311
  • <3 Java/Cpp/VB/QB
    • View Profile
Re: War3 NumberFormatException on connect
« Reply #5 on: July 14, 2007, 12:51:27 pm »
no you don't
~Hdx
http://img140.exs.cx/img140/6720/hdxnew6lb.gif
09/08/05 - Clan SBs @ USEast
 [19:59:04.000] <DeadHelp> We don't like customers.
 [19:59:05.922] <DeadHelp> They're assholes
 [19:59:08.094] <DeadHelp> And they're never right.

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: War3 NumberFormatException on connect
« Reply #6 on: July 15, 2007, 02:14:16 am »
Ah, sweet. By the way, if someone wants to submit a code patch, I'll apply it to my source (eventually).
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Crixus

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: War3 NumberFormatException on connect
« Reply #7 on: July 15, 2007, 09:40:27 am »
I got it to compile using
Code: [Select]
javac -cp ~/workspace/javaop2_pub/src/:. versioning/CheckRevision.java

I started getting
Code: [Select]
[08:34:43.423] exceptions.InvalidVersion: Invalid game version
[08:34:43.425] Login.getLogin(Login.java:184)
[08:34:43.425] PluginMain.processedPacket(PluginMain.java:333)
[08:34:43.426] pluginmanagers.PluginRegistration.processedIncomingPacket(PluginRegistration.java:722)
[08:34:43.427] bot.PacketThread.run(PacketThread.java:179)

I had checkRevision() parse into longs but typecasted to return ints still. So I'm not sure if I need to make it return longs or if my hashes are wrong. I'm not actually sure how the hashing works, I just copied war3.exe, game.dll, and storm.dll from my Windows machine onto my Linux machine under ~/.hashes/WAR3/ where _GameData.txt pointed to.

Offline Hdx

  • The Hdx!
  • Full Member
  • ***
  • Posts: 311
  • <3 Java/Cpp/VB/QB
    • View Profile
Re: War3 NumberFormatException on connect
« Reply #8 on: July 15, 2007, 12:53:54 pm »
does the current crev pass the files as it's suposto?
And return (int)c; will return the proper result.
~Hdx
http://img140.exs.cx/img140/6720/hdxnew6lb.gif
09/08/05 - Clan SBs @ USEast
 [19:59:04.000] <DeadHelp> We don't like customers.
 [19:59:05.922] <DeadHelp> They're assholes
 [19:59:08.094] <DeadHelp> And they're never right.