• R/O
  • SSH
  • HTTPS

jinrousiki: Commit


Commit MetaInfo

Revision2318 (tree)
Time2019-01-06 19:52:55
Authorumethyl

Log Message

RequestDataGameLog

Change Summary

Incremental Difference

--- trunk/include/controller/game_play_class.php (revision 2317)
+++ trunk/include/controller/game_play_class.php (revision 2318)
@@ -263,7 +263,9 @@
263263 $this->OutputHeader();
264264 $this->OutputTimeTable();
265265 $this->OutputLimitSay();
266- if (! RQ::Get()->list_down) GameHTML::OutputPlayer();
266+ if (false === RQ::Get()->list_down) {
267+ GameHTML::OutputPlayer();
268+ }
267269 GamePlayHTML::OutputAbility();
268270 GamePlayHTML::OutputVote();
269271 $this->OutputTalk();
@@ -270,9 +272,15 @@
270272 GameHTML::OutputLastWords();
271273 GameHTML::OutputDead();
272274 GameHTML::OutputVote();
273- if (DB::$ROOM->IsOff(RoomMode::DEAD)) $this->OutputSelfLastWords();
274- if (RQ::Get()->list_down) GameHTML::OutputPlayer();
275- if (RQ::Get()->play_sound) $this->OutputSound();
275+ if (DB::$ROOM->IsOff(RoomMode::DEAD)) {
276+ $this->OutputSelfLastWords();
277+ }
278+ if (true === RQ::Get()->list_down) {
279+ GameHTML::OutputPlayer();
280+ }
281+ if (true === RQ::Get()->play_sound) {
282+ $this->OutputSound();
283+ }
276284 HTML::OutputFooter();
277285 }
278286
@@ -311,7 +319,9 @@
311319
312320 //リンク出力
313321 protected function OutputHeaderLink() {
314- if (GameConfig::ASYNC) $this->OutputHeaderSwitchLink(RequestDataGame::ASYNC);
322+ if (GameConfig::ASYNC) {
323+ $this->OutputHeaderSwitchLink(RequestDataGame::ASYNC);
324+ }
315325 $this->OutputHeaderSwitchLink(
316326 RequestDataGame::SOUND, RequestDataGame::ICON, RequestDataGame::DOWN
317327 );
@@ -376,7 +386,9 @@
376386 } elseif (DB::$ROOM->IsPlaying()) {
377387 GameHTML::OutputTimePass($left_time);
378388 }
379- if (DB::$ROOM->IsOption('limit_talk')) GamePlayHTML::OutputTalkCount();
389+ if (DB::$ROOM->IsOption('limit_talk')) {
390+ GamePlayHTML::OutputTalkCount();
391+ }
380392 $this->OutputObjection($left_time);
381393 TableHTML::OutputFooter();
382394
@@ -402,7 +414,7 @@
402414 //異議ありボタン表示スキップ判定
403415 protected function IgnoreObjection($left_time) {
404416 //昼 + 制限時間内 + 生存者のみ
405- return ! (DB::$ROOM->IsDay() && $left_time > 0 && DB::$ROOM->IsOff(RoomMode::DEAD));
417+ return false === (DB::$ROOM->IsDay() && $left_time > 0 && DB::$ROOM->IsOff(RoomMode::DEAD));
406418 }
407419
408420 //時間制限通知出力
@@ -425,7 +437,7 @@
425437 GamePlayHTML::OutputSuddenDeathAnnounce($this->CountNoVoted());
426438 }
427439
428- if (DB::$SELF->IsDead() && ! DB::$ROOM->IsOpenCast()) {
440+ if (DB::$SELF->IsDead() && false === DB::$ROOM->IsOpenCast()) {
429441 GameHTML::OutputVoteAnnounce(GameMessage::CLOSE_CAST);
430442 }
431443 HTML::OutputDivFooter();
@@ -441,13 +453,19 @@
441453 $count = 0;
442454 if (DB::$ROOM->IsDay()) {
443455 foreach (DB::$USER->Get() as $user) {
444- if ($user->IsLive() && count($user->target_no) < 1) $count++;
456+ if ($user->IsLive() && count($user->target_no) < 1) {
457+ $count++;
458+ }
445459 }
446460 } elseif (DB::$ROOM->IsNight() && DB::$SELF->IsDummyBoy()) { //身代わり君以外は不可
447- if (DB::$ROOM->Stack()->IsEmpty('vote')) DB::$ROOM->LoadVote();
461+ if (DB::$ROOM->Stack()->IsEmpty('vote')) {
462+ DB::$ROOM->LoadVote();
463+ }
448464 $vote_data = DB::$ROOM->ParseVote(); //投票情報をパース
449465 foreach (DB::$USER->Get() as $user) { //未投票チェック
450- if (RoleUser::IsNoVote($user, $vote_data)) $count++;
466+ if (RoleUser::IsNoVote($user, $vote_data)) {
467+ $count++;
468+ }
451469 }
452470 }
453471 return sprintf(GamePlayMessage::NOVOTED_COUNT, $count);
@@ -455,7 +473,7 @@
455473
456474 //発言制限メッセージ出力
457475 final protected function OutputLimitSay() {
458- if (Talk::Stack()->Get(Talk::LIMIT_SAY) === false) {
476+ if (false === Talk::Stack()->Get(Talk::LIMIT_SAY)) {
459477 HTML::OutputWarning(GamePlayMessage::LIMIT_SAY);
460478 }
461479
@@ -466,7 +484,8 @@
466484
467485 //会話出力
468486 protected function OutputTalk() {
469- if (! DB::$ROOM->IsPlaying() && JinrouCacheManager::Enable(JinrouCacheManager::TALK_PLAY)) {
487+ if (false === DB::$ROOM->IsPlaying() &&
488+ JinrouCacheManager::Enable(JinrouCacheManager::TALK_PLAY)) {
470489 $filter = JinrouCacheManager::Get(JinrouCacheManager::TALK_PLAY);
471490 } else {
472491 $filter = Talk::Fetch();
@@ -526,14 +545,18 @@
526545 GamePlayHTML::OutputSceneAsync();
527546 $this->OutputTimelimit(GameTime::GetLeftTime());
528547 GamePlayHTML::OutputVote();
529- if (DB::$ROOM->IsNight()) GamePlayHTML::OutputAbility();
548+ if (DB::$ROOM->IsNight()) {
549+ GamePlayHTML::OutputAbility();
550+ }
530551 $this->OutputTalk();
531- if (RQ::Get()->play_sound) $this->OutputSound();
552+ if (true === RQ::Get()->play_sound) {
553+ $this->OutputSound();
554+ }
532555 }
533556
534557 //過去ログリンクヘッダタグ取得
535558 private function GetLogLinkHeader() {
536- if (! isset($this->link_header)) {
559+ if (false === isset($this->link_header)) {
537560 $this->link_header = sprintf(GamePlayHTML::GetLogLinkHeader(), $this->SelectURL([]));
538561 }
539562 return $this->link_header;
@@ -589,7 +612,9 @@
589612 GamePlayHTML::OutputSceneAsync();
590613 GameHTML::OutputPlayer();
591614 $this->OutputTalk();
592- if (RQ::Get()->play_sound) $this->OutputSound();
615+ if (true === RQ::Get()->play_sound) {
616+ $this->OutputSound();
617+ }
593618 }
594619 }
595620
@@ -681,7 +706,7 @@
681706 //-- GamePlay 出力クラス (霊界) --//
682707 class GamePlayView_Heaven extends GamePlayView {
683708 public function Output() {
684- if (! DB::$SELF->IsDead()) return;
709+ if (false === DB::$SELF->IsDead()) return;
685710
686711 GameHTML::OutputHeader('game_play');
687712 $this->OutputHeader();
@@ -730,7 +755,7 @@
730755 }
731756
732757 public function OutputAsync() {
733- if (! DB::$SELF->IsDead()) return;
758+ if (false === DB::$SELF->IsDead()) return;
734759
735760 GamePlayHTML::OutputSceneAsync();
736761 $this->OutputTalk();
--- trunk/include/data/request_data_class.php (revision 2317)
+++ trunk/include/data/request_data_class.php (revision 2318)
@@ -11,6 +11,12 @@
1111 const ASYNC = 'async';
1212 }
1313
14+//-- 定数リスト (Request/Game/Log) --//
15+final class RequestDataGameLog {
16+ const DATE = 'date';
17+ const SCENE = 'scene';
18+}
19+
1420 //-- 定数リスト (Request/Room) --//
1521 final class RequestDataRoom {
1622 const DEAD = 'dead_mode';
@@ -39,12 +45,6 @@
3945 const BACK_URL = 'back_url';
4046 }
4147
42-//-- 定数リスト (Request/Log/Game) --//
43-final class RequestDataLogGame {
44- const DATE = 'date';
45- const SCENE = 'scene';
46-}
47-
4848 //-- 定数リスト (Request/Log/Room) --//
4949 final class RequestDataLogRoom {
5050 const REVERSE = 'reverse_log';
--- trunk/include/functions.php (revision 2317)
+++ trunk/include/functions.php (revision 2318)
@@ -336,11 +336,6 @@
336336 return sprintf('%s=%d', $key, $value);
337337 }
338338
339- //取得 (bool 型)
340- public static function GetSwitch($key) {
341- return self::GetAdd(sprintf('%s=%s', $key, Switcher::ON));
342- }
343-
344339 //取得 (配列)
345340 public static function GetList($key, $value) {
346341 return sprintf('%s[]=%s', $key, $value);
@@ -351,6 +346,16 @@
351346 return self::GetAdd(self::GetInt($key, $value));
352347 }
353348
349+ //取得 (追加/文字型)
350+ public static function GetAddString($key, $value) {
351+ return self::GetAdd(sprintf('%s=%s', $key, $value));
352+ }
353+
354+ //取得 (追加/bool 型)
355+ public static function GetSwitch($key) {
356+ return self::GetAddString($key, Switcher::ON);
357+ }
358+
354359 //取得 (追加/db_no)
355360 public static function GetAddDB() {
356361 return self::GetDB(self::ADD);
--- trunk/include/html/controller/game_play_html_class.php (revision 2317)
+++ trunk/include/html/controller/game_play_html_class.php (revision 2318)
@@ -8,16 +8,21 @@
88
99 //ログリンク出力
1010 public static function OutputLogLink($header, $scene, $caption, $date = null) {
11- if (isset($date)) {
12- Text::Printf($header . '&date=%d&scene=%s">%d(%s)</a>', $date, $scene, $date, $caption);
11+ if (true === isset($date)) {
12+ $header .= URL::GetAddInt(RequestDataGameLog::DATE, $date);
13+ $str = $date . Text::Quote($caption);
1314 } else {
14- Text::Printf($header . '&scene=%s">%s</a>', $scene, $caption);
15+ $str = $caption;
1516 }
17+ $header .= URL::GetAddString(RequestDataGameLog::SCENE, $scene);
18+ Text::Printf($header . '">%s</a>', $str);
1619 }
1720
1821 //ヘッダーリンク出力
1922 public static function OutputHeaderLink($url, $add_url, $type = null) {
20- if (is_null($type)) $type = $url;
23+ if (true === is_null($type)) {
24+ $type = $url;
25+ }
2126 Text::Printf(self::GetHeaderLink(), $url, $add_url, self::GetHeaderStr($type));
2227 }
2328
@@ -82,7 +87,7 @@
8287
8388 //役職能力出力
8489 public static function OutputAbility() {
85- if (! DB::$ROOM->IsPlaying()) return; //スキップ判定
90+ if (false === DB::$ROOM->IsPlaying()) return; //スキップ判定
8691
8792 HTML::OutputDivHeader('ability-elements');
8893 RoleHTML::OutputAbility();
@@ -91,11 +96,13 @@
9196
9297 //投票情報出力
9398 public static function OutputVote() {
94- if (! DB::$ROOM->IsPlaying()) return; //スキップ判定
99+ if (false === DB::$ROOM->IsPlaying()) return; //スキップ判定
95100
96101 HTML::OutputDivHeader('vote-elements');
97102 RoleHTML::OutputVoteKill();
98- if (DB::$ROOM->IsPlaying()) GameHTML::OutputRevote();
103+ if (DB::$ROOM->IsPlaying()) {
104+ GameHTML::OutputRevote();
105+ }
99106 if (DB::$ROOM->IsQuiz() && DB::$ROOM->IsDay() && DB::$SELF->IsDummyBoy()) {
100107 GamePlayHTML::OutputQuizVote();
101108 }
--- trunk/include/request/game_log.php (revision 2317)
+++ trunk/include/request/game_log.php (revision 2318)
@@ -8,8 +8,8 @@
88 class Request_game_log extends Request {
99 public function __construct() {
1010 $this->ParseGetRoomNo();
11- $this->ParseGetInt(RequestDataLogGame::DATE, RequestDataUser::ID);
12- $this->ParseGetData(RequestDataLogGame::SCENE);
11+ $this->ParseGetInt(RequestDataGameLog::DATE, RequestDataUser::ID);
12+ $this->ParseGetData(RequestDataGameLog::SCENE);
1313 if ($this->IsInvalidScene()) {
1414 HTML::OutputResult(Message::REQUEST_ERROR, Message::REQUEST_ERROR);
1515 }
Show on old repository browser