.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Space Empires: IV & V (http://forum.shrapnelgames.com/forumdisplay.php?f=20)
-   -   PBW Emergency Site ver 2 Development (http://forum.shrapnelgames.com/showthread.php?t=10625)

Ruatha October 25th, 2003 11:53 AM

PBW Emergency Site ver 2 Development
 
So far joint effort by Fyron and Ruatha, anyone else is welcome:


Here are betafiles:
betafiles
(Latest change: removed $date from deadline.php and moved $timezone from gaminfo.php to deadline.php
(Forgot deadline_check.php at work...)

---- In bold = Exists.
ELSEWHERE (OTHER DIRECTORY)
PASSWORD.CFG - Password for autoturn utility and main admin (Setup new games)

---------------
main Directory (Whatever name)

INDEX.PHP
Start page, choose game if more than one otherwise autodirect to MAIN.PHP

MAIN.PHP Main page where everything happens, display players, empires, uploaded, deadline, news, history.

GETTURN.PHP
Getturn script

PLAYERUPLOAD.PHP
Sendturn Script

DEADLINE_CHECK.PHP
Displays deadline in different timezones, each player can check his timezone.

ADMIN.PHP
Admin script, change player names, empires, e-mails, number of players, admin password, news, turns to backup.

AUTOTURN.EXE
Checks if turns has expired or all has uploaded and then autoexecutes them if needed, updates deadlines, checks all subdirectories for DEADLINE.PHP.
Creates new games by setting up subdirectories and placing the appropriate files there.
Password used to access this program is stored in PASSWORD.CFG
Can be used to customize the sites, i e colours and any page image (Same image all pages).
Program is trayable.


-------------------
Game Directories (Name = Gamename, subdirectories)

GAMEINFO.PHP
Used to store game variables;
// Name of savegame file, minus .gam.
$gamename = "name";
// Full title of the game.
$title = "title";
// Info on the host.
$host = "name";
$hostmail = "email";
// URL of alternate forum. If you do not have one to use, just leave the default pointing to Intel Forums.
$forum = "http://www.shrapnelgames.com/cgi-bin/ultimatebb.cgi?ubb=forum;f=23";
// Number of turns to keep backups of.
$numbackups = "1";
// Player information. Each player has 3 variables, name, email and empire. Do not worry about filling in info for players that do not exist (such as playername10 if you have only 9 players. The numplayers variable keeps track of the number of players in the game, so extra player info is ignored.
$numplayers = "13";

$playername1 = "SN";
$playermail1 = "email";
$playerempire1 = "empire name";
(repeat - to 20 players)

DEADLINE.PHP
File defining deadline and turn type (Manual, all uploaded and auto), Used in both PHP script and in AUTOTURN.EXE.
Date stored in Central European time, altered to the set timezone when displayed in each game.
// Date of the deadline.
$deadline_year = "";
$deadline_month = "";
$deadline_day = "";
$deadline_hour = "";
$deadline_minute = "";
// Default timezone.
$timezone = "";

TURNFILES
Directory for player turnfiles (PLR)

GAMEFILE
Directory for Gamefiles (ZIP)

BACKUP
Zipped old PLR and GAM files

---------

[ October 25, 2003, 11:00: Message edited by: Ruatha ]

Ruatha October 25th, 2003 02:19 PM

Re: PBW Emergency Site ver 2 Development
 
Geo, will this do:


On the Admin page:

(Password protected??)

Change player names and e-mails and empire names.
Change number of turns to backupp, turn execution type and deadline length.

Button to download all plr files and one to move all plr files to backupp.
Upload of Game file.
Add news.

In deadline.php we must add
$deadline_lenght (interval in hours of deadline).

[ October 25, 2003, 13:27: Message edited by: Ruatha ]

Ruatha October 26th, 2003 01:43 AM

Re: PBW Emergency Site ver 2 Development
 
An idead is to split up the Main.php into:
INCLUDE ("Header.php")
INCLUDE ("menu.php")
INCLUDE ("News.htm")
INCLUDE ("Deadline_check.php")
INCLUDE ("Show_players.php")
INCLUDE ("History.php")
INCLUDE ("Footer.php")

Where menu contains buttons for:
Get turn
send turn
mail host
mail all
Admin
Forum


???

geoschmo October 26th, 2003 01:50 AM

Re: PBW Emergency Site ver 2 Development
 
Need a button for the host to get all the .plr files.

Ruatha October 28th, 2003 11:16 AM

Re: PBW Emergency Site ver 2 Development
 
Fyron.
I think will add all variables in one PHP file to b eincluded.
The make almost all functions into seperate php files and make the main file almost only include.

I'm aiming to have it ready at the next PBW down time, may it never come.
It will have about the same functions as the current emergency site but be able to run turns automaticly aswell.

And have much easier code to read and edit!!

Ruatha October 28th, 2003 09:14 PM

Re: PBW Emergency Site ver 2 Development
 
Fyron >
I'm doing a total rehaul, everything is changed.
It's based around your PHP variable file.

se here the example;
ver 2 example

The index page is almost done.
It searches the game directory for all directories, pulls out config data and displays it so that one can choose game.
What is missing in index? An Super_host admin page to set up new games, delete games and change info text on the index page, and set mail info (SMTP, account, on/off).

Everything else is game_host controlled (main.php and below)

New betafiles:
Beta 0.1 for ver 2
Work continues......

[ October 29, 2003, 06:37: Message edited by: Ruatha ]

Ruatha October 29th, 2003 12:12 PM

Re: PBW Emergency Site ver 2 Development
 
The index page is complete.
as is the login script for the server host admin page and the host admin page (except for making and deleting games).

The index page looks in the game directory, gets the game info for all games in it and shows links to them.
Nice if I may say it myself.

Finishing site admin page now and then will work on the game main pages.

The problem with ver 1 not updating is solved with three different methods, all used:
1. Meta tags making the page non-caching and reloading every time it's accessed.
2. A java script forcing update.
3. every page get's a random number so you won't get the same url twice (own invention and it seems to work best).
Combined all three makes the page reload on each access (not three times but just when it loads).

If you want to try and login current passsword for site admin page is "ett".

When one first sets up the server it will bypass the login page and go directly to the admin page.
There is no default password.

The admin page is hacker protected and will eventually mail the host Ip and lookup info on wouldbe hacker.
This will be included in game admin pages aswell.

Most will be user changable and all code will be marked and more structured than ver 1

Setting up of games will be done in one of two ways, either through entering a name in the site admin screen and pressing a button, or alternatly by uploading the files to the game directory (files needed are so far only configuration.php).

First steps of ver 2 (0.1)

PLEASE DON'T CHANGE THE PASSWORD IN THE ADMIN SEUP SCREEN!

I'm working with it.

[ October 30, 2003, 12:21: Message edited by: Ruatha ]

Roanon November 2nd, 2003 04:25 PM

Re: PBW Emergency Site ver 2 Development
 
You definitely have too much time, Ruatha http://forum.shrapnelgames.com/images/icons/icon12.gif


Thanks again, you are an excellent and caring host !

Fyron November 2nd, 2003 10:57 PM

Re: PBW Emergency Site ver 2 Development
 
You should be able to just use some batch files for the autoturn thingie. That is how PBW does it IIRC.

Ruatha November 3rd, 2003 02:51 AM

Re: PBW Emergency Site ver 2 Development
 
Getting there,
whats left to do:

game_download_host_turn.php (Host download plr turn files)
game_upload_host_turn.php (Host upload new gam turn file)
game_new_news.php (Host change game news)
game_change.php (write Host admin changes)
game_player_change.php (Choose player settings, name, mail and empire)
game_player_change_execute.php (write player setting changes)
game_upload.php (Almost done, what's left =mail options and change ALPU setting in game config.)
Autoturn.exe

What's done:
index.php
main.php
autoturn.php
auto_change.php
auto_change_execute.php
game_admin.php
game_admin_login.php
game_change.php
game_forms.php
game_full_history.php
game_get_turnfile.php
game_header.php
game_player_table.php
game_shorthistory.php
game_show_deadline.php
game_upload.php
hack.php
pclzip.lib.php
random.php
site_admin.php
site_admin_login.php
site_change.php
site_config.php
site_forms.php
site_game_manip.php
site_header.php
site_new_game.php
site_new_news.php
site_one_game.php
site_switch_mode.php
history.html
site_news.html
Version.html


Auto made for each game:
configuration.php
history.html
news.html
oldnews.html
shorthistory.html

The autoturn.exe will be hardest as I haven't programmed for 4 years, but some pascal/delphi ougth to be close to the surface..

Ruatha November 3rd, 2003 05:59 AM

Re: PBW Emergency Site ver 2 Development
 
Ok, I have some ideas how to make that by using batchfiles (The PHP script making a subbatchfile for each gamedirectory and then there is a constant running batch file that runs those), but I hink a exe file would be easier and better.
I'll go for that first.
As I've already planned on how to control the app through the PHP script.

Another way would to be by using PHP only; a constant running script in a browser at the host computer which updates itself once a minute and checks all game directories, but I'll still go with the exe app first.

You can check how ver 2 is looking so far, I'm using the NGC3 game to flush out bugs:
http://pbw.ath.cx

[ November 03, 2003, 07:19: Message edited by: Ruatha ]

Atrocities November 9th, 2003 03:25 PM

Re: PBW Emergency Site ver 2 Development
 
Ruatha, just in case it hasn't been said before, thank you very much for doing this for us and the game man.

http://forum.shrapnelgames.com/images/icons/icon7.gif

Slynky November 9th, 2003 07:39 PM

Re: PBW Emergency Site ver 2 Development
 
Yeah, I tried to give him a rating Last week but the dog doesn't have it turned on... http://forum.shrapnelgames.com/images/icons/icon12.gif

Ruatha November 9th, 2003 08:31 PM

Re: PBW Emergency Site ver 2 Development
 
Quote:

Originally posted by Atrocities:
Ruatha, just in case it hasn't been said before, thank you very much for doing this for us and the game man.

http://forum.shrapnelgames.com/images/icons/icon7.gif

<font size="2" face="sans-serif, arial, verdana">Thanx, if PBW goes down again, next time we'll be prepared!


Quote:

Originally posted by Slynky:
Yeah, I tried to give him a rating Last week but the dog doesn't have it turned on... http://forum.shrapnelgames.com/images/icons/icon12.gif
<font size="2" face="sans-serif, arial, verdana">Bark, Bark (is it Barf or bark in english? in swedish the sound is vov or as alternative voff, that's how swedish dogs sound!).

Taera November 9th, 2003 08:38 PM

Re: PBW Emergency Site ver 2 Development
 
is it not easier to just get a copy of the PBW itself and locate it elsewhere while the main server is down/moving?

Fyron November 9th, 2003 08:40 PM

Re: PBW Emergency Site ver 2 Development
 
"barf" is generally associated with vomitting. "bark" is the sound dogs make, as well as the hard stuff on the surface of trees. http://forum.shrapnelgames.com/images/icons/icon12.gif "woof" is another sound dogs make, probably related to the "vof" you mentioned.

Fyron November 9th, 2003 08:41 PM

Re: PBW Emergency Site ver 2 Development
 
Quote:

Originally posted by Taera:
is it not easier to just get a copy of the PBW itself and locate it elsewhere while the main server is down/moving?
<font size="2" face="sans-serif, arial, verdana">Not really. PBW has a lot of code, and can only be run on a server that you have root access too (ie: not on any sort of shared web hosting plan).

Ruatha November 9th, 2003 11:49 PM

Re: PBW Emergency Site ver 2 Development
 
Yep, the ver 2 will be able to run both on your home computer where you'll be able to use the autoturn.exe function (Of course you need the SE IV game aswell) or on any PHP capable server, then you'll have to download the files for turn execution at your local computer.
But everything except the autoturn.exe should work everywhere (only PHP and HTML code).

EDIT:


Quote:

Originally posted by Imperator Fyron:
</font><blockquote><font size="1" face="sans-serif, arial, verdana">quote:</font><hr /><font size="2" face="sans-serif, arial, verdana"> I won't use cookies, set your browser to auto complete and you'll just have to type the first letter and click the text that shows up.
<font size="2" face="sans-serif, arial, verdana">Cookies are a good thing. http://forum.shrapnelgames.com/images/icons/tongue.gif </font><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">Yes, but to much sugar isn't good for you!

I've made the complete readme.txt for ver 2.0;


PBW Emergency Site 2.0
======================
2003-11-10

To be used when the PBW server at http://seiv.pbw.cc goes offline.

All help files can be accessed through starting the HELP_CONTENT.HTML in the HTML_FILES directory!!

To set up the site unpack the archive with intact directory structure to a folder that is availible from the net.
You must give all Users write permission (It's also called setting chmod permissions to 646 (allow public write)) to the GAMES directory and all it's subdirectories including all files.
No files above the GAMES directory needs to be changed after the site is up and running.

It might be a good idea to check in your PHP.INI file (do a search on your computer for it if you don't know where it is) that MAGIC QUOTES are off, it won't make any errors if it's on but entered news might show a backslash \ infront of apostrophes ' and quotes ".
Also check in the PHP.INI file the allowed size that Users can upload, it could be a good idea to increase that size!

The starting file for the site can be index.html or index.php, by using index.php as starting page the site will load a fraction of a second faster than when using index.html.

For all other info including troubleshooting check the html help files!

Good Luck


Ruatha
james@visit.se


Is the part of CHMOD understandable?

Up and running at:
http://pbw.ath.cx

To do:
http://pbw.ath.cx/what_to_do.txt
(a dynamicly changing file...)

[ November 09, 2003, 22:14: Message edited by: Ruatha ]

Ruatha November 10th, 2003 02:44 AM

Re: PBW Emergency Site ver 2 Development
 
All PHP to make it a running site is down, what is left to do:

Bug routing.
Error handling with error log.
Hack log.
Help files.
Autoturn.exe

If it's a one game site, it is up to the host to decide if it should bypass the index page and go directly to the game main page or not.

[ November 09, 2003, 12:45: Message edited by: Ruatha ]

Ruatha November 17th, 2003 08:57 AM

Re: PBW Emergency Site ver 2 Development
 
Ok, it's coming along well.
Now it runs the turn, backups and mails the players when all has uploaded, now whats left:
Some features to the site, more help files and comments in the code and the deadline checking.

When PBW comes on-line and the emergency site is finished I'll release it so that it can be put up immediatly on any PBW down-time in the future.

http://pbw.ath.cx


EDIT:
I made the script execute the turn when ALPU and manual execution, if host so allows. Now for timed turns...

[ November 17, 2003, 14:15: Message edited by: Ruatha ]

Ruatha November 18th, 2003 12:25 PM

Re: PBW Emergency Site ver 2 Development
 
Blimey, I think the autoturn exe application is ready, but I'm afraid to try it for real.....

Atrocities November 18th, 2003 01:26 PM

Re: PBW Emergency Site ver 2 Development
 
Quote:

Originally posted by Ruatha:
Blimey, I think the autoturn exe application is ready, but I'm afraid to try it for real.....
<font size="2" face="sans-serif, arial, verdana">*Ruatha stands over his PC, finger poised just a milimeter from the ENTER button, sweat pooring off him like water down a jungle water fall. He ponders the what if's as his finger ever so slowly closes the increadably narrow distance to finally make contact with the ENTER button. That was the Last time any of us ever saw Ruatha again. http://forum.shrapnelgames.com/images/icons/icon10.gif

I guess it didn't go as planned. http://forum.shrapnelgames.com/images/icons/icon9.gif

Ruatha November 18th, 2003 07:02 PM

Re: PBW Emergency Site ver 2 Development
 
http://pbw.ath.cx/autoturn.jpg

I'm Alive http://forum.shrapnelgames.com/images/icons/tongue.gif

Now just to think of a better name than "Form1"....

[ November 18, 2003, 17:03: Message edited by: Ruatha ]

Roanon November 18th, 2003 07:30 PM

Re: PBW Emergency Site ver 2 Development
 
Quote:

Originally posted by Ruatha:
Now just to think of a better name than "Form1"....
<font size="2" face="sans-serif, arial, verdana">How about - Form2 ?
http://forum.shrapnelgames.com/images/icons/icon12.gif

Will you switch NGC3 to automatic then? Maybe we even could use it this time...

Ruatha November 18th, 2003 07:46 PM

Re: PBW Emergency Site ver 2 Development
 
Quote:

Originally posted by Roanon:
</font><blockquote><font size="1" face="sans-serif, arial, verdana">quote:</font><hr /><font size="2" face="sans-serif, arial, verdana">Originally posted by Ruatha:
Now just to think of a better name than "Form1"....

<font size="2" face="sans-serif, arial, verdana">How about - Form2 ?
http://forum.shrapnelgames.com/images/icons/icon12.gif

Will you switch NGC3 to automatic then? Maybe we even could use it this time...
</font><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">I've been thinking about Form 7, but I've already decided on something else. To bad though, "Form 2", I'd never had thought of it http://forum.shrapnelgames.com/image...s/rolleyes.gif

After this turn, I'll switch to auto.
I need to change the Dravens password to allow someone else to take over, so thi sturn it's manual.

Ruatha November 19th, 2003 09:29 AM

Re: PBW Emergency Site ver 2 Development
 
I've run into a strange problem with the autoturn exe, sometimes it hangs the autoexecution script, and then it don't reset the timer so it restarts it every minute... Tonight when I was sleeping it started it 182 times, all running consecutively.

It seems to only occur if the app is started through the web page...
I don't understand this...

EDIT:

I still don't get it.
If I click on the app in explorer it runs great.
if I start if from the webpage it doesn't

It sets the same current directory before calling PHP.exe, but when called from the web it hangs the first time it calls PHP.EXE to executethe runturn script.
I guess, I can disable the web start feature....

[ November 19, 2003, 20:05: Message edited by: Ruatha ]

Ruatha December 4th, 2003 06:16 AM

Re: PBW Emergency Site ver 2 Development
 
Ok, here's what next:

1. Total rewrite of autoturn.exe;
Make it runnabel and controllable remotely through the website.

2. Make it indipendent of PHP scripts;
- It shall be mail capable;
- Can automail new turns.
- Can retreive in-mailed turns.

3. Make it zip workable;
- It shall be able to compress new turns by itself.
- It shall be able to unzip in-sent turns.

So, it will also work as a fully capable mail client (Not in a proffessional way, but workable) and a fully workable zip archiver/de-compresser. If someone want's to use it in that way aswell.

3. rewrite of site to add a switch to use it as a file server or a game running capable server.
If as a file server no game controllable options will be shown.

Ruatha December 10th, 2003 12:30 AM

Re: PBW Emergency Site ver 2 Development
 
Made the site switch "file/game server".
And changed all logins to cookies instead of url parameters, once more I've done as Fyron said...

Remade all news and history handling to add latest news at top instead of bottom.

Made news/mailed news insert line breaks without user having to add html code.

Still developing even if it never comes into use, it's a fun learning process.
Will streamline all code to make lesser time aswell.

Fyron May 19th, 2004 01:21 AM

Re: PBW Emergency Site ver 2 Development
 
So where can we get the latest Version of this Ruatha?

Ruatha May 19th, 2004 06:24 AM

Re: PBW Emergency Site ver 2 Development
 
Quote:

Originally posted by Imperator Fyron:
So where can we get the latest Version of this Ruatha?
<font size="2" face="sans-serif, arial, verdana">Development halted some time ago, time to take it up I think.
Most things work but tthe autorun feature is unrelaible.
I'll start up the server when I get home from work and post a link to the files here.

Aiken May 19th, 2004 06:51 AM

Re: PBW Emergency Site ver 2 Development
 
Ruatha, is it possbile to run it on the web server without root priveledges? And the link to the package would be nice.

Thanks.

[ May 19, 2004, 05:57: Message edited by: aiken ]

Ruatha May 19th, 2004 02:23 PM

Re: PBW Emergency Site ver 2 Development
 
Ok, remember that I haven't touched this since december.
I've got to dive into it to remeber how it's made.
But there is a readme file...
Unpack all with directories to the directory where your server should be.

Start the site with your adress, he start page is "index.html"


NOTE : When setting upite, you'll propably get some notices that you're trying to hack the site and your IP is logged, the hack thing isn't finished so ignore this and try again... I'll fix this ASAP. EDIT Seems to cause alot of problems.. soon...
EDIT2: Ahh, cookie problem, hang on...
Edit3: Darned, should ever have started using cookies...

Good luck:
Removed temp...

I'll set up NGC4 and NeGoC5 here
http://ruatha.homelinux.org/
Yocan check that site and see how it progresses...

[ May 19, 2004, 13:35: Message edited by: Ruatha ]

Ruatha May 19th, 2004 03:55 PM

Re: PBW Emergency Site ver 2 Development
 
Here are the files, remember that it's a work in progress...

http://ruatha.homelinux.org/PBW_e2_beta.zip

For an example see
http://ruatha.homelinux.org

Documentation in HTML help files and readme.txt is still scarse, good luck!

NOTE: Currently I'd reccomend that you use it as a fileserver only, do the turns manually.
I haven't tested the exe file in the Last few months and don't remember if it worked, you can try it, but beware that it might not work.

[ May 19, 2004, 15:11: Message edited by: Ruatha ]

Roanon May 19th, 2004 04:22 PM

Re: PBW Emergency Site ver 2 Development
 
Upload doesn't seem to work yet, I got a short glimpse of a page with an error message before the page reloaded.

Ruatha May 19th, 2004 05:14 PM

Re: PBW Emergency Site ver 2 Development
 
Quote:

Originally posted by Roanon:
Upload doesn't seem to work yet, I got a short glimpse of a page with an error message before the page reloaded.
<font size="2" face="sans-serif, arial, verdana">Your file is uploaded..

It could be that you tried to upload while I was working on the site, but I'll be the first to admit that it propably has bugs...

If you want to use the autoturn application, remember that your game admin password must match that of the game master password.

The autoturn options in the admin screens become visible when the autoturn.exe is running.

[ May 19, 2004, 19:17: Message edited by: Ruatha ]

Ruatha May 19th, 2004 08:02 PM

Re: PBW Emergency Site ver 2 Development
 
New Version:
http://ruatha.homelinux.org/PBW_e2_beta_2.zip

Changed: a "2" to "3" enabled autoturns, ALPU and manual turns in game admin if autoturn.exe runs.

Files changed since Last Version:
Game_show_deadline.php
Game_forms.php

BUGREPORT: Sometimes the site admin login com+plains off missing variable, login goes ok but no variables shows in site admin page.
SOLUTION: Leave to index page and try to re-enter the admin screen.


(I'm not good at cookies, thinking of dumping them and using session variables instead, unless Fyron protests wildly http://forum.shrapnelgames.com/images/icons/icon7.gif )

[ May 19, 2004, 19:45: Message edited by: Ruatha ]

Fyron May 19th, 2004 09:52 PM

Re: PBW Emergency Site ver 2 Development
 
Quote:

(I'm not good at cookies, thinking of dumping them and using session variables instead, unless Fyron protests wildly [Smile] )
<font size="2" face="sans-serif, arial, verdana">Time to get good at them! http://forum.shrapnelgames.com/images/icons/icon12.gif

Ruatha May 20th, 2004 01:04 AM

Re: PBW Emergency Site ver 2 Development
 
Quote:

Originally posted by aiken:
Ruatha, is it possbile to run it on the web server without root priveledges? And the link to the package would be nice.

Thanks.

<font size="2" face="sans-serif, arial, verdana">If you can allow write/read access and it runs PHP I guess it'll be possible, try...

As stated: Will post link to files when I get home.


All times are GMT -4. The time now is 03:18 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.