mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Merge pull request #515 from ngdeao/master
Netcode and Zoning Improvements
This commit is contained in:
@@ -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
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
@@ -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;
|
||||
|
||||
@@ -253,6 +253,7 @@ Mob::Mob(const char* in_name,
|
||||
invulnerable = false;
|
||||
IsFullHP = (cur_hp == max_hp);
|
||||
qglobal=0;
|
||||
spawned = false;
|
||||
|
||||
InitializeBuffSlots();
|
||||
|
||||
|
||||
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user