www.pudn.com > BATTLEROYALE.zip > admin.cgi
#! /usr/bin/perl #require "jcode.pl"; require "br.cgi"; require "$LIB_DIR/lib1.cgi"; &LOCK; require "pref.cgi"; open(DB,"$admin_file");seek(DB,0,0); @admin=;close(DB); &ADMDECODE ; # GET 拒绝方法 $a_pass = crypt($a_pass,"2Y"); if(($Command eq "LOCKOFF")&&($id eq "@admin")) {&LOCKOFF;&UNLOCK;exit;} #锁取下 if(!$p_flag){&ERROR("不正当的访问。");} if ($admpas ne ""){$admpass = crypt($admpas,"2Y");} if ($admpass eq $a_pass){ if ($Command eq "MAIN") {&MENU;} #菜单 elsif($Command eq "BSAVE") {&BACKSAVE;} #接应保存 elsif($Command eq "BREAD") {&BACKREAD;} #接应读入 elsif($Command eq "RESET") {&RESET;} #复位 elsif($Command eq "ITEMLIST") {&ITEMLIST;} #道具名单 elsif($Command eq "RESETACC") {&DATARESET;} #数据复位 elsif($Command eq "USERLIST") {&USERLIST;} #用户名单一览 elsif($Command eq "USERDEL") {&USERDEL;} #用户删掉 elsif($Command eq "USERCHG") {&USERCHG;} #用户变更 elsif($Command eq "USERCHG3") {&USERCHG3;} #用户变更 elsif($Command eq "ENTER") {&ENTER;} #Admin Entrance elsif($Command eq "LOGON") {&MAIN;} #main elsif($Command eq "ITEMCHG") {&ITEMCHG;} #道具变更 elsif($Command eq "LOCKOFF") {&LOCKOFF;} #锁取下 else { &MENU; } }else{&MAIN;&UNLOCK;exit;} &UNLOCK; exit; #==================# # ■ Item Changer # #==================# sub LOCKOFF { local($xx, $name, $value); for $xx (split(/; */, $ENV{'HTTP_COOKIE'})) { if ($xx =~ /BR/){ $cooks = $xx; $cooks =~ s/BR=//; $cooks =~ s/([0-9A-Fa-f][0-9A-Fa-f])/pack("C", hex($1))/eg; ($w_id,$w_password,$w_f_name,$w_l_name,$w_sex,$w_cl,$w_no,$w_endtime,$w_att,$w_def,$w_hit,$w_mhit,$w_level,$w_exp,$w_sta,$w_wep,$w_watt,$w_wtai,$w_bou,$w_bdef,$w_btai,$w_bou_h,$w_bdef_h,$w_btai_h,$w_bou_f,$w_bdef_f,$w_btai_f,$w_bou_a,$w_bdef_a,$w_btai_a,$w_tactics,$w_death,$w_msg,$w_sts,$w_pls,$w_kill,$w_icon,$w_item[0],$w_eff[0],$w_itai[0],$w_item[1],$w_eff[1],$w_itai[1],$w_item[2],$w_eff[2],$w_itai[2],$w_item[3],$w_eff[3],$w_itai[3],$w_item[4],$w_eff[4],$w_itai[4],$w_item[5],$w_eff[5],$w_itai[5],$w_log,$w_dmes,$w_bid,$w_club,$w_wn,$w_wp,$w_wa,$w_wg,$w_we,$w_wc,$w_wd,$w_wb,$w_wf,$w_ws,$w_com,$w_inf,$w_ousen,$w_seikaku,$w_sinri,$w_item_get,$w_eff_get,$w_itai_get,$w_teamID,$w_teamPass,$w_IP,) = split(/,/, $cooks); } } $cook = ""; $cook =~ s/(.)/sprintf("%02X", unpack("C", $1))/eg; print "Set-Cookie: BR=$cook; expires=$expires\n"; $new = rand($now); open(DB,"$admin_file");seek(DB,0,0); @admin= ;close(DB); $admin[0] = "$new"; open(DB,">$admin_file"); seek(DB,0,0); print DB @admin; close(DB); &HEADER ; print <<"_HERE_"; Administrative Mode LOCK 取下了。
>>HOME >>ADMIN _HERE_ &FOOTER; } #==================# # ■ Item Changer # #==================# sub ITEMCHG { open(DB,"$user_file");seek(DB,0,0); @userlist=;close(DB); for ($i=0; $i<$#userlist+1; $i++) { ($w_id,$w_password,$w_f_name,$w_l_name,$w_sex,$w_cl,$w_no,$w_endtime,$w_att,$w_def,$w_hit,$w_mhit,$w_level,$w_exp,$w_sta,$w_wep,$w_watt,$w_wtai,$w_bou,$w_bdef,$w_btai,$w_bou_h,$w_bdef_h,$w_btai_h,$w_bou_f,$w_bdef_f,$w_btai_f,$w_bou_a,$w_bdef_a,$w_btai_a,$w_tactics,$w_death,$w_msg,$w_sts,$w_pls,$w_kill,$w_icon,$w_item[0],$w_eff[0],$w_itai[0],$w_item[1],$w_eff[1],$w_itai[1],$w_item[2],$w_eff[2],$w_itai[2],$w_item[3],$w_eff[3],$w_itai[3],$w_item[4],$w_eff[4],$w_itai[4],$w_item[5],$w_eff[5],$w_itai[5],$w_log,$w_dmes,$w_bid,$w_club,$w_wn,$w_wp,$w_wa,$w_wg,$w_we,$w_wc,$w_wd,$w_wb,$w_wf,$w_ws,$w_com,$w_inf,$w_ousen,$w_seikaku,$w_sinri,$w_item_get,$w_eff_get,$w_itai_get,$w_teamID,$w_teamPass,$w_IP,) = split(/,/, $userlist[$i]); if($w_sts ne "NPC"){$w_pls = 3;} $userlist[$i] = "$w_id,$w_password,$w_f_name,$w_l_name,$w_sex,$w_cl,$w_no,$w_endtime,$w_att,$w_def,$w_hit,$w_mhit,$w_level,$w_exp,$w_sta,$w_wep,$w_watt,$w_wtai,$w_bou,$w_bdef,$w_btai,$w_bou_h,$w_bdef_h,$w_btai_h,$w_bou_f,$w_bdef_f,$w_btai_f,$w_bou_a,$w_bdef_a,$w_btai_a,$w_tactics,$w_death,$w_msg,$w_sts,$w_pls,$w_kill,$w_icon,$w_item[0],$w_eff[0],$w_itai[0],$w_item[1],$w_eff[1],$w_itai[1],$w_item[2],$w_eff[2],$w_itai[2],$w_item[3],$w_eff[3],$w_itai[3],$w_item[4],$w_eff[4],$w_itai[4],$w_item[5],$w_eff[5],$w_itai[5],$w_log,$w_dmes,$w_bid,$w_club,$w_wn,$w_wp,$w_wa,$w_wg,$w_we,$w_wc,$w_wd,$w_wb,$w_wf,$w_ws,$w_com,$w_inf,$w_ousen,$w_seikaku,$w_sinri,$w_item_get,$w_eff_get,$w_itai_get,$w_teamID,$w_teamPass,$w_IP,\n" ; } open(DB,">$user_file"); seek(DB,0,0); print DB @userlist; close(DB); &HEADER ; print <<"_HERE_"; Administrative Mode OK
>>HOME >>ADMIN _HERE_ &FOOTER; } #==================# # ■ ITEM一览 # #==================# sub ITEMLIST { &HEADER ; print <<"_HERE_";Administrative Mode _HERE_ #Del Area Item for ($j=0; $j<$#area+1; $j++) { $filename = "$LOG_DIR/$j$item_file"; open(DB,"$filename");@itemlist=
;close(DB); print " $place[$j] "; for ($i=0;$i<$#itemlist+1;$i+=3) { ($w_i,$w_e,$w_t) = split(/,/, $itemlist[$i]); ($i_name,$i_kind) = split(/<>/, $w_i); if ($i_kind =~ /HH|HD/) {$itemtype = "【体力恢复】";} elsif ($i_kind =~ /SH|SD/) {$itemtype = "【能量恢复】";} elsif ($i_kind eq TN) {$itemtype = "【陷阱】";} elsif ($i_kind =~ /W/) {$itemtype = "【武器"; if ($i_kind =~ /G/) {$itemtype = ($itemtype . "(鎗)");} if ($i_kind =~ /N|S/) {$itemtype = ($itemtype . "(ERROR)");} if ($i_kind =~ /K/) {$itemtype = ($itemtype . "(剑)");} if ($i_kind =~ /C/) {$itemtype = ($itemtype . "(投)");} if ($i_kind =~ /B/) {$itemtype = ($itemtype . "(殴)");} if ($i_kind =~ /D/) {$itemtype = ($itemtype . "(爆)");} $itemtype = ($itemtype . "】");} elsif ($i_kind =~ /D/) {$itemtype = "【防具"; if ($i_kind =~ /B/) {$itemtype = ($itemtype . "(体)");} if ($i_kind =~ /H/) {$itemtype = ($itemtype . "(头)");} if ($i_kind =~ /F/) {$itemtype = ($itemtype . "(足)");} if ($i_kind =~ /A/) {$itemtype = ($itemtype . "(腕)");} $itemtype = ($itemtype . "】");} elsif (($i_kind eq R1)||($i_kind eq R2)) {$itemtype = "【雷达】";} elsif ($i_kind eq Y) { if (($i_name eq "假游戏解除钥匙")||($i_name eq "游戏解除钥匙")) {$itemtype = "【解除钥匙】";} elsif ($i_name eq "【子弹】") {$itemtype = "【弹】";} else {$itemtype = "【道具】";}} elsif ($i_kind eq A) {$itemtype = "【装饰品】";} elsif ($item[$i] eq "无") {$itemtype = "【无】";} else {$itemtype = "【不明】";} print " 道具名<>种类 种类 效果 数量 道具名<>种类 种类 效果 数量 道具名<>种类 种类 效果 数量 "; } } print <<"_HERE_"; $w_i $itemtype $w_e $w_t "; ($w_i,$w_e,$w_t) = split(/,/, $itemlist[$i+1]); ($i_name,$i_kind) = split(/<>/, $w_i); if ($i_kind =~ /HH|HD/) {$itemtype = "【体力恢复】";} elsif ($i_kind =~ /SH|SD/) {$itemtype = "【能量恢复】";} elsif ($i_kind eq TN) {$itemtype = "【陷阱】";} elsif ($i_kind =~ /W/) {$itemtype = "【武器"; if ($i_kind =~ /G/) {$itemtype = ($itemtype . "(鎗)");} if ($i_kind =~ /N|S/) {$itemtype = ($itemtype . "(ERROR)");} if ($i_kind =~ /K/) {$itemtype = ($itemtype . "(剑)");} if ($i_kind =~ /C/) {$itemtype = ($itemtype . "(投)");} if ($i_kind =~ /B/) {$itemtype = ($itemtype . "(殴)");} if ($i_kind =~ /D/) {$itemtype = ($itemtype . "(爆)");} $itemtype = ($itemtype . "】");} elsif ($i_kind =~ /D/) {$itemtype = "【防具"; if ($i_kind =~ /B/) {$itemtype = ($itemtype . "(体)");} if ($i_kind =~ /H/) {$itemtype = ($itemtype . "(头)");} if ($i_kind =~ /F/) {$itemtype = ($itemtype . "(足)");} if ($i_kind =~ /A/) {$itemtype = ($itemtype . "(腕)");} $itemtype = ($itemtype . "】");} elsif (($i_kind eq R1)||($i_kind eq R2)) {$itemtype = "【雷达】";} elsif ($i_kind eq Y) { if (($i_name eq "假游戏解除钥匙")||($i_name eq "游戏解除钥匙")) {$itemtype = "【解除钥匙】";} elsif ($i_name eq "【子弹】") {$itemtype = "【弹】";} else {$itemtype = "【道具】";}} elsif ($i_kind eq A) {$itemtype = "【装饰品】";} elsif ($item[$i] eq "无") {$itemtype = "【无】";} else {$itemtype = "【不明】";} print "$w_i $itemtype $w_e $w_t "; ($w_i,$w_e,$w_t) = split(/,/, $itemlist[$i+2]); ($i_name,$i_kind) = split(/<>/, $w_i); if ($i_kind =~ /HH|HD/) {$itemtype = "【体力恢复】";} elsif ($i_kind =~ /SH|SD/) {$itemtype = "【能量恢复】";} elsif ($i_kind eq TN) {$itemtype = "【陷阱】";} elsif ($i_kind =~ /W/) {$itemtype = "【武器"; if ($i_kind =~ /G/) {$itemtype = ($itemtype . "(鎗)");} if ($i_kind =~ /N|S/) {$itemtype = ($itemtype . "(ERROR)");} if ($i_kind =~ /K/) {$itemtype = ($itemtype . "(剑)");} if ($i_kind =~ /C/) {$itemtype = ($itemtype . "(投)");} if ($i_kind =~ /B/) {$itemtype = ($itemtype . "(殴)");} if ($i_kind =~ /D/) {$itemtype = ($itemtype . "(爆)");} $itemtype = ($itemtype . "】");} elsif ($i_kind =~ /D/) {$itemtype = "【防具"; if ($i_kind =~ /B/) {$itemtype = ($itemtype . "(体)");} if ($i_kind =~ /H/) {$itemtype = ($itemtype . "(头)");} if ($i_kind =~ /F/) {$itemtype = ($itemtype . "(足)");} if ($i_kind =~ /A/) {$itemtype = ($itemtype . "(腕)");} $itemtype = ($itemtype . "】");} elsif (($i_kind eq R1)||($i_kind eq R2)) {$itemtype = "【雷达】";} elsif ($i_kind eq Y) { if (($i_name eq "假游戏解除钥匙")||($i_name eq "游戏解除钥匙")) {$itemtype = "【解除钥匙】";} elsif ($i_name eq "【子弹】") {$itemtype = "【弹】";} else {$itemtype = "【道具】";}} elsif ($i_kind eq A) {$itemtype = "【装饰品】";} elsif ($item[$i] eq "无") {$itemtype = "【无】";} else {$itemtype = "【不明】";} print "$w_i $itemtype $w_e $w_t
_HERE_ &FOOTER; } #==================# # ■ 初期化Main画面# #==================# sub RESET { &HEADER ; print <<"_HERE_";Administrative Mode _HERE_ &FOOTER; } #==================# # ■ 主要机能 # #==================# sub MAIN { &HEADER ; print <<"_HERE_";Administrative Mode _HERE_ &FOOTER; } #==================# # ■ 主要机能 # #==================# sub MENU { &HEADER ; print <<"_HERE_";Administrative Mode _HERE_ &FOOTER; } #==================# # ■ 保存 # #==================# sub BACKSAVE { open(DB,"$user_file");seek(DB,0,0); @userlist=;close(DB); open(DB,">$back_file"); seek(DB,0,0); print DB @userlist; close(DB); &HEADER ; print <<"_HERE_"; Administrative Mode 保存完成。
>>HOME >>ADMIN _HERE_ &FOOTER; } #==================# # ■ 读入 # #==================# sub BACKREAD { open(DB,"$back_file");seek(DB,0,0); @userlist=;close(DB); open(DB,">$user_file"); seek(DB,0,0); print DB @userlist; close(DB); &HEADER ; print <<"_HERE_"; Administrative Mode 读入完成。
>>HOME >>ADMIN _HERE_ &FOOTER; } #==================# # ■ 数据初始化 # #==================# sub DATARESET { if ($RESET9 ne "1"){&ERROR("同意");}# 啦 if ($RESET0){#NPC 初始化 open(DB,"$npc_file");seek(DB,0,0); @baselist=;close(DB); $LEN = @baselist; $basyo = 1; if ($LEN > 0) { for ($i=0; $i<$LEN; $i++) { ($w_f_name,$w_l_name,$w_sex,$w_cl,$w_no,) = split(/,/, $baselist[$i]); if ($w_cl eq "$BOSS"){ #政府方面NPC $w_wep = "水素粒子水铁炮<>WG";$w_watt = "100";$w_wtai = "200"; $w_bou = "特种部队服装<>DB";$w_bdef = "50";$w_btai = "100"; $w_bou_h = "源氏的盔<>DH";$w_bdef_h = "50";$w_btai_h = "100"; $w_bou_f = "Nike的Air Force1<>DF";$w_bdef_f = "50";$w_btai_f = "100"; $w_bou_a = "米奇的手袋<>DA";$w_bdef_a = "50";$w_btai_a = "100"; if ($w_l_name eq "金发") {$w_icon = "42";}elsif ($w_l_name eq "田原") {$w_icon = "43";}elsif ($w_l_name eq "近藤") {$w_icon = "44";}elsif ($w_l_name eq "野村") {$w_icon = "45";}elsif ($w_l_name eq "加藤") {$w_icon = "46";} $w_item[0] = "游戏解除钥匙<>Y";$w_eff[0] = "1";$w_itai[0] = "1"; $w_item[1] = "无";$w_eff[1] = "0";$w_itai[1] = "0"; $w_item[2] = "无";$w_eff[2] = "0";$w_itai[2] = "0"; $w_item[3] = "无";$w_eff[3] = "0";$w_itai[3] = "0"; $w_item[4] = "无";$w_eff[4] = "0";$w_itai[4] = "0"; $w_item[5] = "教师证明书<>A";$w_eff[5] = "1";$w_itai[5] = "1"; $w_dmes = "记着这个嘛,『人生是游戏。』";$w_com = "如果惹怒老师就不行啰~";$w_msg = "呀?看见了啊~"; $w_att = 200;$w_def = 400;$w_hit = 1000; $w_level = 40; $w_exp = int($w_level*$baseexp+(($w_level-1)*$baseexp)) - 17; $w_tactics = "无"; $w_death = "" ; $w_pls = 0; $w_wn=$w_wp=$w_wa=$w_wg=$w_we=$w_wc=$w_wd=$w_wb=$w_wf=$w_ws= 100; $w_mhit=$w_hit; $w_sta = $maxsta; $w_sts = "NPC"; } elsif ($w_cl eq "$KANN"){ #政府方面NPC $w_wep = "狙击鎗㊣<>WG";$w_watt = "75";$w_wtai = "200"; $w_bou = "军服㊣<>DB";$w_bdef = "40";$w_btai = "100"; $w_bou_h = "军帽㊣<>DH";$w_bdef_h = "40";$w_btai_h = "100"; $w_bou_f = "军靴㊣<>DF";$w_bdef_f = "40";$w_btai_f = "100"; $w_bou_a = "军服㊣<>DA";$w_bdef_a = "40";$w_btai_a = "100"; if ($w_l_name eq "金发") {$w_icon = "42";}elsif ($w_l_name eq "田原") {$w_icon = "43";}elsif ($w_l_name eq "近藤") {$w_icon = "44";}elsif ($w_l_name eq "野村") {$w_icon = "45";}elsif ($w_l_name eq "加藤") {$w_icon = "46";} $w_item[0] = "无";$w_eff[0] = "0";$w_itai[0] = "0"; $w_item[1] = "无";$w_eff[1] = "0";$w_itai[1] = "0"; $w_item[2] = "无";$w_eff[2] = "0";$w_itai[2] = "0"; $w_item[3] = "无";$w_eff[3] = "0";$w_itai[3] = "0"; $w_item[4] = "无";$w_eff[4] = "0";$w_itai[4] = "0"; $w_item[5] = "教师证明书<>A";$w_eff[5] = "1";$w_itai[5] = "1"; $w_dmes = "";$w_com = "";$w_msg = ""; $w_att = 175;$w_def = 300;$w_hit = 750; $w_level = 30; $w_exp = int($w_level*$baseexp+(($w_level-1)*$baseexp)) - 17; $w_tactics = "无"; $w_death = "" ; $w_pls = 0; $w_wn=$w_wp=$w_wa=$w_wg=$w_we=$w_wc=$w_wd=$w_wb=$w_wf=$w_ws= 100; $w_mhit=$w_hit; $w_sta = $maxsta; $w_sts = "NPC"; } elsif ($w_cl eq "$ZAKO"){ #政府方面NPC $w_wep = "狙击鎗β<>WG";$w_watt = "50";$w_wtai = "200"; $w_bou = "军服β<>DB";$w_bdef = "30";$w_btai = "100"; $w_bou_h = "军帽β<>DH";$w_bdef_h = "30";$w_btai_h = "100"; $w_bou_f = "军靴β<>DF";$w_bdef_f = "30";$w_btai_f = "100"; $w_bou_a = "军服β<>DA";$w_bdef_a = "30";$w_btai_a = "100"; if ($w_l_name eq "金发") {$w_icon = "42";}elsif ($w_l_name eq "田原") {$w_icon = "43";}elsif ($w_l_name eq "近藤") {$w_icon = "44";}elsif ($w_l_name eq "野村") {$w_icon = "45";}elsif ($w_l_name eq "加藤") {$w_icon = "46";} $w_item[0] = "无";$w_eff[0] = "0";$w_itai[0] = "0"; $w_item[1] = "无";$w_eff[1] = "0";$w_itai[1] = "0"; $w_item[2] = "无";$w_eff[2] = "0";$w_itai[2] = "0"; $w_item[3] = "无";$w_eff[3] = "0";$w_itai[3] = "0"; $w_item[4] = "无";$w_eff[4] = "0";$w_itai[4] = "0"; $w_item[5] = "兵士证明书<>A";$w_eff[5] = "1";$w_itai[5] = "1"; $w_dmes = "";$w_com = "";$w_msg = ""; $w_att = 0;$w_def = 200;$w_hit = 500; $w_level = 20; $w_exp = int($w_level*$baseexp+(($w_level-1)*$baseexp)) - 17; $w_tactics = "无"; $w_death = "" ; $w_pls = $basyo;$basyo++;if ($basyo >= 22){$basyo = 1;}; $w_wn=$w_wp=$w_wa=$w_wg=$w_we=$w_wc=$w_wd=$w_wb=$w_wf=$w_ws= 100; $w_mhit=$w_hit; $w_sta = $maxsta; $w_sts = "NPC"; } else{;}#其他的NPC $w_kill = 0 ; $w_id = ($a_id . "$i"); $w_password = $a_pass; $w_tactics = ""; $w_club=""; $w_log = "" ; $w_bid = "" ; $w_inf=""; $w_seikaku = "无"; #性格未完成 $w_sinri = "无"; #心理未完成 $w_teamID = $a_group_id; #队伍ID未完成 $w_teamPass = $a_group_pass; #队伍密码 $w_tactics = "通常"; $w_ousen = "通常"; $w_club = "NPC"; $w_password = $a_pass_npc; $w_item_get = "无"; $w_eff_get = "0"; $w_itai_get = "0"; $userlist[$i] = "$w_id,$w_password,$w_f_name,$w_l_name,$w_sex,$w_cl,$w_no,$w_endtime,$w_att,$w_def,$w_hit,$w_mhit,$w_level,$w_exp,$w_sta,$w_wep,$w_watt,$w_wtai,$w_bou,$w_bdef,$w_btai,$w_bou_h,$w_bdef_h,$w_btai_h,$w_bou_f,$w_bdef_f,$w_btai_f,$w_bou_a,$w_bdef_a,$w_btai_a,$w_tactics,$w_death,$w_msg,$w_sts,$w_pls,$w_kill,$w_icon,$w_item[0],$w_eff[0],$w_itai[0],$w_item[1],$w_eff[1],$w_itai[1],$w_item[2],$w_eff[2],$w_itai[2],$w_item[3],$w_eff[3],$w_itai[3],$w_item[4],$w_eff[4],$w_itai[4],$w_item[5],$w_eff[5],$w_itai[5],$w_log,$w_dmes,$w_bid,$w_club,$w_wn,$w_wp,$w_wa,$w_wg,$w_we,$w_wc,$w_wd,$w_wb,$w_wf,$w_ws,$w_com,$w_inf,$w_ousen,$w_seikaku,$w_sinri,$w_item_get,$w_eff_get,$w_itai_get,$w_teamID,$w_teamPass,$w_IP,\n" ; } } open(DB,">$user_file"); seek(DB,0,0); print DB @userlist; close(DB); }if ($RESET1){#时间初始化 #时间文件更新 $endtime = $now + ($battle_limit*60*60*24); $timelist="$now,$endtime,\n" ; open(DB,">$time_file"); seek(DB,0,0); print DB $timelist; close(DB); }if ($RESET2){#学生号码初始化 #学生号码文件更新 $memberlist="0,0,0,0,\n" ; open(DB,">$member_file"); seek(DB,0,0); print DB $memberlist; close(DB); }if ($RESET3){#禁止区域初始化 #禁止区域文件更新 ($sec,$min,$hour,$mday,$month,$year,$wday,$yday,$isdst) = localtime($now+(60*60*8)); $min = "0$min" if ($min < 10);$month++;$year += 1900; if (($hour >= 4)&&($hour < 12)){$hour = 8;} elsif (($hour >= 12)&&($hour < 20)){$hour = 16;} elsif (($hour >= 20)&&($hour < 4)){$hour = 0;} else {$hour = 0;} $areadata[0] = ("$year,$month,$mday,$hour,0\n") ; #区域追加时刻 $areadata[1] = "1,0,\n" ; #禁止区域数,hacking标志 @work = @place ;@work2 = @area ;@work3 = @arno ; $ar = splice(@work,0,1) ;$areadata[2] = "$ar," ; $ar2 = splice(@work2,0,1) ;$areadata[3] = "$ar2," ; $ar3 = splice(@work3,0,1) ;$areadata[4] = "$ar3," ; for ($i=1; $i<$#place+1; $i++) { $chk=$#work+1;$index = int(rand($chk)); $ar = splice(@work,$index,1) ;$areadata[2] = ($areadata[2] . "$ar,"); $ar2 = splice(@work2,$index,1) ;$areadata[3] = ($areadata[3] . "$ar2,"); $ar3 = splice(@work3,$index,1) ;$areadata[4] = ($areadata[4] . "$ar3,"); } #weather local($weth) = int(rand(11)) ; $areadata[2] = ($areadata[2] . "\n"); $areadata[3] = ($areadata[3] . "\n"); $areadata[4] = ($areadata[4] . "\n"); $areadata[5] = "$weth\n"; $BRNUM = $arealist[6]; if ($RESET10){$BRNUM++;} $areadata[6] = $BRNUM; open(DB,">$area_file"); seek(DB,0,0); print DB @areadata; close(DB); }if ($RESET4){#初始化及游戏开始追加状态 #Newgame Log $loglist = "$now,$weth,,,,,,,,,,NEWGAME,,\n" ; open(DB,">$log_file"); seek(DB,0,0); print DB $loglist; close(DB); }if ($RESET5){#道具状态初始化 #Del Area Item for ($i=0; $i<$#area+1; $i++) {@areaitem = "" ;$filename = "$LOG_DIR/$i$item_file";open(DB,">$filename"); seek(DB,0,0); print DB @areaitem; close(DB);} #Put Area Item open(DB,"$DAT_DIR/itemfile.dat");seek(DB,0,0); @itemlist= ;close(DB); for ($i=0;$i<$#itemlist+1;$i++) { ($idx,$count,$w_i,$w_e,$w_t) = split(/,/, $itemlist[$i]); chomp $w_t; if ($idx eq 99) { for ($a=$count; $a>=0;$a--){ $idx = int(rand($#place)+1); $filename = "$LOG_DIR/$idx$item_file"; open(DB,"$filename");seek(DB,0,0); @areaitem= ;close(DB); push(@areaitem,"$w_i,$w_e,$w_t,\n") ; open(DB,">$filename"); seek(DB,0,0); print DB @areaitem; close(DB); } }else{ $filename = "$LOG_DIR/$idx$item_file"; open(DB,"$filename");seek(DB,0,0); @areaitem= ;close(DB); for ($a=$count; $a>=0;$a--){ push(@areaitem,"$w_i,$w_e,$w_t,\n") ; } open(DB,">$filename"); seek(DB,0,0); print DB @areaitem; close(DB); } } }if ($RESET6){#鎗声状态初始化 #鎗声状态更新 local($null_data) = "0,,,,"; open(DB,">$gun_log_file"); for ($i=0; $i<6; $i++){print DB "$null_data\n";} close(DB); }if ($RESET7){#用户保存数据文件夹删掉 #用户保存数据删掉 opendir(DIR, "$u_save_dir"); foreach $file (readdir(DIR)) {unless($file =~ /^\.{1,2}$/){if($file =~ /$u_save_file/){push (@f_list,"$u_save_dir$file");}}} closedir(DIR);unlink(@f_list); }if ($RESET8){#Flag文件更新 #FLAG文件更新 open(FLAG,">$end_flag_file"); print FLAG ""; close(FLAG); }if ($RESET9){#Messenger 更新 open(mes_file,">$mes_file"); print mes_file ""; close(mes_file);open(memberfile,">$memberfile"); print memberfile ""; close(memberfile); } &HEADER ; print <<"_HERE_"; Administrative Mode 初期化完成。
>>HOME >>ADMIN _HERE_ &FOOTER; } #==================# # ■ Decoding处理 # #==================# sub ADMDECODE { $p_flag=0; if ($ENV{'REQUEST_METHOD'} eq "POST") {if ($ENV{'CONTENT_LENGTH'} > 51200) { &ERROR("是异常的输入"); }read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});$p_flag=1;} else { $buffer = $ENV{'QUERY_STRING'}; } @pairs = split(/&/, $buffer); foreach (@pairs) { ($name,$value) = split(/=/, $_); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # EUC变换字符编码 if ($name eq "Del") { push(@DEL,$value);} #&jcode'convert(*value, "euc", "", "z"); #&jcode::tr(\$value, '﹛', ' '); #$value =~ s/</g; #$value =~ s/>/>/g; #$value =~ s/&/&/g; #$value =~ s/"/"/g; #$value =~ s/ / /g; #$value =~ s/,/﹜/g; #数据破损对策 $in{$name} = $value; } $id = $in{'Id'}; $admpass = $in{'Password'}; $admpas = $in{'Pass'}; $Command = $in{'Command'}; $Message = $in{'Message'}; if ($Command eq "RESETACC"){ $RESET0 = 0;$RESET1 = 0;$RESET2 = 0;$RESET3 = 0;$RESET4 = 0;$RESET5 = 0;$RESET6 = 0;$RESET7 = 0;$RESET8 = 0;$RESET9 = 0;$RESET10 = 0; $RESET0 = $in{'RESET0'};$RESET1 = $in{'RESET1'};$RESET2 = $in{'RESET2'};$RESET3 = $in{'RESET3'};$RESET4 = $in{'RESET4'};$RESET5 = $in{'RESET5'};$RESET6 = $in{'RESET6'};$RESET7 = $in{'RESET7'};$RESET8 = $in{'RESET8'};$RESET9 = $in{'RESET9'};$RESET10 = $in{'RESET10'}; } if ($Command eq "USERCHG3"){ $w_id = $in{'w_id'};$w_password = $in{'w_password'};$w_f_name = $in{'w_f_name'};$w_l_name = $in{'w_l_name'};$w_sex = $in{'w_sex'};$w_cl = $in{'w_cl'};$w_no = $in{'w_no'};$w_endtime = $in{'w_endtime'};$w_att = $in{'w_att'};$w_def = $in{'w_def'};$w_hit = $in{'w_hit'};$w_mhit = $in{'w_mhit'};$w_level = $in{'w_level'};$w_exp = $in{'w_exp'};$w_sta = $in{'w_sta'};$w_wep = $in{'w_wep'};$w_watt = $in{'w_watt'};$w_wtai = $in{'w_wtai'};$w_bou = $in{'w_bou'};$w_bdef = $in{'w_bdef'};$w_btai = $in{'w_btai'};$w_bou_h = $in{'w_bou_h'};$w_bdef_h = $in{'w_bdef_h'};$w_btai_h = $in{'w_btai_h'};$w_bou_f = $in{'w_bou_f'};$w_bdef_f = $in{'w_bdef_f'};$w_btai_f = $in{'w_btai_f'};$w_bou_a = $in{'w_bou_a'};$w_bdef_a = $in{'w_bdef_a'};$w_btai_a = $in{'w_btai_a'};$w_tactics = $in{'w_tactics'};$w_death = $in{'w_death'};$w_msg = $in{'w_msg'};$w_sts = $in{'w_sts'};$w_pls = $in{'w_pls'};$w_kill = $in{'w_kill'};$w_icon = $in{'w_icon'};$w_item0 = $in{'w_item0'};$w_eff0 = $in{'w_eff0'}; $w_itai0 = $in{'w_itai0'};$w_item1 = $in{'w_item1'};$w_eff1 = $in{'w_eff1'};$w_itai1 = $in{'w_itai1'};$w_item2 = $in{'w_item2'};$w_eff2 = $in{'w_eff2'};$w_itai2 = $in{'w_itai2'};$w_item3 = $in{'w_item3'};$w_eff3 = $in{'w_eff3'};$w_itai3 = $in{'w_itai3'};$w_item4 = $in{'w_item4'};$w_eff4 = $in{'w_eff4'};$w_itai4 = $in{'w_itai4'};$w_item5 = $in{'w_item5'};$w_eff5 = $in{'w_eff5'};$w_itai5 = $in{'w_itai5'};$w_log = $in{'w_log'};$w_dmes = $in{'w_dmes'};$w_bid = $in{'w_bid'};$w_club = $in{'w_club'};$w_wn = $in{'w_wn'};$w_wp = $in{'w_wp'};$w_wa = $in{'w_wa'};$w_wg = $in{'w_wg'};$w_we = $in{'w_we'};$w_wc = $in{'w_wc'};$w_wd = $in{'w_wd'};$w_wb = $in{'w_wb'};$w_wf = $in{'w_wf'};$w_ws = $in{'w_ws'};$w_com = $in{'w_com'};$w_inf = $in{'w_inf'};$w_ousen = $in{'w_ousen'};$w_seikaku = $in{'w_seikaku'};$w_sinri = $in{'w_sinri'};$w_item_get = $in{'w_item_get'};$w_eff_get = $in{'w_eff_get'};$w_itai_get = $in{'w_itai_get'};$w_teamID = $in{'w_teamID'};$w_teamPass = $in{'w_teamPass'};$w_IP = $in{'w_IP'}; $USERCGH = $in{'Del'};} if($buffer eq ""){$Command = "LOGON"; $p_flag=1;} } #==================# # ■ 一览表示处理 # #==================# sub USERLIST { $col_s1 = "" ; $col_s2 = "" ; $col_s3 = "" ; $col_e = "" ; open(DB,"$user_file");seek(DB,0,0); @userlist=;close(DB); push(@log," 生存者一览 "); push(@log,"
") ; &HEADER ; print @log; &FOOTER; } #========# # ■ 变 # #========# sub USERCHG { open(DB,"$user_file");seek(DB,0,0); @userlist=;close(DB); $USERCHG = $DEL[0]; foreach (0 .. $#DEL) { ($w_id,$w_password,$w_f_name,$w_l_name,$w_sex,$w_cl,$w_no,$w_endtime,$w_att,$w_def,$w_hit,$w_mhit,$w_level,$w_exp,$w_sta,$w_wep,$w_watt,$w_wtai,$w_bou,$w_bdef,$w_btai,$w_bou_h,$w_bdef_h,$w_btai_h,$w_bou_f,$w_bdef_f,$w_btai_f,$w_bou_a,$w_bdef_a,$w_btai_a,$w_tactics,$w_death,$w_msg,$w_sts,$w_pls,$w_kill,$w_icon,$w_item[0],$w_eff[0],$w_itai[0],$w_item[1],$w_eff[1],$w_itai[1],$w_item[2],$w_eff[2],$w_itai[2],$w_item[3],$w_eff[3],$w_itai[3],$w_item[4],$w_eff[4],$w_itai[4],$w_item[5],$w_eff[5],$w_itai[5],$w_log,$w_dmes,$w_bid,$w_club,$w_wn,$w_wp,$w_wa,$w_wg,$w_we,$w_wc,$w_wd,$w_wb,$w_wf,$w_ws,$w_com,$w_inf,$w_ousen,$w_seikaku,$w_sinri,$w_item_get,$w_eff_get,$w_itai_get,$w_teamID,$w_teamPass,$w_IP,) = split(/,/, $userlist[$DEL[$_]]); &USERCHG2;exit; } } #=========# # ■ 变2 # #=========# sub USERCHG2 { #状态情报修正部 $USERCHG1 = ": Administrative Mode _HERE_ &FOOTER; } #========# # ■ 变 # #========# sub USERCHG3 { open(DB,"$user_file");seek(DB,0,0); @userlist= ;close(DB); foreach (0 .. $#DEL) { ($c_id,$c_password,$c_f_name,$c_l_name,$c_sex,$c_cl,$c_no,$c_endtime,$c_att,$c_def,$c_hit,$c_mhit,$c_level,$c_exp,$c_sta,$c_wep,$c_watt,$c_wtai,$c_bou,$c_bdef,$c_btai,$c_bou_h,$c_bdef_h,$c_btai_h,$c_bou_f,$c_bdef_f,$c_btai_f,$c_bou_a,$c_bdef_a,$c_btai_a,$c_tactics,$c_death,$c_msg,$c_sts,$c_pls,$c_kill,$c_icon,$c_item[0],$c_eff[0],$c_itai[0],$c_item[1],$c_eff[1],$c_itai[1],$c_item[2],$c_eff[2],$c_itai[2],$c_item[3],$c_eff[3],$c_itai[3],$c_item[4],$c_eff[4],$c_itai[4],$c_item[5],$c_eff[5],$c_itai[5],$c_log,$c_dmes,$c_bid,$c_club,$c_wn,$c_wp,$c_wa,$c_wg,$c_we,$c_wc,$c_wd,$c_wb,$c_wf,$c_ws,$c_com,$c_inf,$c_ousen,$c_seikaku,$c_sinri,$c_item_get,$c_eff_get,$c_itai_get,$c_teamID,$c_teamPass,$c_IP,) = split(/,/, $userlist[$DEL[$_]]); if ($Message ne "change"){$w_log = "$c_log$w_log";} $userlist[$DEL[$_]] = "$w_id,$w_password,$w_f_name,$w_l_name,$w_sex,$w_cl,$w_no,$w_endtime,$w_att,$w_def,$w_hit,$w_mhit,$w_level,$w_exp,$w_sta,$w_wep,$w_watt,$w_wtai,$w_bou,$w_bdef,$w_btai,$w_bou_h,$w_bdef_h,$w_btai_h,$w_bou_f,$w_bdef_f,$w_btai_f,$w_bou_a,$w_bdef_a,$w_btai_a,$w_tactics,$w_death,$w_msg,$w_sts,$w_pls,$w_kill,$w_icon,$w_item0,$w_eff0,$w_itai0,$w_item1,$w_eff1,$w_itai1,$w_item2,$w_eff2,$w_itai2,$w_item3,$w_eff3,$w_itai3,$w_item4,$w_eff4,$w_itai4,$w_item5,$w_eff5,$w_itai5,$w_log,$w_dmes,$w_bid,$w_club,$w_wn,$w_wp,$w_wa,$w_wg,$w_we,$w_wc,$w_wd,$w_wb,$w_wf,$w_ws,$w_com,$w_inf,$w_ousen,$w_seikaku,$w_sinri,$w_item_get,$w_eff_get,$w_itai_get,$w_teamID,$w_teamPass,$w_IP,\n" ; } open(DB,">$user_file"); seek(DB,0,0); print DB @userlist; close(DB); &USERLIST; } #========# # ■ 入 # #========# sub ENTER { open(DB,"$user_file");seek(DB,0,0); @userlist= ;close(DB); foreach (0 .. $#DEL) { ($w_id,$w_password,$w_f_name,$w_l_name,$w_sex,$w_cl,$w_no,$w_endtime,$w_att,$w_def,$w_hit,$w_mhit,$w_level,$w_exp,$w_sta,$w_wep,$w_watt,$w_wtai,$w_bou,$w_bdef,$w_btai,$w_bou_h,$w_bdef_h,$w_btai_h,$w_bou_f,$w_bdef_f,$w_btai_f,$w_bou_a,$w_bdef_a,$w_btai_a,$w_tactics,$w_death,$w_msg,$w_sts,$w_pls,$w_kill,$w_icon,$w_item[0],$w_eff[0],$w_itai[0],$w_item[1],$w_eff[1],$w_itai[1],$w_item[2],$w_eff[2],$w_itai[2],$w_item[3],$w_eff[3],$w_itai[3],$w_item[4],$w_eff[4],$w_itai[4],$w_item[5],$w_eff[5],$w_itai[5],$w_log,$w_dmes,$w_bid,$w_club,$w_wn,$w_wp,$w_wa,$w_wg,$w_we,$w_wc,$w_wd,$w_wb,$w_wf,$w_ws,$w_com,$w_inf,$w_ousen,$w_seikaku,$w_sinri,$w_item_get,$w_eff_get,$w_itai_get,$w_teamID,$w_teamPass,$w_IP,) = split(/,/, $userlist[$DEL[$_]]); } &HEADER; print <<"_HERE_"; Administrative Mode -转送-
_HERE_ &FOOTER; exit; } #==================# # ■ 删除处理 # #==================# sub USERDEL { open(DB,"$user_file");seek(DB,0,0); @userlist=;close(DB); foreach (0 .. $#DEL) { ($w_id,$w_password,$w_f_name,$w_l_name,$w_sex,$w_cl,$w_no,$w_endtime,$w_att,$w_def,$w_hit,$w_mhit,$w_level,$w_exp,$w_sta,$w_wep,$w_watt,$w_wtai,$w_bou,$w_bdef,$w_btai,$w_bou_h,$w_bdef_h,$w_btai_h,$w_bou_f,$w_bdef_f,$w_btai_f,$w_bou_a,$w_bdef_a,$w_btai_a,$w_tactics,$w_death,$w_msg,$w_sts,$w_pls,$w_kill,$w_icon,$w_item[0],$w_eff[0],$w_itai[0],$w_item[1],$w_eff[1],$w_itai[1],$w_item[2],$w_eff[2],$w_itai[2],$w_item[3],$w_eff[3],$w_itai[3],$w_item[4],$w_eff[4],$w_itai[4],$w_item[5],$w_eff[5],$w_itai[5],$w_log,$w_dmes,$w_bid,$w_club,$w_wn,$w_wp,$w_wa,$w_wg,$w_we,$w_wc,$w_wd,$w_wb,$w_wf,$w_ws,$w_com,$w_inf,$w_ousen,$w_seikaku,$w_sinri,$w_item_get,$w_eff_get,$w_itai_get,$w_teamID,$w_teamPass,$w_IP,) = split(/,/, $userlist[$DEL[$_]]); $w_msg = $Message; &LOGSAVE("DEATH4") ; $w_hit = 0 ; $w_sts = "死亡"; $w_death=$deth; $userlist[$DEL[$_]] = "$w_id,$w_password,$w_f_name,$w_l_name,$w_sex,$w_cl,$w_no,$w_endtime,$w_att,$w_def,$w_hit,$w_mhit,$w_level,$w_exp,$w_sta,$w_wep,$w_watt,$w_wtai,$w_bou,$w_bdef,$w_btai,$w_bou_h,$w_bdef_h,$w_btai_h,$w_bou_f,$w_bdef_f,$w_btai_f,$w_bou_a,$w_bdef_a,$w_btai_a,$w_tactics,$w_death,$w_msg,$w_sts,$w_pls,$w_kill,$w_icon,$w_item[0],$w_eff[0],$w_itai[0],$w_item[1],$w_eff[1],$w_itai[1],$w_item[2],$w_eff[2],$w_itai[2],$w_item[3],$w_eff[3],$w_itai[3],$w_item[4],$w_eff[4],$w_itai[4],$w_item[5],$w_eff[5],$w_itai[5],$w_log,$w_dmes,$w_bid,$w_club,$w_wn,$w_wp,$w_wa,$w_wg,$w_we,$w_wc,$w_wd,$w_wb,$w_wf,$w_ws,$w_com,$w_inf,$w_ousen,$w_seikaku,$w_sinri,$w_item_get,$w_eff_get,$w_itai_get,$w_teamID,$w_teamPass,$w_IP,\n" ; } open(DB,">$user_file"); seek(DB,0,0); print DB @userlist; close(DB); &USERLIST; }