Updated UCS versioning code - update your *.conf files

This commit is contained in:
Uleat
2018-03-04 21:38:17 -05:00
parent 525db1819d
commit e5e779c064
28 changed files with 338 additions and 328 deletions
+29 -2
View File
@@ -146,6 +146,8 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
UpdateWindowTitle();
zone->GetTimeSync();
zone->RequestUCSServerStatus();
/* Set Logging */
LogSys.StartFileLogs(StringFormat("%s_version_%u_inst_id_%u_port_%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort));
@@ -847,6 +849,9 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name)
GuildBanks = new GuildBankManager;
else
GuildBanks = nullptr;
m_ucss_available = false;
m_last_ucss_update = 0;
}
Zone::~Zone() {
@@ -1863,14 +1868,17 @@ bool ZoneDatabase::GetDecayTimes(npcDecayTimes_Struct* npcCorpseDecayTimes) {
return true;
}
void Zone::weatherSend()
void Zone::weatherSend(Client* client)
{
auto outapp = new EQApplicationPacket(OP_Weather, 8);
if(zone_weather>0)
outapp->pBuffer[0] = zone_weather-1;
if(zone_weather>0)
outapp->pBuffer[4] = zone->weather_intensity;
entity_list.QueueClients(0, outapp);
if (client)
client->QueuePacket(outapp);
else
entity_list.QueueClients(0, outapp);
safe_delete(outapp);
}
@@ -2336,3 +2344,22 @@ void Zone::UpdateHotzone()
is_hotzone = atoi(row[0]) == 0 ? false: true;
}
void Zone::RequestUCSServerStatus() {
auto outapp = new ServerPacket(ServerOP_UCSServerStatusRequest, sizeof(UCSServerStatus_Struct));
auto ucsss = (UCSServerStatus_Struct*)outapp->pBuffer;
ucsss->available = 0;
ucsss->port = Config->ZonePort;
ucsss->unused = 0;
worldserver.SendPacket(outapp);
safe_delete(outapp);
}
void Zone::SetUCSServerAvailable(bool ucss_available, uint32 update_timestamp) {
if (m_last_ucss_update == update_timestamp && m_ucss_available != ucss_available) {
m_ucss_available = false;
RequestUCSServerStatus();
return;
}
if (m_last_ucss_update < update_timestamp)
m_ucss_available = ucss_available;
}