Merge pull request #515 from ngdeao/master

Netcode and Zoning Improvements
This commit is contained in:
Akkadius
2016-04-07 21:48:27 -05:00
10 changed files with 105 additions and 106 deletions
+1
View File
@@ -7832,6 +7832,7 @@ Bot* EntityList::GetBotByBotName(std::string botName) {
void EntityList::AddBot(Bot *newBot, bool SendSpawnPacket, bool dontqueue) {
if(newBot) {
newBot->SetID(GetFreeID());
newBot->SetSpawned();
if(SendSpawnPacket) {
if(dontqueue) {
EQApplicationPacket* outapp = new EQApplicationPacket();
+2 -1
View File
@@ -123,7 +123,7 @@ Client::Client(EQStreamInterface* ieqs)
camp_timer(29000),
process_timer(100),
stamina_timer(40000),
zoneinpacket_timer(3000),
zoneinpacket_timer(1000),
linkdead_timer(RuleI(Zone,ClientLinkdeadMS)),
dead_timer(2000),
global_channel_timer(1000),
@@ -439,6 +439,7 @@ void Client::SendZoneInPackets()
outapp->priority = 6;
if (!GetHideMe()) entity_list.QueueClients(this, outapp, true);
safe_delete(outapp);
SetSpawned();
if (GetPVP()) //force a PVP update until we fix the spawn struct
SendAppearancePacket(AT_PVP, GetPVP(), true, false);
+2 -4
View File
@@ -495,7 +495,7 @@ void Client::CompleteConnect()
{
UpdateWho();
client_state = CLIENT_CONNECTED;
SendAllPackets();
hpupdate_timer.Start();
position_timer.Start();
autosave_timer.Start();
@@ -750,8 +750,6 @@ void Client::CompleteConnect()
entity_list.SendTraders(this);
zoneinpacket_timer.Start();
if (GetPet()){
GetPet()->SendPetBuffsToClient();
}
@@ -1729,7 +1727,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
SetAttackTimer();
conn_state = ZoneInfoSent;
zoneinpacket_timer.Start();
return;
}
+1 -1
View File
@@ -66,7 +66,7 @@ bool Client::Process() {
if(Connected() || IsLD())
{
// try to send all packets that weren't sent before
if(!IsLD() && zoneinpacket_timer.Check())
if (!IsLD() && zoneinpacket_timer.Check())
{
SendAllPackets();
}
+3 -3
View File
@@ -647,7 +647,7 @@ void EntityList::AddNPC(NPC *npc, bool SendSpawnPacket, bool dontqueue)
uint16 emoteid = npc->GetEmoteID();
if (emoteid != 0)
npc->DoNPCEmote(ONSPAWN, emoteid);
npc->SetSpawned();
if (SendSpawnPacket) {
if (dontqueue) { // aka, SEND IT NOW BITCH!
EQApplicationPacket *app = new EQApplicationPacket;
@@ -686,7 +686,7 @@ void EntityList::AddMerc(Merc *merc, bool SendSpawnPacket, bool dontqueue)
if (merc)
{
merc->SetID(GetFreeID());
merc->SetSpawned();
if (SendSpawnPacket)
{
if (dontqueue) {
@@ -1231,7 +1231,7 @@ void EntityList::SendZoneSpawnsBulk(Client *client)
int32 race=-1;
for (auto it = mob_list.begin(); it != mob_list.end(); ++it) {
spawn = it->second;
if (spawn && spawn->InZone()) {
if (spawn && spawn->GetID() > 0 && spawn->Spawned()) {
if (spawn->IsClient() && (spawn->CastToClient()->GMHideMe(client) ||
spawn->CastToClient()->IsHoveringForRespawn()))
continue;
+1
View File
@@ -253,6 +253,7 @@ Mob::Mob(const char* in_name,
invulnerable = false;
IsFullHP = (cur_hp == max_hp);
qglobal=0;
spawned = false;
InitializeBuffSlots();
+3
View File
@@ -488,6 +488,8 @@ public:
void MakeSpawnUpdateNoDelta(PlayerPositionUpdateServer_Struct* spu);
void MakeSpawnUpdate(PlayerPositionUpdateServer_Struct* spu);
void SendPosition();
void SetSpawned() { spawned = true; };
bool Spawned() { return spawned; };
void SetFlyMode(uint8 flymode);
inline void Teleport(glm::vec3 NewPosition) { m_Position.x = NewPosition.x; m_Position.y = NewPosition.y;
m_Position.z = NewPosition.z; };
@@ -1137,6 +1139,7 @@ protected:
bool held;
bool nocast;
bool focused;
bool spawned;
void CalcSpellBonuses(StatBonuses* newbon);
virtual void CalcBonuses();
void TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success = false, uint16 hand = 0, bool IsDefensive = false); // hand = SlotCharm?