*石碑_重複(罪罰/石碑) [#zd4f954c] -ページ: [[罪罰改造板2]] -投稿者: [[封天雷冥]] -優先順位: 重要 -状態: 着手 -カテゴリー: エラーが出ます -投稿日: 2007-03-18 (日) 11:31:05 -バージョン: **内容 [#d7a68e69] 覇者の石碑のスプリクトをコピーして、指定の場所に貼り付けて、 いざテストしてみると、2回づつログが書き込まれてしまい、↓のような感じになってしまいます。 3/18 10:57:01 ___国 が ___ [__] 等の活躍により大陸を制覇しました!!! ------------------------------------------------------------ 3/18 10:57:01 ___国 が ___ [__] 等の活躍により大陸を制覇しました!!! 2回もログが書きこまれてしまうのは、困るので、どなたか助けてください。 スプリクトの石碑関連の部分を載せておきます。 ./inc/ore_sub-system.cgi # キャラデータ書き込み sub dat_write{ &error("open error no such a file!",1) if(!$nm || !$id); $dat[0] = "la;$time,nm;$nm,pw;$pw,id;$id,sei;$sei,type;$type,age_time;$age_time,act_cnt;$act_cnt,hp;$hp,max_hp;$max_hp,lv;$lv,mp;$mp,max_mp;$max_mp,rank;$rank,ua;$ua,ud;$ud,lr;$lr,ag;$ag,ck;$ck,tm;$tm,bt;$bt,bst;$bst,exe;$exe,rank_exe;$rank_exe,sol;$sol,sol_lv;$sol_lv,nation;$nation,we;$we,camp;$camp,pr;$pr,tnm;$tnm,tid;$tid,thp;$thp,tlr;$tlr,tag;$tag,tsol;$tsol,tsg;$tsg,tsol_lv;$tsol_lv,b_n;$b_n,b_v;$b_v,thp_max;$thp_max,tlv;$tlv,tdg_a;$tdg_a,tdf_a;$tdf_a,tua;$tua,tud;$tud,tmp;$tmp,tcp;$tcp,gold;$gold,roku;$roku,dg_a;$dg_a,dg_cnt;$dg_cnt,df_a;$df_a,df_cnt;$df_cnt,di_a;$di_a,di_cnt;$di_cnt,sogo;$sogo,mes;$mes,info_mes;$info_mes,\n"; $dat[1] = "$date<>$addr<>$host<>$agent<>\n"; open (OUT,">$usrdata$id\.cgi") || &error("open error:$usrdata$id\.cgi",1); print OUT @dat; close(OUT) or die "Can't close : $!"; } # 過去の栄光書き込み&バックアップ処理 sub hist_write{ #ここで国ログ書き込み $cdat = "cn1;$cn1,cg1;$cg1,cf1;$cf1,cs1;$cs1,ce1;$ce1,c1;$c1,c1a;$c1a,cn2;$cn2,cg2;$cg2,cf2;$cf2,cs2;$cs2,ce2;$ce2,c2;$c2,c2a;$c2a,cn3;$cn3,cg3;$cg3,cf3;$cf3,cs3;$cs3,ce3;$ce3,c3;$c3,c3a;$c3a,cn4;$cn4,cg4;$cg4,cf4;$cf4,cs4;$cs4,ce4;$ce4,c4;$c4,c4a;$c4a,cn5;$cn5,cg5;$cg5,cf5;$cf5,cs5;$cs5,ce5;$ce5,c5;$c5,c5a;$c5a,set;$set,all_mem;$all_mem,goal_no;$goal_no,hasya;$hasya,hcamp;$hcamp,ad;$addr,ht;$host,date;$date,wr_mes;$wr_mes,\n"; open (DB,">>$histfile") || &error("open error:$histfile",1); print DB $cdat; close(DB) or die "Can't close : $!"; # 統一時は石碑に刻む if($touitu_flag==1){ &stone_write; } } sub stone_write{ open (DB2,">>$stonefile") || &error("open error:$stonefile",1); print DB2 $cdat; close(DB2) or die "Can't close : $!"; } #------------------------------------------------------------------------------- ./ore_config.cgi $script = "/cgi-bin/ore/ore_.cgi"; # 本スクリプト名 $ore_reg = "./ore_reg.cgi"; # 新規登録 $stonefile = './logdata/stone_log.cgi'; # 石碑ログ # 管理者機能 アクセス方法は # http://あなたのURL/ore_plus/ore_admin.cgi?administrator=管理者パスワード $ore_admin = "./ore_admin.cgi"; 指摘お願いします。 ---- -線が長くなってしまいました。すみません。見づらいですが、よろしくお願いします。 -- [[封天雷冥]] &new{2007-03-18 (日) 11:32:31}; -罪罰改造板2/75、罪罰改造板2/509とか参考にしてみては -- [[あくあ]] &new{2007-03-18 (日) 19:03:10}; -2/75の結果「効果なし」2/509の結果「writeが、どこにあるかがわからない。」これが結果です。お返事お願いします。 -- [[封天雷冥]] &new{2007-03-19 (月) 18:42:30}; -&hist_writeがsystemのsub hist_write{〜〜}を呼び出して処理させて戻る。というのをまず理解してください。(stone_writeはhist〜の処理をするときに、flagの条件が合えば〜で動きます)>その上で、その呼び出し(&hist_write)が行われてそうなcgi全てに検索をかける。。。>>っとぃぅか。。。先に罪罰ファイルのプログラムの流れをシッカリ見て、例え朧気でも、今時分が改造する箇所に行くまでのファイル・プログラムの役割や流れを把握した方が良いと思いますよ? -- [[三毛猫]] &new{2007-03-20 (火) 01:04:55}; -808行目の、 &hist_write if($touitu_flag); を、消したらうまくいきました!ご迷惑かけて申し訳ございませんでした。 -- [[封天雷冥]] &new{2007-03-20 (火) 18:05:22}; - OPoHUTpnOWMeZ -- [[ledhzy]] &new{2008-01-27 (日) 23:35:44}; - INSkTEquJpyAwAU -- [[lhlkzodxczy]] &new{2008-01-27 (日) 23:40:21}; #comment