Alternate Client Connection Fix (Linux/Mac) 1 Click Start

Forum for alternative clients, mods & discussions on the same.

Moderator: Phades

Alternate Client Connection Fix (Linux/Mac) 1 Click Start

Postby rilaf » Sun Sep 04, 2011 6:34 pm

Hello,

I made a BASH script to parse the autohaven.jnlp file. What never occurred to me was to actually download the autohaven file for you.

I now have a script that is a one stop shop for logging into Haven and Hearth. How to use the code I will post below.

1. Create a file in your Alternate client's folder named alternate.sh
2. Edit that file's permissions so it is executable for you (chmod 700 alternate.sh or any other combination you may prefer also you can edit through the properties of the file in the gui if that method tickles you more)
3. Edit alternate.sh with your username and password
4. Run alternate.sh

For future executions you will only need to run the alternate.sh file. It will remember all the values and create new connections to the server as necessary.

Code: Select all
#!/bin/bash

export LD_LIBRARY_PATH=/usr/lib/jni/

USER=YOURUSERNAME
PASS=YOURPASSWORD

wget -O autohaven.wget http://www.havenandhearth.com/portal/sec/login --post-data "r=/portal/autohaven&username=$USER&password=$PASS"

AUTHCK=`grep "haven.authck" autohaven.wget | sed s/"    <property name=\"haven\.authck\" value=\""// | sed s/"\" \/>"//`

rm -rf autohaven.wget

java -Xms384m -Xmx384m -Dhaven.authuser=$USER -Dhaven.authck=$AUTHCK -jar haven.jar moltke.seatribe.se -r ./res


rilaf
Last edited by rilaf on Tue Sep 06, 2011 1:56 am, edited 1 time in total.
rilaf
 
Posts: 22
Joined: Thu Feb 10, 2011 7:23 pm

Re: Alternate Client Connection Fix (Linux/Mac) 1 Click Star

Postby Sitting_Bill » Sun Sep 04, 2011 7:26 pm

You really are amazing...
This works on my mac; I had to download wget from http://www.statusq.org/archives/2005/02/22/610/
great job :)

Edit: Just one minor suggestion for improvement.

If you like to launch from a terminal, you can put these lines:

USER=$1
PASS=$2

and then launch using
./alternate.sh <yourusername> <yourpassword>

This is useful for quick use of alts, I found.
in game character: Gunnar of Hlidarendi
Sitting_Bill
 
Posts: 503
Joined: Tue Mar 15, 2011 12:35 am

Re: Alternate Client Connection Fix (Linux/Mac) 1 Click Star

Postby rilaf » Sun Sep 04, 2011 7:38 pm

Yes great suggestion on the command line parameter option! I'm glad to hear Mac users can use it as well!

rilaf
rilaf
 
Posts: 22
Joined: Thu Feb 10, 2011 7:23 pm

Re: Alternate Client Connection Fix (Linux/Mac) 1 Click Star

Postby Momoka » Sun Sep 04, 2011 10:17 pm

Great, thanks~ Works under Linux.
User avatar
Momoka
 
Posts: 46
Joined: Sun Jul 17, 2011 6:21 am

Re: Alternate Client Connection Fix (Linux/Mac) 1 Click Star

Postby thegreatbear » Mon Sep 05, 2011 3:44 am

Code: Select all
export LD_LIBRARY_PATH=/usr/lib/jni/


what is this line of code meant to represent?

my mac would use "Users/Library/" but what is the "ini/" and whats expected to be picked up from said folder?
I'm not the most code savvy person, but would have been able to solve this issue had I been running Windows.
No matter how many guides I follow, with other users saying "thanks, it works!" none of the methods have actually worked for me, this seemed like the most likely to work but still ever so slightly confused by it.
So additional help would be greatly appreciated.
thegreatbear
 
Posts: 5
Joined: Tue Jul 05, 2011 3:44 am

Re: Alternate Client Connection Fix (Linux/Mac) 1 Click Star

Postby sergo » Mon Sep 05, 2011 10:29 am

rilaf wrote:
Code: Select all
AUTHCK=`grep "haven.authck" autohaven.wget | sed s/"    <property name=\"haven.authck\" value=\""// | sed s/"\" \/>"//`



rilaf


Helo, you better correct sed command like this:

sed s/" <property name=\"haven\.authck\" value=\""//
;)


Cheers
sergo
 
Posts: 19
Joined: Fri May 21, 2010 9:57 pm

Re: Alternate Client Connection Fix (Linux/Mac) 1 Click Star

Postby ElGato » Mon Sep 05, 2011 12:32 pm

sergo wrote:
rilaf wrote:
Code: Select all
AUTHCK=`grep "haven.authck" autohaven.wget | sed s/"    <property name=\"haven.authck\" value=\""// | sed s/"\" \/>"//`



rilaf


Helo, you better correct sed command like this:

sed s/" <property name=\"haven\.authck\" value=\""//
;)


Cheers

Those extra spaces are necessary.
burgingham wrote:We are all Gato, and Gato is Delamore of course. Goons blablabla...

Caradon wrote:Gato, the anti-ghandi

Sabinati wrote:yeah we're gonna kill you gato!!!
User avatar
ElGato
 
Posts: 1946
Joined: Tue Nov 10, 2009 2:10 am

Re: Alternate Client Connection Fix (Linux/Mac) 1 Click Star

Postby sergo » Mon Sep 05, 2011 6:17 pm

Code: Select all
haven\.authck

I told about a slash before dot.
sergo
 
Posts: 19
Joined: Fri May 21, 2010 9:57 pm

Re: Alternate Client Connection Fix (Linux/Mac) 1 Click Star

Postby rilaf » Tue Sep 06, 2011 1:55 am

The correct method would be to escape the period but thankfully for me the wildcard "." matches a "." as well as any other character lol.

I will update my code above to reflect an escaped period.

As far as the other question on the path for what I have as a jni folder at the end. That is the path to the .so files for the graphics library (jogl) on my Linux install.
rilaf
 
Posts: 22
Joined: Thu Feb 10, 2011 7:23 pm

Re: Alternate Client Connection Fix (Linux/Mac) 1 Click Star

Postby Pablon » Tue Sep 06, 2011 4:07 pm

Hi!
I am relatively new to the game and a complete stranger to programming. I am trying this solution on my mac but I get as an answer:

Unable to access jarfile haven.jar

Any idea on what can be the problem and how to solve it?

Thank you!
Pablon
 
Posts: 6
Joined: Thu Jul 29, 2010 3:37 pm

Next

Return to The Wizards' Tower

Who is online

Users browsing this forum: No registered users and 11 guests