Clean Haven Source Booting

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

Moderator: Phades

Clean Haven Source Booting

Postby anasky » Wed Jul 27, 2011 8:00 pm

Hello everyone

I'm trying to start editting Enders client, but can't seem to get it work correctly in Netbeans IDE.
Any suggestions on another IDE / how to make it work in Netbeans??

Thanks in advance, Anasky.
SaintGilbert wrote:Some people claim to have never slept for years.

MagicManICT wrote:Some people claim that they can levitate objects with their mind, too.
anasky
 
Posts: 153
Joined: Fri Jan 21, 2011 2:44 pm

Re: Clean Haven Source Booting

Postby Hyrion » Wed Jul 27, 2011 11:20 pm

Bump for interest.
Image
User avatar
Hyrion
 
Posts: 92
Joined: Sun Jun 12, 2011 10:14 pm

Re: Clean Haven Source Booting

Postby ElGato » Thu Jul 28, 2011 12:29 am

Last time I muffed around with it I used Eclipse and it worked decently.
Might give that a try.
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: 1945
Joined: Tue Nov 10, 2009 2:10 am

Re: Clean Haven Source Booting

Postby MagicManICT » Thu Jul 28, 2011 1:45 am

I've not dug into Ender's code, so I don't know if he's maintained the same formatting as Loftar's original client. That might be causing some issues.

Instead of a half dozen clients laying around, how about someone doing a modular client you can do plug-ins with? :shock:
Opinions expressed in this statement are the authors alone and in no way reflect on the game development values of the actual developers.
User avatar
MagicManICT
 
Posts: 18435
Joined: Tue Aug 17, 2010 1:47 am

Re: Clean Haven Source Booting

Postby ElGato » Thu Jul 28, 2011 2:31 am

Also to OP, I had trouble with it all when I first started fooling.
Then I found this page and then it was all cake :P
http://www.havenandhearth.com/portal/doc-src
or
Detailed Usage of the Source Code

To begin with, you can get a copy of the source code by using the Git Version Control System (http://www.git-scm.org/). Our public (pull-only) repository is accessed via the Git URL <git://sh.seatribe.se/client>. Just clone a repository and hack away!
The Basics

To compile and run the client, you'll need the following things:

A Java 1.5-compatible JDK,
Apache Ant, and
Locally installed versions of JOGL's shared object files (that is, its native code).

Compiling

Compiling the client shouldn't be harder than running ant on the default target in the client source tree. Note that the default target will also download the (proprietary) JAR file with the game resources and place it in the build tree, so that it can be accessed by the client when running.
Running

In turn, running the client shouldn't be any harder than running java -jar build/haven.jar. However, to actually connect to the real server (instead of your local machine), you need to specify the name of the server, being moltke.seatribe.se, as a command-line argument. You will probably also be aided by turning on some of the real-time debugging output with the -d option. The common way of running the client, thus, would be java -jar build/haven.jar -d moltke.seatribe.se. There are some other useful command-line switches as well. Run java -jar build/haven.jar -h to see a summary, and see the code (particularly src/haven/Config.java) for the details.

Finally, if you insist on using an IDE of some kind, you'll have to figure out on your own how to make it do the procedure outlined above. I don't particularly believe in such things.
The Source Tree

The layout of the source tree should be rather simple to comprehend. The src directory contains all the actual source code; the lib directory contains a couple of third-party libraries (they are described more in-depth in the COPYING file); the etc directory contains various odd ends, such as a couple of auxiliary scripts that you'll probably never use, or some server certificates that are built into the Jar file for runtime checking; the build script creates a build directory in which all intermediate files and the final results of the build are placed (it is the only location actually modified by the build script); the build.xml file (Yuck) is the Ant build script; and COPYING is the file describing the copying rights in detail.

As for the source code itself, I cannot reasonably describe all of it, but the following classes ought to be useful as pointers:

haven.MainFrame: The class containing the main function when running the Jar file normally
haven.HavenPanel: This class takes care of the vast majority of ground-work; it runs the main game loop, cycles the draw engine and collects input events.
haven.Session: The class mainly responsible for the protocol decoding and encoding and for establishing and maintaining the connection to the server
haven.error.ErrorHandler: When running in the JNLP environment, this class (which extends java.lang.ThreadGroup) takes care of all the Haven threads, and catches uncaught exceptions, serializes them, and sends them to the server so that I may look at them.
haven.Resource: This class manages the (proprietary) game resources and loads them as necessary.
haven.Widget: This is the base class of all the UI widgets in the game. All specialized widgets need to be registered with it, so that their static code initialization is run (and thus, their names registered) when the game starts.

Coding Style

The first thing you'll probably notice is that my coding style is a bit idiosyncratic—probably more so than usually. It is probably not made any better by the fact that I didn't really intend the code to be public from the beginning, but I'll admit right now that the main reason is because I hate Java with a passion. Describing all the details and reasons for it is certainly beyond the scope of this document, though, so I'll leave it aside. The main things that should be noted are these:

Indentation is done in blocks of 4 columns.
The code uses trailing-brace style ("if(...) {", that is) exclusively.
The Tab character (ASCII 9, that is) is used in the classical and only correct way: It advances the cursor to the next column ordinal divisible by 8. It does not advance the cursor by 8 columns, and it most certainly does not advance the cursor by 4 or 2 columns. If you use an IDE (Eclipse and Visual Studio users are warned especially!), you may want to check your settings on that one, because they are often wrong.
Line endings are neither Mac style (CR) nor Windows style (CRLF), but Unix style (LF).
Last, but not least, I abhor camelCase. If you wish me to accept back any modifications you make, you would do good not to use it. Thank you!

Contributing Back

If you want me to accept back some changes that you might have made into the public client available from the website, there is one main rule that we wish to enforce: We want you to sign over ownership of the code that wish to contribute to us (the same way as the FSF works, in other words). It may seem draconian to some, but it is quite important to us, for two main reasons:

First of all, we wish to ensure that we do not lose control over the client. It would be a great pity if game development was being hindered by some legalistic details along the way or because we would become prevented from doing certain changes because of ownership issues.
I'll admit it: As long as we own the code, we are free to change licenses in the future. We don't expect to have to do so, but it may become important in case of some weird kind of abuse or other unforeseen issues. In relation to this, it is worth mentioning that it is our hope that we may, at some point, be able to derive profit from Haven in one way or another (it is still unclear just how, though). In such an event, your code would be used for our profit.

Generally, we would consider the code owned by us as long as the copyright notices at the top of each source file mentions our and only our names, and as long as the same copyright notice is copied to any new source files you would create, and as long as you haven't made any changes to the contrary in the COPYING file.

Other than that, it's mostly just a matter of technical details. Since we use Git, the preferred method for us to accept code is, simply, by way of pulling it. If you can put up a public pull server for publishing your changes to us, that would be preferable. Just mail me the Git URL to your repo and I'll check whatever you've done.

Of course, that may be hard for you, for some reason or another. If it's just some small change, you can just mail me a patch in the Unified format (just run git diff with any appropriate arguments). It might be even easier for you to use git send-email; please see its documentation for details.
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: 1945
Joined: Tue Nov 10, 2009 2:10 am

Re: Clean Haven Source Booting

Postby Butko » Thu Jul 28, 2011 8:09 am

I'm using IDEA, with little work you can get it work :)
Butko
 
Posts: 542
Joined: Tue Sep 07, 2010 10:05 am

Re: Clean Haven Source Booting

Postby anasky » Thu Jul 28, 2011 11:02 am

@ElGato: Decently??
@MagicManICT: No problem with that, at all. Although I suggest taking either the clean or Enders for it, seeing as how clean is... well, clean
And Enders having the most features
@ElGato: I'm stuck at the JOGL shared object files :(
@Butko: could you elaborate on what I have to do??

EDIT:
Apparently, I'm also stuck on Ant installer...
SaintGilbert wrote:Some people claim to have never slept for years.

MagicManICT wrote:Some people claim that they can levitate objects with their mind, too.
anasky
 
Posts: 153
Joined: Fri Jan 21, 2011 2:44 pm

Re: Clean Haven Source Booting

Postby Butko » Thu Jul 28, 2011 12:58 pm

anasky wrote:@ElGato: Decently??
@MagicManICT: No problem with that, at all. Although I suggest taking either the clean or Enders for it, seeing as how clean is... well, clean
And Enders having the most features
@ElGato: I'm stuck at the JOGL shared object files :(
@Butko: could you elaborate on what I have to do??

EDIT:
Apparently, I'm also stuck on Ant installer...

I have downloaded all source code and put it in one folder. Then I made fresh new project in IDEA and I ported all source code into that project watching to have correct packages. After that I imported all needed libraries into project and voila stuff started to work. I also make my own build script so builder also copy files of certificate into output directory.
Butko
 
Posts: 542
Joined: Tue Sep 07, 2010 10:05 am

Re: Clean Haven Source Booting

Postby anasky » Thu Jul 28, 2011 2:31 pm

How do I make sure that the correct packages / libraries are imported??
The automatic installer makes an identical haven.jar??
SaintGilbert wrote:Some people claim to have never slept for years.

MagicManICT wrote:Some people claim that they can levitate objects with their mind, too.
anasky
 
Posts: 153
Joined: Fri Jan 21, 2011 2:44 pm

Re: Clean Haven Source Booting

Postby Butko » Thu Jul 28, 2011 3:28 pm

anasky wrote:How do I make sure that the correct packages / libraries are imported??
The automatic installer makes an identical haven.jar??

You have to make exact package structure in your project as it is in source code. I have first done package structure then I just copied source inside and everything was ok.
Butko
 
Posts: 542
Joined: Tue Sep 07, 2010 10:05 am

Next

Return to The Wizards' Tower

Who is online

Users browsing this forum: Claude [Bot], Google [Bot] and 1 guest