Page 2 of 3

Re: *sigh* 000webhost don't let you run browser games?

Posted: Sat Jun 19, 2010 3:12 am
by Jackolantern
Running crons is one of the things that you will get you noticed by a free host in the bat of an eye. However, you can even have some more simple multiplayer games that use no more resources per page load than a simple e-commerce website. However, once you start to involve crons, it becomes a problem for oversellers very fast (like Noctrine said). Then your resource usage is not fluctuating with normal usage patterns like everyone else's site, and oversellers depend on your site having downtime.

Re: *sigh* 000webhost don't let you run browser games?

Posted: Sat Jun 19, 2010 5:29 am
by Callan S.
I'll keep that in mind! I'm not really clued into crons anyway, so any events that happen would be me sitting at the database, manually changing it ("oh crap, the GM is online!"). I'm half taking advice given to me here - I will graduate to a paid host latter, but to start off I'm using a free one. I think it'll work out, given spiritwebbs account.

Re: *sigh* 000webhost don't let you run browser games?

Posted: Sat Jun 19, 2010 6:21 am
by Jackolantern
Ahhh ok. Some games go buck wild with crons and have 5 of them running every two seconds :P That would fly for maybe 5 minutes on a free host.

Re: *sigh* 000webhost don't let you run browser games?

Posted: Sat Jun 19, 2010 8:19 am
by Callan S.
No fear of that from me! Crons are strange, unknown magic to me right now! And I get your point, thanks :)

Currently I'm looking at the connect.php and this line

Code: Select all

$db = mysql_connect("localhost","root","") or die("Could not connect to db");
I'm guessing I need to change these details, but I'm not sure what to? Here's some info I could find from my panel...
Home Root /home/a2890094
Would that go where root is? The '/home/a2890094'?

And I'm not sure where to find localhost? Also is the final empty entry there (the "") a password space?

Thanks!

Re: *sigh* 000webhost don't let you run browser games?

Posted: Sat Jun 19, 2010 12:23 pm
by SpiritWebb
To find your localhost on 000webhost, make sure your at your cPanel, and click on the MySQL option and you should see the following:
MySQL databases are required by many web applications including bulletin boards, content management systems, and others. To use MySQL, you need to create database and user, which will be automatically assigned to this database. Click for phpMyAdmin when database is created.

Important: MySQL Host for any database in this account is **********, do not use localhost!

Create new database and user
The ******* part, yours will show and be in bold. This is what you will change localhost to.

Your root and password will be:
MySQL database name:
*********
MySQL user name:
*********
Password for MySQL user:

Enter password again:
Where you choose your username, you will have some account number attached. (Example: a1828374_) You will put that weird identification number along with the underscore and the username you chose for your root. Then, you will enter your password as normal!

Code: Select all

$db = mysql_connect("localhost","root","") or die("Could not connect to db");
"localhost" is the server, "root" is the username and "" is the password. When using localhost, you can setup a username and password, but if you do not wish to, you can simply put "root" and no password "" and be fine. See above for instructions on replacing "localhost","root",""
Keep in mind, your only allowed 2 databases, and they shut one of mine down for "Over excess use of database tables."

Re: *sigh* 000webhost don't let you run browser games?

Posted: Sun Jun 20, 2010 12:22 am
by Callan S.
Thanks, SpiritWebb! That really helps out as I was just guessing before! Got all that down - will do a test upload soon!
Keep in mind, your only allowed 2 databases, and they shut one of mine down for "Over excess use of database tables."
Eye, they didn't really have a rule against making your own forum so they made up an excuse :lol: I'm just going to have one database.

Re: *sigh* 000webhost don't let you run browser games?

Posted: Sun Jun 20, 2010 12:54 am
by Callan S.
Annnnd just uploaded it and it seems to work!!!! Hawt! (though the first time I forgot to upload the login.php of all things!). Also the background doesn't seem to be working, though all other images are working?

Code: Select all

echo "<style>body {background: url('background1.jpg') 50% 0% repeat;}</style>";
background1.jpg is there. It works in wamp.

Anyway, I'll start up a showoff thread sometime soon - it's a small game, not a big one like halls makes. But I like it and it's a good base to build on.

Re: *sigh* 000webhost don't let you run browser games?

Posted: Sun Jun 20, 2010 1:58 am
by Jackolantern
Callan S. wrote:Annnnd just uploaded it and it seems to work!!!! Hawt! (though the first time I forgot to upload the login.php of all things!). Also the background doesn't seem to be working, though all other images are working?

Code: Select all

echo "<style>body {background: url('background1.jpg') 50% 0% repeat;}</style>";
background1.jpg is there. It works in wamp.

Anyway, I'll start up a showoff thread sometime soon - it's a small game, not a big one like halls makes. But I like it and it's a good base to build on.
You need to add an attribute to your style tag:

Code: Select all

<style type="text/css">.....</style>
That may be the problem, or it may be an actual issue in the rule. I am not really a CSS wizz.

Re: *sigh* 000webhost don't let you run browser games?

Posted: Sun Jun 20, 2010 2:16 am
by Callan S.
Thanks, but doesn't seem to make a difference - basically I want to have a thin graphic in the background which is repeated across the screen, basically the same effect as in the early urban realms videos. As said, it worked in wamp. But really all the big stuff worked, ie the actual game, so I'm pleased with that!

Re: *sigh* 000webhost don't let you run browser games?

Posted: Sun Jun 20, 2010 4:00 am
by Rastan
I'm using

Code: Select all

 background-image:url(images/background.png);

I'm pretty bad at CSS as well but I thought I'd throw up what I had working. I dunno how much different the "-image" makes Are your images right in the main folder or do you have them in a separate images folder like I do?