|
@@ -268,12 +268,14 @@ int inter_party_sql_init(void)
|
|
exit(EXIT_FAILURE);
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
}
|
|
|
|
|
|
- /* Uncomment the following if you want to do a party_db cleanup (remove parties with no members) on startup.[Skotlex]
|
|
|
|
- ShowStatus("cleaning party table...\n");
|
|
|
|
- if( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `%s` USING `%s` LEFT JOIN `%s` ON `%s`.leader_id =`%s`.account_id AND `%s`.leader_char = `%s`.char_id WHERE `%s`.account_id IS NULL",
|
|
|
|
- party_db, party_db, char_db, party_db, char_db, party_db, char_db, char_db) )
|
|
|
|
- Sql_ShowDebug(sql_handle);
|
|
|
|
- */
|
|
|
|
|
|
+ // Remove parties with no members on startup from party_db. [Skotlex]
|
|
|
|
+ if (charserv_config.clear_parties) {
|
|
|
|
+ ShowStatus("Cleaning party table...\n");
|
|
|
|
+ if (SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `%s` USING `%s` LEFT JOIN `%s` ON `%s`.leader_id =`%s`.account_id AND `%s`.leader_char = `%s`.char_id WHERE `%s`.account_id IS NULL",
|
|
|
|
+ schema_config.party_db, schema_config.party_db, schema_config.char_db, schema_config.party_db, schema_config.char_db, schema_config.party_db, schema_config.char_db, schema_config.char_db))
|
|
|
|
+ Sql_ShowDebug(sql_handle);
|
|
|
|
+ }
|
|
|
|
+
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|