From f1bcd2c5bc935959d1b1c3fa96316426dba2b16c Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 30 Jun 2010 12:46:19 -0600 Subject: * Fix expected client build --HG-- branch : trunk --- src/server/authserver/Authentication/AuthCodes.h | 2 +- src/server/game/Entities/Object/Updates/UpdateFields.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/authserver/Authentication/AuthCodes.h b/src/server/authserver/Authentication/AuthCodes.h index eb6e4abfb08..883f8d2edd2 100644 --- a/src/server/authserver/Authentication/AuthCodes.h +++ b/src/server/authserver/Authentication/AuthCodes.h @@ -80,7 +80,7 @@ enum LoginResult //3.3.2 build 11403 //3.3.3a build 11723 -#define POST_BC_ACCEPTED_CLIENT_BUILD {11723, 11403, 11159, 10571, 10505, 10146, 9947, 8606, 0} +#define POST_BC_ACCEPTED_CLIENT_BUILD {12213, 11723, 11403, 11159, 10571, 10505, 10146, 9947, 8606, 0} #define PRE_BC_ACCEPTED_CLIENT_BUILD {5875, 6005, 0} #define POST_BC_EXP_FLAG 0x2 diff --git a/src/server/game/Entities/Object/Updates/UpdateFields.h b/src/server/game/Entities/Object/Updates/UpdateFields.h index 5f819375677..09c2b3805c4 100644 --- a/src/server/game/Entities/Object/Updates/UpdateFields.h +++ b/src/server/game/Entities/Object/Updates/UpdateFields.h @@ -21,7 +21,7 @@ #ifndef _UPDATEFIELDS_AUTO_H #define _UPDATEFIELDS_AUTO_H -// Auto generated for version 3, 3, 3, 11723 +// Auto generated for version 3, 3, 3, 12213 enum EObjectFields { -- cgit v1.2.3 From 27958838bf522e92257a9f0c6a359b5c52c474e6 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 30 Jun 2010 12:58:00 -0600 Subject: * Update / Add some opcodes * Thanks TOM_RUS --HG-- branch : trunk --- src/server/game/Server/Protocol/Opcodes.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 6e2fb0b6db1..ef328c70586 100644 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1343,7 +1343,11 @@ enum Opcodes SMSG_UNKNOWN_1304 = 0x518, // something with player movement (move event 58?), speed packet UMSG_UNKNOWN_1305 = 0x519, // not found UMSG_UNKNOWN_1306 = 0x51A, // not found - NUM_MSG_TYPES = 0x51B + CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND = 0x51B, // lua: CommentatorSetSkirmishMatchmakingMode/CommentatorRequestSkirmishQueueData/CommentatorRequestSkirmishMode/CommentatorStartSkirmishMatch + SMSG_UNKNOWN_1308 = 0x51C, // event EVENT_COMMENTATOR_SKIRMISH_QUEUE_REQUEST, CGCommentator::QueueNode + SMSG_UNKNOWN_1309 = 0x51D, // event EVENT_COMMENTATOR_SKIRMISH_QUEUE_REQUEST + SMSG_UNKNOWN_1310 = 0x51E, // some compressed packet? + NUM_MSG_TYPES = 0x51F }; /// Player state -- cgit v1.2.3 From 9b7da805f8223be50fa510e7aa8bd94259d4a245 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 30 Jun 2010 13:02:43 -0600 Subject: * Some update to chat enums * Thanks TOM_RUS --HG-- branch : trunk --- src/server/game/Entities/Player/SocialMgr.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/SocialMgr.h b/src/server/game/Entities/Player/SocialMgr.h index dbed6e93006..9b1176baab9 100644 --- a/src/server/game/Entities/Player/SocialMgr.h +++ b/src/server/game/Entities/Player/SocialMgr.h @@ -43,7 +43,8 @@ enum SocialFlag { SOCIAL_FLAG_FRIEND = 0x01, SOCIAL_FLAG_IGNORED = 0x02, - SOCIAL_FLAG_MUTED = 0x04 // guessed + SOCIAL_FLAG_MUTED = 0x04, // guessed + SOCAIL_FLAG_RAF = 0x08 // Recruit A Friend }; struct FriendInfo @@ -112,7 +113,7 @@ enum FriendsResult }; #define SOCIALMGR_FRIEND_LIMIT 50 -#define SOCIALMGR_IGNORE_LIMIT 25 +#define SOCIALMGR_IGNORE_LIMIT 50 class PlayerSocial { -- cgit v1.2.3 From b0df141c54597cc5af55b4268880af40f62c428d Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 30 Jun 2010 13:05:23 -0600 Subject: * Another opcode update * Thanks TOM_RUS --HG-- branch : trunk --- src/server/game/Server/Protocol/Opcodes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index ef328c70586..44a06ddb8d3 100644 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1244,7 +1244,7 @@ enum Opcodes SMSG_ITEM_REFUND_RESULT = 0x4B5, // refund item result CMSG_CORPSE_MAP_POSITION_QUERY = 0x4B6, // CMSG, uint32 SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x4B7, // SMSG, 3*float+float - CMSG_LFG_SET_ROLES_2 = 0x4B8, // not found + UMSG_UNKNOWN_1208 = 0x4B8, // not found UMSG_UNKNOWN_1209 = 0x4B9, // not found CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP = 0x4BA, // CMSG, uint64, lua: CalendarContextEventSignUp SMSG_CALENDAR_ACTION_PENDING = 0x4BB, // SMSG, calendar related EVENT_CALENDAR_ACTION_PENDING -- cgit v1.2.3 From 4d00596e95a04e274d4a8bbb3222f4ffa60e601d Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 30 Jun 2010 13:11:44 -0600 Subject: * Update for 3.3.5a --HG-- branch : trunk --- src/server/authserver/Authentication/AuthCodes.h | 2 +- src/server/game/Entities/Object/Updates/UpdateFields.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/authserver/Authentication/AuthCodes.h b/src/server/authserver/Authentication/AuthCodes.h index 883f8d2edd2..802b7b78f1b 100644 --- a/src/server/authserver/Authentication/AuthCodes.h +++ b/src/server/authserver/Authentication/AuthCodes.h @@ -80,7 +80,7 @@ enum LoginResult //3.3.2 build 11403 //3.3.3a build 11723 -#define POST_BC_ACCEPTED_CLIENT_BUILD {12213, 11723, 11403, 11159, 10571, 10505, 10146, 9947, 8606, 0} +#define POST_BC_ACCEPTED_CLIENT_BUILD {12340, 11723, 11403, 11159, 10571, 10505, 10146, 9947, 8606, 0} #define PRE_BC_ACCEPTED_CLIENT_BUILD {5875, 6005, 0} #define POST_BC_EXP_FLAG 0x2 diff --git a/src/server/game/Entities/Object/Updates/UpdateFields.h b/src/server/game/Entities/Object/Updates/UpdateFields.h index 09c2b3805c4..1b334967688 100644 --- a/src/server/game/Entities/Object/Updates/UpdateFields.h +++ b/src/server/game/Entities/Object/Updates/UpdateFields.h @@ -21,7 +21,7 @@ #ifndef _UPDATEFIELDS_AUTO_H #define _UPDATEFIELDS_AUTO_H -// Auto generated for version 3, 3, 3, 12213 +// Auto generated for version 3, 3, 3, 12340 enum EObjectFields { -- cgit v1.2.3 From 38316ca97bee09412efe5f1b87e21bfb194232be Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 30 Jun 2010 13:14:23 -0600 Subject: * Fix authentication for the new client * Thanks TOM_RUS --HG-- branch : trunk --- src/server/game/Server/WorldSocket.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index ac4900a0fd3..f7b128fb761 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -768,7 +768,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) // NOTE: ATM the socket is singlethread, have this in mind ... uint8 digest[20]; uint32 clientSeed; - uint32 unk2, unk3; + uint32 unk2, unk3, unk5, unk6, unk7; uint64 unk4; uint32 BuiltNumberClient; uint32 id, security; @@ -797,6 +797,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) recvPacket >> account; recvPacket >> unk3; recvPacket >> clientSeed; + recvPacket >> unk5 >> unk6 >> unk7; recvPacket >> unk4; recvPacket.read (digest, 20); -- cgit v1.2.3 From baf108e5ccc0ee42efcefa4a87e2784421df15c5 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 2 Jul 2010 01:48:49 -0600 Subject: * Updated DBC file checks for 3.3.5a --HG-- branch : trunk --- src/server/game/DataStores/DBCStores.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index bc127cb309c..4ddccd735f5 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -592,13 +592,13 @@ void LoadDBCStores(const std::string& dataPath) } // Check loaded DBC files proper version - if (!sAreaStore.LookupEntry(3617) || // last area (areaflag) added in 3.3.3a - !sCharTitlesStore.LookupEntry(177) || // last char title added in 3.3.3a - !sGemPropertiesStore.LookupEntry(1629) || // last added spell in 3.3.3a - !sItemStore.LookupEntry(54860) || // last gem property added in 3.3.3a - !sItemExtendedCostStore.LookupEntry(2997) || // last item extended cost added in 3.3.3a - !sMapStore.LookupEntry(724) || // last map added in 3.3.3a - !sSpellStore.LookupEntry(76567) ) // last client known item added in 3.3.3a + if (!sAreaStore.LookupEntry(3617) || // last area (areaflag) added in 3.3.5a + !sCharTitlesStore.LookupEntry(177) || // last char title added in 3.3.5a + !sGemPropertiesStore.LookupEntry(1629) || // last added spell in 3.3.5a + !sItemStore.LookupEntry(56806) || // last gem property added in 3.3.5a + !sItemExtendedCostStore.LookupEntry(2997) || // last item extended cost added in 3.3.5a + !sMapStore.LookupEntry(724) || // last map added in 3.3.5a + !sSpellStore.LookupEntry(80864) ) // last client known item added in 3.3.5a { sLog.outError("\nYou have _outdated_ DBC files. Please extract correct versions from current using client."); exit(1); -- cgit v1.2.3 From 09c84f0a24d9345695610b5884220fb28d425c33 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 8 Jul 2010 07:13:35 -0600 Subject: * Fix typo --HG-- branch : trunk --- src/server/game/Entities/Player/SocialMgr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/SocialMgr.h b/src/server/game/Entities/Player/SocialMgr.h index 9b1176baab9..1f40fcf28e9 100644 --- a/src/server/game/Entities/Player/SocialMgr.h +++ b/src/server/game/Entities/Player/SocialMgr.h @@ -44,7 +44,7 @@ enum SocialFlag SOCIAL_FLAG_FRIEND = 0x01, SOCIAL_FLAG_IGNORED = 0x02, SOCIAL_FLAG_MUTED = 0x04, // guessed - SOCAIL_FLAG_RAF = 0x08 // Recruit A Friend + SOCIAL_FLAG_RAF = 0x08 // Recruit A Friend }; struct FriendInfo -- cgit v1.2.3 From 5f119652ea719273b899872069350417fbe83e66 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 8 Jul 2010 12:43:13 -0600 Subject: * Proper quest reputation reward post 3.3.0 * Will require a DB update for all quest_templates that are pre 3.3.0 --HG-- branch : trunk --- src/server/game/Entities/Player/Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index bca7ba5ab97..927cd189e30 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -6536,7 +6536,7 @@ void Player::RewardReputation(Quest const *pQuest) continue; if (pQuest->RewRepValue[i]) { - int32 rep = CalculateReputationGain(GetQuestLevel(pQuest), pQuest->RewRepValue[i], pQuest->RewRepFaction[i], true); + int32 rep = CalculateReputationGain(GetQuestLevel(pQuest), pQuest->RewRepValue[i]/100, pQuest->RewRepFaction[i], true); if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(pQuest->RewRepFaction[i])) GetReputationMgr().ModifyReputation(factionEntry, rep); } -- cgit v1.2.3 From fe39f4f59ab7358510c417db64eb065ade345bb4 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 8 Jul 2010 12:46:04 -0600 Subject: * Version update --HG-- branch : trunk --- src/server/game/Entities/Object/Updates/UpdateFields.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Updates/UpdateFields.h b/src/server/game/Entities/Object/Updates/UpdateFields.h index 1b334967688..ecef0276e7a 100644 --- a/src/server/game/Entities/Object/Updates/UpdateFields.h +++ b/src/server/game/Entities/Object/Updates/UpdateFields.h @@ -21,7 +21,7 @@ #ifndef _UPDATEFIELDS_AUTO_H #define _UPDATEFIELDS_AUTO_H -// Auto generated for version 3, 3, 3, 12340 +// Auto generated for version 3, 3, 5, 12340 enum EObjectFields { -- cgit v1.2.3 From 70a31424f864e29d2f672e18867f9b5e9b9cdfd8 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 9 Jul 2010 04:02:26 -0600 Subject: [mq]: vm3 --HG-- branch : trunk --- src/server/collision/Management/VMapManager2.cpp | 32 ++++++------ src/server/collision/Maps/MapTree.cpp | 64 ++++++++++++++---------- src/server/collision/Maps/MapTree.h | 1 + src/server/collision/Maps/TileAssembler.cpp | 28 ++++++----- src/server/collision/Models/ModelInstance.cpp | 23 +++++---- src/server/collision/Models/WorldModel.cpp | 63 +++++++++++++++++------ src/server/collision/VMapDefinitions.h | 22 ++++---- src/server/worldserver/worldserver.conf.dist | 6 +-- src/tools/vmap3_assembler/VMapAssembler.cpp | 4 +- src/tools/vmap3_extractor/dbcfile.h | 22 ++++++-- src/tools/vmap3_extractor/vmapexport.cpp | 2 +- 11 files changed, 165 insertions(+), 102 deletions(-) (limited to 'src') diff --git a/src/server/collision/Management/VMapManager2.cpp b/src/server/collision/Management/VMapManager2.cpp index 1936ba6ebba..61b202c9342 100644 --- a/src/server/collision/Management/VMapManager2.cpp +++ b/src/server/collision/Management/VMapManager2.cpp @@ -1,19 +1,19 @@ /* + * Copyright (C) 2008-2010 TrinityCore * Copyright (C) 2005-2010 MaNGOS * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #include @@ -57,7 +57,7 @@ namespace VMAP Vector3 VMapManager2::convertPositionToInternalRep(float x, float y, float z) const { Vector3 pos; - const float mid = 0.5 * 64.0 * 533.33333333f; + const float mid = 0.5f * 64.0f * 533.33333333f; pos.x = mid - x; pos.y = mid - y; pos.z = z; @@ -70,7 +70,7 @@ namespace VMAP Vector3 VMapManager2::convertPositionToMangosRep(float x, float y, float z) const { Vector3 pos; - const float mid = 0.5 * 64.0 * 533.33333333f; + const float mid = 0.5f * 64.0f * 533.33333333f; pos.x = mid - x; pos.y = mid - y; pos.z = z; @@ -301,11 +301,11 @@ namespace VMAP WorldModel *worldmodel = new WorldModel(); if (!worldmodel->readFile(basepath + filename + ".vmo")) { - sLog.outError("VMapManager2: could not load '%s%s.vmo'!", basepath.c_str(), filename.c_str()); + sLog.outError("VMapManager2: could not load '%s%s.vmo'", basepath.c_str(), filename.c_str()); delete worldmodel; return NULL; } - sLog.outDebug("VMapManager2: loading file '%s%s'.", basepath.c_str(), filename.c_str()); + sLog.outDebug("VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str()); model = iLoadedModelFiles.insert(std::pair(filename, ManagedModel())).first; model->second.setModel(worldmodel); } @@ -318,7 +318,7 @@ namespace VMAP ModelFileMap::iterator model = iLoadedModelFiles.find(filename); if (model == iLoadedModelFiles.end()) { - sLog.outError("VMapManager2: trying to unload non-loaded file '%s'!", filename.c_str()); + sLog.outError("VMapManager2: trying to unload non-loaded file '%s'", filename.c_str()); return; } if( model->second.decRefCount() == 0) diff --git a/src/server/collision/Maps/MapTree.cpp b/src/server/collision/Maps/MapTree.cpp index af92ec37ae7..e758581e2f8 100644 --- a/src/server/collision/Maps/MapTree.cpp +++ b/src/server/collision/Maps/MapTree.cpp @@ -1,19 +1,19 @@ /* + * Copyright (C) 2008-2010 TrinityCore * Copyright (C) 2005-2010 MaNGOS * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #include "MapTree.h" @@ -57,7 +57,7 @@ namespace VMAP void operator()(const Vector3& point, uint32 entry) { #ifdef VMAP_DEBUG - sLog.outDebug("trying to intersect '%s'", prims[entry].name.c_str()); + sLog.outDebug("AreaInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); #endif prims[entry].intersectPoint(point, aInfo); } @@ -73,7 +73,7 @@ namespace VMAP void operator()(const Vector3& point, uint32 entry) { #ifdef VMAP_DEBUG - sLog.outDebug("trying to intersect '%s'", prims[entry].name.c_str()); + sLog.outDebug("LocationInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); #endif if (prims[entry].GetLocationInfo(point, locInfo)) result = true; @@ -121,7 +121,7 @@ namespace VMAP } StaticMapTree::StaticMapTree(uint32 mapID, const std::string &basePath): - iMapID(mapID), /* iTree(0), */ iTreeValues(0), iBasePath(basePath) + iMapID(mapID), iTreeValues(0), iBasePath(basePath) { if (iBasePath.length() > 0 && (iBasePath[iBasePath.length()-1] != '/' || iBasePath[iBasePath.length()-1] != '\\')) { @@ -260,7 +260,11 @@ namespace VMAP if (!tf) success = false; else + { + if (!readChunk(tf, chunk, VMAP_MAGIC, 8)) + success = false; fclose(tf); + } } fclose(rf); return success; @@ -270,7 +274,7 @@ namespace VMAP bool StaticMapTree::InitMap(const std::string &fname, VMapManager2 *vm) { - sLog.outDebug("Initializing StaticMapTree '%s'", fname.c_str()); + sLog.outDebug("StaticMapTree::InitMap() : initializing StaticMapTree '%s'", fname.c_str()); bool success = true; std::string fullname = iBasePath + fname; FILE *rf = fopen(fullname.c_str(), "rb"); @@ -298,12 +302,12 @@ namespace VMAP // only non-tiled maps have them, and if so exactly one (so far at least...) ModelSpawn spawn; #ifdef VMAP_DEBUG - sLog.outDebug("Map isTiled: %u", static_cast(iIsTiled)); + sLog.outDebug("StaticMapTree::InitMap() : map isTiled: %u", static_cast(iIsTiled)); #endif if (!iIsTiled && ModelSpawn::readFromFile(rf, spawn)) { WorldModel *model = vm->acquireModelInstance(iBasePath, spawn.name); - sLog.outDebug("StaticMapTree::InitMap(): loading %s", spawn.name.c_str()); + sLog.outDebug("StaticMapTree::InitMap() : loading %s", spawn.name.c_str()); if (model) { // assume that global model always is the first and only tree value (could be improved...) @@ -313,7 +317,7 @@ namespace VMAP else { success = false; - sLog.outError("Could not acquire WorldModel pointer!"); + sLog.outError("StaticMapTree::InitMap() : could not acquire WorldModel pointer for '%s'", spawn.name.c_str()); } } @@ -349,7 +353,7 @@ namespace VMAP } if (!iTreeValues) { - sLog.outError("Tree has not been initialized! [%u,%u]", tileX, tileY); + sLog.outError("StaticMapTree::LoadMapTile() : tree has not been initialized [%u,%u]", tileX, tileY); return false; } bool result = true; @@ -358,8 +362,12 @@ namespace VMAP FILE* tf = fopen(tilefile.c_str(), "rb"); if (tf) { + char chunk[8]; + + if (!readChunk(tf, chunk, VMAP_MAGIC, 8)) + result = false; uint32 numSpawns; - if (fread(&numSpawns, sizeof(uint32), 1, tf) != 1) + if (result && fread(&numSpawns, sizeof(uint32), 1, tf) != 1) result = false; for (uint32 i=0; iacquireModelInstance(iBasePath, spawn.name); if (!model) - sLog.outError("error: could not acquire WorldModel pointer! [%u,%u]", tileX, tileY); + sLog.outError("StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [%u,%u]", tileX, tileY); // update tree uint32 referencedVal; @@ -382,7 +390,7 @@ namespace VMAP #ifdef VMAP_DEBUG if (referencedVal > iNTreeValues) { - sLog.outDebug("invalid tree element! (%u/%u)", referencedVal, iNTreeValues); + sLog.outDebug("StaticMapTree::LoadMapTile() : invalid tree element (%u/%u)", referencedVal, iNTreeValues); continue; } #endif @@ -394,9 +402,9 @@ namespace VMAP ++iLoadedSpawns[referencedVal]; #ifdef VMAP_DEBUG if (iTreeValues[referencedVal].ID != spawn.ID) - sLog.outDebug("error: trying to load wrong spawn in node!"); + sLog.outDebug("StaticMapTree::LoadMapTile() : trying to load wrong spawn in node"); else if (iTreeValues[referencedVal].name != spawn.name) - sLog.outDebug("error: name collision on GUID=%u", spawn.ID); + sLog.outDebug("StaticMapTree::LoadMapTile() : name collision on GUID=%u", spawn.ID); #endif } } @@ -417,7 +425,7 @@ namespace VMAP loadedTileMap::iterator tile = iLoadedTiles.find(tileID); if (tile == iLoadedTiles.end()) { - sLog.outError("WARNING: trying to unload non-loaded tile. Map:%u X:%u Y:%u", iMapID, tileX, tileY); + sLog.outError("StaticMapTree::UnloadMapTile() : trying to unload non-loaded tile - Map:%u X:%u Y:%u", iMapID, tileX, tileY); return; } if (tile->second) // file associated with tile @@ -427,6 +435,9 @@ namespace VMAP if (tf) { bool result=true; + char chunk[8]; + if (!readChunk(tf, chunk, VMAP_MAGIC, 8)) + result = false; uint32 numSpawns; if (fread(&numSpawns, sizeof(uint32), 1, tf) != 1) result = false; @@ -446,11 +457,10 @@ namespace VMAP fread(&referencedNode, sizeof(uint32), 1, tf); if (!iLoadedSpawns.count(referencedNode)) { - sLog.outError("Trying to unload non-referenced model '%s' (ID:%u)", spawn.name.c_str(), spawn.ID); + sLog.outError("StaticMapTree::UnloadMapTile() : trying to unload non-referenced model '%s' (ID:%u)", spawn.name.c_str(), spawn.ID); } else if (--iLoadedSpawns[referencedNode] == 0) { - //std::cout << "MapTree: removing '" << spawn.name << "' from tree\n"; iTreeValues[referencedNode].setUnloaded(); iLoadedSpawns.erase(referencedNode); } diff --git a/src/server/collision/Maps/MapTree.h b/src/server/collision/Maps/MapTree.h index 7a7af43e949..f9c51d47b95 100644 --- a/src/server/collision/Maps/MapTree.h +++ b/src/server/collision/Maps/MapTree.h @@ -22,6 +22,7 @@ #include "Define.h" #include "Dynamic/UnorderedMap.h" #include "BoundingIntervalHierarchy.h" +#include "Log.h" namespace VMAP { diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp index 0b9780130ed..c6798e70cc4 100644 --- a/src/server/collision/Maps/TileAssembler.cpp +++ b/src/server/collision/Maps/TileAssembler.cpp @@ -1,19 +1,19 @@ /* + * Copyright (C) 2008-2010 TrinityCore * Copyright (C) 2005-2010 MaNGOS * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #include "WorldModel.h" @@ -82,6 +82,7 @@ namespace VMAP // build global map tree std::vector mapSpawns; UniqueEntryMap::iterator entry; + printf("Calculating model bounds for map %u...\n", map_iter->first); for (entry = map_iter->second->UniqueEntries.begin(); entry != map_iter->second->UniqueEntries.end(); ++entry) { // M2 models don't have a bound set in WDT/ADT placement data, i still think they're not used for LoS at all on retail @@ -100,6 +101,7 @@ namespace VMAP spawnedModelFiles.insert(entry->second.name); } + printf("Creating map tree...\n", map_iter->first); BIH pTree; pTree.build(mapSpawns, BoundsTrait::getBounds); @@ -107,8 +109,6 @@ namespace VMAP std::map modelNodeIdx; for (uint32 i=0; i(mapSpawns[i]->ID, i)); - if (!modelNodeIdx.empty()) - printf("min GUID: %u, max GUID: %u\n", modelNodeIdx.begin()->first, modelNodeIdx.rbegin()->first); // write map tree file std::stringstream mapfilename; @@ -158,6 +158,8 @@ namespace VMAP StaticMapTree::unpackTileID(tile->first, x, y); tilefilename << std::setw(2) << x << "_" << std::setw(2) << y << ".vmtile"; FILE *tilefile = fopen(tilefilename.str().c_str(), "wb"); + // file header + if (success && fwrite(VMAP_MAGIC, 1, 8, tilefile) != 8) success = false; // write number of tile spawns if (success && fwrite(&nSpawns, sizeof(uint32), 1, tilefile) != 1) success = false; // write tile spawns diff --git a/src/server/collision/Models/ModelInstance.cpp b/src/server/collision/Models/ModelInstance.cpp index 677a08e147a..af32d4026e7 100644 --- a/src/server/collision/Models/ModelInstance.cpp +++ b/src/server/collision/Models/ModelInstance.cpp @@ -1,24 +1,25 @@ /* + * Copyright (C) 2008-2010 TrinityCore * Copyright (C) 2005-2010 MaNGOS * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #include "ModelInstance.h" #include "WorldModel.h" #include "MapTree.h" +#include "VMapDefinitions.h" using G3D::Vector3; using G3D::Ray; diff --git a/src/server/collision/Models/WorldModel.cpp b/src/server/collision/Models/WorldModel.cpp index 690c77577ae..0bd156fedc2 100644 --- a/src/server/collision/Models/WorldModel.cpp +++ b/src/server/collision/Models/WorldModel.cpp @@ -1,19 +1,19 @@ /* + * Copyright (C) 2008-2010 TrinityCore * Copyright (C) 2005-2010 MaNGOS * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #include "WorldModel.h" @@ -148,15 +148,48 @@ namespace VMAP bool WmoLiquid::GetLiquidHeight(const Vector3 &pos, float &liqHeight) const { - uint32 tx = (pos.x - iCorner.x)/LIQUID_TILE_SIZE; + float tx_f = (pos.x - iCorner.x)/LIQUID_TILE_SIZE; + uint32 tx = uint32(tx_f); if (tx<0 || tx >= iTilesX) return false; - uint32 ty = (pos.y - iCorner.y)/LIQUID_TILE_SIZE; + float ty_f = (pos.y - iCorner.y)/LIQUID_TILE_SIZE; + uint32 ty = uint32(ty_f); if (ty<0 || ty >= iTilesY) return false; + + // check if tile shall be used for liquid level // checking for 0x08 *might* be enough, but disabled tiles always are 0x?F: if ((iFlags[tx + ty*iTilesX] & 0x0F) == 0x0F) return false; - //placeholder...use only lower left corner vertex - liqHeight = /* iCorner.z + */ iHeight[tx + ty*(iTilesX+1)]; + + // (dx, dy) coordinates inside tile, in [0,1]^2 + float dx = tx_f - (float)tx; + float dy = ty_f - (float)ty; + + /* Tesselate tile to two triangles (not sure if client does it exactly like this) + + ^ dy + | + 1 x---------x (1,1) + | (b) / | + | / | + | / | + | / (a) | + x---------x---> dx + 0 1 + */ + + const uint32 rowOffset = iTilesX + 1; + if (dx > dy) // case (a) + { + float sx = iHeight[tx+1 + ty * rowOffset] - iHeight[tx + ty * rowOffset]; + float sy = iHeight[tx+1 + (ty+1) * rowOffset] - iHeight[tx+1 + ty * rowOffset]; + liqHeight = iHeight[tx + ty * rowOffset] + dx * sx + dy * sy; + } + else // case (b) + { + float sx = iHeight[tx+1 + (ty+1) * rowOffset] - iHeight[tx + (ty+1) * rowOffset]; + float sy = iHeight[tx + (ty+1) * rowOffset] - iHeight[tx + ty * rowOffset]; + liqHeight = iHeight[tx + ty * rowOffset] + dx * sx + dy * sy; + } return true; } diff --git a/src/server/collision/VMapDefinitions.h b/src/server/collision/VMapDefinitions.h index e4a34cc1397..5f4a976ed2a 100644 --- a/src/server/collision/VMapDefinitions.h +++ b/src/server/collision/VMapDefinitions.h @@ -1,19 +1,19 @@ /* + * Copyright (C) 2008-YYYY TrinityCore * Copyright (C) 2005-2010 MaNGOS * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ #ifndef _VMAPDEFINITIONS_H diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 3b6d20e093d..b78d8b363cd 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -177,7 +177,7 @@ EAIErrorLevel = 2 # # vmap.enableIndoorCheck # Enable/Disable VMap based indoor check to remove outdoor-only auras (mounts etc.) -# Default: 0 (disabled) +# Default: 1 (enabled) # # DetectPosCollision # Check final move position, summon position, etc for visible collision @@ -244,10 +244,10 @@ PlayerSave.Stats.MinLevel = 0 PlayerSave.Stats.SaveOnlyOnLogout = 1 vmap.enableLOS = 0 vmap.enableHeight = 0 -vmap.ignoreMapIds = "369" +vmap.ignoreMapIds = "" vmap.ignoreSpellIds = "7720" vmap.petLOS = 0 -vmap.enableIndoorCheck = 0 +vmap.enableIndoorCheck = 1 DetectPosCollision = 1 TargetPosRecalculateRange = 1.5 UpdateUptimeInterval = 10 diff --git a/src/tools/vmap3_assembler/VMapAssembler.cpp b/src/tools/vmap3_assembler/VMapAssembler.cpp index 6666b54356c..d714db5ae45 100644 --- a/src/tools/vmap3_assembler/VMapAssembler.cpp +++ b/src/tools/vmap3_assembler/VMapAssembler.cpp @@ -76,11 +76,13 @@ A '#' at the beginning of a line defines a comment return(result); } */ //======================================================= + int main(int argc, char* argv[]) { if(argc != 3 && argc != 4) { - printf("\nusage: %s [config file name]\n", argv[0]); + //printf("\nusage: %s [config file name]\n", argv[0]); + printf("\nusage: %s \n", argv[0]); return 1; } diff --git a/src/tools/vmap3_extractor/dbcfile.h b/src/tools/vmap3_extractor/dbcfile.h index 7381ab9f668..d405d6ffd60 100644 --- a/src/tools/vmap3_extractor/dbcfile.h +++ b/src/tools/vmap3_extractor/dbcfile.h @@ -1,13 +1,27 @@ +/* + * Copyright (C) 2008-2010 TrinityCore + * Copyright (C) 2005-2010 MaNGOS + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + #ifndef DBCFILE_H #define DBCFILE_H -#define __STORMLIB_SELF__ #include #include -//#include "StormLib.h" -#undef min -#undef max class DBCFile { public: diff --git a/src/tools/vmap3_extractor/vmapexport.cpp b/src/tools/vmap3_extractor/vmapexport.cpp index 82e9bd7cc7b..b82f9249f07 100644 --- a/src/tools/vmap3_extractor/vmapexport.cpp +++ b/src/tools/vmap3_extractor/vmapexport.cpp @@ -435,7 +435,7 @@ bool processArgv(int argc, char ** argv, const char *versionString) int main(int argc, char ** argv) { bool success=true; - const char *versionString = "V2.90 2010_05"; + const char *versionString = "V3.00 2010_07"; // Use command line arguments, when some if(!processArgv(argc, argv, versionString)) -- cgit v1.2.3