UserDB::Insert()
@@ -271,8 +271,8 @@ | ||
271 | 271 | 'uname' => GM::DUMMY_BOY, |
272 | 272 | 'handle_name' => $dummy_boy_handle_name, |
273 | 273 | 'password' => $dummy_boy_password, |
274 | + 'icon_no' => RQ::Get()->gerd ? UserIconConfig::GERD : 0, | |
274 | 275 | 'sex' => Sex::MALE, |
275 | - 'icon_no' => RQ::Get()->gerd ? UserIconConfig::GERD : 0, | |
276 | 276 | 'profile' => Message::DUMMY_BOY_PROFILE, |
277 | 277 | 'last_words' => Message::DUMMY_BOY_LAST_WORDS |
278 | 278 | ]; |
@@ -66,26 +66,17 @@ | ||
66 | 66 | |
67 | 67 | //ユーザ登録処理 |
68 | 68 | public static function Insert(array $list) { |
69 | - extract($list); | |
70 | - $crypt_password = Text::Crypt($password); | |
71 | - $items = 'room_no, user_no, uname, handle_name, icon_no, sex, password, live'; | |
72 | - $values = "{$room_no}, {$user_no}, '{$uname}', '{$handle_name}', {$icon_no}, '{$sex}', " . | |
73 | - "'{$crypt_password}', 'live'"; | |
74 | - | |
75 | - if ($uname != GM::DUMMY_BOY) { | |
76 | - $session_id = Session::GetUniqID(); | |
77 | - $ip_address = Security::GetIP(); | |
78 | - $last_load_scene = RoomScene::BEFORE; | |
69 | + $list['live'] = UserLive::LIVE; | |
70 | + $list['password'] = Text::Crypt($list['password']); | |
71 | + if ($list['uname'] != GM::DUMMY_BOY) { | |
72 | + $list['session_id'] = Session::GetUniqID(); | |
73 | + $list['ip_address'] = Security::GetIP(); | |
74 | + $list['last_load_scene'] = RoomScene::BEFORE; | |
79 | 75 | } |
76 | + $query = Query::Init()->Table('user_entry')->Insert()->Into(array_keys($list)); | |
80 | 77 | |
81 | - $stack = ['profile', 'role', 'session_id', 'last_words', 'ip_address', 'last_load_scene']; | |
82 | - foreach ($stack as $value) { | |
83 | - if (isset($$value)) { | |
84 | - $items .= ", {$value}"; | |
85 | - $values .= ", '{$$value}'"; | |
86 | - } | |
87 | - } | |
88 | - return DB::Insert('user_entry', $items, $values); | |
78 | + DB::Prepare($query->Build(), array_values($list)); | |
79 | + return DB::Execute(); | |
89 | 80 | } |
90 | 81 | |
91 | 82 | //更新処理 (汎用) |