These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

EVE fitting exchange tool

Author
Tonto Auri
Vhero' Multipurpose Corp
#1 - 2013-04-18 18:04:31 UTC  |  Edited by: Tonto Auri
Ze link: http://eve.rootdir.org/evefit/
Ze screens:
EVE DNA is supported.
EFT regular dump is supported.
The result, ingame or out of game.

I've always wanted to do something like that.
saving fittings from EFT to XML, importing to game, then deleting them, because you didn't need them saved in first place - seems way too convoluted.
The opposite process isn't exactly smoother.
But now... now, you can get a fit into/out of game in a finger snap, send a link to your friend, get it back corrected, and send over, exchange ideas and propose variants, transparently in/out of game, across multiple operating systems, and all without loudmouths judging your loadout by their restricted individual perception...

Two most common elements in the universe are hydrogen and stupidity. -- Harlan Ellison

Tonto Auri
Vhero' Multipurpose Corp
#2 - 2013-04-18 22:02:21 UTC
P.S.
I'm NOT storing anything, neither I cache anything server-side, it's all easy come - easy go. But...
The main problem is that the resulting link is VERY long.
I'm looking for a way to shorten the resulting link WITHOUT storing anything at the server side.
If you have a clever idea that might help here, you are welcome.

Two most common elements in the universe are hydrogen and stupidity. -- Harlan Ellison

Tonto Auri
Vhero' Multipurpose Corp
#3 - 2013-04-21 14:55:02 UTC
Okay, I've won from 60% to 70% in average string length using custom DNA format.
http://eve.rootdir.org/evefit/:InXKDTwJPAmhVp9WGi.6B1RwOi0FZRxf0QvRC9EL0QuMekF5HXladah1DHXbdYJ1SXEYdxoy:Explorer

Two most common elements in the universe are hydrogen and stupidity. -- Harlan Ellison

Tonto Auri
Vhero' Multipurpose Corp
#4 - 2013-04-21 16:12:16 UTC
And unicode characters should be handled appropriately now.

Two most common elements in the universe are hydrogen and stupidity. -- Harlan Ellison

Golden Gnu
The Golden Gnu Corp
#5 - 2013-04-21 20:14:51 UTC
If I'm not wrong:
If you release the method you use to generate the url it would be super easy to implement "Export to http://eve.rootdir.org/evefit/" for all programs, right?

I for one would like the option added to jEveAssets...

Eve needs more Interoperability...

...I'm sorry if I'm totally wrong Blink

Creator of jEveAssets - the asset manager

"Download is the meaning of life, upload is the meaning of intelligent life"

Tonto Auri
Vhero' Multipurpose Corp
#6 - 2013-04-21 20:49:17 UTC  |  Edited by: Tonto Auri
I don't see the point, as you can convert about any link you may stumble upon into an URL, and get it out of the page in about any form you might need. (And I may change it slightly in the future) But...
It's really very simple. Each module type id is coded as u16, and packed into string. Multiple modules just repeated. Ammo and drones mentioned only once (this is necessary to simplify the whole thing).
The resulting string is converted using base64 algorythm, then a "+" sign is replaced by a dot to make the string URL-safe.
As you can see, it's really very simple, yet quite efficient. The only shortcoming I've noticed so far is that jQuery apparently not supported in IE8. So you might not get a nice fitting window in OOG browser.

P.S.
The handler also support GET requests with unencoded DNA for historycal reasons. Even less reason to try and match the internal DNA format of the script.
You may just feed it with direct link.
Which is usually at least 2 times longer. At least. But works quite well.

Two most common elements in the universe are hydrogen and stupidity. -- Harlan Ellison

Tonto Auri
Vhero' Multipurpose Corp
#7 - 2013-04-21 21:00:41 UTC
The code itself, that run the party for final DNA construction:

if(isset($fitting['hullId']))
{
$_dna = $fitting['hullId'] . ':';
$_fit = pack('v', $fitting['hullId']);

if(isset($fitting['modules']))
{
foreach($fitting['modules'] as $id => $module)
{
$_dna .= "$id;{$module['quantity']}:";
$i = $module['quantity'];
while($i--)
{
$_fit .= pack('v', $id);
}
}
}

foreach(array('drones', 'charges') as $cat)
{
if(isset($fitting[$cat]))
{
foreach($fitting[$cat] as $id => $module)
{
$_dna .= "$id;{$module['quantity']}:";
$_fit .= pack('v', $id);
}
}
}

$fitting['dna'] = $_dna . ':';
$fitting['evefit'] = strtr(base64_encode($_fit), '+', '.');
}

Two most common elements in the universe are hydrogen and stupidity. -- Harlan Ellison

Tonto Auri
Vhero' Multipurpose Corp
#8 - 2013-04-21 21:07:17 UTC  |  Edited by: Tonto Auri
As I said, I MAY change the resulting custom DNA to include "amount" field for drones and charges, if there would be a strong argument for it.
My initial goal was to make the process of bringing fits into game from EFT/forums, and out of game to EFT and forums a bit more straightforward.
So far, I'm satisfied with the results.

And I already see a way to make that happen... ha!

Two most common elements in the universe are hydrogen and stupidity. -- Harlan Ellison

Tonto Auri
Vhero' Multipurpose Corp
#9 - 2013-04-21 21:38:49 UTC
And encoding issues in IE are resolved at last... Stupid microsoft can't see the explicit charset declarations...

Two most common elements in the universe are hydrogen and stupidity. -- Harlan Ellison

Golden Gnu
The Golden Gnu Corp
#10 - 2013-04-22 17:28:32 UTC
Yes, the unencoded format is much easier to work with, obviously...

One a small side note:
1) On the display page: The auto select all - is not working very well (in Google chrome)
1st mouse button down: Select everything
1st mouse button release: Deselect everything
2nd mouse button down: Nothing happens
2nd. mouse button release: Select everything
3rd mouse down down: Nothing happens
3rd mouse button release: Deselect everything
4th as 2nd
5th as 3rd
etc.
I would prefer on focus select all only - that way I can copy a single module...

Creator of jEveAssets - the asset manager

"Download is the meaning of life, upload is the meaning of intelligent life"

Tonto Auri
Vhero' Multipurpose Corp
#11 - 2013-04-22 23:57:25 UTC
Golden Gnu wrote:
Yes, the unencoded format is much easier to work with, obviously...

One a small side note:
1) On the display page: The auto select all - is not working very well (in Google chrome)

Bugreport it to Google Chrome developers. Though, they are as responsible, as CCP...
It works as intended in IE and Opera.

Two most common elements in the universe are hydrogen and stupidity. -- Harlan Ellison

Manhim
Garoun Investment Bank
Gallente Federation
#12 - 2013-04-25 15:31:45 UTC
You could make an easy to use/make api that that would take all the ids and information as arguments through a POST call and it would return the resulting compact URL. Kinda like URL minifiers.
Tonto Auri
Vhero' Multipurpose Corp
#13 - 2013-04-25 15:55:07 UTC  |  Edited by: Tonto Auri
It already works exactly that way.
You're free to use it as "API", if you wish.

Two most common elements in the universe are hydrogen and stupidity. -- Harlan Ellison