.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Space Empires: IV & V (http://forum.shrapnelgames.com/forumdisplay.php?f=20)
-   -   Ruatha: PBW Alternate Scripts (http://forum.shrapnelgames.com/showthread.php?t=10603)

Fyron October 22nd, 2003 06:43 PM

Ruatha: PBW Alternate Scripts
 
So... could you point me to the latest Version of those scripts you had written to use when PBW is down? http://forum.shrapnelgames.com/images/icons/icon7.gif

Ruatha October 23rd, 2003 06:08 AM

Re: Ruatha: PBW Alternate Scripts
 
Syre Fyron, will do as soon as I get home from work (Approx 12 hours now).

Gandalph October 23rd, 2003 04:25 PM

Re: Ruatha: PBW Alternate Scripts
 
I sent you an email about this also. It would be easier to run my games this way. Please send them on over to me as well.

Ruatha October 23rd, 2003 07:58 PM

Re: Ruatha: PBW Alternate Scripts
 
Here comes as requested, if you don't understand what it is about just ignore it!

You need a HTTP server with PHP capabilty.
You can see it working here
Newbie Galactic combat 3 PBW Emergency Site

Thanx to Fyron for dragging me into PHP scripting, screaming and kicking all the way though! http://forum.shrapnelgames.com/images/icons/tongue.gif

Download all files here:
http://pbw.ath.cx/Site.zip

This is the readme, also included:
[i]
You need a http server capable of handling php files.
The starting file is index.php
You can set up as many sites as you wish but each site needs their own directory ith a gamefile and turnfiles subdirectories.
You can alter all data in simple textfiles, the configuration.txt set up is before the site is turned on and then shouldn't have to be altered anymore.
The playerdata.txt needs to be altered when players drop and are replaced.
The deadline.txt needs to be alterd when the deadline is updated.
Hopefully I'll fix a better deadline handler in the future, and a progress bar for the uplaod turnfile, that script has been giving some players troubles, I'll look into that (Not working for some).

The gamefile that lies in the GAMEFILE directory must be named in PBW standard,
that is:
Gamename_turnnumber.zip
and the gamename the same as in configuration.txt

i e:
NGC3_57.zip

The uploaded turnfiles in TURNFILES directory should be named accrdingly in PBW standard:
Gamename_playernumber(4 numbers).plr

i e:
ngc3_0001.plr

These are the textfiles that needs to be altered:

#1. Configuration.txt:
Game name
Site name
Host name
Host e-mail
Info line

i e:
NGC3
Newbie Galactic Combat 3 PBW Emergency Site
Ruatha
james@visit.se
Made 2003 by Ruatha with Wordpad.

#2. Playerdata.txt :
Number of players
Player1
Player1 e-mail
Player1 empire name

i e:
2
Ruatha
james@visit.se
Swedish Democracy
James
james@storuman.nu
Storuman Republic

#3. Deadline.txt
year
Month
Day
hour

i e:
2003
8
22
20

------------
Good luck.

Ruatha

Fyron October 23rd, 2003 10:27 PM

Re: Ruatha: PBW Alternate Scripts
 
Well this sucks... the get turn file script (oddly named upload.php... http://forum.shrapnelgames.com/images/icons/tongue.gif ) is not working for me. I set the gamename in the configuration info to adamant010. I uploaded a file named adamant010_24.zip to the gamefile turn, but it is not reading the file. http://forum.shrapnelgames.com/images/icons/icon9.gif

Also, on your sample site, it seems to be appending ".php" to the end of the turn file zip...

[ October 23, 2003, 21:29: Message edited by: Imperator Fyron ]

Fyron October 23rd, 2003 10:34 PM

Re: Ruatha: PBW Alternate Scripts
 
I see the problem... http://forum.shrapnelgames.com/images/icons/tongue.gif

In upload.txt, you have this code:

// Format and output the file name and link.
$dl = "ngc3_".$latest.".zip";


This is BAD BAD BAD, as it forces the game to think that the file name is ngc3... http://forum.shrapnelgames.com/images/icons/tongue.gif


Well, that is not the only problem... it is just going to make it impossible to get the right filename for anyone running a game not named "ngc3"... I still can't get it to recognize my file...

It is sending gamefile/adamant010 _24.zip to the send_file function...

[ October 23, 2003, 21:44: Message edited by: Imperator Fyron ]

Fyron October 23rd, 2003 11:02 PM

Re: Ruatha: PBW Alternate Scripts
 
Ok, I have uploaded a fixed Version of the upload.php file for you. http://forum.shrapnelgames.com/images/icons/icon12.gif

http://pbw.spaceempires.net/upload.zip

Ruatha October 24th, 2003 05:59 AM

Re: Ruatha: PBW Alternate Scripts
 
Quote:

Originally posted by Imperator Fyron:
Ok, I have uploaded a fixed Version of the upload.php file for you. http://forum.shrapnelgames.com/images/icons/icon12.gif

http://pbw.spaceempires.net/upload.zip

<font size="2" face="sans-serif, arial, verdana">Thanx.

Ruatha October 24th, 2003 06:02 AM

Re: Ruatha: PBW Alternate Scripts
 
Quote:

Originally posted by Imperator Fyron:
Ok, I have uploaded a fixed Version of the upload.php file for you. http://forum.shrapnelgames.com/images/icons/icon12.gif

http://pbw.spaceempires.net/upload.zip

<font size="2" face="sans-serif, arial, verdana">Thanx.

Ruatha October 24th, 2003 06:05 AM

Re: Ruatha: PBW Alternate Scripts
 
Updated hopefully fixed Version, thanx Fyron!
The only problem now is timeout errors when uploading plr files for some, migth just be my server, I don't know?

You need a HTTP server with PHP capabilty.
You can see it working here
Newbie Galactic combat 3 PBW Emergency Site


Download all files here (v 1.0):
Site ver 1.0

This is the readme, also included:
[i]
You need a http server capable of handling php files.
The starting file is index.php
You can set up as many sites as you wish but each site needs their own directory ith a gamefile and turnfiles subdirectories.
You can alter all data in simple textfiles, the configuration.txt set up is before the site is turned on and then shouldn't have to be altered anymore.
The playerdata.txt needs to be altered when players drop and are replaced.
The deadline.txt needs to be alterd when the deadline is updated.
Hopefully I'll fix a better deadline handler in the future, and a progress bar for the uplaod turnfile, that script has been giving some players troubles, I'll look into that (Not working for some).

The gamefile that lies in the GAMEFILE directory must be named in PBW standard,
that is:
Gamename_turnnumber.zip
and the gamename the same as in configuration.txt

i e:
NGC3_57.zip

The uploaded turnfiles in TURNFILES directory should be named accrdingly in PBW standard:
Gamename_playernumber(4 numbers).plr

i e:
ngc3_0001.plr

These are the textfiles that needs to be altered:

#1. Configuration.txt:
Game name
Site name
Host name
Host e-mail
Info line

i e:
NGC3
Newbie Galactic Combat 3 PBW Emergency Site
Ruatha
james@visit.se
Made 2003 by Ruatha with Wordpad.

#2. Playerdata.txt :
Number of players
Player1
Player1 e-mail
Player1 empire name

i e:
2
Ruatha
james@visit.se
Swedish Democracy
James
james@storuman.nu
Storuman Republic

#3. Deadline.txt
year
Month
Day
hour

i e:
2003
8
22
20

------------
Good luck.

Ruatha

[ October 24, 2003, 05:41: Message edited by: Ruatha ]

Ruatha October 24th, 2003 06:46 AM

Re: Ruatha: PBW Alternate Scripts
 
Next to do:
Auto run batch file and auto update deadline.
History.


What has been fixed:
If you name the empires without player with player name "-" it won't be marked red and will be displayed with the name "(none)".
If the empire is dead name the player "-" and name the empire for example "Dead" or whatever.

(The " shouldn't be included in the textfile)

[ October 24, 2003, 06:43: Message edited by: Ruatha ]

Ruatha October 24th, 2003 08:00 AM

Re: Ruatha: PBW Alternate Scripts
 
It's not much time one has to edit the Posts in....

*For the auto turn I was plannng on making a dos or windows program that runs constantly and checks the current time and the deadlines in as many defined deadline.txt files as wanted, when a deadline is found it will run the game with files from that directory, game file and plr turn files.
move all plr files to a backupdirectory and zip a new turnfile and add it to the gamefile directory.
Update the deadline.txt.
Continue to check all defined deadlines.txt.

Either written in Turbo pascal (Dos) or Delphi (windows).
Support for Mods.
There won't be any auto mail function, for a long while.

*Will also add news section and web based admin possibility as alternative to current text file based.

Anyone wanting to write part or sections of the site are welcome, otherwise I'll do it as a continually thing, slowly..

Any suggestions or other ideas?

[ October 24, 2003, 07:31: Message edited by: Ruatha ]

Ruatha October 24th, 2003 09:20 AM

Re: Ruatha: PBW Alternate Scripts
 
Gosh, I hate http://forum.shrapnelgames.com/images/icons/icon8.gif the new "Edit time expired"!!

Changed "European standard time" to "Local server Time" on main page.

Will make auto app trayable.

Suggestions.

ver 1.01

Gandalph October 24th, 2003 03:15 PM

Re: Ruatha: PBW Alternate Scripts
 
How to get the "Upload" section to show a player has uploaded his turn?

Also the download game file function is not working.

[ October 24, 2003, 14:27: Message edited by: Gandalph ]

Fyron October 24th, 2003 03:27 PM

Re: Ruatha: PBW Alternate Scripts
 
I suggest you not have any code read in the contents of text files to get variables. Instead, have files like "config.php" and "playerdata.php". Reading from text files is relatively slow, and prone to error, much more so than just having .php files included. http://forum.shrapnelgames.com/images/icons/icon12.gif And, it still just requires editing files to be installed, so it is not that big a change for the user of the script.

Also, it would be good to be able to have all the main .php files in a folder, and then have various folders for different games in subfolders, with their appropriate config files and gamefile etc. folders. So you have something like:

se.net/pbw contains the pure code .php, with nothing specific to any game
se.net/pbw/b5modgame contains the mentioned config.php and playerdata.php, as well as its subfolders of gamefile, turnfiles, etc.

[ October 24, 2003, 14:30: Message edited by: Imperator Fyron ]

Ruatha October 24th, 2003 03:48 PM

Re: Ruatha: PBW Alternate Scripts
 
Quote:

Originally posted by Gandalph:
How to get the "Upload" section to show a player has uploaded his turn?

Also the download game file function is not working.

<font size="2" face="sans-serif, arial, verdana">There has been changes made in this area today, do you have the latest files?

Fyron fixed an error where no gamefiles except those named NGC... could be downloaded!

I fixed an error where the check for uploaded files compensated wrongly for letter case, it should work now.

Ruatha October 24th, 2003 03:49 PM

Re: Ruatha: PBW Alternate Scripts
 
Quote:

Originally posted by Imperator Fyron:
I suggest you not have any code read in the contents of text files to get variables. Instead, have files like "config.php" and "playerdata.php". Reading from text files is relatively slow, and prone to error, much more so than just having .php files included. http://forum.shrapnelgames.com/images/icons/icon12.gif And, it still just requires editing files to be installed, so it is not that big a change for the user of the script.

Also, it would be good to be able to have all the main .php files in a folder, and then have various folders for different games in subfolders, with their appropriate config files and gamefile etc. folders. So you have something like:

se.net/pbw contains the pure code .php, with nothing specific to any game
se.net/pbw/b5modgame contains the mentioned config.php and playerdata.php, as well as its subfolders of gamefile, turnfiles, etc.

<font size="2" face="sans-serif, arial, verdana">The multiple folder thing will be fixed to next Version (in a day or two)
Thanx for the suggestion.
About the PHP instead of txt, will think of a good way to fix that, should be doable without to much hassle.
How where you thinking, that I should include variables in include.php where all names etc are entered and then include that file into the main index.php with the include instruction? That seems easiest.
And then make a web page to enter and alter the data in text boxes, so that no real text editing is necessary. Will do this!

[ October 24, 2003, 15:00: Message edited by: Ruatha ]

Ruatha October 24th, 2003 05:17 PM

Re: Ruatha: PBW Alternate Scripts
 
Idea for new structure for next EPS (Emergency Pbw Site):


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

SENDTURN.PHP
Sendturn Script

TIMEZONE.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;
Number of players,
Playernames
E-mails
Empire name
Host name and e-mail.
News
Number of turns to backup
Timezone.

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.

TURNFILES
Directory for player turnfiles (PLR)

GAMEFILE
Directory for Gamefiles (ZIP)

BACKUP
Zipped old PLR and GAM files

[ October 24, 2003, 16:21: Message edited by: Ruatha ]

Ruatha October 24th, 2003 05:56 PM

Re: Ruatha: PBW Alternate Scripts
 
Now I see that it tries to send UPLOAD.PHP when getting the turnfile. Will fix this after work (approx 27 hours of work left first...)

Last time I managed to get rid of the PHP extension by changing the file type, but this latest verion adds upload as name, will have to check why.

EDIT:STRANGE, the next computer I tried here at work worx perfect, right filename and extension!!

EDIT AGAIN:
I have a clue:
It works great on the computer with a Swedish Version of Windows 2000 but not on the one with an English Win 2000, Why?????
So Fyron, when I use Swedish win 2000 or Win XP I can download the turnfile from your site without the PHP extension.
Will have to check this further!

[ October 24, 2003, 17:02: Message edited by: Ruatha ]

geoschmo October 24th, 2003 06:35 PM

Re: Ruatha: PBW Alternate Scripts
 
Ruatha, fyi I am having the same problem with getting the game file on mine.

http://pbw.spaceempires.net/geoschmo/survivor2/

I got around it by modifing the index.php to look for the file directly instead of pulling up the upload.php file. But that's not a good permanent fix because I will have to modify the index file every turn.

Thanks so much for making these files available by the way. It's a big help.

What are the chances of adding a button to the index that will pull up a new email box and fill in all the player emails? It would make notifying them of a new turn very convienent. I guess you'd just need something to parse the player text file and populate a mailto command. Anyway, just a suggestion.

Geoschmo

Ruatha October 24th, 2003 07:13 PM

Re: Ruatha: PBW Alternate Scripts
 
Quote:

Originally posted by geoschmo:
Ruatha, fyi I am having the same problem with getting the game file on mine.

http://pbw.spaceempires.net/geoschmo/survivor2/

I got around it by modifing the index.php to look for the file directly instead of pulling up the upload.php file. But that's not a good permanent fix because I will have to modify the index file every turn.

Thanks so much for making these files available by the way. It's a big help.

What are the chances of adding a button to the index that will pull up a new email box and fill in all the player emails? It would make notifying them of a new turn very convienent. I guess you'd just need something to parse the player text file and populate a mailto command. Anyway, just a suggestion.

Geoschmo

<font size="2" face="sans-serif, arial, verdana">It's an annoying BAD bug that needs to fixed fast, to bad I'm at work the next 25 hours (will still look at it some though...)
The mail button was a good idea, will do!

EDIT: Have included a crude "mail all" function, but I have nowhere to upload it (Haven't started the FTP server at home since the Last reformatation!, can't find the upload function here at the forum!)

[ October 24, 2003, 18:38: Message edited by: Ruatha ]

Ruatha October 24th, 2003 07:52 PM

Re: Ruatha: PBW Alternate Scripts
 
A temporary fix one can make is to change the link from "upload.php" to the "gamefile" directory, ugly but it works while we fix it.
Have a Version of the index.php that does this aswell, but- have no way of testing it right now and nowhere to upload it.

Fyron October 25th, 2003 12:05 AM

Re: Ruatha: PBW Alternate Scripts
 
I added a news.html file that the host can edit to post up some nice news info. http://forum.shrapnelgames.com/images/icons/icon12.gif Just put this in the folder over the old index.php.

http://pbw.spaceempires.net/newsfile.zip

Have you considered making use of a database? It would greatly simplify some things. http://forum.shrapnelgames.com/images/icons/icon12.gif

[ October 24, 2003, 23:10: Message edited by: Imperator Fyron ]

Ruatha October 25th, 2003 12:13 AM

Re: Ruatha: PBW Alternate Scripts
 
How stupid can I be allowed to be??? http://forum.shrapnelgames.com/images/icons/icon8.gif

Instead of making PHP start the download I can make PHP make a dynamic HREF link to the newest gamefile to the "get turn" button, it's so easy!!
Why didn't I see it?
I've made the script but can't upload it until I get home from work tomorrow, will incorporate your News section then Fyron.
This means that Upload.php is scrapped totally and incorporated into index.php.

Databases, have never used any, always made my own.
I'll make PHP files to include variables instead of txt files next though.

[ October 24, 2003, 23:24: Message edited by: Ruatha ]

Fyron October 25th, 2003 12:20 AM

Re: Ruatha: PBW Alternate Scripts
 
I started on some of the php for the newer Version. http://forum.shrapnelgames.com/images/icons/icon12.gif I took the liberty of renaming some of the variables to have better names.

http://pbw.spaceempires.net/betafiles.zip

So far, I have a gameinfo.php and deadline.php. I did not put news in there, as I would rather see news handled via its own HTML file included in main.php.

Edit:
Email them to me and I can post them. http://forum.shrapnelgames.com/images/icons/icon12.gif

[ October 24, 2003, 23:28: Message edited by: Imperator Fyron ]

Ruatha October 25th, 2003 12:26 AM

Re: Ruatha: PBW Alternate Scripts
 
Ok, the only new file is the index.php
Will mail it to you as soon as the patient I'm waiting for have come and gone.
(Will have to go to another computer in another room)

Will download the gameinfo and work out of that, thanx.
It's good that you change the variables, I'm usually sloppy about the varaible names.
This will be a total rewrite of the site so it's good to start fresh.
(my variables usually ends up having names like "trash1, trash2, trash3" etc but in swedish....)

[ October 24, 2003, 23:30: Message edited by: Ruatha ]

Fyron October 25th, 2003 12:29 AM

Re: Ruatha: PBW Alternate Scripts
 
Added deadline.php, though I have no idea what you wanted with "Date in Central European time, altered to the set timezone when displayed in each game."...

Ruatha October 25th, 2003 12:33 AM

Re: Ruatha: PBW Alternate Scripts
 
It just means that all deadlines will be stored in the same timezone, doesn't matter wich.
But when it is displayed on the web page it is changed to the timezone that the host has defined for that particular game (add or subtract hours)
.

The player will be able to press a button to have it converted to all the other time zones, to see his/hers local deadline time.

EDIT: Should the design be similar to PBW or should it be radically different?

EDIT2:
I really like the variable files. I'm thinking of counting the player names until the first "SN" name and checking that against $numplayers.

In deadline.php I'll change $date to $timezone

Edit 3.5: Mail is on the way.
Won't be able to check this site or mail for some 6-7 hours, work work work...

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

Fyron October 25th, 2003 01:01 AM

Re: Ruatha: PBW Alternate Scripts
 
I am working on and have uploaded a main.php (in that same betafiles.zip). But, I am having some problems with it... check out this test site to see what they are http://forum.shrapnelgames.com/images/icons/icon12.gif :

http://pbw.spaceempires.net/test/main.php

http://pbw.spaceempires.net/betafiles.zip

I am attempting to move all the plr file checking to a new file called "playerupload.php" to keep main uncluttered.

[ October 25, 2003, 00:03: Message edited by: Imperator Fyron ]

Ruatha October 25th, 2003 04:16 AM

Re: Ruatha: PBW Alternate Scripts
 
I've made a deadline_check.php that checks the deadline.php in the $game directory against current time, displays this and what timezone is being used (So far only what the variable $timezone is, up to the host to define it so far) and a countdown in hours.
Also a link to a world timezone web page (External).

This is meant to be included in the Main.php
INCLUDE "deadline_check.php"

Fyron October 25th, 2003 05:13 AM

Re: Ruatha: PBW Alternate Scripts
 
The index you sent me had issues with not displaying colors properly for players that had uploaded plr files.

Ruatha October 25th, 2003 08:17 AM

Re: Ruatha: PBW Alternate Scripts
 
Will fix when I get home

Ruatha October 25th, 2003 10:59 AM

Re: Ruatha: PBW Alternate Scripts
 
Have fixed it.

Download latest pathc and unzip to the main directory, won't overwrite the variable files.
patch 1.2

or newsest complete files:
ver 1.2 complete

Ruatha October 26th, 2003 09:39 AM

Re: Ruatha: PBW Alternate Scripts
 
This thread isn't updated anymore.
for the latest files go to:
http://www.shrapnelgames.com/cgi-bin...&f=23&t=010250

[ October 26, 2003, 07:41: Message edited by: Ruatha ]


All times are GMT -4. The time now is 10:34 PM.

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