Lobby 1.3.1 doesn't work for MAC OSX 10.4.11

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Lobby 1.3.1 doesn't work for MAC OSX 10.4.11

corsair
Not sure who else this affects, but it appears that all the whizbang features of the new lobby are not backwards compatible with < 10.6 MAC users.  Can 1.2.5 lobby reopen until this is addressed?  If so thanks a million, if not my tournament opponents thank you.
corsair
Reply | Threaded
Open this post in threaded view
|

Re: Lobby 1.3.1 doesn't work for MAC OSX 10.4.11

Wisconsin
Here's the code for that portion of the class:

        try
        {
            InetAddress address = InetAddress.getLocalHost();
            NetworkInterface localHostNI = NetworkInterface.getByInetAddress(address);
            if (localHostNI != null)
            {
                byte[] rawMac = localHostNI.getHardwareAddress(); //This line caused error
                String mac = convertMacBytesToString(rawMac);
                if (isMacValid(mac))
                    return mac;
            }
        }
        catch (Exception ex) //And it wasn't caught here, because NoSuchMethodError is not an exception, it's an Error. Both Exception and Error classes are extensions of the Throwable class. (Found this out online)

So to fix this issue, we just have to change this line:

        catch (Exception ex)

To this:

        catch (Throwable ex)

So then, if someone has an older version of java, it will simply skip that code block and try to use one of the other three mac-retrieval methods. (Which get hashed, btw)
Reply | Threaded
Open this post in threaded view
|

Re: Lobby 1.3.1 doesn't work for MAC OSX 10.4.11

corsair
kudos wisc, there are some true geniuses up in here.
corsair
Reply | Threaded
Open this post in threaded view
|

Re: Lobby 1.3.1 doesn't work for MAC OSX 10.4.11

U-boat
corsair wrote
kudos wisc, there are some true geniuses up in here.
Word.
Reply | Threaded
Open this post in threaded view
|

Re: Lobby 1.3.1 doesn't work for MAC OSX 10.4.11

Veqryn
Administrator
In reply to this post by Wisconsin
wisc,

do we need to change the other 9 instances of "exception" to "throwable" in that class?

if not, why not?

thanks for finding this error, as I would not have been able to figure this one out,
veqryn
Please contribute to the TripleA 2013 donation drive:
http://tripleadev.1671093.n2.nabble.com/2013-TripleA-Donation-Drive-tp7583455.html
Reply | Threaded
Open this post in threaded view
|

Re: Lobby 1.3.1 doesn't work for MAC OSX 10.4.11

Wisconsin
Well, because the rest use cmd commands instead of the java getHardwareAddress method...

But now that you bring it up, there is one other call to getHardwareAddress()... I'll go fix it.
Reply | Threaded
Open this post in threaded view
|

Re: Lobby 1.3.1 doesn't work for MAC OSX 10.4.11

Veqryn
Administrator
maybe we should just change them all to throwable just in case?
i mean, is there any chance that something will go wrong in one of those code blocks on an older machine that could otherwise run the rest of triplea just fine?
Please contribute to the TripleA 2013 donation drive:
http://tripleadev.1671093.n2.nabble.com/2013-TripleA-Donation-Drive-tp7583455.html
Reply | Threaded
Open this post in threaded view
|

Re: Lobby 1.3.1 doesn't work for MAC OSX 10.4.11

Wisconsin
This post was updated on .
Well, I don't really know, but my guess would be that even older java's would be able to run the other stuff.

Yeah, I checked and both ProcessBuilder and Runtime were there in 1.6. (ProcessBuilder was added in 1.6, I think, which is also TripleA's official required version)
Reply | Threaded
Open this post in threaded view
|

Re: Lobby 1.3.1 doesn't work for MAC OSX 10.4.11

Veqryn
Administrator
if the only difference is that Throwable doesn't stop the program, and Exception stops the program, then I think throwable would be better.  
If the person can't run any of those mac getter codes, then they will not be able to join anyway, so in that way they will get stopped with a better message.  (and the throwable still prints the original error to the consol, correct?)
Please contribute to the TripleA 2013 donation drive:
http://tripleadev.1671093.n2.nabble.com/2013-TripleA-Donation-Drive-tp7583455.html
Reply | Threaded
Open this post in threaded view
|

Re: Lobby 1.3.1 doesn't work for MAC OSX 10.4.11

Wisconsin
Nope, if either is not caught, it will stop the program. (Well, at least stop the lobby login code)

So all in all, Throwable can't really make things worse, so we might as well use it. (Though I don't think it's needed for the other ones)