Files
ore/ore_reg.cgi
T

254 lines
9.0 KiB
Perl
Executable File
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.
#!/usr/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=UTF-8">
<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">반각 영문/숫자 4~12글자</span>입니다.
<li>플레이어명은 <span style="color:#eebbdd">전각 8자(반각 16자) 이내</span>입니다.
<li>비밀번호는 <span style="color:#eebbdd">반각 영문/숫자 4~8글자</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=UTF-8">
<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">(전각 4~8자)<br>
ID:<input type="text" size="6" name="id">(반각 영문/숫자 4~12자)<br>
비밀번호:<input type="text" size="6" maxlength="8" name="pw">(반각 영문/숫자 4~8자)<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">메인으로</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=UTF-8">
<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);}
}