• R/O
  • SSH
  • HTTPS

jinrousiki: Commit


Commit MetaInfo

Revision2310 (tree)
Time2018-12-30 19:36:53
Authorumethyl

Log Message

OldLogHTML:整形

Change Summary

Incremental Difference

--- trunk/include/html/old_log_html_class.php (revision 2309)
+++ trunk/include/html/old_log_html_class.php (revision 2310)
@@ -4,7 +4,7 @@
44 //指定の部屋番号のログを生成する
55 public static function Generate() {
66 $base_title = ServerConfig::TITLE . OldLogMessage::TITLE;
7- if (! DB::$ROOM->IsFinished() || ! DB::$ROOM->IsAfterGame()) { //閲覧判定
7+ if (false === DB::$ROOM->IsFinished() || false === DB::$ROOM->IsAfterGame()) { //閲覧判定
88 $url = RQ::Get()->generate_index ? 'index.html' : 'old_log.php';
99 $back = HTML::GenerateLink($url, Message::BACK);
1010 $str = Text::Join(OldLogMessage::NOT_FINISHED, $back);
@@ -13,7 +13,9 @@
1313
1414 if (JinrouCacheManager::Enable(JinrouCacheManager::LOG)) { //キャッシュ取得判定
1515 $str = JinrouCacheManager::Get(JinrouCacheManager::LOG);
16- if (isset($str)) return $str;
16+ if (true === isset($str)) {
17+ return $str;
18+ }
1719 }
1820
1921 if (DB::$ROOM->IsOn(RoomMode::WATCH)) { //観戦モード判定
@@ -22,7 +24,7 @@
2224 }
2325
2426 if (RQ::Get()->auto_play) { //自動再生モード判定
25- if (! RQ::Get()->reverse_log && RQ::Get()->time && DB::$ROOM->IsOn(RoomMode::WATCH)) {
27+ if (false === RQ::Get()->reverse_log && RQ::Get()->time && DB::$ROOM->IsOn(RoomMode::WATCH)) {
2628 DB::$ROOM->Flag()->Set(RoomMode::AUTO_PLAY, true);
2729 Loader::LoadFile('auto_play_talk_class');
2830 AutoPlayTalk::InitStack();
@@ -207,6 +209,7 @@
207209 public static function GenerateIndex() {
208210 RQ::Set('reverse', Switcher::OFF);
209211 if (RQ::Get()->max_room_no < 1) return false;
212+
210213 $header = sprintf('../log/%sindex', RQ::Get()->prefix);
211214 $footer = Text::LineFeed('</body></html>');
212215 $end_page = ceil((RQ::Get()->max_room_no - RQ::Get()->min_room_no + 1) / OldLogConfig::VIEW);
@@ -252,9 +255,11 @@
252255
253256 //通常ログ出力
254257 private static function GenerateLog() {
255- if (RQ::Get()->reverse_log) {
258+ if (true === RQ::Get()->reverse_log) {
256259 $str = self::GenerateTalk(0, RoomScene::BEFORE);
257- if (DB::$ROOM->IsOption('open_day')) $str .= self::GenerateTalk(0, RoomScene::DAY);
260+ if (DB::$ROOM->IsOption('open_day')) {
261+ $str .= self::GenerateTalk(0, RoomScene::DAY);
262+ }
258263 for ($i = 1; $i <= DB::$ROOM->last_date; $i++) {
259264 $str .= self::GenerateTalk($i, '');
260265 }
@@ -285,7 +290,7 @@
285290 //霊界ログ出力
286291 private static function GenerateHeavenLog() {
287292 $str = '';
288- if (RQ::Get()->reverse_log) {
293+ if (true === RQ::Get()->reverse_log) {
289294 for ($i = 1; $i <= DB::$ROOM->last_date; $i++) {
290295 $str .= self::GenerateTalk($i, RoomScene::HEAVEN_ONLY);
291296 }
@@ -299,7 +304,7 @@
299304
300305 //指定の日付の会話ログを生成
301306 private static function GenerateTalk($date, $scene) {
302- $flag_border_game = false;
307+ $border_game_flag = false;
303308 switch ($scene) { //シーンに合わせたデータをセット
304309 case RoomScene::BEFORE:
305310 $table_class = $scene;
@@ -307,7 +312,9 @@
307312 DB::$USER->ResetRoleList();
308313 DB::$ROOM->ResetEvent();
309314 }
310- if (! RQ::Get()->reverse_log) DB::$USER->ResetPlayer(); //player 復元処理
315+ if (false === RQ::Get()->reverse_log) {
316+ DB::$USER->ResetPlayer(); //player 復元処理
317+ }
311318 break;
312319
313320 case RoomScene::AFTER:
@@ -316,11 +323,13 @@
316323 DB::$USER->ResetRoleList();
317324 DB::$ROOM->ResetEvent();
318325 }
319- if (RQ::Get()->reverse_log) DB::$USER->ResetPlayer(); //player 復元処理
326+ if (true === RQ::Get()->reverse_log) {
327+ DB::$USER->ResetPlayer(); //player 復元処理
328+ }
320329 break;
321330
322331 case RoomScene::HEAVEN_ONLY:
323- if (RQ::Get()->reverse_log && $date != 1) {
332+ if (true === RQ::Get()->reverse_log && $date != 1) {
324333 $table_class = RoomScene::DAY; //2日目以降は昼から
325334 } else {
326335 $table_class = RoomScene::NIGHT;
@@ -328,8 +337,8 @@
328337 break;
329338
330339 default:
331- $flag_border_game = true;
332- if (RQ::Get()->reverse_log && $date != 1) {
340+ $border_game_flag = true;
341+ if (true === RQ::Get()->reverse_log && $date != 1) {
333342 $table_class = RoomScene::DAY; //2日目以降は昼から
334343 } else {
335344 $table_class = RoomScene::NIGHT;
@@ -344,7 +353,7 @@
344353
345354 //出力
346355 $str = '';
347- if ($flag_border_game && ! RQ::Get()->reverse_log) {
356+ if (true === $border_game_flag && false === RQ::Get()->reverse_log) {
348357 DB::$ROOM->date = $date + 1;
349358 DB::$ROOM->SetScene(RoomScene::DAY);
350359 $str .= self::GenerateLastWords() . self::GenerateDead(); //死亡者を出力
@@ -352,34 +361,48 @@
352361
353362 DB::$ROOM->date = $date;
354363 DB::$ROOM->SetScene($table_class);
355- if ($scene != RoomScene::HEAVEN_ONLY) DB::$ROOM->SetWeather();
356- if (DB::$ROOM->IsOn(RoomMode::AUTO_PLAY)) AutoPlayTalk::InitScene();
364+ if ($scene != RoomScene::HEAVEN_ONLY) {
365+ DB::$ROOM->SetWeather();
366+ }
367+ if (DB::$ROOM->IsOn(RoomMode::AUTO_PLAY)) {
368+ AutoPlayTalk::InitScene();
369+ }
357370
358371 $id = DB::$ROOM->IsPlaying() ? 'date' . DB::$ROOM->date : DB::$ROOM->scene;
359372 $builder = new TalkBuilder('talk ' . $table_class, $id);
360- if (ServerConfig::DEBUG_MODE) Talk::SetBuilder($builder); //デバッグ発言出力用
361- if (RQ::Get()->reverse_log) $builder->GenerateTimeStamp();
373+ if (ServerConfig::DEBUG_MODE) {
374+ Talk::SetBuilder($builder); //デバッグ発言出力用
375+ }
376+ if (true === RQ::Get()->reverse_log) {
377+ $builder->GenerateTimeStamp();
378+ }
362379
363380 foreach (TalkDB::GetLog($date, $scene) as $talk) {
364381 switch ($talk->scene) {
365382 case RoomScene::DAY:
366383 case RoomScene::NIGHT:
367- if ($talk->scene == DB::$ROOM->scene || $talk->location == TalkLocation::DUMMY_BOY) break;
384+ if ($talk->scene == DB::$ROOM->scene || $talk->location == TalkLocation::DUMMY_BOY) {
385+ break;
386+ }
368387
369388 $str .= $builder->Refresh() . self::GenerateSceneChange($date);
370389 DB::$ROOM->SetScene($talk->scene);
371390 $id = 'date' . DB::$ROOM->date . '_' . DB::$ROOM->scene;
372391 $builder->Begin('talk ' . $talk->scene, $id);
373- if (DB::$ROOM->IsOn(RoomMode::AUTO_PLAY)) AutoPlayTalk::SetScene(true);
392+ if (DB::$ROOM->IsOn(RoomMode::AUTO_PLAY)) {
393+ AutoPlayTalk::SetScene(true);
394+ }
374395 break;
375396 }
376397 $builder->Generate($talk); //会話生成
377398 }
378399
379- if (! RQ::Get()->reverse_log) $builder->GenerateTimeStamp();
400+ if (false === RQ::Get()->reverse_log) {
401+ $builder->GenerateTimeStamp();
402+ }
380403 $str .= $builder->Refresh();
381404
382- if ($flag_border_game && RQ::Get()->reverse_log) {
405+ if (true === $border_game_flag && true === RQ::Get()->reverse_log) {
383406 //突然死で勝敗が決定したケース
384407 if ($date == DB::$ROOM->last_date && DB::$ROOM->IsDay()) {
385408 $str .= self::GenerateVote();
@@ -397,9 +420,12 @@
397420 //シーン切り替え処理
398421 private static function GenerateSceneChange($date) {
399422 $str = '';
400- if (RQ::Get()->heaven_only) return $str;
423+ if (RQ::Get()->heaven_only) {
424+ return $str;
425+ }
426+
401427 DB::$ROOM->date = $date;
402- if (RQ::Get()->reverse_log) {
428+ if (true === RQ::Get()->reverse_log) {
403429 DB::$ROOM->SetScene(RoomScene::NIGHT);
404430 $str .= self::GenerateVote() . self::GenerateDead();
405431 } else {
@@ -418,7 +444,9 @@
418444 $str_stack = [];
419445 $role_stack = [];
420446 foreach (array_intersect(RoleDataManager::GetList(), $stack) as $role) {
421- if (! isset($camp)) $camp = RoleDataManager::GetCamp($role);
447+ if (false === isset($camp)) {
448+ $camp = RoleDataManager::GetCamp($role);
449+ }
422450 if ($camp != RoleDataManager::GetCamp($role) || count($role_stack) > 9) {
423451 $str_stack[] = ArrayFilter::Concat($role_stack, ' / ');
424452 $role_stack = [];
@@ -445,11 +473,15 @@
445473 foreach (RQ::Get() as $key => $value) { //何か値がセットされていたら無効
446474 switch ($key) {
447475 case 'page':
448- if ($value != 1) return false;
476+ if ($value != 1) {
477+ return false;
478+ }
449479 break;
450480
451481 default:
452- if (! empty($value)) return false;
482+ if (false === empty($value)) {
483+ return false;
484+ }
453485 break;
454486 }
455487 }
Show on old repository browser