From 0a9222e1ee39791f5de1d3b3c5db8b33201cdee5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 1 Sep 2014 23:54:15 -0500 Subject: [PATCH] - --- common/shareddb.cpp | 2 +- world/zoneserver.cpp | 3 +++ zone/client.cpp | 50 ++++++++++++++++++++++---------------------- zone/mob.cpp | 1 + zone/worldserver.cpp | 2 +- zone/zoning.cpp | 22 +++++++++++++++++++ 6 files changed, 53 insertions(+), 27 deletions(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 9f234b4ae..6124d37f1 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -92,7 +92,7 @@ uint32 SharedDatabase::SetPlayerProfile_MQ(char** query, uint32 account_id, uint if (strlen(pp->name) == 0) // Sanity check in case pp never loaded return false; - end += sprintf(end, "UPDATE character_ SET timelaston=unix_timestamp(now()),name=\'%s\', zonename=\'%s\', zoneid=%u, instanceid=%u, x = %f, y = %f, z = %f, ", pp->name, "halas", 29, current_instance, pp->x, pp->y, pp->z); + end += sprintf(end, "UPDATE character_ SET timelaston=unix_timestamp(now()),name=\'%s\', zonename=\'%s\', zoneid=%u, instanceid=%u, x = %f, y = %f, z = %f, ", pp->name, GetZoneName(current_zone), current_zone, current_instance, pp->x, pp->y, pp->z); // end += DoEscapeString(end, (char*)pp, sizeof(PlayerProfile_Struct)); end += sprintf(end, " extprofile=\'"); end += DoEscapeString(end, (char*)ext, sizeof(ExtendedProfile_Struct)); diff --git a/world/zoneserver.cpp b/world/zoneserver.cpp index 7c4f4f963..af0752a95 100644 --- a/world/zoneserver.cpp +++ b/world/zoneserver.cpp @@ -675,6 +675,9 @@ bool ZoneServer::Process() { zlog(WORLD__ZONE,"ZoneToZone request for %s current zone %d req zone %d\n", ztz->name, ztz->current_zone_id, ztz->requested_zone_id); + printf("\n\n ZoneToZone request for %s current zone %d req zone %d\n\n", + ztz->name, ztz->current_zone_id, ztz->requested_zone_id); + if(GetZoneID() == ztz->current_zone_id && GetInstanceID() == ztz->current_instance_id) // this is a request from the egress zone { zlog(WORLD__ZONE,"Processing ZTZ for egress from zone for client %s\n", ztz->name); diff --git a/zone/client.cpp b/zone/client.cpp index 2213c0a26..c56d47b4d 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -588,31 +588,31 @@ bool Client::Save(uint8 iCommitNow) { /* Save Character Task */ SaveTaskState(); - if (iCommitNow <= 1) { - // char* query = 0; - // uint32_breakdown workpt; - // workpt.b4() = DBA_b4_Entity; - // workpt.w2_3() = GetID(); - // workpt.b1() = DBA_b1_Entity_Client_Save; - // DBAsyncWork* dbaw = new DBAsyncWork(&database, &MTdbafq, workpt, DBAsync::Write, 0xFFFFFFFF); - // dbaw->AddQuery(iCommitNow == 0 ? true : false, &query, database.SetPlayerProfile_MQ(&query, account_id, character_id, &m_pp, &m_inv, &m_epp, 0, 0, MaxXTargets), false); - // if (iCommitNow == 0){ - // pQueuedSaveWorkID = dbasync->AddWork(&dbaw, 2500); - // } - // else { - // dbasync->AddWork(&dbaw, 0); - // SaveBackup(); - // } - // safe_delete_array(query); - // return true; - } - else if (database.SetPlayerProfile(account_id, character_id, &m_pp, &m_inv, &m_epp, 0, 0, MaxXTargets)) { - SaveBackup(); - } - else { - std::cerr << "Failed to update player profile" << std::endl; - return false; - } + // if (iCommitNow <= 1) { + // // char* query = 0; + // // uint32_breakdown workpt; + // // workpt.b4() = DBA_b4_Entity; + // // workpt.w2_3() = GetID(); + // // workpt.b1() = DBA_b1_Entity_Client_Save; + // // DBAsyncWork* dbaw = new DBAsyncWork(&database, &MTdbafq, workpt, DBAsync::Write, 0xFFFFFFFF); + // // dbaw->AddQuery(iCommitNow == 0 ? true : false, &query, database.SetPlayerProfile_MQ(&query, account_id, character_id, &m_pp, &m_inv, &m_epp, 0, 0, MaxXTargets), false); + // // if (iCommitNow == 0){ + // // pQueuedSaveWorkID = dbasync->AddWork(&dbaw, 2500); + // // } + // // else { + // // dbasync->AddWork(&dbaw, 0); + // // SaveBackup(); + // // } + // // safe_delete_array(query); + // // return true; + // } + // else if (database.SetPlayerProfile(account_id, character_id, &m_pp, &m_inv, &m_epp, 0, 0, MaxXTargets)) { + // SaveBackup(); + // } + // else { + // std::cerr << "Failed to update player profile" << std::endl; + // return false; + // } /* Save Character Data */ database.SaveCharacterData(this->CharacterID(), this->AccountID(), &m_pp); diff --git a/zone/mob.cpp b/zone/mob.cpp index 0d7002253..9b4e3f53e 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -1931,6 +1931,7 @@ void Mob::SetZone(uint32 zone_id, uint32 instance_id) { CastToClient()->GetPP().zone_id = zone_id; CastToClient()->GetPP().zoneInstance = instance_id; + CastToClient()->Save(); } Save(); } diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 791a34ee4..152ed4f0d 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -322,7 +322,7 @@ void WorldServer::Process() { entity->CastToMob()->SetZone(ztz->requested_zone_id, ztz->requested_instance_id); - if(ztz->ignorerestrictions == 3) + if(ztz->ignorerestrictions == 3) entity->CastToClient()->GoToSafeCoords(ztz->requested_zone_id, ztz->requested_instance_id); } diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 1b64fef3c..88351ee3e 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -50,6 +50,10 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { #endif ZoneChange_Struct* zc=(ZoneChange_Struct*)app->pBuffer; + printf("INCOMING CLIENT\n\n"); + printf("%s\n", zc->char_name); + printf("%u\n", zc->zoneID); + uint16 target_zone_id = 0; uint16 target_instance_id = zc->instanceID; ZonePoint* zone_point = nullptr; @@ -368,6 +372,8 @@ void Client::DoZoneSuccess(ZoneChange_Struct *zc, uint16 zone_id, uint32 instanc outapp->priority = 6; FastQueuePacket(&outapp); + printf("INTERZONE PROCESS\n"); + zone->StartShutdownTimer(AUTHENTICATION_TIMEOUT * 1000); } else { // vesuvias - zoneing to another zone so we need to the let the world server @@ -384,6 +390,17 @@ void Client::DoZoneSuccess(ZoneChange_Struct *zc, uint16 zone_id, uint32 instanc strcpy(ztz->name, GetName()); ztz->guild_id = GuildID(); worldserver.SendPacket(pack); + + printf("ZONING REQUEST TO WORLD\n"); + printf("ztz->response %u \n", ztz->response); + printf("ztz->current_zone_id %u \n", ztz->current_zone_id); + printf("ztz->current_instance_id %u \n", ztz->current_instance_id); + printf("ztz->requested_zone_id %u \n", ztz->requested_zone_id); + printf("ztz->requested_instance_id %u \n", ztz->requested_instance_id); + printf("ztz->admin %u \n", ztz->admin); + printf("ztz->ignorerestrictions %u \n", ztz->ignorerestrictions); + printf("ztz->guild_id %u \n", ztz->guild_id); + safe_delete(pack); } @@ -551,6 +568,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z if(ReadyToZone) { zone_mode = zm; + printf("\n\n ZONE MODE %u \n\n", zm); if(zm == ZoneToBindPoint) { EQApplicationPacket* outapp = new EQApplicationPacket(OP_ZonePlayerToBind, sizeof(ZonePlayerToBind_Struct) + iZoneNameLength); ZonePlayerToBind_Struct* gmg = (ZonePlayerToBind_Struct*) outapp->pBuffer; @@ -584,6 +602,10 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z gmg->instance_id = instance_id; gmg->type = 0x01; //an observed value, not sure of meaning + printf("gmg->zone_id %u \n", gmg->zone_id); + printf("gmg->x %u \n", gmg->x); + printf("gmg->y %u \n", gmg->y); + outapp->priority = 6; FastQueuePacket(&outapp); safe_delete(outapp);