Shop OBEX P1 Docs P2 Docs Learn Events
Questions about etherx card, webserver games, etc. — Parallax Forums

Questions about etherx card, webserver games, etc.

VIRANDVIRAND Posts: 656
edited 2009-11-04 23:07 in Propeller 1
I perused the manual and have some questions about etherx and something else...

Extent of relevant knowledge: I have not programmed the internet since I used BASIC to operate a 300 baud modem with a TS or UNIX account. But I have made some web pages with HTML since then.

Questions: (Generally speaking, assuming not simple answers...)
1.Having a domain name already, How might I make HYDRA use dynamic DNS to tell a nameserver it's current IP?

2.How to get data from an extended URL, to parse it? These would be pseudo examples of extended URLs:
"www.mygame.tld/gamename/gamelevel00001" or
"www.mygame.tld/?&game=gamename_level00001" or
"www.mygame.tld/tictactoe=xox oxo ---" or something like that.
Maybe that way many people could play a game without filling up the HUBRAM by way of storing their gamestates
only in the URL itself, with game objects in the web browser having URL links to gamestates caused by clicking them,
and the HYDRA only needs to know about a particular game while it is serving and processing a state change.
A spin program would arrange and serve new HTML in response the those gamestate URLs,
and probably also have small prepared image files of gamepieces to serve from SD or eeprom.
Theoretically, it should be able to play a large number of simultaneous games (players) that way, methinks.

3.Dumb question: Could the SDMAX and ETHERX be connected at the same time? (I was just too lazy to look it up myself)

4.Dumb question: I broke the SD card connector on my SDMAX and it is currently held together with sticky tape.
From what source and part number can I replace it and then resolder it myself?
I also want to get another (SD card connector) for my proto board.

Post Edited (VIRAND) : 2/5/2009 1:21:12 AM GMT

Comments

  • saverysavery Posts: 12
    edited 2009-02-05 20:21
    I can definitely answer 1. One feature I would have loved for the W5100 to include is domain name lookup. Since it doesn't, you would have to implement this yourself. Google something like "DNS tutorial" or "domain name lookup tutorial". What you are looking for is the format of the packet you need to send to the DNS server and what the format of the packet response is. Basically, you send a packet of data to a DNS server that says "what is the IP address of this domain" and it will respond with the IP address. You can probably use the IP of your gateway when sending a DNS request (since it will likely forward the request on to a proper DNS server) or you can use one of the public DNS servers.

    Hopefully someone who knows a lot about web servers and how they handle extended URLs can help you with question #2.

    Concerning question #3, without some hardware hack/modification SDMAX and ETHERX cannot be connect at the same time. There is only one expansion slot. You could make a cool PCB that plugs into the expansion slot which would run the signals out to multiple slots but it would require additional circuitry so that you determine which card you are communicating with (things like tri-state buffers). That way multiple cards won't drive the signals at the same time.

    Try and ping on Andre' about question #4.

    Hope this helps.
  • VIRANDVIRAND Posts: 656
    edited 2009-02-06 02:48
    I hope I asked the right question and got the right answer about Dynamic DNS for the HYDRA webserver.

    Just to clarify,
    I want to make the HYDRA WEBSERVER into a game.
    I want to rent the domain "www.thenameofmygame.com". (This I know how to do.)
    I want the HYDRA WEBSERVER to boot up,
    *---> and figure out HYDRA WEBSERVER's own IP,
    *---> and tell it to the nameserver for "thenameofmygame.com",
    so anyone can play THENAMEOFMYGAME by typing "thenameofmygame.com" into their PC browser while my HYDRA is on.

    I don't think that the HYDRA WEBSERVER needs to look up any URL's because the player's browser does that.
    I think that for people to play my HYDRA on my website, my HYDRA must be able to tell my domain name server it's IP.

    (And question #2 is just asking if and how an idea for using the browsers of x number of players to communicate
    gameplaying information with a game based on HYDRA WEBSERVER without using up it's memory and sockets ... might work. )
    ...

    It might be awhile before I get around to doing what I'm thinking of doing,
    but that is OK, a few of the people on these forums are quicker than myself,
    and I ask on behalf of everyone, and I submit my idea on behalf of everyone,
    because if it works, it would be super easy to make a wide variety of game websites
    this way compared to any other way that I am aware of. For example:

    If HYDRA can play chess (why not?) then it could play against 100 people at the same time,
    just by responding to 100 URLs representing chessboards with 64 extra characters
    with HTML chessboards whose squares and chessmen icons have links indicating
    intent to move them when they are clicked. (hmm. Might require two clicks to move?)

    And it should even more easily play a Myst-like game, in which you could move by
    clicking on a pre-served tile image that may clearly indicate moving in a direction
    (left,right,forward) by the position of the tile in the served scene, or, if the tile
    contains the image of a useable game object, the game will respond with the
    visible effect of collecting or using the object, and any player's browser would
    send the game state in the extended URL in such a way as to indicate the player's
    position in the world, direction facing, objects already collected, and especially
    what was clicked on. Everything that can be clicked on has it's own pre-generated
    URL which includes the previous game state and the future game state which was
    anticipated and included in the previously served HTML which generated the
    current scene in the game of one of several players who are playing it on their browser.
    I don't think this is as hard as it sounds. I've made games like that before, and I'm thinking
    of renovating one of my websites to be like this kind of game, in HTML even without the HYDRA.
    (The hardest part would be pre-rendering all the scenes and breaking them into pieces that should
    do something when clicked on. On the HYDRA all those images would have to be stored on an SD card,
    after, most likely, being drawn with PC art software.)

    I have not thought very far into the idea of making HTML-based games, especially where they
    have a world, ESPECIALLY not about methods where multiple players would be aware of each other
    and be able to communicate, since my current idea is supposed to work without the HYDRA
    "knowing" anything about the players (which would require keeping track of them in it's memory).
    With my idea of using extended URL data to keep track of each player's game, two players with
    computers who could actually see each other in real life could be in the same place in the game world,
    and if one takes an object, it would still be there for the other player to also take, until he takes it.

    That makes more sense if both players were playing chess against the HYDRA. Each player only knows
    what moves were made in his own game, which only exists on his own browser screen. At this point in
    time, my idea only covers games that from the player's point of view are single-player games against
    the HYDRA WEBSERVER. I don't have any ideas for making HYDRA WEBSERVER based HTML MMOG's yet.

    I don't even know if this method would work yet. If it does, and is any good for fun, use it!
  • saverysavery Posts: 12
    edited 2009-02-07 02:02
    I'm sorry man. I didn't give you good answer. I don't know if I was in a rush or was too tired or what. The DNS answer I gave you answered the question "How does EtherX send data to a domain name". What you wanted to know was "How can I tell all the DNS servers in the world that domainname.com now equals the IP of your Hydra". I honestly can't remember how to do this and I'm sorry I answered my own question instead of yours. Keep in mind though that it may take minutes to hours for the domain name to eventually point to your Hydra. Obviously, the DNS servers closest to the request will get updated right away, many minutes later the ones in the next state, hours later the ones in India. So, don't think that you can send the request to have the domain name point to your Hydra and immediately your buddy half a world away can play chess with you.

    Hopefully someone on the forum who knows more about DNS servers will be able to help.
  • VIRANDVIRAND Posts: 656
    edited 2009-02-09 02:44
    I see. The DNS system is not centralized. Maybe I have another way... . idea.gif

    I think I've seen this way done before but not sure how it is done exactly. <--(edit:automatic redirects)

    The HYDRA should FTP to my (hypothetical) host server at www.mygame.com/index.html
    and upload a small page of HTML (edit:with a link to my HYDRA IP address) saying:
    ____________________________________________________________________

    Welcome to MYGAME.
    Please click "here" to connect to my HYDRA.
    <---This is for illustration purposes only so don't click.
    If nothing happens soon, I'm sorry, my HYDRA must not be on.
    _____________________________________________________________________

    (A link to HYDRA from a hosted page can be quickly updated even if the DNS servers can not, right?)
    (This will require learning something about FTP that probably isn't in the manual.)
    (I have also seen web pages do the "redirect" automatically after a few seconds but I'm not sure how.)

    Post Edited (VIRAND) : 2/9/2009 2:49:36 AM GMT
  • gonzobrainsgonzobrains Posts: 27
    edited 2009-08-01 10:25
    Hey it is cool you asked this. I actually wanna try something like this myself. I think routers use similar technology to continuously update themselves with a service like DynDNS.org

    http://www.dyndns.com/developers/specs/

    I haven't checked this out yet myself. But I saw your post and I thought I would look around because now I'm interested in that, too. I've never looked into the details how it is done because my router has always done that for me. Or I just downloaded their Windows-based updater for my laptop.

    It would be cool to try that out on the Hydra. I'm not sure why you would need that though other than for experimenting. Couldn't you just update your router and then point your game traffic to the hydra through your router's configuration?

    Jeff
  • VIRANDVIRAND Posts: 656
    edited 2009-09-18 17:20
    My DNS server always gives the same IP address to my normal webserver,
    but my ISP for internet access often changes my IP when I boot or when the modem power is interrupted.

    I think it sounds like a great idea to ftp a link page to www.mygame.com (or whatever) from my Hydra every time
    it powers up as a game server and gets a new IP address, if possible.
  • gonzobrainsgonzobrains Posts: 27
    edited 2009-11-04 23:07
    I can reach my HYDRA board through the internet using my router. My router has a feature that works with DynDNS.org I set up an account with them, and entered the information into the router. I simply forward the port I am interested in to the HYDRA, and the router takes care of all the rest!
Sign In or Register to comment.