• R/O
  • SSH
  • HTTPS

jinrousiki: Commit


Commit MetaInfo

Revision2319 (tree)
Time2019-01-06 21:12:36
Authorumethyl

Log Message

RequestDataTalk

Change Summary

Incremental Difference

--- trunk/include/controller/test/objection_test_class.php (revision 2318)
+++ trunk/include/controller/test/objection_test_class.php (revision 2319)
@@ -17,7 +17,7 @@
1717 //テスト実行
1818 private static function RunTest() {
1919 Loader::LoadFile('sound_class');
20- $id = 'set_objection';
20+ $id = RequestDataTalk::OBJECTION;
2121 RQ::Get()->ParsePostData($id);
2222 $key = RQ::Get()->$id;
2323 if (in_array($key, self::GetList())) {
--- trunk/include/data/request_data_class.php (revision 2318)
+++ trunk/include/data/request_data_class.php (revision 2319)
@@ -36,6 +36,13 @@
3636 const LOGIN = 'login_manually';
3737 }
3838
39+//-- 定数リスト (Request/Talk) --//
40+final class RequestDataTalk {
41+ const SENTENCE = 'say';
42+ const VOICE = 'font_type';
43+ const OBJECTION = 'set_objection';
44+}
45+
3946 //-- 定数リスト (Request/Vote) --//
4047 final class RequestDataVote {
4148 const ON = 'vote';
--- trunk/include/data/talk_data_class.php (revision 2318)
+++ trunk/include/data/talk_data_class.php (revision 2319)
@@ -20,10 +20,11 @@
2020
2121 //-- 定数リスト (Talk/Voice) --//
2222 final class TalkVoice {
23- const STRONG = 'strong';
24- const NORMAL = 'normal';
25- const WEAK = 'weak';
26- const SECRET = 'secret';
23+ const STRONG = 'strong';
24+ const NORMAL = 'normal';
25+ const WEAK = 'weak';
26+ const SECRET = 'secret';
27+ const LAST_WORDS = 'last_words';
2728 }
2829
2930 //-- 定数リスト (Talk/Element) --//
--- trunk/include/html/controller/game_play_html_class.php (revision 2318)
+++ trunk/include/html/controller/game_play_html_class.php (revision 2319)
@@ -76,7 +76,8 @@
7676 //異議ありボタン出力
7777 public static function OutputObjection($url) {
7878 Text::Printf(self::GetObjection(),
79- $url, Objection::GetImage(), GamePlayMessage::OBJECTION, Objection::Count()
79+ $url, RequestDataTalk::OBJECTION, Switcher::ON,
80+ Objection::GetImage(), GamePlayMessage::OBJECTION, Objection::Count()
8081 );
8182 }
8283
@@ -198,7 +199,7 @@
198199 private static function GetObjection() {
199200 return <<<EOF
200201 <td class="objection"><form method="post" action="%s">
201-<input type="hidden" name="set_objection" value="on">
202+<input type="hidden" name="%s" value="%s">
202203 <input type="image" name="objection_image" src="%s" alt="%s">
203204 (%d)</form></td>
204205 EOF;
--- trunk/include/html/controller/game_up_html_class.php (revision 2318)
+++ trunk/include/html/controller/game_up_html_class.php (revision 2319)
@@ -16,9 +16,14 @@
1616 private static function OutputForm() {
1717 Text::Printf(self::GetForm(),
1818 RQ::Get()->url, RQ::Get()->url, RQ::Get()->heaven_mode ? 'reload_middle_frame();' : '',
19- Security::GetToken(RQ::Get()->room_no), GameUpMessage::SUBMIT,
20- GameUpMessage::STRONG, GameUpMessage::NORMAL, GameUpMessage::WEAK,
21- GameUpMessage::SECRET, GameUpMessage::LAST_WORDS,
19+ Security::GetToken(RQ::Get()->room_no),
20+ RequestDataTalk::SENTENCE, GameUpMessage::SUBMIT,
21+ RequestDataTalk::VOICE,
22+ TalkVoice::STRONG, GameUpMessage::STRONG,
23+ TalkVoice::NORMAL, HTML::GenerateSelected(true), GameUpMessage::NORMAL,
24+ TalkVoice::WEAK, GameUpMessage::WEAK,
25+ TalkVoice::SECRET, GameUpMessage::SECRET,
26+ TalkVoice::LAST_WORDS, GameUpMessage::LAST_WORDS,
2227 RQ::Get()->url, GameUpMessage::VOTE, GameUpMessage::TOP
2328 );
2429 }
@@ -30,15 +35,15 @@
3035 <form method="post" action="game_play.php%s" target="bottom" class="input-say" name="send" onSubmit="%sset_focus();">
3136 <input type="hidden" name="token" value="%s">
3237 <table><tr>
33-<td><textarea name="say" rows="3" cols="70" wrap="soft"></textarea></td>
38+<td><textarea name="%s" rows="3" cols="70" wrap="soft"></textarea></td>
3439 <td>
3540 <input type="submit" onClick="setTimeout(&quot;auto_clear()&quot;, 10)" value="%s"><br>
36-<select name="font_type">
37-<option value="strong">%s</option>
38-<option value="normal" selected>%s</option>
39-<option value="weak">%s</option>
40-<option value="secret">%s</option>
41-<option value="last_words">%s</option>
41+<select name="%s">
42+<option value="%s">%s</option>
43+<option value="%s"%s>%s</option>
44+<option value="%s">%s</option>
45+<option value="%s">%s</option>
46+<option value="%s">%s</option>
4247 </select><br>
4348 [<a class="vote" href="game_vote.php%s">%s</a>]
4449 <a class="top-link" href="./" target="_top">%s</a>
--- trunk/include/html/controller/test/objection_test_html_class.php (revision 2318)
+++ trunk/include/html/controller/test/objection_test_html_class.php (revision 2319)
@@ -12,7 +12,8 @@
1212 TableHTML::OutputTrHeader();
1313 TableHTML::OutputTdHeader('objection');
1414 Text::Printf(self::GetForm(),
15- $url, $name, $image . self::GetImage($name) . '.gif', ObjectionTestMessage::$$name
15+ $url, Switcher::ON, RequestDataTalk::OBJECTION, $name,
16+ $image . self::GetImage($name) . '.gif', ObjectionTestMessage::$$name
1617 );
1718 TableHTML::OutputTdFooter();
1819 TableHTML::OutputTrFooter();
@@ -36,9 +37,9 @@
3637 private static function GetForm() {
3738 return <<<EOF
3839 <form method="post" action="%s">
39-<input type="hidden" name="execute" value="on">
40-<input type="hidden" name="set_objection" value="%s">
41-<input type="image" name="objimage" src="%s" border="0"> %s
40+<input type="hidden" name="execute" value="%s">
41+<input type="hidden" name="%s" value="%s">
42+<input type="image" name="objection_image" src="%s" border="0"> %s
4243 </form>
4344 EOF;
4445 }
--- trunk/include/loader_class.php (revision 2318)
+++ trunk/include/loader_class.php (revision 2319)
@@ -297,7 +297,7 @@
297297 'game_view_message', 'game_view_html_class', 'talk_class', 'icon_class', 'cache_class'],
298298 'game_frame_class' => ['game_message', 'game_frame_html_class'],
299299 'game_up_class' => [
300- 'game_up_message', 'game_up_html_class', 'game_html_class'],
300+ 'game_up_message', 'talk_data_class', 'game_up_html_class', 'game_html_class'],
301301 'game_play_class' => [
302302 'time_config', 'game_play_message', 'game_play_html_class', 'game_play_talk_class',
303303 'session_class', 'image_class', 'talk_class', 'icon_class', 'cache_class'],
--- trunk/include/request/game_play.php (revision 2318)
+++ trunk/include/request/game_play.php (revision 2319)
@@ -12,9 +12,9 @@
1212 Text::EncodePost();
1313 parent::__construct();
1414 $this->ParseGetOn(RequestDataRoom::DEAD, RequestDataRoom::HEAVEN);
15- $this->ParsePostOn('set_objection');
16- $this->ParsePostStr('font_type');
17- $this->ParsePostData('say');
18- $this->last_words = ($this->font_type == 'last_words');
15+ $this->ParsePostOn(RequestDataTalk::OBJECTION);
16+ $this->ParsePostStr(RequestDataTalk::VOICE);
17+ $this->ParsePostData(RequestDataTalk::SENTENCE);
18+ $this->last_words = (TalkVoice::LAST_WORDS == $this->font_type);
1919 }
2020 }
--- trunk/include/role/role_class.php (revision 2318)
+++ trunk/include/role/role_class.php (revision 2319)
@@ -856,6 +856,7 @@
856856 //置換処理
857857 public static function Convert(&$say) {
858858 if ($say == '') return null; //リロード時なら処理スキップ
859+
859860 //文字数・行数チェック
860861 if (Text::Over($say, GameConfig::LIMIT_SAY) ||
861862 substr_count($say, Text::LF) >= GameConfig::LIMIT_SAY_LINE) {
@@ -862,11 +863,15 @@
862863 $say = '';
863864 return false;
864865 }
865- //発言置換モード
866- if (GameConfig::REPLACE_TALK) $say = strtr($say, GameConfig::$replace_talk_list);
867866
867+ if (GameConfig::REPLACE_TALK) { //発言置換モード
868+ $say = strtr($say, GameConfig::$replace_talk_list);
869+ }
870+
868871 //死者・ゲームプレイ中以外なら以降はスキップ
869- if (DB::$SELF->IsDead() || ! DB::$ROOM->IsPlaying()) return null;
872+ if (DB::$SELF->IsDead() || false === DB::$ROOM->IsPlaying()) {
873+ return null;
874+ }
870875 //if (DB::$SELF->IsDead()) return false; //テスト用
871876
872877 $virtual = DB::$SELF->GetVirtual(); //仮想ユーザを取得
--- trunk/include/talk/game_play_talk_class.php (revision 2318)
+++ trunk/include/talk/game_play_talk_class.php (revision 2319)
@@ -21,7 +21,7 @@
2121 //-- 秘密発言判定 --//
2222 if (RQ::Get()->font_type == TalkVoice::SECRET) {
2323 RQ::Set('secret_talk', true);
24- RQ::Set('font_type', TalkVoice::NORMAL); //声の大きさは普通で固定
24+ RQ::Set(RequestDataTalk::VOICE, TalkVoice::NORMAL); //声の大きさは普通で固定
2525 } else {
2626 RQ::Set('secret_talk', false);
2727 }
@@ -31,7 +31,7 @@
3131
3232 //-- 無条件登録 (ゲーム開始前後 > 身代わり君のシステムメッセージ (遺言) > 死者の霊話) --//
3333 $talk = new RoleTalkStruct($say);
34- if (! DB::$ROOM->IsPlaying()) {
34+ if (false === DB::$ROOM->IsPlaying()) {
3535 return RoleTalk::Store($talk, true);
3636 } elseif (RQ::Get()->last_words && DB::$SELF->IsDummyBoy()) {
3737 $talk->Set(TalkStruct::LOCATION, TalkLocation::DUMMY_BOY);
Show on old repository browser