FRIHOST • FORUMS • SEARCH • FAQ • TOS • BLOGS • COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Connecting Remotely (Easier than it Sounds)





polly-gone
Okay, so I am having some problems with a Browser Based game that I am making. How it will work is you go to a main website and you can see news, sign up for an account, check out the forums, etc. On that web page, the will be listings for different Worlds there. You can choose World 1, World 2, World 3, and so on. I know for a fact that I will be hosting the website, the testing world, and 2 or 3 worlds, but I want to do a sort of remote hosting thing where someone can host a world on their own servers.

If you want to go to World One, when you click on the login link on the main page, it will take you to http://w1.example.com. Well, if someone else is hosting World 2, how do I get it that when you click on the link, you go to w2.example.com and every page you go to there is w2.example.com/index.php?page=whatever, but the page layout, images, text, and database is coming from the other persons server.

Thanks,

-Nick Very Happy Very Happy Very Happy
gecko
If I understood well the question...

Personally, I would split the code into The Engine and The Layout. Now there are two ways of doing the rest.

1) All the requests go to your server. Then The Engine handles them and after that, it connects to some Layout code (yours or on other server) and with the help of that presents the effects of request.

2) All the requests go to some server on which The Layout is. Then it would use API you create to handle the request and get the results.

The second seems a little more advanced and lets you create (for example) a real application (for win/linux/mac) to play the game.

Hope this would be any help...
rvec
I don't know if it's possible on frihost, but if you have access to a dns server where you can edit the records you can send all users asking for w1.example.com to 123.123.123.1 and every user asking for w2.example.com to 321.321.321.2 with an A record for each. Then you set a wildcard at the bottom just in case users try to access world 999 (which probably doesn't exist) to your main ip.

If you setup a vps you can set this up yourself, else you should find a domein services where you get advanced dns services with it (called zones or dns-records).

edit: of course you should split it , but I don't think it's a good idea to put half of the code on one server and the other half on another. It would make it really complicated and then the main server would get all the requests and thus use a lot of bandwidth. Better put all the code needed for each requests on one server, and maybe make all servers send stats to the main server once an hour (for dynamic sigs, statspages, ....). That way you might have some slow updating stats, but you could use just one server for only the main website, another for stats, and one for each world (and combime or split them even more as much as you want).
polly-gone
Well, I use Yahoo! and GoDaddy to host domain names and I can do DNS settings. So if someone went to w1.example.com, they would be connecting that that other server, but every page they would go to would be at w1.example.com/whatever?

-Nick Smile Smile Smile
rvec
that's still the same domain. You can make subdomains, sub-sub domains, .... and all send them to other servers, but you can't make different dirs go to differnent servers with dns for all I know. You could try it with .htaccess, but I doubt that'll look as pretty as with dns.
Related topics
Keeping Forum Activity
Google's Video Sharing
Windows Vista Official Thread
Remote Desktop Connection
Help Please
Remote Desktop Problem
Gabriel & the Qur’an: Archangel author or imposter?
Linux connecting to unix
should we care about antartic ice melting?
10 Reasons To Buy Windows 7 Professional (!)
I'm still a noobie at home networks, please help...
Say Good Bye to pi
A vision of the ideal economy...
Does it require faith to believe in extraterrestrials?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.