Author Topic: General help  (Read 981 times)

Offline Rimmy

  • Level 12
  • *
  • Posts: 80
  • Reputation: +1/-0
    • View Profile
General help
« on: July 08, 2008, 01:33:00 PM »
I have reached a point in my game where I can no longer ignore certain things. I need help with certain things present in all games.

1. I need help with a registration script. Could someone post one here so I could look at it?
2. I need help with a login script. Once again, it would be nice if someone could post one for me to look at.
3. I could use some help with a logout script to go with the login script.
4. My game gives everyone turns once an hour. How would I do that exaactly? People have kind of told me, but nobody has been specific.

Offline codestryke

  • Administrator
  • Level 33
  • *****
  • Posts: 589
  • Reputation: +22/-0
    • View Profile
    • eXtremeCast Games
Re: General help
« Reply #1 on: July 08, 2008, 11:55:53 PM »
Look at the game engine we were working on long ago on here. The registration and login scripts are pretty well written if I remember correctly..

For your turn problem, do you have telnet/ssh ability on your server? Can you create a CRON job? That is best way to do it, if you don't then you can add them with a "hack" in your code.

Let us know what you have and we'll go from there.
Creating online addictions, one game at a time:

Offline Rimmy

  • Level 12
  • *
  • Posts: 80
  • Reputation: +1/-0
    • View Profile
Re: General help
« Reply #2 on: July 09, 2008, 05:03:39 PM »
Atm, I am going to be using x10hosting as a testing place. They do have CRONS, but I don't know if the host I will eventually end up with will have CRONS.

What game engine were you refering to?

Offline codestryke

  • Administrator
  • Level 33
  • *****
  • Posts: 589
  • Reputation: +22/-0
    • View Profile
    • eXtremeCast Games
Re: General help
« Reply #3 on: July 09, 2008, 11:59:43 PM »
http://community.bbgamezone.net/index.php/topic,196.0.html

About session security...

http://community.bbgamezone.net/index.php/topic,358.0.html

For CRONS.. make a php script that adds the turns, lets call this script hourly.php

Then upload it into a scripts directory on your server. Make SURE this directory is not web accessible!!!

telnet/ssh to the server.. enter the command
which php

This will tell you where php is located at.. Lets say it gives back /usr/local/bin/php

If it returns nothing then your host won't allow php to run as an executable. Get a new host as this is a pretty standard setting to have and those that don't allow it usually don't have a good tech crew working for them.

Next navigate to your script directory. enter the command
pwd

This will tell you what directory your are in.. Lets say its /home/killergame/scripts

Ok now create a text file called cronjobs in that file put (this is assuming you want to run the php script to add turns every hour)
0 * * * * /usr/local/bin/php -q /home/killergame/scripts/hourly.php

now at the command line enter
crontab cronjobs

Ta DAAAA you now have a your script running every hour! To verify that it will run enter
crontab -l

Hope this helps
That will give you a list of all your cron jobs.. You can also enter
crontab -r

That will remove all your cron jobs ;)
Creating online addictions, one game at a time:

Offline Zeggy

  • Global Moderator
  • Level 35
  • *****
  • Posts: 1,187
  • Reputation: +13/-4
    • View Profile
Re: General help
« Reply #4 on: July 10, 2008, 12:14:20 AM »
If you only have CPanel access, there's a page in there for cron jobs as well.

Just enter the same command (/usr/local/bin/php -q /home/killergame/scripts/hourly.php).

Offline codestryke

  • Administrator
  • Level 33
  • *****
  • Posts: 589
  • Reputation: +22/-0
    • View Profile
    • eXtremeCast Games
Re: General help
« Reply #5 on: July 11, 2008, 12:08:56 PM »
Real men use the command line  :D
Creating online addictions, one game at a time:

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal