HOWTO: Put your images on a webserver (Repository)

Articles on how to do things in MapTool (answers only here -- questions should stay in the main MT forum)

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Forum rules
Please discuss all HOWTO topics in the main forum. They will be moved here by a moderator when appropriate.
User avatar
trevor
Codeum Arcanum (RPTools Founder)
Posts: 11311
Joined: Mon Jan 09, 2006 4:16 pm
Location: Austin, Tx
Contact:

Post by trevor »

Phergus wrote:Why a per campaign repository?
For convenience.

having a single respository with all your images available to any of your campaigns is totally possible, and is in fact what the rptools gallery does.

The whole concept is having an index file you tell MT about that contains the md5key of the image and a relative path on the web server of the actual file.

The index for the rptools gallery, which comes default with every campaign, uses a perl script to walk the gallery image hierarchy and creates the index. We'll be making this script available along with other ways of creating the index.

We hope to get it installed at other major image repositories such as rpgmapshare.

I'll also add MapTool level repositories that you add that apply to all campaigns that you load. Then you just add all the major repositories along with your personal repositories, and you should never have anyone pulling images from your MT server again :)

Summary
The campaign repo export is simply a convenience mechanism to take advantage of a more elaborate system. It automatically creates the index and groups the images necessary for your campaign. But nothing is stopping you from creating your own repository with your own index and updating it in any way that you want ;)
Dreaming of a 1.3 release

User avatar
Mortani
Giant
Posts: 131
Joined: Tue Oct 03, 2006 11:00 am

Post by Mortani »

trevor wrote: having a single respository with all your images available to any of your campaigns is totally possible, and is in fact what the rptools gallery does.
I'm walking this through to make sure I've followed it correctly in regards to the "single repository" concept which is what I find valuable in this feature. Not that the "per campaign" doesn't have merit, but I wouldn't prefer to use it like that.

With that thought in mind, in order to use that Gallery Repository (Or my own Single Repository once the perl script is available) so the md5's match up is to either use the unaltered image files copied to your local pc so you can use the Image Explorer method or to drag them from the Web into your campaign.

Next when folks connect to your campaign, rptools tells them the md5 of the file they need to get and since it's available in the Gallery Repository it would choose to download it from there?

If I got that right, the only thing I would want to help make a "Single Repository" easier is the ability to add another Default Repository. As of now when you add one it only "sticks" inside that campaign file.

User avatar
trevor
Codeum Arcanum (RPTools Founder)
Posts: 11311
Joined: Mon Jan 09, 2006 4:16 pm
Location: Austin, Tx
Contact:

Post by trevor »

Mortani wrote:If I got that right, the only thing I would want to help make a "Single Repository" easier is the ability to add another Default Repository. As of now when you add one it only "sticks" inside that campaign file.
Yup :) As noted above, there will be MapTool level repositories that apply to all campaigns. But that isn't in there yet.
Dreaming of a 1.3 release

User avatar
Mortani
Giant
Posts: 131
Joined: Tue Oct 03, 2006 11:00 am

Post by Mortani »

Sweet. Given the way it works, the Http based Image Explorer is less interesting to me as I would want the images local so I can build maps as fast as Dorpond!

User avatar
Sir Flak
Dragon
Posts: 344
Joined: Thu Sep 28, 2006 4:20 pm
Location: Oklahoma, US

Post by Sir Flak »

Maybe steel rat can index rpgmapshare.com's gallery? Between the two galleries i think nearly all my images would be in a repository. The only ones missing would be dundjinni forum stuff.

User avatar
trevor
Codeum Arcanum (RPTools Founder)
Posts: 11311
Joined: Mon Jan 09, 2006 4:16 pm
Location: Austin, Tx
Contact:

Post by trevor »

Sir Flak wrote:Maybe steel rat can index rpgmapshare.com's gallery? Between the two galleries i think nearly all my images would be in a repository. The only ones missing would be dundjinni forum stuff.
I wonder if we could get mindy to drop in the perl script that generates it. Doubt it, but that would rule.
Dreaming of a 1.3 release

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Post by Phergus »

trevor wrote:I'll also add MapTool level repositories that you add that apply to all campaigns that you load.
'nuff said.

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Post by RPTroll »

trevor wrote:
Sir Flak wrote:Maybe steel rat can index rpgmapshare.com's gallery? Between the two galleries i think nearly all my images would be in a repository. The only ones missing would be dundjinni forum stuff.
I wonder if we could get mindy to drop in the perl script that generates it. Doubt it, but that would rule.
Perl? I love perl. :-)

OK, pursuant to Phergus' remark about an entire image set being in a repository, can we have access to the perl script that indexes the subdirs and produce the index file?
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

User avatar
Kepli
Giant
Posts: 218
Joined: Sat Dec 23, 2006 2:58 pm
Location: Netherlands
Contact:

Post by Kepli »

trevor wrote:
Sir Flak wrote:Maybe steel rat can index rpgmapshare.com's gallery? Between the two galleries i think nearly all my images would be in a repository. The only ones missing would be dundjinni forum stuff.
I wonder if we could get mindy to drop in the perl script that generates it. Doubt it, but that would rule.
You'll have to wait for the new Dunjinni website :wink:
Image

osman
Giant
Posts: 100
Joined: Sat Apr 12, 2008 12:23 pm
Location: Latham, NY

Post by osman »

Hi. I've been checking out MapTool pretty heavily for the last few days, after trying to find a good VTT. (Might need one soon, if some of my group has to move away for work reasons...). Anyway, during exploration of the UI, I found the Repositories thing, and had to try and guess at what it did, which led me to this thread.

I'm still a little confused, though. I've been trying to compile a decent library of artwork from the excellent links on the forums. Several people in this thread are discussing using lots of artwork from the Gallery. How? Is there some way to directly use images that haven't been downloaded? If not, I seem to be missing an easy way to download the entire Gallery contents (if that's what people are doing). Or are people just picking and choosing what they want from the Gallery? Also, does the md5 sum include the relative path? In other words, if I just want to use Gallery art to avoid uploading any more images anywhere, do I have to preserve the directory structure that's reflected in the index file?

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Post by Phergus »

osman wrote:Several people in this thread are discussing using lots of artwork from the Gallery. How? Is there some way to directly use images that haven't been downloaded?
Basically if you have downloaded a map or other graphic from the Gallery - and haven't modified it in any way - then when your players view the map with that graphic it will be requested from the RPTools Gallery instead of from you.
osman wrote:Or are people just picking and choosing what they want from the Gallery?
Yes.
osman wrote:Also, does the md5 sum include the relative path?
Nope. The md5 checksum is calculated on the image. When a client needs an image it checks its own local cache and if it isn't there then the remote repositories are checked and finally it is requested from the GMs server. The GM's server knows where it is from when you placed it within the campaign.

Neither the GM nor the players need to worry about directory structures.

osman
Giant
Posts: 100
Joined: Sat Apr 12, 2008 12:23 pm
Location: Latham, NY

Post by osman »

Aha. Thanks a lot, it makes a lot more sense now. The md5 sums being over the images themselves, plus the format of the index files, makes everything fit together quite nicely.

User avatar
trevor
Codeum Arcanum (RPTools Founder)
Posts: 11311
Joined: Mon Jan 09, 2006 4:16 pm
Location: Austin, Tx
Contact:

Post by trevor »

osman wrote:The md5 sums being over the images themselves, plus the format of the index files, makes everything fit together quite nicely.
Indeed ! Hurray for one way hashing algorithms :)
Dreaming of a 1.3 release

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Post by Full Bleed »

I'm glad that we have this option... but I do wish it was much easier to use and see what was going on. I wish I could just designate a FTP directory that MT would look first before pulling from the host server.

As it is now, once I've started a campaign I'm not really sure how I go about updating them through the repository without re-exporting the entire campaign repository and uploading it... etc.

And once I've uploaded the zip to my web space and unzipped it, and the "assets" directory and index.gz file is created, can I then delete the zip file?

What happens when I upload another zipped campaign file try and unzip it to the same? Will the files from both campaigns for into the same assets folder? Will the index.gz be overwritten or appended with the new information?

I honestly have very little conception of what's happening on my webspace when the assets directory and index.gz file is created. I just know that for the 6 meg campaign file I uploaded, it seemed to work. But I haven't tried sending a second campaign file up yet because I'm not sure what's going to happen when I try.

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Post by Phergus »

Updating Existing Campaign Repositories

Two methods: Full Replacement or Update

Both require you to first export a current campaign repository file.

For Full Replacement, delete the existing files from your web server and upload the contents from the new repository file to the website. You can also just upload over the top of the existing files on the website.

For Update, upload any new assets from the new repository file that aren't present on the web repository and then upload the new index.gz file. You could also remove any assets that are on the website but not in the current repository if saving space is an issue.

Multiple Campaign Repositories

The repositories for different campaigns should be placed in separate directories on the website. If you have two campaigns, Campaign1 and Campaign2, then you would have two directories and two repositories on your web site.

Your repository directory on your website would look something like this:

Code: Select all

/www/repos/.
+---Campaign1
|   |   index.gz
|   |
|   \---assets
|           0b21e8af0c7e51d2876cef4cd79da722
|           85382ae371d18220e98fccc16221326a
|           c200eeec9d354bc546a05aa615865ca8
|           c4a499da1e97010b2ff20dcdb4e2054f
|           d90294b4bcbfb849dcea0b03b192c9c1
|
\---Campaign2
    |   index.gz
    |
    \---assets
            0b21e8af0c7e51d2876cef4cd79da722
            85382ae371d18220e98fccc16221326a
            c200eeec9d354bc546a05aa615865ca8
            c4a499da1e97010b2ff20dcdb4e2054f
            d90294b4bcbfb849dcea0b03b192c9c1
In the example the campaigns are the same but wouldn't be normally.

You would add the corresponding repository URL to each campaign.

http://www.yoursitename.com/repos/Campaign1/index.gz

or

http://www.yoursitename.com/repos/Campaign2/index.gz

Post Reply

Return to “How To”