Client source code

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

Re: Client source code

Postby synntax33 » Mon Jun 01, 2020 6:36 pm

Is this still a current client path, with the new client implemented?

**Edit: nm found a way to fetch it from my phone
User avatar
synntax33
 
Posts: 124
Joined: Mon Aug 22, 2011 5:48 pm

Re: Client source code

Postby kirion » Mon Jan 18, 2021 5:45 am

Would someone please explain how to setup a project using NetBeans or Eclipse, step by step? I'm unfamiliar with java's IDEs, even more on how to import from Git...
User avatar
kirion
 
Posts: 373
Joined: Sat Jul 31, 2010 11:45 pm

Re: Client source code

Postby TheMephProject » Fri Mar 19, 2021 9:29 pm

kirion wrote:Would someone please explain how to setup a project using NetBeans or Eclipse, step by step? I'm unfamiliar with java's IDEs, even more on how to import from Git...


recoment seaching Youtube or google ...
User avatar
TheMephProject
 
Posts: 31
Joined: Fri Mar 27, 2015 9:36 pm

Re: Client source code

Postby Händler » Fri Mar 26, 2021 3:58 pm

Got the client.
Made a build with ant.
Ran client with
Code: Select all
javaw -Xss1024k -Xms512m -Xmx1024m -jar hafen.jar -U http://game.havenandhearth.com/hres/ game.havenandhearth.com


Successfully connects to the server.
Can login to my account, move around, use UI and everything with a new character (fairy orb 3D model).
But once the game tries to load my human character model, game freezes.

Is this client the vanilla client ready to go and ready to get extra modification or does it require some extra setup to run the vanilla version? Do I need to fetch the gfx resources like for the characters from the server and unpack them into a jar or something?
Händler
 
Posts: 15
Joined: Thu Aug 29, 2013 12:39 am

Re: Client source code

Postby Ysh » Fri Mar 26, 2021 4:02 pm

Händler wrote:Got the client.
Made a build with ant.
Ran client with
Code: Select all
javaw -Xss1024k -Xms512m -Xmx1024m -jar hafen.jar -U http://game.havenandhearth.com/hres/ game.havenandhearth.com


Successfully connects to the server.
Can login to my account, move around, use UI and everything with a new character (fairy orb 3D model).
But once the game tries to load my human character model, game freezes.

Is this client the vanilla client ready to go and ready to get extra modification or does it require some extra setup to run the vanilla version? Do I need to fetch the gfx resources like for the characters from the server and unpack them into a jar or something?

I must add properties from autohaven launcher to use vanilla client from repo. Some thing like this in MainFrame.java:
Code: Select all
private static void main2(String[] args) {
   // https://game.havenandhearth.com/java/hafen.hl
   System.setProperty("haven.errorurl", "http://game.havenandhearth.com/java/error");
   System.setProperty("haven.defserv", "game.havenandhearth.com");
   System.setProperty("haven.resurl", "https://game.havenandhearth.com/res/");
   System.setProperty("haven.screenurl", "http://game.havenandhearth.com/mt/ss");
   System.setProperty("haven.cachebase", "http://game.havenandhearth.com/render/");
   System.setProperty("haven.mapbase", "http://game.havenandhearth.com/java/");
   System.setProperty("haven.fullscreen", "off");
   System.setProperty("haven.sun.java2d.uiScale.enabled", "false");
   Config.cmdline(args);
   ...
Kaios wrote:Spice Girls are integral to understanding Ysh's thought process when communicating, duly noted.

I have become victory of very nice Jordan Coles Contest! Enjoy my winning submit here if it pleasures you.
User avatar
Ysh
 
Posts: 5953
Joined: Sun Jan 31, 2010 4:43 am
Location: Chatting some friends on forum

Re: Client source code

Postby loftar » Sat Mar 27, 2021 2:23 am


Not sure if that's your only problem, but that's the URL for the pre-render resources. The new one is just res instead of hres.
"Object-oriented design is the roman numerals of computing." -- Rob Pike
User avatar
loftar
 
Posts: 8926
Joined: Fri Apr 03, 2009 7:05 am

Re: Client source code

Postby kmarad » Tue Apr 27, 2021 3:46 pm

I'm coding a client in python, and I have a little question about Hafen code :

OCache.java seems to get the "Delta" messages, and updates the client accordingly.

There is a lot of types of "delta" messages, and I don't really need all of them.
Especially for a beginning. I'd like to just get gobs, their movement, and their removal.

But since those messages are all packed in a bigger one, It looks like I must treat every single one to be sure to get those that I need.

Is that right or is there a lovely work-around ? ;)
kmarad
 
Posts: 132
Joined: Mon Jan 06, 2020 7:46 pm

Re: Client source code

Postby shubla » Tue Apr 27, 2021 10:31 pm

kmarad wrote:I'm coding a client in python, and I have a little question about Hafen code :

OCache.java seems to get the "Delta" messages, and updates the client accordingly.

There is a lot of types of "delta" messages, and I don't really need all of them.
Especially for a beginning. I'd like to just get gobs, their movement, and their removal.

But since those messages are all packed in a bigger one, It looks like I must treat every single one to be sure to get those that I need.

Is that right or is there a lovely work-around ? ;)

Well you don't have to simulate them all, you can just read enough to ignore them. Literally copy paste code from OCache.java, maybe 1 hour of work.
Image
I'm not sure that I have a strong argument against sketch colors - Jorb, November 2019
http://i.imgur.com/CRrirds.png?1
Join the moderated unofficial discord for the game! https://discord.gg/2TAbGj2
Purus Pasta, The Best Client
User avatar
shubla
 
Posts: 13043
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

Re: Client source code

Postby kmarad » Tue Apr 27, 2021 11:02 pm

shubla wrote:Well you don't have to simulate them all, you can just read enough to ignore them. Literally copy paste code from OCache.java, maybe 1 hour of work.


Haha, I'd gladly watch anyone translate OCache.java to it's python equivalent in an hour. :D
kmarad
 
Posts: 132
Joined: Mon Jan 06, 2020 7:46 pm

Re: Client source code

Postby shubla » Tue Apr 27, 2021 11:12 pm

kmarad wrote:
shubla wrote:Well you don't have to simulate them all, you can just read enough to ignore them. Literally copy paste code from OCache.java, maybe 1 hour of work.


Haha, I'd gladly watch anyone translate OCache.java to it's python equivalent in an hour. :D

Well you should of course implement Message.java first, because its quite core part of communication, and helpful as then you can just use same function names to read the messages.
After that OCache is just copy pasting, even in python, because there is almost no difference to how you would do them in python or any other object oriented capable language really.

You should also notice that most things in OCache consist of two functions. 1 Function that parses the message that server sent, and another that processes that information. You can only implement the first kind of function which parses the messages that server sends.

For example you won't have to do public static void overlay(Gob g, int olid, boolean prs, Indir<Resource> resid, Message sdt) {, It sufficies to do public Delta overlay(Message msg) {, which is maybe 3 or 4 rows in python, if you ignore all the data.

Look at this example:

IN java
Code: Select all
public Delta overlay(Message msg) {
   int olidf = msg.int32();
   boolean prs = (olidf & 1) != 0;
   int olid = olidf >>> 1;
   int resid = msg.uint16();
   Indir<Resource> res;
   Message sdt;
   if(resid == 65535) {
       res = null;
       sdt = Message.nil;
   } else {
       if((resid & 0x8000) != 0) {
      resid &= ~0x8000;
      sdt = new MessageBuf(msg.bytes(msg.uint8()));
       } else {
      sdt = Message.nil;
       }
       res = getres(resid);
   }
   return(gob -> overlay(gob, olid, prs, res, sdt));
    }


Same roughly in python, ignoring all message contents.
Code: Select all
def overlay(gob, msg):
      olid = msg.getint32()
      resid = msg.getuint16()
      if resid == 65535:
         pass
      else:
         if (resid & 0x8000) != 0:
            Message().addBytes(msg.getBytes(msg.getuint8()))
Image
I'm not sure that I have a strong argument against sketch colors - Jorb, November 2019
http://i.imgur.com/CRrirds.png?1
Join the moderated unofficial discord for the game! https://discord.gg/2TAbGj2
Purus Pasta, The Best Client
User avatar
shubla
 
Posts: 13043
Joined: Sun Nov 03, 2013 11:26 am
Location: Finland

PreviousNext

Return to The Wizards' Tower

Who is online

Users browsing this forum: No registered users and 11 guests