State of Fortune

I just finished uploading the higher quality textures. Thanks to the dds compression I’m now using 4 times as high resolution textures while using a quarter of the space :slight_smile: Thanks! Here is a picture of how the new blocks look like.


http://stateoffortune.com/pictures/screenshots/newBlocksSmall.png

Click for a bigger picture

There are still textures to be improved like the shop, shopkeeper, grain and the machines, but that will come at a later time.

Mike

Really wanted to try the game.

But it won’t let me login.

Here is my user: Zeke

I don’t know if my password is the problem. It is 30 chars long and has a lot of symbols, upper case, and numbers… etc.

Could that be an issue? I really want to try this out!!!

Really wanted to try the game.

But it won’t let me login.

Here is my user: Zeke

I don’t know if my password is the problem. It is 30 chars long and has a lot of symbols, upper case, and numbers… etc.

Could that be an issue? I really want to try this out!!!

Hi Zeke,

Thanks for the interest! :slight_smile:

I see your account but for security reasons I cannot see passwords. Maybe you could try to reset it by clicking on “Forgot password?” in the launcher and see if that is the problem indeed.

Maybe you can let me know whether or not it works in a PM or on the forum of the game :slight_smile:

I currently encode the password to md5 before submitting it from the launcher, maybe my function doesn’t handle all cases that well? Does anyone have a piece of code that they know work and give the same answer as PHP?

This is how it currently looks like and it always worked until now:

    public static String encrypt(String input) {
        String result = input;
        if (input != null) {
            MessageDigest md;
            try {
                md = MessageDigest.getInstance("MD5");
                md.update(input.getBytes("UTF-8"));
                BigInteger hash = new BigInteger(1, md.digest());
                result = hash.toString(16);
                while (result.length() < 32) {
                    result = "0" + result;
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return result;
    }

Mike

Hi Zeke,

Thanks for the interest! :slight_smile:

I see your account but for security reasons I cannot see passwords. Maybe you could try to reset it by clicking on “Forgot password?” in the launcher and see if that is the problem indeed.

Maybe you can let me know whether or not it works in a PM or on the forum of the game :slight_smile:

I currently encode the password to md5 before submitting it from the launcher, maybe my function doesn’t handle all cases that well? Does anyone have a piece of code that they know work and give the same answer as PHP?

This is how it currently looks like and it always worked until now:

    public static String encrypt(String input) {
        String result = input;
        if (input != null) {
            MessageDigest md;
            try {
                md = MessageDigest.getInstance("MD5");
                md.update(input.getBytes("UTF-8"));
                BigInteger hash = new BigInteger(1, md.digest());
                result = hash.toString(16);
                while (result.length() < 32) {
                    result = "0" + result;
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return result;
    }

Mike

Be strict! (and limit variable scopes) :point:


@@ byte[] passwordHash = hash(password.getBytes("UTF-8"));

-    public static String encrypt(String input) {
+    public static String hash(byte[] input) {
-        String result = input; // no longer needed

-        if (input != null) {
+        if (input == null) throw new IllegalArgumentException(); // early out!

-            MessageDigest md;
            try {
-                md = MessageDigest.getInstance("MD5");
+               MessageDigest md = MessageDigest.getInstance("MD5");
                md.update(input);
-               BigInteger hash = new BigInteger(1, md.digest());
-               result = hash.toString(16);
-               while (result.length() < 32) {
-                   result = "0" + result;
-               }
+               return toHex(md.digest());
            } catch (Exception e) {
@@                // so when something goes wrong, we return the original password!? no way!

-               e.printStackTrace();
+               throw new ShouldNeverHappenException(e);
            }
-        }
-        return result;
    }


	private static final char[] hex_lookup_table = "0123456789abcdef".toCharArray();

	public static String toHex(byte[] data)
	{
		char[] hex = new char[data.length * 2];
		for(int i = 0, p = 0; i < data.length; i++)
		{
			hex[p++] = hex_lookup_table[(data[i] >> 4) & 0xF];
			hex[p++] = hex_lookup_table[(data[i] >> 0) & 0xF];
		}
		return new String(hex);
	}

My $0.02 :persecutioncomplex:

Awesome as always Riv :slight_smile: I’ll try it out and see how it works with weird passwords.

Mike

Please, don’t only hash your passwords with md5. That’s still a security problem.

If someone knows the password of one of the users, he is able to crack all other user’s accounts that have the same hash. Please use salting, so this doesn’t happen.

Also, there is stuff like Rainbow Tables, which make it easier / possible to brute-force md5 hashed passwords with today’s amount of memory and computation speed.

I suggest you to look into the ‘Blowfish’ algorithm. I have just quickly googled about what your options are. It looks like JCE is the best option.

Wait a minute, I’ll try to write up a simple function and test it :slight_smile:

Be strict! (and limit variable scopes) :point:


@@ byte[] passwordHash = hash(password.getBytes("UTF-8"));

-    public static String encrypt(String input) {
+    public static String hash(byte[] input) {
-        String result = input; // no longer needed

-        if (input != null) {
+        if (input == null) throw new IllegalArgumentException(); // early out!

-            MessageDigest md;
            try {
-                md = MessageDigest.getInstance("MD5");
+               MessageDigest md = MessageDigest.getInstance("MD5");
                md.update(input);
-               BigInteger hash = new BigInteger(1, md.digest());
-               result = hash.toString(16);
-               while (result.length() < 32) {
-                   result = "0" + result;
-               }
+               return toHex(md.digest());
            } catch (Exception e) {
@@                // so when something goes wrong, we return the original password!? no way!

-               e.printStackTrace();
+               throw new ShouldNeverHappenException(e);
            }
-        }
-        return result;
    }


	private static final char[] hex_lookup_table = "0123456789abcdef".toCharArray();

	public static String toHex(byte[] data)
	{
		char[] hex = new char[data.length * 2];
		for(int i = 0, p = 0; i < data.length; i++)
		{
			hex[p++] = hex_lookup_table[(data[i] >> 4) & 0xF];
			hex[p++] = hex_lookup_table[(data[i] >> 0) & 0xF];
		}
		return new String(hex);
	}

My $0.02 :persecutioncomplex:

Awesome as always Riv :slight_smile: I’ll try it out and see how it works with weird passwords.

Mike

Please, don’t only hash your passwords with md5. That’s still a security problem.

If someone knows the password of one of the users, he is able to crack all other user’s accounts that have the same hash. Please use salting, so this doesn’t happen.

Also, there is stuff like Rainbow Tables, which make it easier / possible to brute-force md5 hashed passwords with today’s amount of memory and computation speed.

I suggest you to look into the ‘Blowfish’ algorithm. I have just quickly googled about what your options are. It looks like JCE is the best option.

Wait a minute, I’ll try to write up a simple function and test it :slight_smile:

@Mickelukas

Ya, Matheus23 and Riven are pretty spot on.

Here are two links you may want to read.

http://www.php.net/manual/en/faq.passwords.php

Also, it is working now… password is now only 12 chars after reset. (Idc about this pass, it is strickly for this game)

– Break –

On a separate note, how do I build things in the game??? I wana make a building. :slight_smile:

@Mickelukas

Ya, Matheus23 and Riven are pretty spot on.

Here are two links you may want to read.

http://www.php.net/manual/en/faq.passwords.php

Also, it is working now… password is now only 12 chars after reset. (Idc about this pass, it is strickly for this game)

– Break –

On a separate note, how do I build things in the game??? I wana make a building. :slight_smile:

In playground simply click ‘b’ and go nuts :slight_smile:

In game, buy a piece of land by clicking on a for sale sign (land gets cheaper further away), click ‘b’ and go nuts until you run out of money :wink:

You might want to plant some grain to get a bit of income. To open the inventory you can click ‘i’ or ‘e’.

Mike

In playground simply click ‘b’ and go nuts :slight_smile:

In game, buy a piece of land by clicking on a for sale sign (land gets cheaper further away), click ‘b’ and go nuts until you run out of money :wink:

You might want to plant some grain to get a bit of income. To open the inventory you can click ‘i’ or ‘e’.

Mike

Adding bump maps without passing the tangent doesn’t make it look as nice as when the tangent is passed. I’ll have to add that somewhere down the road. For now it’s done in the fragment shader.

Here are a couple of screenshots of how the game scales with the lowest and highest settings (my laptop runs the lowest settings in 200-300fps, and the highest in 30-40 for a comparison).

http://stateoffortune.com/pictures/screenshots/lowSettings.png


http://stateoffortune.com/pictures/screenshots/highSettings.png

I’ve also passed 170 registered accounts :slight_smile:

Mike

Adding bump maps without passing the tangent doesn’t make it look as nice as when the tangent is passed. I’ll have to add that somewhere down the road. For now it’s done in the fragment shader.

Here are a couple of screenshots of how the game scales with the lowest and highest settings (my laptop runs the lowest settings in 200-300fps, and the highest in 30-40 for a comparison).

http://stateoffortune.com/pictures/screenshots/lowSettings.png


http://stateoffortune.com/pictures/screenshots/highSettings.png

I’ve also passed 170 registered accounts :slight_smile:

Mike

I’m still waiting for some new stuff :smiley:
And people online too :smiley:

Also… I’ve done something that I havent for a long time… I FOUND A BUG! :smiley:

On Login:

http://joaolourenco.net/StateBugs/Bug1.png

On Teleport:

http://joaolourenco.net/StateBugs/Bug2.png

I’m still waiting for some new stuff :smiley:
And people online too :smiley: