sub entername内
print "お名前を入力してください(半角カナ禁止)。<br>\n";
&input('text','name',$c_name,'','<br>');
print "お誕生日を選択してください。<br>\n";
@birth_ml = (1,2,3,4,5,6,7,8,9,10,11,12);
print "<SELECT name=birth_m>";
foreach(0 .. $#birth_ml) {
if ($c_birth_m eq "$birth_ml[$_]") {
print "<OPTION value=\"$birth_ml[$_]\" selected>$birth_ml[$_]\n";
}
else {
print "<OPTION value=\"$birth_ml[$_]\">$birth_ml[$_]\n";
}
}
print "</SELECT>月";
@birth_dl = (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31);
print "<SELECT name=birth_d>";
foreach(0 .. $#birth_dl) {
if ($c_birth_d eq "$birth_dl[$_]") {
print "<OPTION value=\"$birth_dl[$_]\" selected>$birth_dl[$_]\n";
}
else {
print "<OPTION value=\"$birth_dl[$_]\">$birth_dl[$_]\n";
}
}
print "</SELECT>日<BR>";
print "データ保存用にパスワードを入力してください。<br>\n";
&input('password','pass',$c_pass,'','<br><br>');
sub checkname内
# 新規ユーザーを登録
if ($flag == 0) {
$gdate = time - $dayhour[$playtime + 1];
# $birth_m = 0;
# $birth_d = 0;
$birth_m = $FORM{'birth_m'};
$birth_d = $FORM{'birth_d'};
$dummy03 = 0;
$dummy04 = 0;
$dummy05 = 0;
$dummy06 = 0;
$dummy07 = 0;
$dummy08 = 0;
$dummy09 = 0;
$dummy10 = 0;
@new = @lines;
push(@new,"$FORM{'name'}<>$FORM{'pass'}<>$gdate<>0<>$birth_m<>$birth_d<>$dummy03<>$dummy04<>$dummy05<>$dummy06<>$dummy07<>$dummy08<>$dummy09<>$dummy10<>\n");
&openoutuserdata;
$love = 0; # Add Ver 2.2
}
# 既存ユーザーの場合入室チェック
else {
$enter = 1 if time - $gdate < $dayhour[$playtime] && $playtime != 0;
$enter = 1 if time - $gdate < $playminute * 60 && $playtime == 0;
$birth_m = $FORM{'birth_m'};
$birth_d = $FORM{'birth_d'};
}
sub condition内
print "<tr<\n";
print "<td<\n";
&tabletop;
&petnow($dead_img,"$petnameは死にました。<br<死後$deadover日経っています。");
print "<tr<";
print "<td align=\"right\"<\n";
&input('hidden','mode','nopet','','');
&input('hidden','name',$FORM{'name'},'','');
&input('hidden','pass',$FORM{'pass'},'','');
&input('hidden','birth_m',$FORM{'birth_m'},'','');
&input('hidden','birth_d',$FORM{'birth_d'},'','');
print "新しいペットを飼う\n";
&input('submit','','OK','','');
&tablebottom;
print "</td<\n";
print "</tr<\n";
return;
sub petform内
print "<tr>\n";
print "<td colspan=\"2\">\n";
print "<div align=\"right\">\n";
&input('hidden','name',$FORM{'name'},'','');
&input('hidden','pass',$FORM{'pass'},'','');
&input('hidden','birth_m',$FORM{'birth_m'},'','');
&input('hidden','birth_d',$FORM{'birth_d'},'','');
&input('hidden','good',"$scheduledsr[$timeafter]$plusfeed",'','');
&input('hidden','bad',"$schedulednt[$timeafter]$minusfeed",'','');
&input('submit','','OK!','','<br>');
print "</div>\n";
&tablebottom;
} else { $actionflag = 1; }
sub nopet内
print "<tr>\n";
print "<td align=\"right\">\n";
&input('hidden','mode','newpet','','');
&input('hidden','name',$FORM{'name'},'','');
&input('hidden','pass',$FORM{'pass'},'','');
&input('hidden','birth_m',$FORM{'birth_m'},'','');
&input('hidden','birth_d',$FORM{'birth_d'},'','');
print "OKを押すと新しくペットが住みつきます。\n";
&input('submit','','OK','','');
&tablebottom;
sub newpet内
$gdate = time - $dayhour[$playtime + 1];
# $birth_m = 0;
# $birth_d = 0;
$birth_m = $FORM{'birth_m'};
$birth_d = $FORM{'birth_d'};
$dummy03 = 0;
$dummy04 = 0;
$dummy05 = 0;
$dummy06 = 0;
$dummy07 = 0;
$dummy08 = 0;
$dummy09 = 0;
$dummy10 = 0;
@new = "$FORM{'name'}<>$FORM{'msg'}<>$FORM{'pass'}<>$gdate<>$loved<>$birth_m<>$birth_d<>$dummy03<>$dummy04<>$dummy05<>$dummy06<>$dummy07<>$dummy08<>$dummy09<>$dummy10<>\n";
&openoutuserdata;
&petform;
sub bodybottom内
print " <a href=\"$cgiurl?mode=owner&name=$FORM{'name'}&pass=$FORM{'pass'}&birth_m=$FORM{'birth_m'}&birth_d=$FORM{'birth_d'}\">[飼い主ランキング]</a>\n" if $actionflag == 1;
if ($FORM{'mode'} eq "owner") {
print " <a href=\"$cgiurl?mode=back&name=$FORM{'name'}&pass=$FORM{'pass'}&birth_m=$FORM{'birth_m'}&birth_d=$FORM{'birth_d'}\">[戻る]</a>\n";
}
# ------------------------- #
# Sub Set Cookie
# クッキーの保存
# ------------------------- #
sub set_cookie {
# クッキーは90日間有効
($secg,$ming,$hourg,$mdayg,$mong,$yearg,$wdayg,$ydayg,$isdstg) = gmtime(time + 90*24*60*60);
$yearg += 1900;
if ($secg < 10) { $secg = "0$secg" }
if ($ming < 10) { $ming = "0$ming" }
if ($hourg < 10) { $hourg = "0$hourg" }
if ($mdayg < 10) { $mdayg = "0$mdayg" }
$month = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')[$mong];
$youbi = ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday')[$wdayg];
$date_gmt = "$youbi, $mdayg\-$month\-$yearg $hourg:$ming:$secg GMT";
$cook = "name\:$FORM{'name'}\,pass\:$FORM{'pass'}\,birth_m\:$FORM{'birth_m'}\,birth_d\:$FORM{'birth_d'}";
print "Set-Cookie: PETROOM2=$cook; expires=$date_gmt\n";
}
# ------------------------- #
# Sub Get Cookie
# クッキーの読みこみ
# ------------------------- #
sub get_cookie {
@pairs = split(/\;/,$ENV{'HTTP_COOKIE'});
foreach $pair (@pairs) {
local($name, $value) = split(/\=/, $pair);
$name =~ s/ //g;
$DUMMY{$name} = $value;
}
@pairs = split(/\,/,$DUMMY{'PETROOM2'});
foreach $pair (@pairs) {
local($name, $value) = split(/\:/, $pair);
$COOKIE{$name} = $value;
}
$c_name = $COOKIE{'name'};
$c_pass = $COOKIE{'pass'};
$c_birth_m = $COOKIE{'birth_m'};
$c_birth_d = $COOKIE{'birth_d'};
}
|