• R/O
  • SSH
  • HTTPS

jinrousiki: Commit


Commit MetaInfo

Revision2714 (tree)
Time2021-05-29 21:33:07
Authorumethyl

Log Message

RoomManagerController::StoreInChange()

Change Summary

Incremental Difference

--- trunk/include/controller/room_manager_class.php (revision 2713)
+++ trunk/include/controller/room_manager_class.php (revision 2714)
@@ -86,46 +86,13 @@
8686 $option_role = RoomOption::Get(OptionGroup::ROLE);
8787 //self::p(); //テスト用
8888
89+ //-- 登録処理 --//
8990 if (true === RQ::Get()->change_room) { //オプション変更
90- RoomOption::LoadPost('close_room');
91- if (RQ::Get()->gm_logout) { //GM ログアウト処理
92- if (DB::$ROOM->IsClosing() || RQ::Get()->close_room == RoomStatus::CLOSING) {
93- RoomManagerHTML::OutputResult('gm_logout');
94- } elseif (false === UserDB::LogoutGM()) {
95- RoomManagerHTML::OutputResult('busy');
96- }
97- }
98- $list = [
99- 'name' => RQ::Get()->room_name,
100- 'comment' => RQ::Get()->room_comment,
101- 'max_user' => RQ::Get()->max_user,
102- 'game_option' => $game_option,
103- 'option_role' => $option_role,
104- 'status' => RQ::Get()->close_room ? RoomStatus::CLOSING : RoomStatus::WAITING
105- ];
106- if (false === RoomManagerDB::Update($list)) {
107- RoomManagerHTML::OutputResult('busy');
108- }
109-
110- //システムメッセージ
111- $str = Message::SYSTEM . Message::COLON . RoomManagerMessage::CHANGE;
112- RoomTalk::StoreBeforeGame($str, DB::$SELF);
113-
114- //投票リセット処理 (募集停止のみが変更されている場合はスキップ)
115- if (DB::$ROOM->status == $list['status'] ||
116- DB::$ROOM->game_option->row != $game_option ||
117- DB::$ROOM->option_role->row != $option_role) {
118- if (false === RoomDB::UpdateVoteCount()) {
119- RoomManagerHTML::OutputResult('busy');
120- }
121- }
122- DB::Commit();
123-
91+ self::StoreInChange();
12492 $str = HTML::GenerateCloseWindow(RoomManagerMessage::CHANGE);
12593 HTML::OutputResult(RoomManagerMessage::TITLE_CHANGE, $str);
12694 }
12795
128- //-- 登録処理 --//
12996 $room_no = RoomManagerDB::GetNext(); //村番号を取得
13097 if (false === ServerConfig::DRY_RUN) {
13198 if (false === RoomManagerDB::Insert($room_no, $game_option, $option_role)) { //村作成
@@ -335,6 +302,46 @@
335302 }
336303 }
337304
305+ //村作成情報登録 (オプション変更時)
306+ private static function StoreInChange() {
307+ RoomOption::LoadPost('close_room');
308+ if (RQ::Get()->gm_logout) { //GM ログアウト処理
309+ if (DB::$ROOM->IsClosing() || RQ::Get()->close_room == RoomStatus::CLOSING) {
310+ RoomManagerHTML::OutputResult('gm_logout');
311+ } elseif (false === UserDB::LogoutGM()) {
312+ RoomManagerHTML::OutputResult('busy');
313+ }
314+ }
315+
316+ $game_option = RoomOption::Get(OptionGroup::GAME);
317+ $option_role = RoomOption::Get(OptionGroup::ROLE);
318+ $list = [
319+ 'name' => RQ::Get()->room_name,
320+ 'comment' => RQ::Get()->room_comment,
321+ 'max_user' => RQ::Get()->max_user,
322+ 'game_option' => $game_option,
323+ 'option_role' => $option_role,
324+ 'status' => RQ::Get()->close_room ? RoomStatus::CLOSING : RoomStatus::WAITING
325+ ];
326+ if (false === RoomManagerDB::Update($list)) {
327+ RoomManagerHTML::OutputResult('busy');
328+ }
329+
330+ //システムメッセージ
331+ $str = Message::SYSTEM . Message::COLON . RoomManagerMessage::CHANGE;
332+ RoomTalk::StoreBeforeGame($str, DB::$SELF);
333+
334+ //投票リセット処理 (募集停止のみが変更されている場合はスキップ)
335+ if (DB::$ROOM->status == $list['status'] ||
336+ DB::$ROOM->game_option->row != $game_option ||
337+ DB::$ROOM->option_role->row != $option_role) {
338+ if (false === RoomDB::UpdateVoteCount()) {
339+ RoomManagerHTML::OutputResult('busy');
340+ }
341+ }
342+ DB::Commit();
343+ }
344+
338345 //テスト用結果表示
339346 private static function p() {
340347 if (true !== ServerConfig::DEBUG_MODE) { //スキップ判定
Show on old repository browser