mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
Fix for locked server bug, bandaid to fix stupid missile code.
This commit is contained in:
parent
5fa8ffd3bc
commit
ed813363a5
@ -163,7 +163,6 @@ enum { //timer settings, all in milliseconds
|
||||
ClientProximity_interval = 150,
|
||||
CombatEventTimer_expire = 12000,
|
||||
Tribute_duration = 600000,
|
||||
ZoneTimerResolution = 3, //sleep time between zone main loop runs (milliseconds)
|
||||
FeignMemoryDuration = 120000, // Duration player must feign death to clear zonewide agro.
|
||||
EnragedTimer = 360000,
|
||||
EnragedDurationTimer = 10000
|
||||
|
||||
@ -386,6 +386,7 @@ int main(int argc, char** argv) {
|
||||
Log.OutF(Logs::General, Logs::World_Server, "New Zone Server connection from {2} at {0}:{1}",
|
||||
connection->Handle()->RemoteIP(), connection->Handle()->RemotePort(), connection->GetUUID());
|
||||
|
||||
numzones++;
|
||||
zoneserver_list.Add(new ZoneServer(connection));
|
||||
});
|
||||
|
||||
@ -393,6 +394,7 @@ int main(int argc, char** argv) {
|
||||
Log.OutF(Logs::General, Logs::World_Server, "Removed Zone Server connection from {0}",
|
||||
connection->GetUUID());
|
||||
|
||||
numzones--;
|
||||
zoneserver_list.Remove(connection->GetUUID());
|
||||
});
|
||||
|
||||
|
||||
@ -86,7 +86,6 @@ void ZSList::KillAll() {
|
||||
while(iterator != list.end()) {
|
||||
(*iterator)->Disconnect();
|
||||
iterator = list.erase(iterator);
|
||||
numzones--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
18
zone/net.cpp
18
zone/net.cpp
@ -76,6 +76,7 @@
|
||||
#include <time.h>
|
||||
#include <ctime>
|
||||
#include <thread>
|
||||
#include <chrono>
|
||||
|
||||
#ifdef _CRTDBG_MAP_ALLOC
|
||||
#undef new
|
||||
@ -108,6 +109,7 @@ EQEmuLogSys Log;
|
||||
const SPDat_Spell_Struct* spells;
|
||||
int32 SPDAT_RECORDS = -1;
|
||||
const ZoneConfig *Config;
|
||||
uint64_t frame_time = 0;
|
||||
|
||||
void Shutdown();
|
||||
extern void MapOpcodes();
|
||||
@ -431,11 +433,16 @@ int main(int argc, char** argv) {
|
||||
zoneupdate_timer.Start();
|
||||
bool eqsf_open = false;
|
||||
std::unique_ptr<EQ::Net::EQStreamManager> eqsm;
|
||||
std::chrono::time_point<std::chrono::system_clock> frame_prev = std::chrono::system_clock::now();
|
||||
|
||||
EQ::Timer process_timer(50, true, [&eqsf_open, &eqsm, &stream_identifier, &eqsi, &worldwasconnected,
|
||||
&zoneupdate_timer, &IDLEZONEUPDATE, &ZONEUPDATE, &quest_timers, &InterserverTimer](EQ::Timer* t) {
|
||||
EQ::Timer process_timer(50, true, [&](EQ::Timer* t) {
|
||||
//Advance the timer to our current point in time
|
||||
Timer::SetCurrentTime();
|
||||
|
||||
//Calculate frame time
|
||||
std::chrono::time_point<std::chrono::system_clock> frame_now = std::chrono::system_clock::now();
|
||||
frame_time = std::chrono::duration_cast<std::chrono::milliseconds>(frame_now - frame_prev).count();
|
||||
frame_prev = frame_now;
|
||||
|
||||
if (!eqsf_open && Config->ZonePort != 0) {
|
||||
Log.Out(Logs::General, Logs::Zone_Server, "Starting EQ Network server on port %d", Config->ZonePort);
|
||||
@ -525,7 +532,12 @@ int main(int argc, char** argv) {
|
||||
|
||||
while(RunLoops) {
|
||||
EQ::EventLoop::Get().Process();
|
||||
Sleep(1);
|
||||
if (is_zone_loaded) {
|
||||
Sleep(1);
|
||||
}
|
||||
else {
|
||||
Sleep(50);
|
||||
}
|
||||
}
|
||||
|
||||
entity_list.Clear();
|
||||
|
||||
@ -26,6 +26,8 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
extern uint64_t frame_time;
|
||||
|
||||
int Mob::GetBaseSkillDamage(EQEmu::skills::SkillType skill, Mob *target)
|
||||
{
|
||||
int base = EQEmu::skills::GetBaseDamage(skill);
|
||||
@ -1012,7 +1014,7 @@ void Mob::ProjectileAttack()
|
||||
ProjectileAtk[i].skill = 0;
|
||||
ProjectileAtk[i].speed_mod = 0.0f;
|
||||
} else {
|
||||
ProjectileAtk[i].increment++;
|
||||
ProjectileAtk[i].increment += frame_time;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user