Merge fix

This commit is contained in:
KimLS 2017-07-22 14:20:40 -07:00
commit 69c6879ac9
23 changed files with 71 additions and 42 deletions

View File

@ -305,6 +305,7 @@ union
uint8 DestructibleUnk8;
uint32 DestructibleUnk9;
bool targetable_with_hotkey;
bool show_name;
};

View File

@ -87,6 +87,7 @@ enum LogCategory {
Client_Login,
Headless_Client,
HP_Update,
FixZ,
MaxCategoryID /* Don't Remove this*/
};
@ -138,7 +139,8 @@ static const char* LogCategoryName[LogCategory::MaxCategoryID] = {
"Login Server",
"Client Login",
"Headless Client",
"HP Update"
"HP Update",
"FixZ"
};
}

View File

@ -382,13 +382,8 @@ void EQ::Net::DaybreakConnection::ProcessPacket(Packet &p)
return;
}
if (p.GetInt8(0) != 0) {
LogF(Logs::Detail, Logs::Netcode, "Error parsing packet, did not start with a 0 frame, not a valid protocol packet.");
return;
}
auto opcode = p.GetInt8(1);
if (opcode == OP_KeepAlive || opcode == OP_OutboundPing) {
if (p.GetInt8(0) == 0 && (opcode == OP_KeepAlive || opcode == OP_OutboundPing)) {
return;
}
@ -407,10 +402,16 @@ void EQ::Net::DaybreakConnection::ProcessPacket(Packet &p)
for (int i = 1; i >= 0; --i) {
switch (m_encode_passes[i]) {
case EncodeCompression:
Decompress(temp, DaybreakHeader::size(), temp.Length() - DaybreakHeader::size());
if(temp.GetInt8(0) == 0)
Decompress(temp, DaybreakHeader::size(), temp.Length() - DaybreakHeader::size());
else
Decompress(temp, 1, temp.Length() - 1);
break;
case EncodeXOR:
Decode(temp, DaybreakHeader::size(), temp.Length() - DaybreakHeader::size());
if (temp.GetInt8(0) == 0)
Decode(temp, DaybreakHeader::size(), temp.Length() - DaybreakHeader::size());
else
Decode(temp, 1, temp.Length() - 1);
break;
default:
break;
@ -425,7 +426,10 @@ void EQ::Net::DaybreakConnection::ProcessPacket(Packet &p)
for (int i = 1; i >= 0; --i) {
switch (m_encode_passes[i]) {
case EncodeXOR:
Decode(temp, DaybreakHeader::size(), temp.Length() - DaybreakHeader::size());
if (temp.GetInt8(0) == 0)
Decode(temp, DaybreakHeader::size(), temp.Length() - DaybreakHeader::size());
else
Decode(temp, 1, temp.Length() - 1);
break;
default:
break;
@ -1187,24 +1191,21 @@ void EQ::Net::DaybreakConnection::InternalSend(Packet &p)
if (PacketCanBeEncoded(p)) {
DynamicPacket out;
if (p.GetUInt8(0) != 0) {
out.PutUInt8(0, 0);
out.PutUInt8(1, OP_Combined);
out.PutUInt8(2, p.Length());
out.PutPacket(3, p);
}
else {
out.PutPacket(0, p);
}
out.PutPacket(0, p);
for (int i = 0; i < 2; ++i) {
switch (m_encode_passes[i]) {
case EncodeCompression:
Compress(out, DaybreakHeader::size(), out.Length() - DaybreakHeader::size());
if(out.GetInt8(0) == 0)
Compress(out, DaybreakHeader::size(), out.Length() - DaybreakHeader::size());
else
Compress(out, 1, out.Length() - 1);
break;
case EncodeXOR:
Encode(out, DaybreakHeader::size(), out.Length() - DaybreakHeader::size());
if (out.GetInt8(0) == 0)
Encode(out, DaybreakHeader::size(), out.Length() - DaybreakHeader::size());
else
Encode(out, 1, out.Length() - 1);
break;
default:
break;

View File

@ -81,7 +81,12 @@ void EQ::Net::EQStream::QueuePacket(const EQApplicationPacket *p, bool ack_req)
break;
}
m_connection->QueuePacket(out);
if (ack_req) {
m_connection->QueuePacket(out);
}
else {
m_connection->QueuePacket(out, 0, false);
}
}
}

View File

@ -3930,7 +3930,7 @@ namespace RoF
if (strlen(emu->suffix))
PacketSize += strlen(emu->suffix) + 1;
bool ShowName = 1;
bool ShowName = emu->show_name;
if (emu->bodytype >= 66)
{
emu->race = 127;

View File

@ -4086,7 +4086,7 @@ namespace RoF2
PacketSize += strlen(emu->DestructibleString) + 1;
}
bool ShowName = 1;
bool ShowName = emu->show_name;
if (emu->bodytype >= 66)
{
emu->race = 127;

View File

@ -2560,7 +2560,7 @@ namespace SoD
PacketSize += strlen(emu->DestructibleString) + 1;
}
bool ShowName = 1;
bool ShowName = emu->show_name;
if (emu->bodytype >= 66)
{
emu->race = 127;

View File

@ -2097,7 +2097,7 @@ namespace SoF
int k;
for (r = 0; r < entrycount; r++, eq++, emu++) {
eq->showname = 1; //New Field - Toggles Name Display on or off - 0 = off, 1 = on
eq->showname = emu->show_name ? 1 : 0; //New Field - Toggles Name Display on or off - 0 = off, 1 = on
eq->linkdead = 0; //New Field - Toggles LD on or off after name - 0 = off, 1 = on
eq->statue = 0; //New Field - 1 freezes animation
eq->showhelm = emu->showhelm;
@ -2136,10 +2136,10 @@ namespace SoF
eq->findable = emu->findable;
if (emu->bodytype >= 66)
{
eq->bodytype = 11; //non-targetable
eq->showname = 0; //no visible name
eq->race = 127; //invisible man
eq->gender = 0; //invisible men are gender 0
eq->bodytype = 11; //non-targetable
eq->showname = 0; //no visible name
eq->race = 127; //invisible man
eq->gender = 0; //invisible men are gender 0
}
else
{

View File

@ -2844,7 +2844,7 @@ namespace UF
PacketSize += strlen(emu->DestructibleString) + 1;
}
bool ShowName = 1;
bool ShowName = emu->show_name;
if (emu->bodytype >= 66)
{
emu->race = 127;

View File

@ -30,7 +30,7 @@
Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
*/
#define CURRENT_BINARY_DATABASE_VERSION 9112
#define CURRENT_BINARY_DATABASE_VERSION 9113
#ifdef BOTS
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9017
#else

View File

@ -1454,7 +1454,7 @@ sub map_files_fetch_bulk{
get_remote_file("http://github.com/Akkadius/EQEmuMaps/archive/master.zip", "maps/maps.zip", 1);
unzip('maps/maps.zip', 'maps/');
my @files;
my $start_dir = "maps/EQEmuMaps-master/maps";
my $start_dir = "maps/EQEmuMaps-master/";
find(
sub { push @files, $File::Find::name unless -d; },
$start_dir
@ -2179,4 +2179,5 @@ sub generate_random_password {
map $alphanumeric[rand @alphanumeric], 0..$passwordsize;
return $randpassword;
}
}

View File

@ -366,6 +366,7 @@
9110|2017_04_10_graveyard.sql|show index from graveyard WHERE key_name = 'zone_id_nonunique'|empty|
9111|2017_06_24_saylink_index.sql|SHOW INDEX FROM `saylink` WHERE `key_name` = 'phrase_index'|empty|
9112|2017_06_24_rule_values_expand.sql|SHOW COLUMNS FROM rule_values WHERE Field = 'rule_value' and Type = 'varchar(30)'|empty|
9113|2017_07_19_show_name.sql|SHOW COLUMNS FROM `npc_types` LIKE 'show_name'|empty|
# Upgrade conditions:
# This won't be needed after this system is implemented, but it is used database that are not

View File

@ -0,0 +1,3 @@
ALTER TABLE `npc_types` ADD COLUMN `show_name` TINYINT(2) NOT NULL DEFAULT 1;
ALTER TABLE `npc_types` ADD COLUMN `untargetable` TINYINT(2) NOT NULL DEFAULT 0;
UPDATE `npc_types` SET `show_name` = 0, `untargetable` = 1 WHERE `bodytype` >= 66;

View File

@ -1281,6 +1281,10 @@ void Client::Clearance(int8 response)
} else {
zs_addr = zs->GetIP().c_str();
if (!zs_addr[0]) {
zs_addr = WorldConfig::get()->LocalAddress.c_str();
}
if(strcmp(zs_addr, "127.0.0.1") == 0)
{
Log(Logs::Detail, Logs::World_Server, "Local zone address was %s, setting local address to: %s", zs_addr, WorldConfig::get()->LocalAddress.c_str());

View File

@ -1944,6 +1944,7 @@ void Client::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
ns->spawn.guildID = GuildID();
// ns->spawn.linkdead = IsLD() ? 1 : 0;
// ns->spawn.pvp = GetPVP() ? 1 : 0;
ns->spawn.show_name = true;
strcpy(ns->spawn.title, m_pp.title);

View File

@ -659,6 +659,8 @@ void EntityList::AddNPC(NPC *npc, bool SendSpawnPacket, bool dontqueue)
QueueClients(npc, app);
npc->SendArmorAppearance();
npc->SetAppearance(npc->GetGuardPointAnim(),false);
if (!npc->IsTargetable())
npc->SendTargetable(false);
safe_delete(app);
} else {
auto ns = new NewSpawn_Struct;
@ -799,6 +801,8 @@ void EntityList::CheckSpawnQueue()
NPC *pnpc = it->second;
pnpc->SendArmorAppearance();
pnpc->SetAppearance(pnpc->GetGuardPointAnim(), false);
if (!pnpc->IsTargetable())
pnpc->SendTargetable(false);
}
safe_delete(outapp);
iterator.RemoveCurrent();

View File

@ -175,7 +175,5 @@ void Mob::CalculateNewFearpoint()
if (currently_fleeing)
m_FearWalkTarget = glm::vec3(ranx, rany, ranz);
else //Break fear
BuffFadeByEffect(SE_Fear);
}

View File

@ -375,6 +375,7 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, const glm::vec4& position, int if
CalcBonuses();
raid_target = d->raid_target;
ignore_despawn = d->ignore_despawn;
m_targetable = !d->untargetable;
}
NPC::~NPC()
@ -1906,6 +1907,7 @@ void NPC::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
ns->spawn.is_npc = 1;
UpdateActiveLight();
ns->spawn.light = GetActiveLightType();
ns->spawn.show_name = NPCTypedata->show_name;
}
void NPC::PetOnSpawn(NewSpawn_Struct* ns)

View File

@ -120,4 +120,4 @@ void Client::SendPathPacket(std::vector<FindPerson_Point> &points) {
fpr->dest = *cur;
FastQueuePacket(&outapp);
}
}

View File

@ -3640,7 +3640,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
case SE_Fear: {
if (zone->random.Roll(RuleI(Spells, FearBreakCheckChance))) {
float resist_check = ResistSpell(spells[buff.spellid].resisttype, buff.spellid, caster);
float resist_check = ResistSpell(spells[buff.spellid].resisttype, buff.spellid, caster,0,0,true);
if (resist_check == 100)
break;

View File

@ -774,7 +774,7 @@ void Mob::FixZ() {
Log(
Logs::Moderate,
Logs::Pathing,
Logs::FixZ,
"Mob::FixZ() (%s) returned %4.3f at %4.3f, %4.3f, %4.3f - Took %lf",
this->GetCleanName(),
new_z,
@ -794,7 +794,7 @@ void Mob::FixZ() {
if (RuleB(Map, MobZVisualDebug))
this->SendAppearanceEffect(103, 0, 0, 0, 0);
Log(Logs::General, Logs::Debug, "%s is failing to find Z %f", this->GetCleanName(), std::abs(m_Position.z - new_z));
Log(Logs::General, Logs::FixZ, "%s is failing to find Z %f", this->GetCleanName(), std::abs(m_Position.z - new_z));
}
last_z = m_Position.z;

View File

@ -1967,7 +1967,9 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
"npc_types.handtexture, "
"npc_types.legtexture, "
"npc_types.feettexture, "
"npc_types.ignore_despawn "
"npc_types.ignore_despawn, "
"npc_types.show_name, "
"npc_types.untargetable "
"FROM npc_types %s",
where_condition.c_str()
);
@ -2143,6 +2145,8 @@ const NPCType* ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
temp_npctype_data->legtexture = atoi(row[95]);
temp_npctype_data->feettexture = atoi(row[96]);
temp_npctype_data->ignore_despawn = atoi(row[97]) == 1 ? true : false;
temp_npctype_data->show_name = atoi(row[98]) != 0 ? true : false;
temp_npctype_data->untargetable = atoi(row[99]) != 0 ? true : false;
// If NPC with duplicate NPC id already in table,
// free item we attempted to add.

View File

@ -133,6 +133,8 @@ struct NPCType
uint8 legtexture;
uint8 feettexture;
bool ignore_despawn;
bool show_name; // should default on
bool untargetable;
};
namespace player_lootitem {