[Tutorial] Client Editing

Forum for alternative clients, mods & discussions on the same.
User avatar
borka
Posts: 9965
Joined: Thu Feb 03, 2011 7:47 pm
Location: World of Sprucecap

Re: [Tutorial] Client Editing

Post by borka »

to keep the cmd window open edit in a new line containing

Code: Select all

pause 
to the .bat file
Avatar by SacreDoom
Java 8 - manually downloads - good to check for actual versions url here:
viewtopic.php?f=42&t=40331
Remember what the dormouse said: Feed your head Feed your head
User avatar
TurtleHermit
Posts: 88
Joined: Mon Sep 16, 2013 1:37 am

Re: [Tutorial] Client Editing

Post by TurtleHermit »

How does one merge latest and non-latest changes with loftar's code?
User avatar
vatas
Posts: 5249
Joined: Fri Apr 05, 2013 8:34 am
Location: Suomi Finland Perkele

Re: [Tutorial] Client Editing

Post by vatas »

Ardennesss wrote:Client still discontinued but I made the source public again, will require some recent merges from loftar to function. Enjoy, and stuff.

https://github.com/Ardenneslol/ArdClient
Haven and Hearth Wiki (Maintained by volunteers - test/verify when practical. Forum thread

Basic Claim Safety (And what you’re doing wrong
TL:;DR: Build a Palisade with only Visitor gates.)

Combat Guide (Overview, PVE, PVP) (Includes how to escape/minimize risk of getting killed.)
User avatar
LostJustice
Posts: 691
Joined: Sun Mar 25, 2012 3:57 am

Re: [Tutorial] Client Editing

Post by LostJustice »

TurtleHermit wrote:How does one merge latest and non-latest changes with loftar's code?
In IntelliJ there is an option with source control to create a pull request. So assuming you followed the tutorial and cloned the repository and haven’t redirected it to your own private one then all you would need to do is Click the menu options VCS -> GIT -> Fetch and then VCS -> GIT -> PULL. Note if there is merge conflicts then you must resolve them and then pull again. If you are using ardennes source for instance then you must reset the branch to master to amber or loftar’s source and go through the lovely pain of trying to figure out what to merge and what might break and won’t break which I highly recommend you do not even attempt to do if you want to save your valuable time on client maintenance.
Image
User avatar
LostJustice
Posts: 691
Joined: Sun Mar 25, 2012 3:57 am

Re: [Tutorial] Client Editing

Post by LostJustice »

I noticed some people not getting auto ranked in discord. If this happens please feel free to message me if you are not auto ranked after 5 minutes. This rarely happens and mainly has to do with lag that the bots run into with discord. Updated main post for this as well.
Image
ladygrey
Posts: 10
Joined: Wed Dec 01, 2010 8:31 pm

Re: [Tutorial] Client Editing

Post by ladygrey »

I followed the tutorial and tried to run the client from build folder and all it showed me is blank black screen... what should i do? :|

+or, is there any other way that i can build that client source? im trying to find way how to build in eclipse, but im completely new with this thing, and its kind of hard to figure out... x.x wish i could find simple and easy way
User avatar
LostJustice
Posts: 691
Joined: Sun Mar 25, 2012 3:57 am

Re: [Tutorial] Client Editing

Post by LostJustice »

ladygrey wrote:I followed the tutorial and tried to run the client from build folder and all it showed me is blank black screen... what should i do? :|

+or, is there any other way that i can build that client source? im trying to find way how to build in eclipse, but im completely new with this thing, and its kind of hard to figure out... x.x wish i could find simple and easy way
Go into MainFrame.java and replace the main method with this code:

Code: Select all

public static void main(final String[] args) {
		String[] a = argCheck(args);
		/* Set up the error handler as early as humanly possible. */
		ThreadGroup g = new ThreadGroup("Haven main group");
		String ed;
		if(!(ed = Utils.getprop("haven.errorurl", "")).equals("")) {
			try {
				final haven.error.ErrorHandler hg = new haven.error.ErrorHandler(new java.net.URL(ed));
				hg.sethandler(new haven.error.ErrorGui(null) {
					public void errorsent() {
						hg.interrupt();
					}
				});
				g = hg;
				new DeadlockWatchdog(hg).start();
			} catch(java.net.MalformedURLException e) {
			}
		}
		Thread main = new HackThread(g, new Runnable() {
			public void run() {
				main2(a);
			}
		}, "Haven main thread");
		main.start();
	}
Then add these methods as well (I added mine at the end of the class):

Code: Select all

//LJ
	public static String[] argCheck(String[] args)
	{
		System.out.println("Running client!");
		ArrayList<String> list = new ArrayList<>();
		if(!contains("-U", args))
		{
			list.add("-U");
			list.add("https://game.havenandhearth.com/res/");
			list.add("game.havenandhearth.com");
		}
		else
		{
			Arrays.stream(args).forEach(x -> list.add(x));
		}
		//Arrays.stream(args).forEach(x -> list.add(x));
		String[] a = list.toArray(new String[0]);
		return a;
	}

	private static boolean contains(String s, String[] a)
	{
		for(int i = 0; i < a.length; i++)
		{
			if(a[i].equals(s))
				return true;
		}
		return false;
	}
Then try running the code with that. If it still black or white screen, keep restarting till it isn't. It is a bug that is still being worked out.
Image
ladygrey
Posts: 10
Joined: Wed Dec 01, 2010 8:31 pm

Re: [Tutorial] Client Editing

Post by ladygrey »

it works! :D tyvm
Aoyama
Posts: 12
Joined: Sat May 25, 2019 9:46 am

Re: [Tutorial] Client Editing

Post by Aoyama »

I suggest you edit the build.xml file instead of changing client code

example, edit the run command to your liking

Code: Select all

  <target name="run" depends="jars">
    <java fork="true" jar="build/hafen.jar">
      <sysproperty key="haven.defserv" value="game.havenandhearth.com" />
      <sysproperty key="haven.resurl" value="http://game.havenandhearth.com/render/res/" />
      <sysproperty key="haven.cachebase" value="http://game.havenandhearth.com/render/" />
    </java>
  </target>
  
User avatar
LostJustice
Posts: 691
Joined: Sun Mar 25, 2012 3:57 am

Re: [Tutorial] Client Editing

Post by LostJustice »

Aoyama wrote:I suggest you edit the build.xml file instead of changing client code

example, edit the run command to your liking

Code: Select all

  <target name="run" depends="jars">
    <java fork="true" jar="build/hafen.jar">
      <sysproperty key="haven.defserv" value="game.havenandhearth.com" />
      <sysproperty key="haven.resurl" value="http://game.havenandhearth.com/render/res/" />
      <sysproperty key="haven.cachebase" value="http://game.havenandhearth.com/render/" />
    </java>
  </target>
  
You can do this too but it nice for when after it is built that you can just double click the jar and run it without the need for a run.bat.
Last edited by LostJustice on Thu Nov 19, 2020 6:57 pm, edited 1 time in total.
Image

Return to “The Wizards' Tower”