2 Commits

Author SHA1 Message Date
a4aa180b63 v0.0.5 2025-11-08 23:36:08 -07:00
d7f2b5d1d6 v0.0.4 2025-09-18 21:00:20 -06:00
25 changed files with 416 additions and 173 deletions

View File

@@ -1,3 +1,18 @@
Version 0.0.5 - 2025-11-08
* Update docs
* Minor changes
Version 0.0.4 - 2025-09-18
* Add placeholder for BASH version of irpg-release
* Fix admincomms was excluded from the web's HTML
* Add CAPTCHA to contact form
* Add web version var and display in web footer
* Update footer version and contact link
* Update docs
* Minor changes
Version 0.0.3 - 2025-09-15 Version 0.0.3 - 2025-09-15
* Update shebang to /bin/perl in irpg.pl * Update shebang to /bin/perl in irpg.pl

View File

@@ -1,2 +0,0 @@
### Issues
All issues, bugs and features are tracked using GitEmAll

View File

@@ -10,12 +10,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
CHANGELOG.md = CHANGELOG.md CHANGELOG.md = CHANGELOG.md
CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
CONTRIBUTING.md = CONTRIBUTING.md CONTRIBUTING.md = CONTRIBUTING.md
ISSUES.md = ISSUES.md
LICENSE = LICENSE LICENSE = LICENSE
README.md = README.md README.md = README.md
screenshot1.png = screenshot1.png screenshot1.png = screenshot1.png
screenshot2.png = screenshot2.png screenshot2.png = screenshot2.png
TODO.md = TODO.md
EndProjectSection EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "irpg-bot", "irpg-bot", "{3784E8C8-32DE-4740-8F55-324EF1EC4E86}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "irpg-bot", "irpg-bot", "{3784E8C8-32DE-4740-8F55-324EF1EC4E86}"
@@ -24,6 +22,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "irpg-bot", "irpg-bot", "{37
irpg-bot\ChangeLog.txt = irpg-bot\ChangeLog.txt irpg-bot\ChangeLog.txt = irpg-bot\ChangeLog.txt
irpg-bot\events.txt = irpg-bot\events.txt irpg-bot\events.txt = irpg-bot\events.txt
irpg-bot\INSTALL.txt = irpg-bot\INSTALL.txt irpg-bot\INSTALL.txt = irpg-bot\INSTALL.txt
irpg-bot\install-bot.md = irpg-bot\install-bot.md
irpg-bot\irpg.pl = irpg-bot\irpg.pl irpg-bot\irpg.pl = irpg-bot\irpg.pl
irpg-bot\irpgcheck.sh = irpg-bot\irpgcheck.sh irpg-bot\irpgcheck.sh = irpg-bot\irpgcheck.sh
irpg-bot\irpgdbtool = irpg-bot\irpgdbtool irpg-bot\irpgdbtool = irpg-bot\irpgdbtool
@@ -33,7 +32,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "irpg-bot", "irpg-bot", "{37
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "irpg-web", "irpg-web", "{B2C6CD83-5E84-40A2-8D1A-A57517EC36D9}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "irpg-web", "irpg-web", "{B2C6CD83-5E84-40A2-8D1A-A57517EC36D9}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
irpg-web\admincomms.txt = irpg-web\admincomms.txt irpg-web\admincomms.php = irpg-web\admincomms.php
irpg-web\captchaimage.php = irpg-web\captchaimage.php
irpg-web\ChangeLog.txt = irpg-web\ChangeLog.txt irpg-web\ChangeLog.txt = irpg-web\ChangeLog.txt
irpg-web\commonfunctions.php = irpg-web\commonfunctions.php irpg-web\commonfunctions.php = irpg-web\commonfunctions.php
irpg-web\config.php = irpg-web\config.php irpg-web\config.php = irpg-web\config.php
@@ -48,10 +48,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "irpg-web", "irpg-web", "{B2
irpg-web\idlerpg-adv.txt = irpg-web\idlerpg-adv.txt irpg-web\idlerpg-adv.txt = irpg-web\idlerpg-adv.txt
irpg-web\idlerpg.png = irpg-web\idlerpg.png irpg-web\idlerpg.png = irpg-web\idlerpg.png
irpg-web\idlerpg_000000.png = irpg-web\idlerpg_000000.png irpg-web\idlerpg_000000.png = irpg-web\idlerpg_000000.png
irpg-web\idlerpg_025D30.png = irpg-web\idlerpg_025D30.png
irpg-web\idlerpg_ff0000.png = irpg-web\idlerpg_ff0000.png irpg-web\idlerpg_ff0000.png = irpg-web\idlerpg_ff0000.png
irpg-web\index.php = irpg-web\index.php irpg-web\index.php = irpg-web\index.php
irpg-web\INSTALL.txt = irpg-web\INSTALL.txt irpg-web\INSTALL.txt = irpg-web\INSTALL.txt
irpg-web\install-web.md = irpg-web\install-web.md
irpg-web\makemap.php = irpg-web\makemap.php irpg-web\makemap.php = irpg-web\makemap.php
irpg-web\makequestmap.php = irpg-web\makequestmap.php irpg-web\makequestmap.php = irpg-web\makequestmap.php
irpg-web\makeworldmap.php = irpg-web\makeworldmap.php irpg-web\makeworldmap.php = irpg-web\makeworldmap.php

View File

@@ -4,9 +4,14 @@
## About ## About
IdleRPG or IRPG is the original automated IRC idle role playing game. IdleRPG or IRPG is the original automated IRC idle role playing game.
This is a modified and updated version of the 2004 version forked from idlerpg.net. This is a modified, updated and maintained version of the 2004 version forked from idlerpg.net.
IdleRPG comes with a bot written in Perl, a graphical web interface written in PHP and uses a file based database. The Idle RPG is just what it sounds like: an RPG in which the players idle. In addition to merely gaining levels, players can find items and battle other players. However, this is all done for you; you just idle. There are no set classes; you can name your character anything you like, and have its class be anything you like, as well.
## Features
* Bot backend written in Perl
* Web frontend written in PHP/XHTML
* File based database on the frontend, readable/writable by the web server
## Screenshots ## Screenshots
![IdleRPG Screenshot 1](screenshot1.png?raw=true "IdleRPG Screenshot 1") ![IdleRPG Screenshot 1](screenshot1.png?raw=true "IdleRPG Screenshot 1")

View File

@@ -1,2 +0,0 @@
### ToDo
All ToDo lists and milestones are tracked using GitEmAll

View File

@@ -75,7 +75,7 @@ botghostcmd PRIVMSG NickServ :ghost %botnick% %botpass%
helpurl https://www.mynet.org/irpg/ helpurl https://www.mynet.org/irpg/
# URL where users can reach the admin commands list (for admin help) # URL where users can reach the admin commands list (for admin help)
admincommurl https://www.mynet.org/irpg/admincomms.txt admincommurl https://www.mynet.org/irpg/admincomms.php
# URL where users can reach the online quest map, if available. if not # URL where users can reach the online quest map, if available. if not
# offering a map to users, leave this blank # offering a map to users, leave this blank

View File

@@ -1,5 +1,5 @@
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
First-time Installation: First-time Installation
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
1. Copy all of the irpg-bot files to your private web folder. The folder must 1. Copy all of the irpg-bot files to your private web folder. The folder must
@@ -14,7 +14,7 @@ First-time Installation:
Thanks for your interest in IdleRPG! :^) Thanks for your interest in IdleRPG! :^)
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Upgrading: Upgrading
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
1. Remove your old bot source, ie, rm -rfv that old buggy crap and start over. 1. Remove your old bot source, ie, rm -rfv that old buggy crap and start over.

28
irpg-bot/install-bot.md Normal file
View File

@@ -0,0 +1,28 @@
## Install-Bot
### First-time Installation
1. Copy all of the irpg-bot files to your private web folder. The folder must
be readable and writable by the web server and able to execute Perl and PHP.
2. Edit .irpg.conf with your favorite editor. This file must be in the same
private directory where the bot resides.
3. Run the bot with: perl irpg.pl
4. If you have problems, try running it in debug mode with:
perl irpg.pl --debug
5. Edit the bot ANY WAY you see fit.
6. All milestones, issues, bugs and features are tracked using GitEmAll.
Thanks for your interest in IdleRPG! :^)
### Upgrading
1. Remove your old bot source, ie, rm -rfv that old buggy crap and start over.
2. Copy all of the irpg-bot files to your private web folder. The folder must
be readable and writable by the web server and able to execute Perl and PHP.
2. Edit .irpg.conf with your favorite editor. This file must be in the same
private directory where the bot resides.
4. Run the bot with: perl irpg.pl
5. If you have problems, try running it in debug mode with:
perl irpg.pl --debug
6. Edit the bot ANY WAY you see fit.
7. All milestones, issues, bugs and features are tracked using GitEmAll.
Thanks for your interest in IdleRPG! :^)

View File

@@ -33,7 +33,8 @@ my %opts;
readconfig(); readconfig();
my $version = "0.0.3"; # bot version
my $version = "0.0.5";
# command line overrides .irpg.conf # command line overrides .irpg.conf
GetOptions(\%opts, GetOptions(\%opts,

View File

@@ -5,22 +5,27 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3C3C4730-9D32-418C-BFDC-CE89148AA6CA}</ProjectGuid> <ProjectGuid>{3C3C4730-9D32-418C-BFDC-CE89148AA6CA}</ProjectGuid>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />
<None Include="irpg-release.sh" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<ReleaseName>IdleRPG</ReleaseName> <ReleaseName>IdleRPG</ReleaseName>
<ReleaseVersion>0.0.3</ReleaseVersion> <ReleaseVersion>0.0.5</ReleaseVersion>
<ReleaseBotSourceName>IdleRPG-Bot</ReleaseBotSourceName> <ReleaseBotSourceName>IdleRPG-Bot</ReleaseBotSourceName>
<ReleaseWebSourceName>IdleRPG-Web</ReleaseWebSourceName> <ReleaseWebSourceName>IdleRPG-Web</ReleaseWebSourceName>
<ReleaseSolutionSourceName>IdleRPG-Source</ReleaseSolutionSourceName> <ReleaseSolutionSourceName>IdleRPG-Source</ReleaseSolutionSourceName>

View File

@@ -0,0 +1,8 @@
#!/bin/bash
# irpg-release.sh
#
# BASH version of the Release maker
#
# Run this after building all of the projects in this solution, to make
# zipped releases.
# This file is not yet written. Please use the MS Build version, irpg-release.csproj.

View File

@@ -1,5 +1,5 @@
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
First-time Installation: First-time Installation
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
1. Make sure you have the irpg-bot functional and running. 1. Make sure you have the irpg-bot functional and running.
@@ -23,7 +23,7 @@ First-time Installation:
Thanks for your interest in IdleRPG! :^) Thanks for your interest in IdleRPG! :^)
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Upgrading: Upgrading
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
1. Remove your old web source, ie, rm -rfv that old buggy crap and start over. 1. Remove your old web source, ie, rm -rfv that old buggy crap and start over.

105
irpg-web/admincomms.php Normal file
View File

@@ -0,0 +1,105 @@
<?php
include("config.php");
$irpg_page_title = "Admin Game Info";
$irpg_page_desc = "IdleRPG Game Info for Admins";
include("header.php");
?>
<h1>Idle RPG</h1>
<h2>Admin Commands</h2>
<p>This is not the full list of commands for the Idle RPG bot, but only
the list of admin commands.</p>
<dl>
<dt>INFO</dt>
<dd>retrieve some fairly useless stats about the bot.</dd>
<dt>DIE</dt>
<dd>kills the bot.</dd>
<dt>HOG</dt>
<dd>summon the Hand of God spell. See the main help file.</dd>
<dt>RESTART</dt>
<dd>restarts the bot.</dd>
<dt>CHPASS &lt;char name&gt; &lt;new password&gt;</dt>
<dd>change a character&apos;s pass in the IRPG.</dd>
<dt>CHCLASS &lt;char name&gt; &lt;new class name&gt;</dt>
<dd>change a character&apos;s class in the IRPG.</dd>
<dt>CHUSER &lt;char name&gt; &lt;new char name&gt;</dt>
<dd>change a character&apos;s username in the IRPG.
Please only use in very special circumstances; otherwise, have them
form a new player and DEL the old one. This should not let you
overwrite an existing account, but is untested.</dd>
<dt>PUSH &lt;char name&gt; &lt;seconds&gt;</dt>
<dd>push a player toward his goal by subtracting time
from his next time to level. Please use this only if bot has mistakenly
penalized someone. You could also use this to punish a user by setting
the number of seconds to a negative number. Don&apos;t do that.</dd>
<dt>DEL &lt;char name&gt;</dt>
<dd>remove a user&apos;s account.</dd>
<dt>JUMP &lt;server[:port]&gt;</dt>
<dd>move the bot to another server.</dd>
<dt>SILENT &lt;mode&gt;</dt>
<dd>switch bot between 4 modes of silence.
<ul>
<li>mode 0, bot sends all privmsgs.</li>
<li>mode 1, only chanmsg() is disabled.</li>
<li>mode 2, only privmsg()/notice() to non-channels is disabled.</li>
<li>mode 3, privmsgs/notices to users and channels are disabled.</li>
</ul>
</dd>
<dt>BACKUP</dt>
<dd>tell bot to copy $opts{&apos;dbfile&apos;} to .dbbackup/$opts{&apos;dbfile&apos;}TIMESTAMP</dd>
<dt>RELOADDB</dt>
<dd>force bot to reload player database file, rewriting all memory.
RELOADDB can only be used while in pause mode.</dd>
<dt>PAUSE</dt>
<dd>toggle pause mode.</dd>
<dt>PEVAL &lt;code&gt;</dt>
<dd>execute arbitrary argument as Perl code. Queues output &gt; 3 lines
or &gt; 1k of text. Some useful PEVAL commands:
<ul>
<li>Delete all accounts not logged in in 4 weeks (See also: DELOLD):<br />
<code>
/msg bot PEVAL delete $rps{$_} for grep { time()-$rps{$_}{lastlogin} &gt; 3600*24*7*4 && !$rps{$_}{online} } keys %rps;
</code>
</li>
<li>Remove one hour from everyone&apos;s clocks:<br />
<code>
/msg bot PEVAL $rps{$_}{next} -= 3600 for keys %rps;
</code>
</li>
<li>List all online users, separated by commas:<br />
<code>
/msg bot PEVAL join(&apos;, &apos;,grep { $rps{$_}{online} } keys %rps);
</code>
</li>
<li>View contents of a file on remote host:<br />
<code>
/msg bot PEVAL `cat file`
</code>
</li>
<li>Turn on debug mode:<br />
<code>
/msg bot PEVAL $opts{debug}=1;
</code>
</li>
<li>Force write-out of database:<br />
<code>
/msg bot PEVAL writedb();
</code>
</li>
</ul>
</dd>
<dt>DELOLD &lt;days&gt;</dt>
<dd>remove all non-logged-in accounts inactive in the last &lt;days&gt;
days.</dd>
<dt>CLEARQ</dt>
<dd>clear the outgoing message queue. Useful to use if someone floods
the bot with a lot of text that it plans to respond to.</dd>
<dt>MKADMIN &lt;username&gt;</dt>
<dd>set the isadmin flag for a given username.</dd>
</dl>
<?php
include("footer.php");
?>

View File

@@ -1,64 +0,0 @@
This is not the full list of commands for the Idle RPG bot, but only the list
of admin commands.
INFO, retrieve some fairly useless stats about the bot.
DIE, kills the bot.
HOG, summon the Hand of God spell. See the main help file.
RESTART, restarts the bot.
CHPASS <char name> <new password>, change a character's pass in the IRPG.
CHCLASS <char name> <new class name>, change a character's class in the IRPG.
CHUSER <char name> <new char name>, change a character's username in the IRPG.
Please only use in very special circumstances; otherwise, have them form
a new player and DEL the old one. This should not let you overwrite an
existing account, but is untested.
PUSH <char name> <seconds>, push a player toward his goal by subtracting time
from his next time to level. Please use this only if bot has mistakenly
penalized someone. You could also use this to punish a user by setting
the number of seconds to a negative number. Don't do that.
DEL <char name>, remove a user's account.
JUMP <server[:port]>, move the bot to another server.
SILENT <mode>, switch bot between 4 modes of silence.
- mode 0, bot sends all privmsgs.
- mode 1, only chanmsg() is disabled.
- mode 2, only privmsg()/notice() to non-channels is disabled.
- mode 3, privmsgs/notices to users and channels are disabled.
BACKUP, tell bot to copy $opts{'dbfile'} to .dbbackup/$opts{'dbfile'}TIMESTAMP
RELOADDB, force bot to reload player database file, rewriting all memory.
RELOADDB can only be used while in pause mode.
PAUSE, toggle pause mode.
PEVAL <code>, execute arbitrary argument as Perl code. Queues output > 3 lines
or >1k of text. Some useful PEVAL commands:
- Delete all accounts not logged in in 4 weeks (See also: DELOLD):
/msg bot PEVAL delete $rps{$_} for grep { time()-$rps{$_}{lastlogin} > 3600*24*7*4 && !$rps{$_}{online} } keys %rps;
- Remove one hour from everyone's clocks:
/msg bot PEVAL $rps{$_}{next} -= 3600 for keys %rps;
- List all online users, separated by commas:
/msg bot PEVAL join(', ',grep { $rps{$_}{online} } keys %rps);
- View contents of a file on remote host:
/msg bot peval `cat file`
- Turn on debug mode:
/msg bot peval $opts{debug}=1;
- Force write-out of database:
/msg bot peval writedb();
DELOLD <days>, remove all non-logged-in accounts inactive in the last <days>
days.
CLEARQ, clear the outgoing message queue. Useful to use if someone floods the
bot with a lot of text that it plans to respond to.
MKADMIN <username>, set the isadmin flag for a given username.

50
irpg-web/captchaimage.php Normal file
View File

@@ -0,0 +1,50 @@
<?php
session_start();
// Create a blank image
$width = 52;
$height = 16;
$image = imagecreate($width, $height);
$backgroundColor = imagecolorallocate($image, 212, 255, 226);
imagefilledrectangle($image, 0, 0, $width, $height, $backgroundColor);
// Add some text
$captchaString = "";
$allowedChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$charColor = imagecolorallocate($image, 64, 64, 64);
$numChars = 5;
for ($i=0; $i<$numChars; $i++)
{
$char = $allowedChars[rand(0, strlen($allowedChars)-1)];
imagestring($image, 5, 2+($i*10), 0, $char, $charColor);
$captchaString .= $char;
}
// Save the text to a session variable.
$_SESSION['captchaString'] = $captchaString;
// Add some lines
$lineColor = imagecolorallocate($image, 234, 132, 13);
$numLines = rand(2,2);
for($i=0; $i<$numLines; $i++)
{
imageline($image, 0, rand()%16, 52, rand()%16, $lineColor);
}
// Add some pixels
$pixelColor = imagecolorallocate($image, 11, 213, 142);
$numPixels = rand(38,40);
for($i=0; $i<$numPixels; $i++)
{
imagesetpixel($image, rand()%52, rand()%16, $pixelColor);
}
// Set the content type header - in this case image/jpeg
header('Content-type: image/jpeg');
// Output the image
imagejpeg($image);
// Free up memory
imagedestroy($image);
?>

View File

@@ -5,6 +5,9 @@ $admin_nick="admin";
// admin email // admin email
$admin_email="admin@mynet.org"; $admin_email="admin@mynet.org";
// web version
$irpg_version = "0.0.5";
// your game's bot nickname // your game's bot nickname
$irpg_bot="IdleBot"; $irpg_bot="IdleBot";
@@ -20,6 +23,12 @@ $irpg_irc_network_name="MyNet IRC Network";
// your server's network address advertisement // your server's network address advertisement
$irpg_irc_network_address="ircs://irc.mynet.org:7000"; $irpg_irc_network_address="ircs://irc.mynet.org:7000";
// your server's network info advertisement
// leave this empty if you don't have any special info or notes
// $irpg_irc_network_info="* This IRC Network requires SASL authentication using".
// " your forum username and password";
$irpg_irc_network_info="";
// base directory of your game's url // base directory of your game's url
// my site is https://www.mynet.org/irpg/, so it's "/irpg/" // my site is https://www.mynet.org/irpg/, so it's "/irpg/"
$irpg_base_dir="/irpg/"; $irpg_base_dir="/irpg/";

View File

@@ -1,8 +1,17 @@
<?php <?php
session_start();
include("config.php"); include("config.php");
$irpg_page_title = "Contact"; $irpg_page_title = "Contact";
$irpg_page_desc = "IdleRPG Contact"; $irpg_page_desc = "IdleRPG Contact";
include("header.php"); include("header.php");
if (!$_SESSION['captchaString'] || $_SESSION['captchaString'] == "") {
$numA = rand(0, 9);
$numB = rand(0, 9);
$numC = rand(0, 9);
$numD = rand(0, 9);
$numE = rand(0, 9);
$_SESSION['captchaString'] = $numA.$numB.$numC.$numD.$numE;
}
echo "<h1>Contact</h1>"; echo "<h1>Contact</h1>";
if (!$irpg_site_email) { if (!$irpg_site_email) {
@@ -11,35 +20,57 @@
else if ($irpg_site_email == "disabled") { else if ($irpg_site_email == "disabled") {
echo " <blockquote>Email is disabled.</blockquote>\n"; echo " <blockquote>Email is disabled.</blockquote>\n";
} }
else if ($irpg_site_email == "php" && $_POST['from'] && $_POST['text']) { else if ($irpg_site_email == "php" && $_POST['from_email'] && $_POST['message'] && $_POST['captchaString']) {
if (strtolower($_POST['captchaString']) != strtolower($_SESSION['captchaString'])) { echo " <blockquote>Your CAPTCHA didn't match.</blockquote>\n"; }
else if (!filter_var($_POST['from_email'], FILTER_VALIDATE_EMAIL)) { echo " <blockquote>Your email address isn't valid.</blockquote>\n"; }
else {
$to = $admin_email; $to = $admin_email;
$subject = "IdleRPG: ".$_POST['from']; $subject = "IdleRPG: Contact Form";
$message = "Name: ".$_POST['name']."\nE-mail: ".$_POST['from']."\n\n".$_POST['text']; $message = "Name: ".$_POST['from_name']."\nEmail: ".$_POST['from_email']."\n\n".$_POST['message'];
$additional_headers = "From: ".$_POST['from']."\r\n"; $additional_headers = "From: ".$_POST['from_name']." <".$_POST['from_email'].">\r\n";
mail($to, $subject, $message, $additional_headers); mail($to, $subject, $message, $additional_headers);
echo " <blockquote>Thanks for your submission.</blockquote>\n"; echo " <blockquote>Thanks for your submission.</blockquote>\n";
$_SESSION['captchaString'] = "";
} }
else if ($irpg_site_email == "smtp" && $_POST['from'] && $_POST['text']) { }
echo " <blockquote>SMTP Email is under construction. Your submission was not submitted.</blockquote>\n"; else if ($irpg_site_email == "smtp" && $_POST['from_email'] && $_POST['message'] && $_POST['captchaString']) {
echo " <blockquote>SMTP Email is under construction.</blockquote>\n";
} }
else { else {
echo " <form method=\"post\" action=\"contact.php\">\n". echo " <form method=\"post\" action=\"contact.php\">\n".
" <table border=\"0\">\n". " <table border=\"0\">\n".
" <tr>\n". " <tr>\n".
" <th align=\"left\"><label for=\"from\">Your e-mail address</label>:</th>\n". " <th align=\"left\"><label for=\"from_name\">Your Name:</label></th>\n".
" <td align=\"right\">\n". " <td align=\"right\">\n".
" <input type=\"text\" size=\"20\" maxlength=\"50\" name=\"from\" id=\"from\" />\n". " <input type=\"text\" size=\"20\" maxlength=\"50\" name=\"from_name\" id=\"from_name\" />\n".
" </td>\n". " </td>\n".
" </tr>\n". " </tr>\n".
" <tr>\n". " <tr>\n".
" <th align=\"left\"><label for=\"name\">Your name</label>:</th>\n". " <th align=\"left\"><label for=\"from_email\">Your Email Address:</label></th>\n".
" <td align=\"right\">\n". " <td align=\"right\">\n".
" <input type=\"text\" size=\"20\" maxlength=\"50\" name=\"name\" id=\"name\" />\n". " <input type=\"text\" size=\"20\" maxlength=\"50\" name=\"from_email\" id=\"from_email\" />\n".
" </td>\n". " </td>\n".
" </tr>\n". " </tr>\n".
" <tr>\n". " <tr>\n".
" <th align=\"left\"><label for=\"captchaImage\">CAPTCHA:</label></th>\n".
" <td align=\"right\">\n".
" <img id='captchaImage' src='captchaimage.php' alt='CAPTCHA' />\n".
" </td>\n".
" </tr>\n".
" <tr>\n".
" <th align=\"left\"><label for=\"captchaString\">CAPTCHA:</label></th>\n".
" <td align=\"right\">\n".
" <input type=\"text\" size=\"20\" maxlength=\"5\" name=\"captchaString\" id=\"captchaString\" />\n".
" </td>\n".
" </tr>\n".
" <tr>\n".
" <th align=\"left\" colspan=\"2\">\n".
" <label for=\"message\">Your Message: (Please be detailed)</label>\n".
" </th>\n".
" </tr>\n".
" <tr>\n".
" <td colspan=\"2\">\n". " <td colspan=\"2\">\n".
" <textarea name=\"text\" rows=\"6\" cols=\"44\"></textarea><br />\n". " <textarea name=\"message\" rows=\"6\" cols=\"44\"></textarea>\n".
" </td>\n". " </td>\n".
" </tr>\n". " </tr>\n".
" <tr>\n". " <tr>\n".

View File

@@ -4,9 +4,9 @@
Questions? Comments? Suggestions? Bugs? Naked pics? Questions? Comments? Suggestions? Bugs? Naked pics?
<?php <?php
if ($irpg_site_email != null && $irpg_site_email != "disabled") { if ($irpg_site_email != null && $irpg_site_email != "disabled") {
echo " <a href=\"contact.php\">$admin_email</a> or\n"; echo " Contact <a href=\"contact.php\">".$admin_nick."</a> or\n";
} }
echo " ".$admin_nick."@IRC.\n"; echo " ".$admin_nick."@IRC\n";
?> ?>
<?php <?php
$hits = file("hits.db"); $hits = file("hits.db");
@@ -14,13 +14,13 @@
$thispage = explode("/",$_SERVER['PHP_SELF']); $thispage = explode("/",$_SERVER['PHP_SELF']);
$thispage = array_pop($thispage); $thispage = array_pop($thispage);
if ($fp == false) { if ($fp == false) {
echo " Error: could not open file hits.db."; echo " &bull; Error: could not open file hits.db";
} }
foreach ($hits as $line) { foreach ($hits as $line) {
list($page,$numhits,$date) = explode("\t",trim($line)); list($page,$numhits,$date) = explode("\t",trim($line));
if ($page == $thispage) { if ($page == $thispage) {
++$numhits; ++$numhits;
echo " $numhits hits since $date\n"; echo " &bull; $numhits hits since $date\n";
$found = 1; $found = 1;
} }
if ($fp) { if ($fp) {
@@ -32,6 +32,9 @@
fwrite($fp,$thispage."\t1\t".date("M j, Y",time())."\n"); fwrite($fp,$thispage."\t1\t".date("M j, Y",time())."\n");
} }
fclose($fp); fclose($fp);
?>
<?php
echo " &bull; IdleRPG Web v".$irpg_version."\n";
?> ?>
</p> </p>
</div> </div>

View File

@@ -19,8 +19,8 @@
$topbarurl = array( $topbarurl = array(
'Game Info' => $irpg_base_dir . 'index.php', 'Game Info' => $irpg_base_dir . 'index.php',
'Player Info' => $irpg_base_dir . 'players.php', 'Player Info' => $irpg_base_dir . 'players.php',
'World Map' => $irpg_base_dir . 'worldmap.php',
'Quest Info' => $irpg_base_dir . 'quest.php', 'Quest Info' => $irpg_base_dir . 'quest.php',
'World Map' => $irpg_base_dir . 'worldmap.php',
); );
if ($irpg_site_email && $irpg_site_email != "disabled") { if ($irpg_site_email && $irpg_site_email != "disabled") {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

View File

@@ -20,6 +20,11 @@
in the channel in the channel
<a href="<?php echo $irpg_irc_network_address; ?>/<?php echo $irpg_chan; ?>"><?php echo $irpg_chan; ?></a>. <a href="<?php echo $irpg_irc_network_address; ?>/<?php echo $irpg_chan; ?>"><?php echo $irpg_chan; ?></a>.
</p> </p>
<?php
if ($irpg_irc_network_info != null && !empty($irpg_irc_network_info)) {
echo " <p><i>$irpg_irc_network_info</i></p>\n";
}
?>
<h2>Registering</h2> <h2>Registering</h2>
<p>To register, simply:</p> <p>To register, simply:</p>

46
irpg-web/install-web.md Normal file
View File

@@ -0,0 +1,46 @@
## Install-Web
### First-time Installation
1. Make sure you have the irpg-bot functional and running.
2. Copy all of the irpg-web files to your public_html/irpg web folder.
3. Edit config.php with your favorite editor. This file must be in the same
public directory where the irpg web resides.
4. chmod 644 * && chmod 666 hits.db
5. If you change the default settings in the IRPG bot (for example, if you turn
off the option to write quest info to file, you'll have to manually edit
some scripts to take this into account. If you disable the INFO command,
you might want to remove it from the index.php page.
6. Some code in this package requires that your system have GD 2.0+ (or have it
enabled in your php.ini, on Win32). If you don't want this functionality to
be available, edit the script playerview.php to remove the use of the map
and header.php to remove the links to the world map and the quest info page.
You can also delete the worldmap.php, makeworldmap.php, makemap.php,
quest.php, and makequestmap.php scripts.
7. Edit the website ANY WAY you see fit. You don't have to keep all of the
links to me, I just thought they might be useful or interesting to users :^)
8. All milestones, issues, bugs and features are tracked using GitEmAll.
Thanks for your interest in IdleRPG! :^)
### Upgrading
1. Remove your old web source, ie, rm -rfv that old buggy crap and start over.
2. Make sure you have the irpg-bot functional and running.
3. Copy all of the irpg-web files to your public_html/irpg web folder.
4. Edit config.php with your favorite editor. This file must be in the same
public directory where the irpg web resides.
5. chmod 644 * && chmod 666 hits.db
6. If you change the default settings in the IRPG bot (for example, if you turn
off the option to write quest info to file, you'll have to manually edit
some scripts to take this into account. If you disable the INFO command,
you might want to remove it from the index.php page.
7. Some code in this package requires that your system have GD 2.0+ (or have it
enabled in your php.ini, on Win32). If you don't want this functionality to
be available, edit the script playerview.php to remove the use of the map
and header.php to remove the links to the world map and the quest info page.
You can also delete the worldmap.php, makeworldmap.php, makemap.php,
quest.php, and makequestmap.php scripts.
8. Edit the website ANY WAY you see fit. You don't have to keep all of the
links to me, I just thought they might be useful or interesting to users :^)
9. All milestones, issues, bugs and features are tracked using GitEmAll.
Thanks for your interest in IdleRPG! :^)

View File

@@ -1,6 +1,4 @@
<?php <?php
include("config.php");
// use sessions to generate only one map / person / 20s // use sessions to generate only one map / person / 20s
session_start(); session_start();
if (isset($_SESSION['time']) && time()-$_SESSION['time'] < 20) { if (isset($_SESSION['time']) && time()-$_SESSION['time'] < 20) {
@@ -9,6 +7,8 @@
} }
$_SESSION['time']=time(); $_SESSION['time']=time();
include("config.php");
$map = imageCreate(500,500); $map = imageCreate(500,500);
$user = substr($_GET['player'],0,30); $user = substr($_GET['player'],0,30);
$stringx=$stringy=-1; $stringx=$stringy=-1;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 79 KiB