Download Game! Currently 45 players and visitors. Last logged in:XaarovHylemanBylethDregas

BatMUD Forums > Batclient > Re: https

 
 
#1
23 Mar 2012 12:12
 
 
How about making BatClient regocnize https links?

 
 
 
Tonto
3y, 146d, 1h, 9m, 51s old
Level:
102
 
 
#2
23 Mar 2012 14:24
 
 
Quote:
How about making BatClient regocnize https links?
That is a bit difficult to fix for us, would need to patch mouseClicked and
maybe the MouseMotionListener in
com.mythicscape.batclient.desktop.BatTextPane.class. Currently playing around a
bit with it, but the exception handler there is a bit fishy.

 
 
 
Tugmeno
159d, 1h, 21m, 5s old
Level:
75
 
 
#3
23 Mar 2012 16:48
 
 
Quote:
How about making BatClient regocnize https links?

That is a bit difficult to fix for us, would need to patch mouseClicked and
maybe the MouseMotionListener in
com.mythicscape.batclient.desktop.BatTextPane.class. Currently playing around a
bit with it, but the exception handler there is a bit fishy.
Ok, I fixed it - first of all I couldn't fully test it because clicking on a
link only throws UnsupportedOperationException for me, but that isn't
mythicscape fault.

Problem is now, since it requires editing the class files I am not sure on
whether I am allowed to distribute a diff, so I will describe what I did.
First of all download the client, I am still using 1.97 so there is a small
chance that they changed something there. After downloading the jar file unpack
it with 'jar -xvf file.jar' and go to com/mythicscape/batclient/desktop there
are 2 files to edit BatTextPane$1.class for the mouseover effect and
BatTextPane$2.class for the actual clicking. Now the best idea would of course
be to change the if(s.startsWith("http://")) to if(s.startsWith("http://") ||
s.startsWith("https://")). Since that would require to get java to assemble
things together again, I decided to locate the constant pool instead and
changed the "http://" to "http". That shouldn't be much of a problem since
usally words don't start with http. If you plan to use
http://sourceforge.net/projects/classeditor/ note that the current version has
a bug and you should change in line 60 of
classfile/attributes/InnerClassesAttribute.java to
dos.writeInt(iNumberOfClasses); to dos.writeShort(iNumberOfClasses);
Finding that bug took quite a while..
After changing the 2 classfiles you can pack the jar file together again or
just start the Main.class directly from where ever you placed the com folder.

That was it, problem solved.

 
 
 
Tugmeno
159d, 3h, 58m, 10s old
Level:
75