Amber Client

Forum for alternative clients, mods & discussions on the same.
User avatar
jaguar
Posts: 251
Joined: Sun Jan 16, 2011 11:59 pm

Re: Amber Client

Post by jaguar »

And please explain why you send username and passwords over http?

Code: Select all

 private boolean mklogin() {
+        try {
+            URL url = new URL("http://www.havenandhearth.com/portal/sec/login");
+            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
+
+            Map<String,Object> params = new LinkedHashMap<>();
+            params.put("username", username);
+            params.put("password", pass);
+
+            StringBuilder postdata = new StringBuilder();
+            for (Map.Entry<String,Object> param : params.entrySet()) {
+                if (postdata.length() != 0)
+                    postdata.append('&');
+                postdata.append(URLEncoder.encode(param.getKey(), "UTF-8"));
+                postdata.append('=');
+                postdata.append(URLEncoder.encode(String.valueOf(param.getValue()), "UTF-8"));
+            }
+
+            conn.setRequestMethod("POST");
+            conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+            conn.setRequestProperty("Content-Length", String.valueOf(postdata.toString().length()));
+
+            conn.setDoOutput(true);
+            DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
+            wr.writeBytes(postdata.toString());
+            wr.flush();
+            wr.close();
+
+            int responsecode = conn.getResponseCode();
+            if (responsecode != HttpURLConnection.HTTP_OK)
+                return false;
+        } catch (IOException ex) {
+            return false;
+        }
+
+        return true;
+    }
Last edited by jaguar on Tue Sep 29, 2015 11:35 pm, edited 1 time in total.
User avatar
kaizokuroof
Posts: 799
Joined: Sat Jun 05, 2010 6:24 am

Re: Amber Client

Post by kaizokuroof »

jaguar wrote:And please explain why you send username and passwords over http?

Code: Select all

private boolean mklogin() {
        try {
            URL url = new URL("http://www.havenandhearth.com/portal/sec/login");
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();

            Map<String,Object> params = new LinkedHashMap<>();
            params.put("username", username);
            params.put("password", pass);
Pretty sure that's for the login screen, so you can login with multiple accounts/store multiple accounts.

Thanks for the client Ramovs, quality as always.
I had a retardedly huge signature and have gotten this embarrassing replacement to show for it.
User avatar
jaguar
Posts: 251
Joined: Sun Jan 16, 2011 11:59 pm

Re: Amber Client

Post by jaguar »

Accounts stored in registry currently. This code is new from not released(yet) client. Inside you can see that pass sent over http to http://www.havenandhearth.com/ portal. But this is really bad practice.

https://github.com/romovs/amber/commit/ ... e093907108
User avatar
GladiatoR
Posts: 213
Joined: Fri Aug 28, 2015 11:04 pm

Re: Amber Client

Post by GladiatoR »

Then they should use https connection to secure account details.
User avatar
romovs
Posts: 1472
Joined: Sun Sep 29, 2013 9:26 am
Location: The Tabouret

Re: Amber Client

Post by romovs »

jaguar wrote:
romovs wrote:
jaguar wrote:Incorrect frame on the pictures. So, I'm not alone who have this issue.
?
romovs wrote:Just drew a slightly a better top/bottom right corners for minimap window.
Wait who else is having this issue? All the screens I've seen have the updated frame.
jaguar wrote:And please explain why you send username and passwords over http?

Code: Select all

 private boolean mklogin() {
+        try {
+            URL url = new URL("http://www.havenandhearth.com/portal/sec/login");
+            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
...
Because I haven't gotten to that part yet. I literally just merged it like 30 minutes ago :). Work in progress...

In case anyone is wondering, this is for a new feature "status widget" developed by b0r3d0m. It displays current ping times and account status hence it needs to connect to havenandhearth.com website to get the account status information.
User avatar
jaguar
Posts: 251
Joined: Sun Jan 16, 2011 11:59 pm

Re: Amber Client

Post by jaguar »

I see :)
User avatar
Hervarth
Posts: 301
Joined: Sun Aug 16, 2015 4:24 pm

Re: Amber Client

Post by Hervarth »

romovs wrote:
karmov wrote:So I'm curious if anyone has gotten this client working on OSX? I've tried 1.6 and 1.8 Java with no luck, developer doesn't have a Mac to test with so I'm curious if anyone out there does have it working and if so, what's you configuration, OS version, java version, anything special you did to make it work?

For context, it's working for me except for clicks inside the main window which was the problem I had with vanilla client running Java 1.8. Moving to 1.6 fixed that with vanilla, but this client doesn't work in either version (or so it seems). I'm hoping someone out there with a Mac hit this snag and has a workaround because I've heard nothing but awesome stuff about this client and the options I have fiddled with while trying to get it working look fantastic. Would love to be able to use it.
I'll try to publish version compiled for 1.6 when the next update comes out (this Friday hopefully).
If you did this this would be great, i think it would fix all us mac users problems...
_Gunnar's alt
User avatar
Colin500
Posts: 1018
Joined: Mon Feb 14, 2011 11:07 pm

Re: Amber Client

Post by Colin500 »

Hey romovs.
I appreciate all the work you did in here with Amber Client and I want to say thanks for creating it.
Also I'm curious why don't you for example edit the first post with a changelog in spoiler?
User avatar
Apillion
Posts: 405
Joined: Mon Dec 30, 2013 10:34 am

Re: Amber Client

Post by Apillion »

Colin500 wrote:Hey romovs.
I appreciate all the work you did in here with Amber Client and I want to say thanks for creating it.
Also I'm curious why don't you for example edit the first post with a changelog in spoiler?
This!

Edit:
Also add a to do list so people can see what you are working on and not request the stuff that's already on your too do.

And so i can see the stuff i have requested has not been forgotten ¦]
Last edited by Apillion on Thu Oct 01, 2015 7:52 am, edited 2 times in total.
Vraatjuh
Posts: 456
Joined: Tue Sep 28, 2010 4:08 pm
Location: Heaven

Re: Amber Client

Post by Vraatjuh »

Great client so far.

Got one request though; show percentages on growing trees! I know it is possible since some other clients have it as well, and it would be a great feature for a tree-farmer like me!

keep up the great work!

Return to “The Wizards' Tower”