Amber Client

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

Re: Amber Client

Postby jaguar » Tue Sep 29, 2015 11:02 pm

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
jaguar
 
Posts: 251
Joined: Sun Jan 16, 2011 11:59 pm

Re: Amber Client

Postby kaizokuroof » Tue Sep 29, 2015 11:19 pm

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
kaizokuroof
 
Posts: 799
Joined: Sat Jun 05, 2010 6:24 am

Re: Amber Client

Postby jaguar » Tue Sep 29, 2015 11:39 pm

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/1e9adba2c756be19daa14adfd42636e093907108
User avatar
jaguar
 
Posts: 251
Joined: Sun Jan 16, 2011 11:59 pm

Re: Amber Client

Postby GladiatoR » Tue Sep 29, 2015 11:51 pm

Then they should use https connection to secure account details.
User avatar
GladiatoR
 
Posts: 213
Joined: Fri Aug 28, 2015 11:04 pm

Re: Amber Client

Postby romovs » Wed Sep 30, 2015 12:06 am

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
romovs
 
Posts: 1472
Joined: Sun Sep 29, 2013 9:26 am
Location: The Tabouret

Re: Amber Client

Postby jaguar » Wed Sep 30, 2015 3:01 am

I see :)
User avatar
jaguar
 
Posts: 251
Joined: Sun Jan 16, 2011 11:59 pm

Re: Amber Client

Postby Hervarth » Wed Sep 30, 2015 4:25 am

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
Hervarth
 
Posts: 301
Joined: Sun Aug 16, 2015 4:24 pm

Re: Amber Client

Postby Colin500 » Thu Oct 01, 2015 6:37 am

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
Colin500
 
Posts: 1018
Joined: Mon Feb 14, 2011 11:07 pm

Re: Amber Client

Postby Apillion » Thu Oct 01, 2015 6:39 am

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.
User avatar
Apillion
 
Posts: 405
Joined: Mon Dec 30, 2013 10:34 am

Re: Amber Client

Postby Vraatjuh » Thu Oct 01, 2015 7:18 am

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!
Vraatjuh
 
Posts: 454
Joined: Tue Sep 28, 2010 4:08 pm
Location: Heaven

PreviousNext

Return to The Wizards' Tower

Who is online

Users browsing this forum: Meta [Bot] and 0 guests