diff --git a/CHANGELOG.md b/CHANGELOG.md index 08098ce..d9ab8d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +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 * Update shebang to /bin/perl in irpg.pl diff --git a/IdleRPG.sln b/IdleRPG.sln index 7fa5f00..6a3f45a 100644 --- a/IdleRPG.sln +++ b/IdleRPG.sln @@ -33,7 +33,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "irpg-bot", "irpg-bot", "{37 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "irpg-web", "irpg-web", "{B2C6CD83-5E84-40A2-8D1A-A57517EC36D9}" 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\commonfunctions.php = irpg-web\commonfunctions.php irpg-web\config.php = irpg-web\config.php diff --git a/README.md b/README.md index 90f71b1..7d273b9 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,14 @@ ## About 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 ![IdleRPG Screenshot 1](screenshot1.png?raw=true "IdleRPG Screenshot 1") diff --git a/irpg-bot/.irpg.conf b/irpg-bot/.irpg.conf index 3f4af50..85091a3 100644 --- a/irpg-bot/.irpg.conf +++ b/irpg-bot/.irpg.conf @@ -75,7 +75,7 @@ botghostcmd PRIVMSG NickServ :ghost %botnick% %botpass% helpurl https://www.mynet.org/irpg/ # 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 # offering a map to users, leave this blank diff --git a/irpg-bot/irpg.pl b/irpg-bot/irpg.pl index 727c446..cdf82ab 100644 --- a/irpg-bot/irpg.pl +++ b/irpg-bot/irpg.pl @@ -33,7 +33,8 @@ my %opts; readconfig(); -my $version = "0.0.3"; +# bot version +my $version = "0.0.4"; # command line overrides .irpg.conf GetOptions(\%opts, diff --git a/irpg-release/irpg-release.csproj b/irpg-release/irpg-release.csproj index 1304f04..ad4179e 100644 --- a/irpg-release/irpg-release.csproj +++ b/irpg-release/irpg-release.csproj @@ -1,75 +1,76 @@ - - - Debug - AnyCPU - {3C3C4730-9D32-418C-BFDC-CE89148AA6CA} - - - AnyCPU - bin\Debug\ - - - AnyCPU - bin\Release\ - - - - - - - IdleRPG - 0.0.3 - IdleRPG-Bot - IdleRPG-Web - IdleRPG-Source - $(OutputPath)Bot\ - $(OutputPath)Web\ - $(OutputPath)Source\ - $(OutputPath)Releases\ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + Debug + AnyCPU + {3C3C4730-9D32-418C-BFDC-CE89148AA6CA} + + + AnyCPU + bin\Debug\ + + + AnyCPU + bin\Release\ + + + + + + + + IdleRPG + 0.0.4 + IdleRPG-Bot + IdleRPG-Web + IdleRPG-Source + $(OutputPath)Bot\ + $(OutputPath)Web\ + $(OutputPath)Source\ + $(OutputPath)Releases\ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/irpg-release/irpg-release.sh b/irpg-release/irpg-release.sh new file mode 100644 index 0000000..49d06f1 --- /dev/null +++ b/irpg-release/irpg-release.sh @@ -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. diff --git a/irpg-web/admincomms.php b/irpg-web/admincomms.php new file mode 100644 index 0000000..7d83cf5 --- /dev/null +++ b/irpg-web/admincomms.php @@ -0,0 +1,105 @@ + + +

Idle RPG

+ +

Admin Commands

+ +

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. + +
+
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: + +
+
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.
+
+ + diff --git a/irpg-web/admincomms.txt b/irpg-web/admincomms.txt deleted file mode 100644 index 1a53de1..0000000 --- a/irpg-web/admincomms.txt +++ /dev/null @@ -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 , change a character's pass in the IRPG. - -CHCLASS , change a character's class in the IRPG. - -CHUSER , 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 , 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 , remove a user's account. - -JUMP , move the bot to another server. - -SILENT , 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 , 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 , remove all non-logged-in accounts inactive in the last - 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 , set the isadmin flag for a given username. diff --git a/irpg-web/captchaimage.php b/irpg-web/captchaimage.php new file mode 100644 index 0000000..184cca3 --- /dev/null +++ b/irpg-web/captchaimage.php @@ -0,0 +1,50 @@ + diff --git a/irpg-web/config.php b/irpg-web/config.php index 2287f87..42f4cba 100644 --- a/irpg-web/config.php +++ b/irpg-web/config.php @@ -5,6 +5,9 @@ $admin_nick="admin"; // admin email $admin_email="admin@mynet.org"; +// web version +$irpg_version = "0.0.4"; + // your game's bot nickname $irpg_bot="IdleBot"; @@ -20,6 +23,12 @@ $irpg_irc_network_name="MyNet IRC Network"; // your server's network address advertisement $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 // my site is https://www.mynet.org/irpg/, so it's "/irpg/" $irpg_base_dir="/irpg/"; diff --git a/irpg-web/contact.php b/irpg-web/contact.php index 4efd232..994cfcd 100644 --- a/irpg-web/contact.php +++ b/irpg-web/contact.php @@ -1,8 +1,17 @@ Contact"; if (!$irpg_site_email) { @@ -11,35 +20,57 @@ else if ($irpg_site_email == "disabled") { echo "
Email is disabled.
\n"; } - else if ($irpg_site_email == "php" && $_POST['from'] && $_POST['text']) { - $to = $admin_email; - $subject = "IdleRPG: ".$_POST['from']; - $message = "Name: ".$_POST['name']."\nE-mail: ".$_POST['from']."\n\n".$_POST['text']; - $additional_headers = "From: ".$_POST['from']."\r\n"; - mail($to, $subject, $message, $additional_headers); - echo "
Thanks for your submission.
\n"; + else if ($irpg_site_email == "php" && $_POST['from_email'] && $_POST['message'] && $_POST['captchaString']) { + if (strtolower($_POST['captchaString']) != strtolower($_SESSION['captchaString'])) { echo "
Your CAPTCHA didn't match.
\n"; } + else if (!filter_var($_POST['from_email'], FILTER_VALIDATE_EMAIL)) { echo "
Your email address isn't valid.
\n"; } + else { + $to = $admin_email; + $subject = "IdleRPG: Contact Form"; + $message = "Name: ".$_POST['from_name']."\nEmail: ".$_POST['from_email']."\n\n".$_POST['message']; + $additional_headers = "From: ".$_POST['from_name']." <".$_POST['from_email'].">\r\n"; + mail($to, $subject, $message, $additional_headers); + echo "
Thanks for your submission.
\n"; + $_SESSION['captchaString'] = ""; + } } - else if ($irpg_site_email == "smtp" && $_POST['from'] && $_POST['text']) { - echo "
SMTP Email is under construction. Your submission was not submitted.
\n"; + else if ($irpg_site_email == "smtp" && $_POST['from_email'] && $_POST['message'] && $_POST['captchaString']) { + echo "
SMTP Email is under construction.
\n"; } else { echo "
\n". " \n". " \n". - " \n". + " \n". " \n". " \n". " \n". - " \n". + " \n". " \n". " \n". " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". + " \n". " \n". " \n". " \n". diff --git a/irpg-web/footer.php b/irpg-web/footer.php index 9c4d0d4..9bb9221 100644 --- a/irpg-web/footer.php +++ b/irpg-web/footer.php @@ -4,9 +4,9 @@ Questions? Comments? Suggestions? Bugs? Naked pics? $admin_email or\n"; + echo " Contact ".$admin_nick." or\n"; } - echo " ".$admin_nick."@IRC.\n"; + echo " ".$admin_nick."@IRC\n"; ?> +

diff --git a/irpg-web/header.php b/irpg-web/header.php index 13b2982..3e779a6 100644 --- a/irpg-web/header.php +++ b/irpg-web/header.php @@ -19,8 +19,8 @@ $topbarurl = array( 'Game Info' => $irpg_base_dir . 'index.php', 'Player Info' => $irpg_base_dir . 'players.php', - 'World Map' => $irpg_base_dir . 'worldmap.php', 'Quest Info' => $irpg_base_dir . 'quest.php', + 'World Map' => $irpg_base_dir . 'worldmap.php', ); if ($irpg_site_email && $irpg_site_email != "disabled") { diff --git a/irpg-web/index.php b/irpg-web/index.php index c44dfce..41abb3e 100644 --- a/irpg-web/index.php +++ b/irpg-web/index.php @@ -20,6 +20,11 @@ in the channel .

+$irpg_irc_network_info

\n"; + } +?>

Registering

To register, simply:

diff --git a/irpg-web/makemap.php b/irpg-web/makemap.php index d2b180d..8b19f3d 100644 --- a/irpg-web/makemap.php +++ b/irpg-web/makemap.php @@ -1,6 +1,4 @@
:\n". - " \n". + " \n". "
:\n". - " \n". + " \n". "
\n". + " CAPTCHA\n". + "
\n". + " \n". + "
\n". + " \n". + "
\n". - "
\n". + " \n". "