Verify link integrity in HTML games

Games in project or under development. The posts and games in this section can not ask for money.

Verify link integrity in HTML games

Postby bosbrand » Wed, 12Feb22 18:54

The vdategame Lisette finally pushed me over the edge. I've been annoyed by the fact that the existence of the files referred by the HTML seems to be an everlasting source of bugs for ages. But now I finally decided to do something about it.

I've written a small Java program that reads all *.html and *.js files in a directory, and verifies the existence of all (recognized) file mentions.
Currently that means that all filenames directly surrounded by quotes are recognized.
For example
Code: Select all
document.write("<img src='buttonsetc/clock930.jpg'>");
or
<area shape="rect" coords="536,119,654,228" onClick="varMinus5('money')" href="dbandbarcheck3.html" title="Choose beer" />

but that should be simple to expand if needed.

A little sample of the tool at work:
Code: Select all
C:\Users\bosbrand\Documents\Code\Results>java -jar LinkVerifier.jar "c:\Div\Virtual Dates\Lisette\game"
dbandbar4.html -> dbandcheck4.html      link missing
hdare102.html -> images/dare2.jpg      link missing
hdare103.html -> images/dare3.jpg      link missing
hdare3_13.html -> dare3_15.html      link missing
hdare3_5.html -> dare3_7.html      link missing
hdare9_12.html -> hare9_15.html      link missing
restgame.html -> street3.html      link missing
restgame.html -> street4.html      link missing
restgame.html -> street5.html      link missing
restgame.html -> home1.html      link missing
restgame2.html -> restquizcheck8.html      link missing
tubcheck3.html -> bedcheck2.html      link missing
tubcheck3.html -> bedroom2.html      link missing
tubcheck4.html -> bedcheck2.html      link missing
tubcheck4.html -> bedroom2.html      link missing
tubcheck5.html -> tun21.html      link missing
tubcheck6.html -> tun51.html      link missing


And of course a downloadlink, just in case there actually is a demand out there...
https://rapidshare.com/files/2834667117/LinkVerifier.jar
(Hope this works, never used Rapidshare before)
bosbrand
great white shark
 
Posts: 41
Joined: Sun, 11Mar27 23:00

Re: Verify link integrity in HTML games

Postby Ehlanna » Wed, 12Feb22 22:53

Bloody good idea!
If only the authors of such games would use it! :)
User avatar
Ehlanna
star of the reef
 
Posts: 423
Joined: Thu, 10Apr22 23:00
Location: Looking out the screen at you ... ;)

Re: Verify link integrity in HTML games

Postby ElKo » Wed, 12Feb22 22:57

Very nice tool!
But I don't think Chaotic will look at it.
ElKo
Pilot fish
 
Posts: 5
Joined: Sat, 11Apr30 15:48

Re: Verify link integrity in HTML games

Postby sylakone2 » Thu, 12Feb23 09:58

Hi i have downloaded it but how do I actually get it to work double clicking doesn't do anything sorry my java knowledge is very limited I know java script will but it is completely different.

Thanks
Cheers Sy
User avatar
sylakone2
lagoon predator
 
Posts: 224
Joined: Mon, 12Jan09 13:08
Location: Australia, SA
sex: Masculine

Re: Verify link integrity in HTML games

Postby bosbrand » Thu, 12Feb23 10:41

Of course. I should have packaged it with a little readme. You'll need to fire it up from the command line. Wish I knew how to integrate it better into Windows, but that's ongoing research, I'm afraid.

Anyways. Quick HowTo:

Start a command line and cd to the place where the LinkVerifier.jar lives.
Start the verifier with a command like this:
Code: Select all
java -jar LinkVerifier.jar "c:\documents\dirToBeChecked"

The results should show up directly on the screen.

HTH.
bosbrand
great white shark
 
Posts: 41
Joined: Sun, 11Mar27 23:00

Re: Verify link integrity in HTML games

Postby sylakone2 » Thu, 12Feb23 12:26

Thanks heaps that tool will be very useful as i get further into my new game.

Cheers
Cheers Sy
User avatar
sylakone2
lagoon predator
 
Posts: 224
Joined: Mon, 12Jan09 13:08
Location: Australia, SA
sex: Masculine


Return to Projects

Who is online

Users browsing this forum: No registered users and 11 guests

eXTReMe Tracker