Files
ore/ore_reg.cgi
T

248 lines
11 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; charset=UTF-8\n\n";
if($mv_mode eq 'pc'){
print <<"EOM";
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>죄와 벌++ 신규 등록</title>
<link rel="stylesheet" type="text/css" href="$css">
</head>
<body class="modern-ui">
<div class="game-container" style="max-width: 600px; margin-top: 50px;">
<div class="card">
<div class="card-title">신규 등록</div>
<form action="$ore_reg" method="$method" name="ore_reg" style="display: flex; flex-direction: column; gap: 15px;">
<input type="hidden" name="mode" value="regist2">
<div>
<label style="display:block; margin-bottom:5px; color:var(--text-secondary); font-size:12px;">유저 ID (반각 영문/숫자 4~12자)</label>
<input type="text" name="id" maxlength="12" class="button1" style="width:100%; text-align:left; padding-left:12px; margin-bottom:0;">
</div>
<div>
<label style="display:block; margin-bottom:5px; color:var(--text-secondary); font-size:12px;">플레이어명 (한글 8자, 영문/숫자 16자 이내)</label>
<input type="text" name="nm" class="button1" style="width:100%; text-align:left; padding-left:12px; margin-bottom:0;">
</div>
<div>
<label style="display:block; margin-bottom:5px; color:var(--text-secondary); font-size:12px;">비밀번호 (반각 영문/숫자 4~8자)</label>
<input type="password" name="pw" maxlength="8" class="button1" style="width:100%; text-align:left; padding-left:12px; margin-bottom:0;">
</div>
<div style="display: flex; gap: 20px; align-items: center; padding: 5px 0;">
<span style="color:var(--text-secondary); font-size:12px;">성별:</span>
<label style="cursor:pointer; display: flex; align-items: center; gap: 5px;">
<input type="radio" name="sei" value="1"> 남성
</label>
<label style="cursor:pointer; display: flex; align-items: center; gap: 5px;">
<input type="radio" name="sei" value="2"> 여성
</label>
</div>
<div style="display: flex; gap: 10px; margin-top: 10px;">
<input type="submit" value="등록하기" style="flex: 2; margin-bottom:0; display:block; box-sizing:border-box;">
<input type="reset" value="초기화" style="flex: 1; margin-bottom:0; background-color: rgba(255,255,255,0.05); color: #fff; display:block; box-sizing:border-box;">
</div>
</form>
</div>
<!-- 규정 설명 카드 -->
<div class="card">
<div class="card-title">이용 규정 및 안내</div>
<ul style="margin: 0; padding-left: 20px; color: var(--text-secondary); font-size: 13px; line-height: 1.8;">
<li>중복 등록은 금지되어 있습니다. 발견 시 즉시 계정이 삭제됩니다.</li>
<li>가입 후 <span style="color:#7b66ff; font-weight:bold;">$del_limit일</span> 동안 로그인이나 행동이 없을 시 캐릭터가 삭제됩니다.</li>
<li>본 게임의 최대 동시 등록 제한은 <span style="color:#7b66ff; font-weight:bold;">$sanka명</span>입니다.</li>
</ul>
</div>
<div style="text-align: center; margin-top: 20px; margin-bottom: 40px;">
<input type="button" value="타이틀로 돌아가기" class="button1" style="width: 200px; display:inline-block; box-sizing:border-box;" onClick="top.location.href='$index'">
</div>
</div>
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">(한글 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; charset=UTF-8\n\n";
print <<"EOM";
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>죄와 벌++ 신규 등록 완료</title>
<link rel="stylesheet" type="text/css" href="$css">
</head>
<body class="modern-ui">
<div class="game-container" style="max-width: 500px; margin-top: 50px;">
<div class="card">
<div class="card-title">신규 등록 완료</div>
<div style="font-size:14px; line-height: 1.8; margin-bottom: 20px; color: var(--text-primary);">
<div style="font-size: 16px; font-weight: bold; color: #7b66ff; margin-bottom: 15px;">캐릭터 생성 성공!</div>
• <b>이름:</b> $in{'nm'}<br>
• <b>아이디:</b> $id<br>
• <b>비밀번호:</b> $pw<br>
<hr style="margin: 15px 0;">
<div style="font-weight: bold; margin-bottom: 5px; color: var(--text-secondary);">초기 스탯:</div>
• <b>체력 [HP]:</b> $hp<br>
• <b>마력 [MP]:</b> $mp<br>
• <b>공격 [UA]:</b> $ua<br>
• <b>방어 [UD]:</b> $ud<br>
• <b>지휘 [LR]:</b> $lr
</div>
<form action="$script" method="$method" style="margin-top: 20px;">
<input type="hidden" name="id" value="$id">
<input type="hidden" name="pw" value="$pw">
<input type="submit" value="게임 시작하기" class="button1" style="width: 100%;">
</form>
<div style="text-align: center; margin-top: 15px;">
<a href="$index" style="color: var(--text-secondary); text-decoration: none; font-size: 13px;">타이틀로 돌아가기</a>
</div>
</div>
</div>
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'})>24){ &error("이름은 한글 8자(영문/숫자 16자) 이내여야 합니다.",1); }
if(length($id)<4 || length($id)>12){ &error("유저 ID는 반각 영문/숫자 4~12자 이내여야 합니다.",1); }
if($id eq $pw){ &error("유저 ID와 비밀번호가 동일합니다.",1);}
}