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

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

Moderator: Phades

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

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

Post by rilaf »

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.
Sitting_Bill
Posts: 503
Joined: Tue Mar 15, 2011 12:35 am

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

Post by Sitting_Bill »

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
rilaf
Posts: 22
Joined: Thu Feb 10, 2011 7:23 pm

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

Post by rilaf »

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

rilaf
User avatar
Momoka
Posts: 46
Joined: Sun Jul 17, 2011 6:21 am

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

Post by Momoka »

Great, thanks~ Works under Linux.
thegreatbear
Posts: 5
Joined: Tue Jul 05, 2011 3:44 am

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

Post by thegreatbear »

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.
sergo
Posts: 19
Joined: Fri May 21, 2010 9:57 pm

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

Post by sergo »

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
User avatar
ElGato
Posts: 1945
Joined: Tue Nov 10, 2009 2:10 am

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

Post by ElGato »

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!!!
sergo
Posts: 19
Joined: Fri May 21, 2010 9:57 pm

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

Post by sergo »

Code: Select all

haven\.authck

I told about a slash before dot.
rilaf
Posts: 22
Joined: Thu Feb 10, 2011 7:23 pm

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

Post by rilaf »

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.
Pablon
Posts: 6
Joined: Thu Jul 29, 2010 3:37 pm

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

Post by Pablon »

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!

Return to “The Wizards' Tower”