| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  * Class DBStaticUser | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  | class DBStaticUser extends DBStaticRecord { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  |   public static $_table = 'users'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |   public static $_idField = 'id'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  |   // TODO - это вообще-то надо хранить в конфигурации | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  |   /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  |    * @return string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  |    */ | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 16 |  |  |   public static function getLastRegisteredUserName() { | 
            
                                                                        
                            
            
                                    
            
            
                | 17 |  |  |     $query = | 
            
                                                                        
                            
            
                                    
            
            
                | 18 |  |  |       static::buildDBQ() | 
            
                                                                        
                            
            
                                    
            
            
                | 19 |  |  |         ->field('username') | 
            
                                                                        
                            
            
                                    
            
            
                | 20 |  |  |         ->where('`user_as_ally` IS NULL') | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 21 |  |  |         ->orderBy(array('`id` DESC')); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  |     return (string)static::$dbStatic->doStmtSelectValue($query); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  |   protected static function whereNotAlly() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  |   /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  |    * @return DbResultIterator | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  |    */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  |   public static function db_player_list_export_blitz_info() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  |     return static::$dbStatic->doStmtSelectIterator( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  |       static::buildDBQ() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  |         ->fields(array('id', 'username', 'total_rank', 'total_points', 'onlinetime',)) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |         ->where('`user_as_ally` IS NULL') | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  |         ->orderBy(array('`id`')) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  |     ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  |   /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  |    * @return DbResultIterator | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  |    */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |   public static function db_user_list_non_bots() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  | //    $query = doquery("SELECT `id` FROM {{users}} WHERE `user_as_ally` IS NULL AND `user_bot` = " . USER_BOT_PLAYER . " FOR UPDATE;"); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  |     $query = | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  |       static::buildDBQ() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  |         ->field('id') | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  |         ->where("`user_as_ally` IS NULL") | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  |         ->where("`user_bot` = " . USER_BOT_PLAYER) | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  |         ->setForUpdate(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  |     return static::$dbStatic->doStmtSelectIterator($query); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 |  |  |   public static function db_user_lock_with_target_owner_and_acs($user, $planet = array()) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  |     $query = "SELECT 1 FROM `{{users}}` WHERE `id` = " . idval($user['id']) . | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 |  |  |       (!empty($planet['id_owner']) ? ' OR `id` = ' . idval($planet['id_owner']) : '') | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 |  |  |     . " FOR UPDATE" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  |     ; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  |     static::$dbStatic->doquery($query); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  |   /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 |  |  |    * @param bool $online | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 |  |  |    * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 70 |  |  |    * @return int | 
            
                                                                                                            
                            
            
                                    
            
            
                | 71 |  |  |    */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 72 |  |  |   public static function db_user_count($online = false) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 73 |  |  |     return intval(static::$dbStatic->doQueryFetchValue( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 74 |  |  |       'SELECT COUNT(`id`) AS `user_count` FROM `{{users}}` WHERE `user_as_ally` IS NULL' . ($online ? ' AND `onlinetime` > ' . (SN_TIME_NOW - classSupernova::$config->game_users_online_timeout) : '') | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 |  |  |     )); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 |  |  |   public static function db_user_list_admin_sorted($sort, $online = false) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 |  |  | //    $query = "SELECT | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 |  |  | //          u.*, COUNT(r.id) AS referral_count, SUM(r.dark_matter) AS referral_dm | 
            
                                                                                                            
                            
            
                                    
            
            
                | 81 |  |  | //      FROM | 
            
                                                                                                            
                            
            
                                    
            
            
                | 82 |  |  | //          {{users}} as u | 
            
                                                                                                            
                            
            
                                    
            
            
                | 83 |  |  | //          LEFT JOIN | 
            
                                                                                                            
                            
            
                                    
            
            
                | 84 |  |  | //              {{referrals}} as r on r.id_partner = u.id | 
            
                                                                                                            
                            
            
                                    
            
            
                | 85 |  |  | //      WHERE " . | 
            
                                                                                                            
                            
            
                                    
            
            
                | 86 |  |  | //      ($online ? "`onlinetime` >= :onlineTime" : 'user_as_ally IS NULL') . | 
            
                                                                                                            
                            
            
                                    
            
            
                | 87 |  |  | //      " GROUP BY u.id | 
            
                                                                                                            
                            
            
                                    
            
            
                | 88 |  |  | //        ORDER BY user_as_ally, {$sort} ASC"; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 89 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 90 |  |  |     $query = static::buildDBQ() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 91 |  |  |       ->setAlias('u') | 
            
                                                                                                            
                            
            
                                    
            
            
                | 92 |  |  |       ->field('u.*') | 
            
                                                                                                            
                            
            
                                    
            
            
                | 93 |  |  |       ->fieldCount('r.id', 'referral_count') | 
            
                                                                                                            
                            
            
                                    
            
            
                | 94 |  |  |       ->fieldSingleFunction('sum', 'r.dark_matter', 'referral_dm') | 
            
                                                                                                            
                            
            
                                    
            
            
                | 95 |  |  |       ->join('LEFT JOIN {{referrals}} as r on r.id_partner = u.id') | 
            
                                                                                                            
                            
            
                                    
            
            
                | 96 |  |  |       ->where($online ? "`onlinetime` >= " . intval(SN_TIME_NOW - classSupernova::$config->game_users_online_timeout) : 'user_as_ally IS NULL') | 
                            
                    |  |  |  | 
                                                                                        
                                                                                            
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 97 |  |  |       ->groupBy('u.id') | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 98 |  |  |       ->orderBy("user_as_ally, {$sort} ASC") | 
            
                                                                                                            
                            
            
                                    
            
            
                | 99 |  |  |     ; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 100 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 101 |  |  |     $result = static::$dbStatic->doStmtSelectIterator($query); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 102 |  |  |     return $result; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 103 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 104 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 105 |  |  |   public static function db_user_list_to_celebrate($config_user_birthday_range) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 106 |  |  |     $query = static::buildDBQ() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 107 |  |  |       ->field('id', 'username', 'user_birthday', 'user_birthday_celebrated') | 
            
                                                                                                            
                            
            
                                    
            
            
                | 108 |  |  |       ->fieldLiteral('CONCAT(YEAR(CURRENT_DATE), DATE_FORMAT(`user_birthday`, \'-%m-%d\')) AS `current_birthday`') | 
            
                                                                                                            
                            
            
                                    
            
            
                | 109 |  |  |       ->fieldLiteral('DATEDIFF(CURRENT_DATE, CONCAT(YEAR(CURRENT_DATE), DATE_FORMAT(`user_birthday`, \'-%m-%d\'))) AS `days_after_birthday`') | 
            
                                                                                                            
                            
            
                                    
            
            
                | 110 |  |  |       ->where('`user_birthday` IS NOT NULL') | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 111 |  |  |       ->where('(`user_birthday_celebrated` IS NULL OR DATE_ADD(`user_birthday_celebrated`, INTERVAL 1 YEAR) < CURRENT_DATE)') | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 112 |  |  |       ->where('`user_as_ally` IS NULL') | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 113 |  |  |       ->having('`days_after_birthday` >= 0') | 
            
                                                                                                            
                            
            
                                    
            
            
                | 114 |  |  |       ->having('`days_after_birthday` < ' . intval($config_user_birthday_range)) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 115 |  |  |       ->setForUpdate() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 116 |  |  |     ; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 117 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 118 |  |  |     $result = static::$dbStatic->doStmtSelectIterator($query); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 119 |  |  | // | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 120 |  |  | //    $query = "SELECT | 
            
                                                                                                            
                            
            
                                    
            
            
                | 121 |  |  | //        `id`, `username`, `user_birthday`, `user_birthday_celebrated`, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 122 |  |  | //        CONCAT(YEAR(CURRENT_DATE), DATE_FORMAT(`user_birthday`, '-%m-%d')) AS `current_birthday`, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 123 |  |  | //        DATEDIFF(CURRENT_DATE, CONCAT(YEAR(CURRENT_DATE), DATE_FORMAT(`user_birthday`, '-%m-%d'))) AS `days_after_birthday` | 
            
                                                                                                            
                            
            
                                    
            
            
                | 124 |  |  | //      FROM | 
            
                                                                                                            
                            
            
                                    
            
            
                | 125 |  |  | //        `{{users}}` | 
            
                                                                                                            
                            
            
                                    
            
            
                | 126 |  |  | //      WHERE | 
            
                                                                                                            
                            
            
                                    
            
            
                | 127 |  |  | //        `user_birthday` IS NOT NULL | 
            
                                                                                                            
                            
            
                                    
            
            
                | 128 |  |  | //        AND `user_as_ally` IS NULL | 
            
                                                                                                            
                            
            
                                    
            
            
                | 129 |  |  | //        AND (`user_birthday_celebrated` IS NULL OR DATE_ADD(`user_birthday_celebrated`, INTERVAL 1 YEAR) < CURRENT_DATE) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 130 |  |  | //      HAVING | 
            
                                                                                                            
                            
            
                                    
            
            
                | 131 |  |  | //        `days_after_birthday` >= 0 AND `days_after_birthday` < {$config_user_birthday_range} FOR UPDATE"; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 132 |  |  | // | 
            
                                                                                                            
                            
            
                                    
            
            
                | 133 |  |  | //    $result = static::$dbStatic->doQueryIterator($query); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 134 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 135 |  |  |     return $result; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 136 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 137 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 138 |  |  |   /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 139 |  |  |    * @return DbEmptyIterator|DbMysqliResultIterator | 
            
                                                                                                            
                            
            
                                    
            
            
                | 140 |  |  |    */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 141 |  |  |   public static function db_user_list_admin_multiaccounts() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 142 |  |  |     $query = "SELECT COUNT(*) AS `ip_count`, `user_lastip` | 
            
                                                                                                            
                            
            
                                    
            
            
                | 143 |  |  |       FROM `{{users}}` | 
            
                                                                                                            
                            
            
                                    
            
            
                | 144 |  |  |       WHERE `user_as_ally` IS NULL | 
            
                                                                                                            
                            
            
                                    
            
            
                | 145 |  |  |       GROUP BY `user_lastip` | 
            
                                                                                                            
                            
            
                                    
            
            
                | 146 |  |  |       HAVING COUNT(*) > 1"; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 147 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 148 |  |  |     return static::$dbStatic->doQueryIterator($query); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 149 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 150 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 151 |  |  |   public static function db_player_list_blitz_delete_players() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 152 |  |  |     doquery("DELETE FROM `{{users}}` WHERE username LIKE 'Игрок%';"); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 153 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 154 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 155 |  |  |   public static function db_player_list_blitz_set_50k_dm() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 156 |  |  |     doquery('UPDATE `{{users}}` SET dark_matter = 50000, dark_matter_total = 50000;'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 157 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 158 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 159 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 160 |  |  |   /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 161 |  |  |    * Выбирает записи игроков по списку их ID | 
            
                                                                                                            
                            
            
                                    
            
            
                | 162 |  |  |    * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 163 |  |  |    * @param $user_id_list | 
            
                                                                                                            
                            
            
                                    
            
            
                | 164 |  |  |    * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 165 |  |  |    * @return array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 166 |  |  |    */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 167 |  |  |   public static function db_user_list_by_id($user_id_list) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 168 |  |  |     !is_array($user_id_list) ? $user_id_list = array($user_id_list) : false; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 169 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 170 |  |  |     $user_list = array(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 171 |  |  |     foreach ($user_id_list as $user_id_unsafe) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 172 |  |  |       $user = DBStaticUser::db_user_by_id($user_id_unsafe); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 173 |  |  |       !empty($user) ? $user_list[$user_id_unsafe] = $user : false; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 174 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 175 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 176 |  |  |     return $user_list; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 177 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 178 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 179 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 180 |  |  |   public static function db_user_by_username($username_unsafe, $for_update = false, $fields = '*', $player = null, $like = false) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 181 |  |  |     return classSupernova::db_get_user_by_username($username_unsafe, $for_update, $fields, $player, $like); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 182 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 183 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 184 |  |  |   public static function db_user_list($user_filter = '', $for_update = false, $fields = '*') { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                            
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 185 |  |  |     return classSupernova::db_get_record_list(LOC_USER, $user_filter); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 186 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 187 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 188 |  |  |   public static function db_user_set_by_id($user_id, $set) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 189 |  |  |     return classSupernova::db_upd_record_by_id(LOC_USER, $user_id, $set); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 190 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 191 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 192 |  |  |   public static function db_user_by_id($user_id_unsafe, $for_update = false, $fields = '*', $player = null) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 193 |  |  |     return classSupernova::db_get_user_by_id($user_id_unsafe, $for_update, $fields, $player); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 194 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 195 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 196 |  |  |   public static function db_user_list_set_mass_mail(&$owners_list, $set) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 197 |  |  |     return classSupernova::db_upd_record_list(LOC_USER, !empty($owners_list) ? '`id` IN (' . implode(',', $owners_list) . ');' : '', $set); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 198 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 199 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 200 |  |  |   public static function db_user_list_set_by_ally_and_rank($ally_id, $ally_rank_id, $set) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 201 |  |  |     return classSupernova::db_upd_record_list(LOC_USER, "`ally_id`={$ally_id} AND `ally_rank_id` >= {$ally_rank_id}", $set); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 202 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 203 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 204 |  |  |   public static function db_user_list_set_ally_deprecated_convert_ranks($ally_id, $i, $rank_id) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 205 |  |  |     return classSupernova::db_upd_record_list(LOC_USER, "`ally_id` = {$ally_id} AND `ally_rank_id`={$rank_id}", "`ally_rank_id` = {$i}"); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 206 |  |  |   } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 207 |  |  |  | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 208 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 209 |  |  |  | 
            
                        
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: