Example #1
0
 function Order()
 {
     // ログイン処理する前に処理するもの
     // まだユーザデータ読んでません
     switch (true) {
         case $_GET["menu"] === "auction":
             include CLASS_AUCTION;
             $ItemAuction = new Auction(item);
             $ItemAuction->AuctionHttpQuery("auction");
             $ItemAuction->ItemCheckSuccess();
             // 競売が終了した品物を調べる
             $ItemAuction->UserSaveData();
             // 競売品と金額を各IDに配って保存する
             break;
         case $_GET["menu"] === "rank":
             include CLASS_RANKING;
             $Ranking = new Ranking();
             break;
     }
     if (true === ($message = $this->CheckLogin())) {
         //if( false ):
         // ログイン
         include_once DATA_ITEM;
         include CLASS_CHAR;
         if ($this->FirstLogin()) {
             return 0;
         }
         switch (true) {
             case $this->OptionOrder():
                 return false;
             case $_POST["delete"]:
                 if ($this->DeleteMyData()) {
                     return 0;
                 }
                 // 設定
             // 設定
             case $_SERVER["QUERY_STRING"] === "setting":
                 if ($this->SettingProcess()) {
                     $this->SaveData();
                 }
                 $this->fpCloseAll();
                 $this->SettingShow();
                 return 0;
                 // オークション
             // オークション
             case $_GET["menu"] === "auction":
                 $this->LoadUserItem();
                 //道具データ読む
                 $this->AuctionHeader();
                 /*
                  * 出品用のフォーム
                  * 表示を要求した場合か、
                  * 出品に失敗した場合表示する。
                  */
                 $ResultExhibit = $this->AuctionItemExhibitProcess($ItemAuction);
                 $ResultBidding = $this->AuctionItemBiddingProcess($ItemAuction);
                 $ItemAuction->ItemSaveData();
                 // 変更があった場合だけ保存する。
                 // 出品リストを表示する
                 if ($_POST["ExhibitItemForm"]) {
                     $this->fpCloseAll();
                     $this->AuctionItemExhibitForm($ItemAuction);
                     // 出品か竞标に成功した場合はデータを保存する
                 } else {
                     if ($ResultExhibit !== false) {
                         if ($ResultExhibit === true || $ResultBidding === true) {
                             $this->SaveData();
                         }
                         $this->fpCloseAll();
                         $this->AuctionItemBiddingForm($ItemAuction);
                         // それ以外
                     } else {
                         $this->fpCloseAll();
                         $this->AuctionItemExhibitForm($ItemAuction);
                     }
                 }
                 $this->AuctionFoot($ItemAuction);
                 return 0;
                 // 狩場
             // 狩場
             case $_SERVER["QUERY_STRING"] === "hunt":
                 $this->LoadUserItem();
                 //道具データ読む
                 $this->fpCloseAll();
                 $this->HuntShow();
                 return 0;
                 // 街
             // 街
             case $_SERVER["QUERY_STRING"] === "town":
                 $this->LoadUserItem();
                 //道具データ読む
                 $this->fpCloseAll();
                 $this->TownShow();
                 return 0;
                 // シミュれ
             // シミュれ
             case $_SERVER["QUERY_STRING"] === "simulate":
                 $this->CharDataLoadAll();
                 //キャラデータ読む
                 if ($this->SimuBattleProcess()) {
                     $this->SaveData();
                 }
                 $this->fpCloseAll();
                 $this->SimuBattleShow($result);
                 return 0;
                 // ユニオン
             // ユニオン
             case $_GET["union"]:
                 $this->CharDataLoadAll();
                 //キャラデータ読む
                 include CLASS_UNION;
                 include DATA_MONSTER;
                 if ($this->UnionProcess()) {
                     // 戦闘する
                     $this->SaveData();
                     $this->fpCloseAll();
                 } else {
                     // 表示
                     $this->fpCloseAll();
                     $this->UnionShow();
                 }
                 return 0;
                 // 一般モンスター
             // 一般モンスター
             case $_GET["common"]:
                 $this->CharDataLoadAll();
                 //キャラデータ読む
                 $this->LoadUserItem();
                 //道具データ読む
                 if ($this->MonsterBattle()) {
                     $this->SaveData();
                     $this->fpCloseAll();
                 } else {
                     $this->fpCloseAll();
                     $this->MonsterShow();
                 }
                 return 0;
                 // キャラステ
             // キャラステ
             case $_GET["char"]:
                 $this->CharDataLoadAll();
                 //キャラデータ読む
                 include DATA_SKILL;
                 include DATA_JUDGE_SETUP;
                 $this->LoadUserItem();
                 //道具データ読む
                 $this->CharStatProcess();
                 $this->fpCloseAll();
                 $this->CharStatShow();
                 return 0;
                 // 道具一覧
             // 道具一覧
             case $_SERVER["QUERY_STRING"] === "item":
                 $this->LoadUserItem();
                 //道具データ読む
                 //$this->ItemProcess();
                 $this->fpCloseAll();
                 $this->ItemShow();
                 return 0;
                 // 精錬
             // 精錬
             case $_GET["menu"] === "refine":
                 $this->LoadUserItem();
                 $this->SmithyRefineHeader();
                 if ($this->SmithyRefineProcess()) {
                     $this->SaveData();
                 }
                 $this->fpCloseAll();
                 $result = $this->SmithyRefineShow();
                 return 0;
                 // 製作
             // 製作
             case $_GET["menu"] === "create":
                 $this->LoadUserItem();
                 $this->SmithyCreateHeader();
                 include DATA_CREATE;
                 //製作できるものデータ等
                 if ($this->SmithyCreateProcess()) {
                     $this->SaveData();
                 }
                 $this->fpCloseAll();
                 $this->SmithyCreateShow();
                 return 0;
                 // ショップ(旧式:買う,売る,打工)
             // ショップ(旧式:買う,売る,打工)
             case $_SERVER["QUERY_STRING"] === "shop":
                 $this->LoadUserItem();
                 //道具データ読む
                 if ($this->ShopProcess()) {
                     $this->SaveData();
                 }
                 $this->fpCloseAll();
                 $this->ShopShow();
                 return 0;
                 // ショップ(買う)
             // ショップ(買う)
             case $_GET["menu"] === "buy":
                 $this->LoadUserItem();
                 //道具データ読む
                 $this->ShopHeader();
                 if ($this->ShopBuyProcess()) {
                     $this->SaveData();
                 }
                 $this->fpCloseAll();
                 $this->ShopBuyShow();
                 return 0;
                 // ショップ(売る)
             // ショップ(売る)
             case $_GET["menu"] === "sell":
                 $this->LoadUserItem();
                 //道具データ読む
                 $this->ShopHeader();
                 if ($this->ShopSellProcess()) {
                     $this->SaveData();
                 }
                 $this->fpCloseAll();
                 $this->ShopSellShow();
                 return 0;
                 // ショップ(働く)
             // ショップ(働く)
             case $_GET["menu"] === "work":
                 $this->ShopHeader();
                 if ($this->WorkProcess()) {
                     $this->SaveData();
                 }
                 $this->fpCloseAll();
                 $this->WorkShow();
                 return 0;
                 // ランキング
             // ランキング
             case $_GET["menu"] === "rank":
                 $this->CharDataLoadAll();
                 //キャラデータ読む
                 $RankProcess = $this->RankProcess($Ranking);
                 if ($RankProcess === "BATTLE") {
                     $this->SaveData();
                     $this->fpCloseAll();
                 } else {
                     if ($RankProcess === true) {
                         $this->SaveData();
                         $this->fpCloseAll();
                         $this->RankShow($Ranking);
                     } else {
                         $this->fpCloseAll();
                         $this->RankShow($Ranking);
                     }
                 }
                 return 0;
                 // 雇用
             // 雇用
             case $_SERVER["QUERY_STRING"] === "recruit":
                 if ($this->RecruitProcess()) {
                     $this->SaveData();
                 }
                 $this->fpCloseAll();
                 $this->RecruitShow($result);
                 return 0;
                 // それ以外(トップ)
             // それ以外(トップ)
             default:
                 $this->CharDataLoadAll();
                 //キャラデータ読む
                 $this->fpCloseAll();
                 $this->LoginMain();
                 return 0;
         }
     } else {
         // ログアウト
         $this->fpCloseAll();
         switch (true) {
             case $this->OptionOrder():
                 return false;
             case $_POST["Make"]:
                 list($bool, $message) = $this->MakeNewData();
                 if (true === $bool) {
                     $this->LoginForm($message);
                     return false;
                 }
             case $_SERVER["QUERY_STRING"] === "newgame":
                 $this->NewForm($message);
                 return false;
             default:
                 $this->LoginForm($message);
         }
     }
 }