mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-04 00:40:26 +00:00
update
This commit is contained in:
+6
-1
@@ -1,6 +1,6 @@
|
||||
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
||||
-------------------------------------------------------
|
||||
== 02/13/2014 ==
|
||||
== 02/14/2014 ==
|
||||
Kayen: Fixes for buffs not fading under certain conditions in revised numhits system, and other fixes.
|
||||
Kayen: Implemented support for spell_new field CastRestrictions (limits what type of targets spells can effect).
|
||||
*A detailed list describing what the values used in this field do can be found in Mob::PassCastRestriction*
|
||||
@@ -9,6 +9,11 @@ Kayen: Implemented support for spell_new field not_reflectable, no_partial_resis
|
||||
Required SQL: utils/sql/git/2014_02_13_spells_new_updates.sql
|
||||
Names many unknown fields in the table.
|
||||
|
||||
== 02/13/2014 ==
|
||||
Sorvani: Renamed the instance_lockout and instance_lockout_player tables to instance_list and instance_list_player. Cleaned up the Database::GetUnusedInstanceID logic.
|
||||
|
||||
Required SQL: utils/sql/git/2014_02_13_Rename_instance_lockout_tables.sql
|
||||
|
||||
== 02/10/2014 ==
|
||||
demonstar55 (Secrets): Re-wrote the entity list to be a std::map. This should be used for direct entityID lookups and is noticably faster performance-wise. Also should result in less nil pointers potentially.
|
||||
Secrets: Fixed a crash issue that could occur on #repop related to quest timers.
|
||||
|
||||
+35
-74
@@ -668,7 +668,7 @@ bool Database::DeleteCharacter(char *name)
|
||||
#if DEBUG >= 5
|
||||
printf(" instances");
|
||||
#endif
|
||||
RunQuery(query, MakeAnyLenString(&query, "DELETE FROM instance_lockout_player WHERE charid='%d'", charid), errbuf, nullptr, &affected_rows);
|
||||
RunQuery(query, MakeAnyLenString(&query, "DELETE FROM instance_list_player WHERE charid='%d'", charid), errbuf, nullptr, &affected_rows);
|
||||
if(query)
|
||||
{
|
||||
safe_delete_array(query);
|
||||
@@ -2278,7 +2278,7 @@ bool Database::VerifyZoneInstance(uint32 zone_id, uint16 instance_id)
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT id FROM instance_lockout where id=%u AND zone=%u",
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT id FROM instance_list where id=%u AND zone=%u",
|
||||
instance_id, zone_id), errbuf, &result))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
@@ -2308,7 +2308,7 @@ bool Database::CharacterInInstanceGroup(uint16 instance_id, uint32 char_id)
|
||||
MYSQL_RES *result;
|
||||
bool lockout_instance_player = false;
|
||||
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT charid FROM instance_lockout_player where id=%u AND charid=%u",
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT charid FROM instance_list_player where id=%u AND charid=%u",
|
||||
instance_id, char_id), errbuf, &result))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
@@ -2330,10 +2330,10 @@ void Database::DeleteInstance(uint16 instance_id)
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
|
||||
RunQuery(query, MakeAnyLenString(&query, "DELETE FROM instance_lockout WHERE id=%u", instance_id), errbuf);
|
||||
RunQuery(query, MakeAnyLenString(&query, "DELETE FROM instance_list WHERE id=%u", instance_id), errbuf);
|
||||
safe_delete_array(query);
|
||||
|
||||
RunQuery(query, MakeAnyLenString(&query, "DELETE FROM instance_lockout_player WHERE id=%u", instance_id), errbuf);
|
||||
RunQuery(query, MakeAnyLenString(&query, "DELETE FROM instance_list_player WHERE id=%u", instance_id), errbuf);
|
||||
safe_delete_array(query);
|
||||
|
||||
RunQuery(query, MakeAnyLenString(&query, "DELETE FROM respawn_times WHERE instance_id=%u", instance_id), errbuf);
|
||||
@@ -2354,7 +2354,7 @@ bool Database::CheckInstanceExpired(uint16 instance_id)
|
||||
int32 start_time = 0;
|
||||
int32 duration = 0;
|
||||
uint32 never_expires = 0;
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT start_time, duration, never_expires FROM instance_lockout WHERE id=%u",
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT start_time, duration, never_expires FROM instance_list WHERE id=%u",
|
||||
instance_id), errbuf, &result))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
@@ -2400,7 +2400,7 @@ uint32 Database::ZoneIDFromInstanceID(uint16 instance_id)
|
||||
MYSQL_ROW row;
|
||||
uint32 ret;
|
||||
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT zone FROM instance_lockout where id=%u", instance_id),
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT zone FROM instance_list where id=%u", instance_id),
|
||||
errbuf, &result))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
@@ -2433,7 +2433,7 @@ uint32 Database::VersionFromInstanceID(uint16 instance_id)
|
||||
MYSQL_ROW row;
|
||||
uint32 ret;
|
||||
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT version FROM instance_lockout where id=%u", instance_id),
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT version FROM instance_list where id=%u", instance_id),
|
||||
errbuf, &result))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
@@ -2468,7 +2468,7 @@ uint32 Database::GetTimeRemainingInstance(uint16 instance_id, bool &is_perma)
|
||||
uint32 duration = 0;
|
||||
uint32 never_expires = 0;
|
||||
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT start_time, duration, never_expires FROM instance_lockout WHERE id=%u",
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT start_time, duration, never_expires FROM instance_list WHERE id=%u",
|
||||
instance_id), errbuf, &result))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
@@ -2516,68 +2516,29 @@ bool Database::GetUnusedInstanceID(uint16 &instance_id)
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT COUNT(*) FROM instance_lockout"), errbuf, &result))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
if (mysql_num_rows(result) != 0)
|
||||
{
|
||||
row = mysql_fetch_row(result);
|
||||
int count = atoi(row[0]);
|
||||
if(count == 0)
|
||||
{
|
||||
mysql_free_result(result);
|
||||
instance_id = RuleI(Zone, ReservedInstances) + 1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mysql_free_result(result);
|
||||
}
|
||||
mysql_free_result(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
safe_delete_array(query);
|
||||
instance_id = 0;
|
||||
return false;
|
||||
}
|
||||
uint32 count = RuleI(Zone, ReservedInstances) + 1;
|
||||
uint32 max = 65535;
|
||||
|
||||
int32 count = RuleI(Zone, ReservedInstances) + 1;
|
||||
int32 max = 65535;
|
||||
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT id FROM instance_lockout where id >= %i ORDER BY id", count), errbuf, &result))
|
||||
{
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT id FROM instance_list where id >= %i ORDER BY id", count), errbuf, &result)) {
|
||||
safe_delete_array(query);
|
||||
if (mysql_num_rows(result) != 0)
|
||||
{
|
||||
while((row = mysql_fetch_row(result)))
|
||||
{
|
||||
if(count < atoi(row[0]))
|
||||
{
|
||||
if (mysql_num_rows(result) != 0) {
|
||||
while((row = mysql_fetch_row(result))) {
|
||||
if(count < atoi(row[0])) {
|
||||
instance_id = count;
|
||||
mysql_free_result(result);
|
||||
return true;
|
||||
}
|
||||
else if(count > max)
|
||||
{
|
||||
} else if(count > max) {
|
||||
instance_id = 0;
|
||||
mysql_free_result(result);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
mysql_free_result(result);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
safe_delete_array(query);
|
||||
}
|
||||
instance_id = count;
|
||||
@@ -2590,7 +2551,7 @@ bool Database::CreateInstance(uint16 instance_id, uint32 zone_id, uint32 version
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
|
||||
if(RunQuery(query, MakeAnyLenString(&query, "INSERT INTO instance_lockout (id, zone, version, start_time, duration)"
|
||||
if(RunQuery(query, MakeAnyLenString(&query, "INSERT INTO instance_list (id, zone, version, start_time, duration)"
|
||||
" values(%lu, %lu, %lu, UNIX_TIMESTAMP(), %lu)", (unsigned long)instance_id, (unsigned long)zone_id, (unsigned long)version, (unsigned long)duration), errbuf))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
@@ -2611,7 +2572,7 @@ void Database::PurgeExpiredInstances()
|
||||
MYSQL_ROW row;
|
||||
|
||||
uint16 id = 0;
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT id FROM instance_lockout where "
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT id FROM instance_list where "
|
||||
"(start_time+duration) <= UNIX_TIMESTAMP() and never_expires = 0"), errbuf, &result))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
@@ -2638,7 +2599,7 @@ bool Database::AddClientToInstance(uint16 instance_id, uint32 char_id)
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
|
||||
if(RunQuery(query, MakeAnyLenString(&query, "INSERT INTO instance_lockout_player(id, charid) "
|
||||
if(RunQuery(query, MakeAnyLenString(&query, "INSERT INTO instance_list_player(id, charid) "
|
||||
"values(%lu, %lu)", (unsigned long)instance_id, (unsigned long)char_id), errbuf))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
@@ -2656,7 +2617,7 @@ bool Database::RemoveClientFromInstance(uint16 instance_id, uint32 char_id)
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
|
||||
if(RunQuery(query, MakeAnyLenString(&query, "DELETE FROM instance_lockout_player WHERE id=%lu AND charid=%lu",
|
||||
if(RunQuery(query, MakeAnyLenString(&query, "DELETE FROM instance_list_player WHERE id=%lu AND charid=%lu",
|
||||
(unsigned long)instance_id, (unsigned long)char_id), errbuf))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
@@ -2674,7 +2635,7 @@ bool Database::RemoveClientsFromInstance(uint16 instance_id)
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
|
||||
if(RunQuery(query, MakeAnyLenString(&query, "DELETE FROM instance_lockout_player WHERE id=%lu",
|
||||
if(RunQuery(query, MakeAnyLenString(&query, "DELETE FROM instance_list_player WHERE id=%lu",
|
||||
(unsigned long)instance_id), errbuf))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
@@ -2693,7 +2654,7 @@ bool Database::CheckInstanceExists(uint16 instance_id)
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT * FROM instance_lockout where id=%u", instance_id),
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT * FROM instance_list where id=%u", instance_id),
|
||||
errbuf, &result))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
@@ -2738,7 +2699,7 @@ uint16 Database::GetInstanceVersion(uint16 instance_id)
|
||||
MYSQL_ROW row;
|
||||
uint32 ret;
|
||||
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT version FROM instance_lockout where id=%u", instance_id),
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT version FROM instance_list where id=%u", instance_id),
|
||||
errbuf, &result))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
@@ -2771,9 +2732,9 @@ uint16 Database::GetInstanceID(const char* zone, uint32 charid, int16 version)
|
||||
MYSQL_ROW row;
|
||||
uint16 ret;
|
||||
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT instance_lockout.id FROM instance_lockout, instance_lockout_player "
|
||||
"WHERE instance_lockout.zone=%u AND instance_lockout.version=%u AND instance_lockout.id=instance_lockout_player.id AND "
|
||||
"instance_lockout_player.charid=%u LIMIT 1;", GetZoneID(zone), version, charid, charid), errbuf, &result))
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT instance_list.id FROM instance_list, instance_list_player "
|
||||
"WHERE instance_list.zone=%u AND instance_list.version=%u AND instance_list.id=instance_list_player.id AND "
|
||||
"instance_list_player.charid=%u LIMIT 1;", GetZoneID(zone), version, charid, charid), errbuf, &result))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
if (mysql_num_rows(result) != 0)
|
||||
@@ -2808,9 +2769,9 @@ uint16 Database::GetInstanceID(uint32 zone, uint32 charid, int16 version)
|
||||
MYSQL_ROW row;
|
||||
uint16 ret;
|
||||
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT instance_lockout.id FROM instance_lockout, instance_lockout_player "
|
||||
"WHERE instance_lockout.zone=%u AND instance_lockout.version=%u AND instance_lockout.id=instance_lockout_player.id AND "
|
||||
"instance_lockout_player.charid=%u LIMIT 1;", zone, version, charid), errbuf, &result))
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT instance_list.id FROM instance_list, instance_list_player "
|
||||
"WHERE instance_list.zone=%u AND instance_list.version=%u AND instance_list.id=instance_list_player.id AND "
|
||||
"instance_list_player.charid=%u LIMIT 1;", zone, version, charid), errbuf, &result))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
if (mysql_num_rows(result) != 0)
|
||||
@@ -2840,7 +2801,7 @@ void Database::GetCharactersInInstance(uint16 instance_id, std::list<uint32> &ch
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT charid FROM instance_lockout_player WHERE id=%u", instance_id), errbuf, &result)) {
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT charid FROM instance_list_player WHERE id=%u", instance_id), errbuf, &result)) {
|
||||
safe_delete_array(query);
|
||||
while ((row = mysql_fetch_row(result)))
|
||||
{
|
||||
@@ -2950,7 +2911,7 @@ void Database::SetInstanceDuration(uint16 instance_id, uint32 new_duration)
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
|
||||
if(RunQuery(query, MakeAnyLenString(&query, "UPDATE `instance_lockout` SET start_time=UNIX_TIMESTAMP(), "
|
||||
if(RunQuery(query, MakeAnyLenString(&query, "UPDATE `instance_list` SET start_time=UNIX_TIMESTAMP(), "
|
||||
"duration=%u WHERE id=%u", new_duration, instance_id), errbuf))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
@@ -2970,7 +2931,7 @@ bool Database::GlobalInstance(uint16 instance_id)
|
||||
MYSQL_ROW row;
|
||||
bool ret;
|
||||
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT is_global from instance_lockout where id=%u LIMIT 1", instance_id), errbuf, &result))
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT is_global from instance_list where id=%u LIMIT 1", instance_id), errbuf, &result))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
row = mysql_fetch_row(result);
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
-- rename the instance_lockout tables to instance_list. They have nothing to do with lockouts.
|
||||
ALTER TABLE `instance_lockout` RENAME TO `instance_list` ;
|
||||
ALTER TABLE `instance_lockout_player` RENAME TO `instance_list_player` ;
|
||||
@@ -46,6 +46,12 @@ void QuestParserCollection::RegisterQuestInterface(QuestInterface *qi, std::stri
|
||||
_load_precedence.push_back(qi);
|
||||
}
|
||||
|
||||
void QuestParserCollection::ClearInterfaces() {
|
||||
_interfaces.clear();
|
||||
_extensions.clear();
|
||||
_load_precedence.clear();
|
||||
}
|
||||
|
||||
void QuestParserCollection::AddVar(std::string name, std::string val) {
|
||||
std::list<QuestInterface*>::iterator iter = _load_precedence.begin();
|
||||
while(iter != _load_precedence.end()) {
|
||||
|
||||
@@ -39,7 +39,8 @@ public:
|
||||
~QuestParserCollection();
|
||||
|
||||
void RegisterQuestInterface(QuestInterface *qi, std::string ext);
|
||||
|
||||
void UnRegisterQuestInterface(QuestInterface *qi, std::string ext);
|
||||
void ClearInterfaces();
|
||||
void AddVar(std::string name, std::string val);
|
||||
void Init();
|
||||
void ReloadQuests(bool reset_timers = true);
|
||||
|
||||
+1
-1
@@ -16313,7 +16313,7 @@ void EntityList::ShowSpawnWindow(Client* client, int Distance, bool NamedOnly) {
|
||||
std::string WindowText;
|
||||
int LastCon = -1;
|
||||
int CurrentCon = 0;
|
||||
Mob* curMob = NULL;
|
||||
Mob* curMob = nullptr;
|
||||
|
||||
uint32 array_counter = 0;
|
||||
|
||||
|
||||
+10
-6
@@ -268,6 +268,9 @@ Mob *HateList::GetTop(Mob *center)
|
||||
Mob* top = nullptr;
|
||||
int32 hate = -1;
|
||||
|
||||
if(center == nullptr)
|
||||
return nullptr;
|
||||
|
||||
if (RuleB(Aggro,SmartAggroList)){
|
||||
Mob* topClientTypeInRange = nullptr;
|
||||
int32 hateClientTypeInRange = -1;
|
||||
@@ -380,15 +383,15 @@ Mob *HateList::GetTop(Mob *center)
|
||||
}
|
||||
|
||||
if(!isTopClientType)
|
||||
return topClientTypeInRange;
|
||||
return topClientTypeInRange ? topClientTypeInRange : nullptr;
|
||||
|
||||
return top;
|
||||
return top ? top : nullptr;
|
||||
}
|
||||
else {
|
||||
if(top == nullptr && skipped_count > 0) {
|
||||
return center->GetTarget();
|
||||
return center->GetTarget() ? center->GetTarget() : nullptr;
|
||||
}
|
||||
return top;
|
||||
return top ? top : nullptr;
|
||||
}
|
||||
}
|
||||
else{
|
||||
@@ -413,10 +416,11 @@ Mob *HateList::GetTop(Mob *center)
|
||||
++iterator;
|
||||
}
|
||||
if(top == nullptr && skipped_count > 0) {
|
||||
return center->GetTarget();
|
||||
return center->GetTarget() ? center->GetTarget() : nullptr;
|
||||
}
|
||||
return top;
|
||||
return top ? top : nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Mob *HateList::GetMostHate(){
|
||||
|
||||
+3
-1
@@ -476,6 +476,8 @@ int main(int argc, char** argv) {
|
||||
|
||||
entity_list.Clear();
|
||||
|
||||
parse->ClearInterfaces();
|
||||
|
||||
#ifdef EMBPERL
|
||||
safe_delete(perl_parser);
|
||||
#endif
|
||||
@@ -496,7 +498,7 @@ int main(int argc, char** argv) {
|
||||
dbasync->StopThread();
|
||||
safe_delete(taskmanager);
|
||||
command_deinit();
|
||||
|
||||
safe_delete(parse);
|
||||
CheckEQEMuErrorAndPause();
|
||||
_log(ZONE__INIT, "Proper zone shutdown complete.");
|
||||
return 0;
|
||||
|
||||
+3
-3
@@ -2484,9 +2484,9 @@ void ZoneDatabase::ListAllInstances(Client* c, uint32 charid)
|
||||
MYSQL_ROW row;
|
||||
|
||||
|
||||
if (RunQuery(query,MakeAnyLenString(&query, "SELECT instance_lockout.id, zone, version FROM instance_lockout JOIN"
|
||||
" instance_lockout_player ON instance_lockout.id = instance_lockout_player.id"
|
||||
" WHERE instance_lockout_player.charid=%lu", (unsigned long)charid),errbuf,&result))
|
||||
if (RunQuery(query,MakeAnyLenString(&query, "SELECT instance_list.id, zone, version FROM instance_list JOIN"
|
||||
" instance_list_player ON instance_list.id = instance_list_player.id"
|
||||
" WHERE instance_list_player.charid=%lu", (unsigned long)charid),errbuf,&result))
|
||||
{
|
||||
safe_delete_array(query);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user