Files
ore/ore_reg.cgi
T
2026-06-22 21:09:26 +09:00

254 lines
8.0 KiB
Perl
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/local/bin/perl
# サーバーの環境に合わせて変更して下さい。
require './ore_config.cgi'; # ore_config.cgiのパス
#-----------------------------------------------------------#
# 罪と罰++ 二律背反 #
# Copyright(C) 2001-2002 by Vivid Studio. BLANK BOARD #
# Vivid Studio.[ http://www17.big.or.jp/~obochan/vivid/ ] #
# BLANK BOARD [ http://pom.to/ ] #
#-----------------------------------------------------------#
$ver = '新規登録 v1.1'; # バージョン情報(変更不可)
#--- [注意事項] --------------------------------------------#
# 1.このスクリプトは以下の利用規程に従って配布しています。 #
# http://www24.big.or.jp/~obo/game/ore_/gild/ #
#-----------------------------------------------------------#
# 以下処理 基本的にこれ以下はいじらないように。
&error("現在メンテナンス中。しばらくお待ち下さい(約 $ertm 分間)<br>内訳:$erni") if $er;
&error("現在登録不可") if $kisei;
&get_time; # 日時取得
&safetime; # プレイ規制
&decode; # フォームデコード
&axs_check; # アクセスチェック
($mode eq 'regist2') ? &regist2 : &regist1 ;
exit;
#-------------------------------------------------------------------------------
# 以下サブルーチン
# キャラファイル追加処理
sub regist1{
print "Content-type: text/html\n\n";
if($mv_mode eq 'pc'){
print <<"EOM";
<html>
<head>
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=Shift_JIS">
<title>罪と罰++ 新規登録</title>
<style type="text/css">
<!--
.button1{
font-family: "MS Pゴシック", "Osaka"; font-size: 12px; font-weight: 400; color: #bbbbcc;
border: 2px #666699 ridge; cursor: hand; background-color: #222244;
width:100px;
}
body,td { font-size: 10px; color: #aaaab9; cursor: crosshair}
-->
</style>
</head>
<body $body>
<center>
<table border="0" cellspacing="0" cellpadding="0" align="center" width="100%" height="100%">
<tr>
<td align="center" valign="middle">
<table border="0" cellspacing="0" cellpadding="0" align="center" width="480" height="360">
<tr>
<form action="$ore_reg" method="$method" name="ore_reg">
<input type="hidden" name="mode" value="regist2">
<td align="center" valign="middle">
<tt style="font-size:10pt;color:#aaaaaa">
<b style="color:#ffeeee;font-size:11pt">$title<br><br>新 規 登 録</b><br><br>
ユーザーID : <input type="text" size="8" name="id" maxlength="12" style="width:100px" class="button1"><br>
プレイヤ名 : <input type="text" size="16" name="nm" style="width:100px" class="button1"><br>
パスワード : <input type="password" size="8" maxlength="8" name="pw" style="width:100px" class="button1"><br>
性別    :  男<input type="radio" name="sei" value="1">  女<input type="radio" name="sei" value="2"><br>
<br>
<input type="submit" value="登録" style="width:120px" class="button1">
<input type="reset" value="リセット" style="width:60px" class="button1">
<br><br>
</tt>
<table border="0" cellspacing="4" cellpadding="4" align="center" bgcolor="#222222">
<tr>
<td align="left" valign="middle">
<tt style="font-size:10pt;color:#aaaabb">
<li>ユーザーIDは <span style="color:#eebbdd">半角英数字412文字</span> です。
<li>プレイヤ名は <span style="color:#eebbdd">全角8(半角16)文字以内</span> です。
<li>パスワードは <span style="color:#eebbdd">半角英数字48文字</span> です。
<hr color=#444466 size=4 hoshade>
<li>重複登録は禁止です。発見次第削除します。
<li><span style="color:#eebbdd">$del_limit</span> 日間放置するとキャラが抹消されます。
<li>最大<span style="color:#eebbdd">$sanka</span>人まで登録\可\能\です。
</tt>
</td>
</tr>
</table>
</td>
</form>
</tr>
</table>
<form>
<input type="button" value="タイトルへ戻る" style="width:120px" class="button1" onClick="top.location.href='$index'">
</form>
</td>
</tr>
</table>
EOM
}
else{
print <<"EOM";
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=x-sjis">
<title>新規登録</title>
</head>
<body $body>
<center>
新規登録
<form action="$ore_reg" method="$method" name="ore_reg">
<input type="hidden" name="mode" value="regist2">
プレイヤー名:<input type="text" size="6" name="nm">(全角48文字)<br>
ID:<input type="text" size="6" name="id">(半角英数412文字)<br>
パスワード:<input type="text" size="6" maxlength="8" name="pw">(半角英数48文字)<br>
性別:男<input type="radio" name="sei" value="1"> 女<input type="radio" name="sei" value="2"><br>
<input type="submit" value="OK">
</form>
<a href="$index">INDEXへ</a>
</body>
</html>
EOM
}
&copyright;
exit;
}
# キャラファイル追加処理
sub regist2{
&form_check; # フォーム情報チェック
&usrdata_read;
&usrdata_open;
&cdata_open;
require './inc/ore_sub-members-p1.cgi';&member_list;
foreach (0 .. $#tdat){
%DAT = '';
my @pairs = split(/,/,$tdat[$_]);
foreach (0 .. $#pairs){
my($key,$v) = split(/;/,$pairs[$_]);
$DAT{$key} = $v;
}
if($in{'nm'} eq $DAT{'nm'}){&error("同じプレイヤー名が既に使われています");}
if($id eq $DAT{'id'}){&error("同じユーザーIDが既に使われています");}
# 期限切れ及び レベル2以内で3日間無アクセス(見物人排除) のファイル削除
if(($del_limit*3600*24<$time-$DAT{'la'}) || (3*3600*24<$time-$DAT{'la'} && $DAT{'lv'}<=2)){
unlink("$usrdata$DAT{'id'}\.cgi");
}
}
# 参加人数は最大でも400人ほど。リロード量がこわいので。
&error("現在定員の為、新規受付できません") if $#tdat+1>=$sanka;
local($hp,$max_hp,$mp,$max_mp,$ua,$ud,$lr,$ag);
$hp = $max_hp = int(rand(5)+10);
$mp = $max_mp = int(rand(5)+10);
$ua = int(rand(3)+1);
$ud = int(rand(3)+1);
$lr = int(rand(3)+1);
$ag = int(rand(3)+1);
$gold = int(rand(500)+500);
$nm = $in{'nm'};
$sei= $in{'sei'};
$camp=0;
&dat_write;
chmod($chmod,"$usrdata$id\.cgi");
print "Content-type: text/html\n\n";
print <<"EOM";
<html>
<head>
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=Shift_JIS">
<title>罪と罰++ 新規登録</title>
</head>
<body $body>
<center>
<table border=0>
<tr>
<td align=left>
<tt style="font-size:12pt">新規登録完了<br>
<br><br>
NAME $in{'nm'}<br>
I D&nbsp;&nbsp;$id<br>
PASS $pw<br>
<br>
HP  $hp<br>
MP  $mp<br>
UA  $ua<br>
UD  $ud<br>
LR  $lr<br>
<br>
<form action=$script method=$method>
<input type=hidden name=id value=$id>
<input type=hidden name=pw value=$pw>
<input type=submit value=ゲーム開始>
</form>
<br>
<a href="$index">タイトルに戻る</a>
</td>
</tr>
</table>
</center>
EOM
&copyright;
exit;
}
# フォームデータチェック
sub form_check{
if(!$in{'nm'}){ &error("名前が入力されていません。",1); }
if(!$pw){ &error("パスワードが入力されていません。",1); }
if(!$id){ &error("ユーザーIDが入力されていません。",1); }
if(!$in{'sei'}){ &error("性別が入力されていません。",1); }
if($in{'sei'}=~ m/[^12]/){ &error("性別が異常です。",1); }
if($in{'nm'} =~ /</){ &error("名前に不正な文字( &lt; )が含まれています。",1); }
if($in{'nm'} =~ />/){ &error("名前に不正な文字( &gt; )が含まれています。",1); }
if($in{'nm'} =~ /:/){ &error("名前に不正な文字( : )が含まれています。",1); }
if($in{'nm'} =~ /;/){ &error("名前に不正な文字( ; )が含まれています。",1); }
if($in{'nm'} =~ /,/){ &error("名前に不正な文字( , )が含まれています。",1); }
if($in{'nm'} =~ /"/){ &error("名前に不正な文字( \" )が含まれています。",1); }
if($in{'nm'} =~ /'/){ &error("名前に不正な文字( ' )が含まれています。",1); }
if($in{'nm'} =~ /\//){ &error("名前に不正な文字( / )が含まれています。",1); }
if($in{'nm'} =~ /\\/){ &error("名前に不正な文字( \ )が含まれています。",1); }
if($in{'nm'} =~ /\s/){ &error("名前に不正な文字( ` )が含まれています。",1); }
if($in{'nm'} =~ /`/){ &error("名前に不正な文字(全角スペース)が含まれています。",1); }
if($in{'nm'} =~ / /){ &error("名前に不正な文字(全角スペース)が含まれています。",1); }
if($id =~ m/[^0-9a-zA-Z]/){ &error("ユーザーIDは半角英数字で入力して下さい。",1); }
if($pw =~ m/[^0-9a-zA-Z]/){ &error("パスワードは半角英数字で入力して下さい。",1); }
if(length($pw)<4 || length($pw)>8){ &error("パスワードは半角英数字4~8文字です。",1); }
if(length($in{'nm'})>16){ &error("名前は半角英数字16文字以内です。",1); }
if(length($id)<4 || length($id)>12){ &error("ユーザーIDは半角英数字4~12文字以内です。",1); }
if($id eq $pw){ &error("ユーザーIDとパスワードが同一文字列です。",1);}
}