diff --git a/changelog.txt b/changelog.txt index f12dfd0ae..4d2d34a2c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 02/23/2015 == +Uleat: Fix for RoF+ clients showing active 'Return Home' button when action is not available (swapped 'GoHome' and 'Enabled' fields in RoF-era CharacterSelectEntry structs) + == 02/21/2015 == Noudess: Starting erudites that were supposed to start in paineel were landing in erudin on Titanium. Fixed to be paineel. diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index 27fe9bb2b..65d6fba3b 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -158,6 +158,7 @@ struct CharSelectEquip Color_Struct Color; }; +// RoF2-based hybrid struct struct CharacterSelectEntry_Struct { char Name[64]; @@ -184,11 +185,11 @@ struct CharacterSelectEntry_Struct uint8 EyeColor2; uint8 HairStyle; uint8 Beard; - uint8 Enabled; + uint8 GoHome; // Seen 0 for new char and 1 for existing uint8 Tutorial; // Seen 1 for new char or 0 for existing uint32 DrakkinHeritage; uint8 Unknown1; // Seen 0 - uint8 GoHome; // Seen 0 for new char and 1 for existing + uint8 Enabled; // Originally labeled as 'CharEnabled' - unknown purpose and setting -U uint32 LastLogin; uint8 Unknown2; // Seen 0 }; diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index d6723db4d..f47d55c89 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -2982,11 +2982,11 @@ namespace RoF eq_cse->EyeColor2 = emu_cse->EyeColor2; eq_cse->HairStyle = emu_cse->HairStyle; eq_cse->Beard = emu_cse->Beard; - eq_cse->Enabled = emu_cse->Enabled; + eq_cse->GoHome = emu_cse->GoHome; eq_cse->Tutorial = emu_cse->Tutorial; eq_cse->DrakkinHeritage = emu_cse->DrakkinHeritage; eq_cse->Unknown1 = emu_cse->Unknown1; - eq_cse->GoHome = emu_cse->GoHome; + eq_cse->Enabled = emu_cse->Enabled; eq_cse->LastLogin = emu_cse->LastLogin; eq_cse->Unknown2 = emu_cse->Unknown2; diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 493f369e1..c03c8cd30 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -3066,11 +3066,11 @@ namespace RoF2 eq_cse->EyeColor2 = emu_cse->EyeColor2; eq_cse->HairStyle = emu_cse->HairStyle; eq_cse->Beard = emu_cse->Beard; - eq_cse->Enabled = emu_cse->Enabled; + eq_cse->GoHome = emu_cse->GoHome; eq_cse->Tutorial = emu_cse->Tutorial; eq_cse->DrakkinHeritage = emu_cse->DrakkinHeritage; eq_cse->Unknown1 = emu_cse->Unknown1; - eq_cse->GoHome = emu_cse->GoHome; + eq_cse->Enabled = emu_cse->Enabled; eq_cse->LastLogin = emu_cse->LastLogin; eq_cse->Unknown2 = emu_cse->Unknown2; diff --git a/common/patches/rof2_structs.h b/common/patches/rof2_structs.h index d5ab87fb6..a00991a70 100644 --- a/common/patches/rof2_structs.h +++ b/common/patches/rof2_structs.h @@ -189,11 +189,11 @@ struct CharacterSelectEntry_Struct /*0000*/ uint8 EyeColor2; /*0000*/ uint8 HairStyle; /*0000*/ uint8 Beard; -/*0000*/ uint8 Enabled; +/*0000*/ uint8 GoHome; // Seen 0 for new char and 1 for existing /*0000*/ uint8 Tutorial; // Seen 1 for new char or 0 for existing /*0000*/ uint32 DrakkinHeritage; /*0000*/ uint8 Unknown1; // Seen 0 -/*0000*/ uint8 GoHome; // Seen 0 for new char and 1 for existing +/*0000*/ uint8 Enabled; // Swapped position with 'GoHome' 02/23/2015 -U /*0000*/ uint32 LastLogin; /*0000*/ uint8 Unknown2; // Seen 0 }; diff --git a/common/patches/rof_structs.h b/common/patches/rof_structs.h index f773d422c..42845a244 100644 --- a/common/patches/rof_structs.h +++ b/common/patches/rof_structs.h @@ -189,11 +189,11 @@ struct CharacterSelectEntry_Struct /*0000*/ uint8 EyeColor2; /*0000*/ uint8 HairStyle; /*0000*/ uint8 Beard; -/*0000*/ uint8 Enabled; +/*0000*/ uint8 GoHome; // Seen 0 for new char and 1 for existing /*0000*/ uint8 Tutorial; // Seen 1 for new char or 0 for existing /*0000*/ uint32 DrakkinHeritage; /*0000*/ uint8 Unknown1; // Seen 0 -/*0000*/ uint8 GoHome; // Seen 0 for new char and 1 for existing +/*0000*/ uint8 Enabled; // Swapped position with 'GoHome' 02/23/2015 -U /*0000*/ uint32 LastLogin; /*0000*/ uint8 Unknown2; // Seen 0 }; diff --git a/world/client.cpp b/world/client.cpp index 540dfa683..b6b846f31 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -720,6 +720,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { } // This can probably be moved outside and have another method return requested info (don't forget to remove the #include "../common/shareddb.h" above) + // (This is a literal translation of the original process..I don't see why it can't be changed to a single-target query over account iteration -U) if (!pZoning) { size_t character_limit = EQLimits::CharacterCreationLimit(eqs->GetClientVersion()); if (character_limit > EmuConstants::CHARACTER_CREATION_LIMIT) { character_limit = EmuConstants::CHARACTER_CREATION_LIMIT; } diff --git a/world/worlddb.cpp b/world/worlddb.cpp index 9a2bb630a..4b2a75ac6 100644 --- a/world/worlddb.cpp +++ b/world/worlddb.cpp @@ -138,25 +138,25 @@ void WorldDatabase::GetCharSelectInfo(uint32 accountID, EQApplicationPacket **ou cse->EyeColor2 = (uint8)atoi(row[12]); cse->HairStyle = (uint8)atoi(row[13]); cse->Beard = (uint8)atoi(row[14]); - cse->Enabled = 1; + cse->GoHome = 0; // Processed Below cse->Tutorial = 0; // Processed Below cse->DrakkinHeritage = (uint32)atoi(row[16]); cse->Unknown1 = 0; - cse->GoHome = 0; // Processed Below + cse->Enabled = 1; cse->LastLogin = (uint32)atoi(row[7]); // RoF2 value: 1212696584 cse->Unknown2 = 0; /* Fill End */ - if (RuleB(World, EnableTutorialButton) && (cse->Level <= RuleI(World, MaxLevelForTutorial))) { - cse->Tutorial = 1; - } - if (RuleB(World, EnableReturnHomeButton)) { int now = time(nullptr); if ((now - atoi(row[7])) >= RuleI(World, MinOfflineTimeToReturnHome)) cse->GoHome = 1; } + if (RuleB(World, EnableTutorialButton) && (cse->Level <= RuleI(World, MaxLevelForTutorial))) { + cse->Tutorial = 1; + } + /* Set Bind Point Data for any character that may possibly be missing it for any reason */ cquery = StringFormat("SELECT `zone_id`, `instance_id`, `x`, `y`, `z`, `heading`, `is_home` FROM `character_bind` WHERE `id` = %i LIMIT 2", character_id); auto results_bind = database.QueryDatabase(cquery);