Jump to content
Ding

Coding a Hatchery

Recommended Posts

Well, using the API, one would at least be able to find lineage shapes like even-gen, stair, spiral. But scanning a whole scroll + every dragon's ancestors probably leads to quite some server strain.

 

What I'd like to do is an interface where I enter up to 3 codes: male, female, sample offspring, and select a breed for male and female (possibly from a drop-down box to avoid the infinituplety of spellings for each breed). Then the tool would display number of generations and each dragon's name, and lineage notes like "perfect checker", "alternating checker", "faux checker with silver Shimmer", "inbred checker" or even "would be a checker but refused 2016-02-02, need new mate". Basically, I've build something like that just last week as a spreadsheet which I would happily share if only google drive would work on this computer ... I'll get the link tomorrow at work if you're interested xd.png

I'll PM you with the thoughts I have so far. smile.gif

Share this post


Link to post

I was hoping I could get a little advice on interacting with the API and what is expected of a site before they can expect API access granted to them.

 

I have a lot of experience with more general aspects of website design, and I have been making a fansite mostly for my own amusement, but I have almost no experience working with an API. I was hoping to use the API but I haven't heard back about accessing it in over a week. That might be normal, I'm not sure. Do I need to do a 'beta' period of public run before the site is acceptable enough to use the API?

 

I wanted my fansite to be able to access View Count, Unique View and Click counts before 'launch' because I was hoping to have a few fun toys in there in addition to the normal hatchery stuff. Right now all the hatchery auto-detection (Removing adults, switching dragons to the egg section vs. the hatchling section, etc) is generated through imagery comparison, which accounts for most dragon aging, but not for frozen hatchlings, and detecting dead ones might pose a problem if any hatchling images are too similar to the dead image (vampires come to mind). If I need to do a beta launch before I can get API data, does anyone have advice for tools that I should consider to make a nicer API-lacking site?

 

Any advice on these elements would be incredibly appreciated! And by way of thanks, if anyone has coding questions regarding HTML, CSS, PHP or MYSQL I have several years of experience under my belt that I would be happy to share. I'm still shaky on Javascript, lol.

 

Share this post


Link to post

I have a lot of experience with more general aspects of website design, and I have been making a fansite mostly for my own amusement, but I have almost no experience working with an API. I was hoping to use the API but I haven't heard back about accessing it in over a week. That might be normal, I'm not sure. Do I need to do a 'beta' period of public run before the site is acceptable enough to use the API?

I think I ended up waiting for an API key for seven months or thereabouts, and submitted a request twice (possibly three times) in that time period. The last request was answered very quickly, though, so it might just be a question of when you catch TJ in a good moment? Er. I don't really want to encourage spamming his inbox, haha.

 

I dunno, though, keep an eye on it and resubmit after a few more weeks? smile.gif

 

I don't think you need a beta site, but I might be mistaken. The only data point I have is Daily Dragon Fix, which isn't even my site but emmilely's, and was originally coded with no API at all (and can still run independent of it, should something ever happen to the API or my access to it).

 

If you do want to make a beta site, frozen hatchlings tend to be a fairly insignificant problem (holidays notwithstanding, I suppose!) and in my experience don't really need addressing. That said, dead hatchlings just get a tombstone, which should be easy enough to differentiate to the vampire hatchlings if you're really doing an image comparison. Alternatively, maybe consider giving people the right to mark a dragon as fogged/dead/frozen/adult and keep a counter, unique by IP, as to how many people have marked the dragon, then kick the code out when e.g. five unique people have marked it. (That approach (except with user accounts rather than IPs) is what Daily Dragon Fix would fall back to if the API is not available.)

 

Hope that helps! user posted image

Edited by pinkgothic

Share this post


Link to post

Thanks for the information! I'll give it some more time, and then resubmit. There's still a lot of backend stuff to do so its not like I'm in urgent need of the API smile.gif

 

 

Share this post


Link to post

Would it be worth paying someone to code a Hatchery for me? I've always wanted to run a Hatchery, but have zero coding knowledge.

Share this post


Link to post

I'm not a coder, but I just don't see the point of running a hatchery if you can't do any of the upkeep on it. If you really want to run a hatchery, I would really suggest putting in time to learn at least some basic coding so you have a basic understanding of what is possible, can help with maintenance, etc.

Share this post


Link to post
I'm not a coder, but I just don't see the point of running a hatchery if you can't do any of the upkeep on it. If you really want to run a hatchery, I would really suggest putting in time to learn at least some basic coding so you have a basic understanding of what is possible, can help with maintenance, etc.

Oh, I didn't think of that. Thanks for the input! I'll maybe try to learn some coding. smile.gif

Share this post


Link to post
how about if someone posts a base code here to help others who don't have much knowledge on php/html ?

Probably because if you're going to be running a hatchery, you really need a good bit of knowledge about how to code it in the first place. When issues crop up, it'll really help you in figuring out how to fix them if you understand the code, and the best way to do that is to create it yourself. The tutorials on php/html in the first post should really help get you started on figuring it out, though. As well, reading through the thread might give you some insight on what goes into creating and hosting a site. =)

Share this post


Link to post

FYI

Seems there was an API change:  

    [errors] => Array
        (
            [0] => Array
                (
                    [0] => 7
                    [1] => Switch to HTTPS. HTTP may break in the future.
                )
        )

 

Replace occurrences of http://dragcave.net/api with https://dragcave.net/api 

Share this post


Link to post
17 hours ago, MaidMarian said:

FYI

Seems there was an API change:  

 


    [errors] => Array
        (
            [0] => Array
                (
                    [0] => 7
                    [1] => Switch to HTTPS. HTTP may break in the future.
                )
        )

 

 

Replace occurrences of http://dragcave.net/api with https://dragcave.net/api 

That error is more of a warning; you will still receive the full API response alongside it.

 

I've mentioned a few times in the past (i.e. when HTTP has broken in the past) that HTTPS is the future.

Share this post


Link to post

So, in light of this: https://forums.dragcave.net/topic/89465-list-of-active-fansites/?do=findComment&comment=9612515

 

The things I'm missing about EatW are:

 

- the fact that the inbred checker used the API's "massview" option (because that one's the only way to see if an egg is still in AP limbo - I wish there was another way, but there isn't)

- the scroll checker that filtered caveborn adult dragons

- the dragonmarket (with API login)

 

Anyone stepping up for any of these three features? XD

Share this post


Link to post

^^^

I also sorely miss EATW "tools" page: current Day/Night Glory drops, hatching times for Sunrises and Sunsets, Zombie visibility.

 

...although from my very limited understanding that might be way easier to code than the features Ruby Eyes listed?? *has no clue*

Share this post


Link to post

@Aleoleo

Day and Night Glory drops as well as the sun rising and setting can now be checked via this in-game page: https://dragcave.net/help/time

It would say "Time of Day It is day. The sun is rising." when Day Glories can be found/laid and Sunrises hatch.

It would say "Time of Day It is day." when Day Glories can be found/laid but neither Sunrises nor Sunsets hatch.

etc.

For zombie visibility, I suppose you'll have to check a Zombie?

Edited by Ruby Eyes

Share this post


Link to post
4 minutes ago, Ruby Eyes said:

@Aleoleo

Day and Night Glory drops as well as the sun rising and setting can now be checked via this in-game page: https://dragcave.net/help/time

It would say "Time of Day It is day. The sun is rising." when Day Glories can be found/laid and Sunrises hatch.

It would say "Time of Day It is day." when Day Glories can be found/laid but neither Sunrises nor Sunsets hatch.

etc.

For zombie visibility, I suppose you'll have to check a Zombie?

 

I actually never noticed the added "the sun is rising" sentence! That does help, thanks for the tip! <3

 

...although I still miss the handy "they will next be able to hatch in....." box-thing. Then I didn't have to think at all. XD

Share this post


Link to post

I don't know if it has been suggested yet, but would it be possible for a fansite to put an upper limit on the number of people being able to view eggs at any one given time? Like, maybe 100 users at once? Additionally, any user viewing eggs through a rotator should be kicked automatically after they've given one view to everything, so that other users can give their unique view to the little ones, too. I think that this (or any other appropriate number of users able to view) should be able to prevent further bot attacks like the one that happened to EATW while allowing our eggs and hatchlings to grow up at a reasonable rate. Win-win.

Share this post


Link to post
On 4/5/2010 at 5:09 PM, Stealthypugs said:

I don't know of any place that will assist you in making your own hatchery, but I'm guessing that you can learn from this:

 

http://www.jaemeia.net/er/geter.php

 

It gives you codes so you can add an ER to a page, although this can easily be used as just a regular hatchie if I'm not mistaken.

 

Hope that helps!

wait what...there is nothing helpful there!

Share this post


Link to post

That's because the post you linked is very old. Jaemeia fell over years ago. But you are never going to find a site that does it all for you, as you seem to want. You said in another thread that you haven't time to learn coding, in which case, this is probably not a good idea for you anyway. Setting up a fansite is not just copying code and posting a link, and to make anyone want to use yours, you'd need the knowhow to add something the others don't have.

Share this post


Link to post
On 9/11/2016 at 9:07 AM, Obscure_Trash said:

Probably because if you're going to be running a hatchery, you really need a good bit of knowledge about how to code it in the first place. When issues crop up, it'll really help you in figuring out how to fix them if you understand the code, and the best way to do that is to create it yourself. The tutorials on php/html in the first post should really help get you started on figuring it out, though. As well, reading through the thread might give you some insight on what goes into creating and hosting a site. =)

This post says it all. Sorry for double posting, but my tablet refused to copy/paste!

Share this post


Link to post

Not sure if this thread is still active - let me know if I need to post elsewhere! - but from what I see in the API text, the dragon data doesn't give either the species or the image of the dragon, is that correct?

 

If so, how do hatcheries etc get dragon images? Page scraping for them seems like it'd defeat the point of having an API, so I'm fairly sure I'm missing something.

 

Also, if the above is true, is there a way to get the dragon's species via the API?  I'm intending on coding myself some kind of lair-and-lineage organising tool, half for the learning experience and half because doing lineage charts in a spreadsheet makes me want to cry, but I need to know what I'm able to get before I start designing exactly how things should connect to each other...

Share this post


Link to post
32 minutes ago, Nootybloops said:

Not sure if this thread is still active - let me know if I need to post elsewhere! - but from what I see in the API text, the dragon data doesn't give either the species or the image of the dragon, is that correct?

 

If so, how do hatcheries etc get dragon images? Page scraping for them seems like it'd defeat the point of having an API, so I'm fairly sure I'm missing something.

You can get an individual dragon's image through its code. If you look at the "Show HTML/BBCode Links" link on the /view/ page of a dragon, there's a section called "Direct Links" which give you the URL for the image. For example, NvWwX's image link is https://dragcave.net/image/NvWwX.gif - so if you just know the code, you can construct that URL.

 

For lineage builders, it's manual maintenance; whenever there's a new species, the site owner downloads the necessary images and adds them to their site's database.

 

See also 

 for some prior discussion, and

. for a request of the functionality (unsure why that's locked, might be an indicator it won't happen).

Share this post


Link to post
30 minutes ago, Nootybloops said:

Not sure if this thread is still active - let me know if I need to post elsewhere! - but from what I see in the API text, the dragon data doesn't give either the species or the image of the dragon, is that correct?

 

If so, how do hatcheries etc get dragon images? Page scraping for them seems like it'd defeat the point of having an API, so I'm fairly sure I'm missing something.

 

Also, if the above is true, is there a way to get the dragon's species via the API?  I'm intending on coding myself some kind of lair-and-lineage organising tool, half for the learning experience and half because doing lineage charts in a spreadsheet makes me want to cry, but I need to know what I'm able to get before I start designing exactly how things should connect to each other...

 

Nope, the API doesn't return data for breed.

 

The image is simply the url, replace {CODEHERE} with the code of the dragon: https://dragcave.net/image/{CODEHERE}.gif

 

All the hatcheries do is keep a database of codes and display those urls in an img element. Depending on how you develop this, you could use this method or even download the images themselves.

Share this post


Link to post

Ah, thank you both so much! :D I didn't know that about pet images, since on-site they're all whatever the database has as the image code for the day.

 

Lack of breed data is going to be a pain, though, boo.  But good to know I'll need to figure out ways of setting it manually instead!  (At least my current breeding focus is purebreds, that's a lot easier than pretty much any other option.)

Share this post


Link to post

*I am new to web development so please understand my question may be dumb 🙄*
I can't remember the information about the login API I received before,

and I haven't applied for a public key, so I'm trying to get API Permission again.

But I don't know how to fill in the fields in the API request form.

 

Most examples on the internet use popular social login APIs (e.g. Google, Twitter, etc.).
I don't know how to apply this to DC.
1. URL and IP
When I look at the example, "enter localhost here" is this right? If I do web hosting or the address of the login action page changes in the future, do I need to change this?
2. Public key
I don't know the difference between private key and this. What I understand is:
1) Private Key: A key used to access data that should not be exposed to anyone other than the administrator
2) Public Key: A key used to log in that does not matter if it is exposed to anyone other than the administrator
Why do you need the URL and IP to prevent third parties from using the public key?

3. Access permission

When UserA use the DC Login API, can UserA(with site) also get a list of dragons who have hidden scrolls in their account settings?

 

I think I'm missing something, but I don't know what it is...

dumb.PNG

Edited by Kingchobab

Share this post


Link to post
7 hours ago, Kingchobab said:

*I am new to web development so please understand my question may be dumb 🙄*
I can't remember the information about the login API I received before,

and I haven't applied for a public key, so I'm trying to get API Permission again.

But I don't know how to fill in the fields in the API request form.

 

Most examples on the internet use popular social login APIs (e.g. Google, Twitter, etc.).
I don't know how to apply this to DC.
1. URL and IP
When I look at the example, "enter localhost here" is this right? If I do web hosting or the address of the login action page changes in the future, do I need to change this?
2. Public key
I don't know the difference between private key and this. What I understand is:
1) Private Key: A key used to access data that should not be exposed to anyone other than the administrator
2) Public Key: A key used to log in that does not matter if it is exposed to anyone other than the administrator
Why do you need the URL and IP to prevent third parties from using the public key?

3. Access permission

When UserA use the DC Login API, can UserA(with site) also get a list of dragons who have hidden scrolls in their account settings?

 

I think I'm missing something, but I don't know what it is...

dumb.PNG

 

1)

When I set up mine I used the details for my VPS (virtual private server).  Localhost is fine for local development and testing but you'll need to fill out the API with the details of where you'll eventually be deploying your site. If you need to change them in the future, you can just email TJ with the new details.

 

So for mine:

  • Site URL: chazza.me
  • IP: IP of my VPS (your webhost should provide this)

2)

a) Correct.

b) Also correct.

 

Don't leak the private key (easily done if you accidentally call the API from the frontend instead of backend). API usage is in the documentation but essentially if your key is ABCDEFGHI1234565 and you want to fetch a user's dragons (the /user call) then your website will need to make a GET request to

https://dragcave.net/api/ABCDEFGHI1234565/json/user/Kingchobab

 

Currently the public key is only used if you require the login verification functionality. I don't use it myself but as I understand it:

3)

Not sure, you'll need to try that one!

 

 

Share this post


Link to post


  • Recently Browsing   0 members

    • No registered users viewing this page.