diff options
| author | n0n4m3 <none@none> | 2010-04-11 11:11:32 +0400 |
|---|---|---|
| committer | n0n4m3 <none@none> | 2010-04-11 11:11:32 +0400 |
| commit | 8db7c06e6b16728eca499d29bb136980d714313b (patch) | |
| tree | a06f96173df6f3f23aa2c5a51effa1fd69bd3dcd /src/game | |
| parent | 36e13c1d1c615d89c1e18add73411c0525ecbf08 (diff) | |
Fix Auth on server also some fixes and cleanups. Big thx to TOM_RUS.
--HG--
branch : trunk
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/BattleGroundMgr.cpp | 4 | ||||
| -rw-r--r-- | src/game/DBCEnums.h | 8 | ||||
| -rw-r--r-- | src/game/DBCStructure.h | 20 | ||||
| -rw-r--r-- | src/game/DBCfmt.h | 4 | ||||
| -rw-r--r-- | src/game/Item.cpp | 4 | ||||
| -rw-r--r-- | src/game/Mail.cpp | 2 | ||||
| -rw-r--r-- | src/game/MiscHandler.cpp | 21 | ||||
| -rw-r--r-- | src/game/Opcodes.h | 22 | ||||
| -rw-r--r-- | src/game/Player.cpp | 25 | ||||
| -rw-r--r-- | src/game/Player.h | 6 | ||||
| -rw-r--r-- | src/game/PlayerDump.cpp | 4 | ||||
| -rw-r--r-- | src/game/Unit.cpp | 8 |
12 files changed, 86 insertions, 42 deletions
diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index 98feec46da0..831ceeef761 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -1705,8 +1705,8 @@ void BattleGroundMgr::CreateInitialBattleGrounds() //check values from DB if (MaxPlayersPerTeam == 0 || MinPlayersPerTeam == 0 || MinPlayersPerTeam > MaxPlayersPerTeam) { - MaxPlayersPerTeam = bl->maxplayersperteam; - MinPlayersPerTeam = bl->maxplayersperteam / 2; + MinPlayersPerTeam = 0; // by default now expected strong full bg requirement + MaxPlayersPerTeam = 40; } if (MinLvl == 0 || MaxLvl == 0 || MinLvl > MaxLvl) { diff --git a/src/game/DBCEnums.h b/src/game/DBCEnums.h index 3a3a46fdfaa..ba38e63fb5d 100644 --- a/src/game/DBCEnums.h +++ b/src/game/DBCEnums.h @@ -209,8 +209,12 @@ enum AchievementCriteriaTypes // 0..115 => 116 criteria types total ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS = 115, ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS = 119, - // 0..119 => 120 criteria types total - ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 120, + // 120 + // 121 + // 122 + // 123 + // 0..123 => 124 criteria types total + ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 124, }; enum AreaFlags diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 1e6a349c2ea..66a049b4c49 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -596,13 +596,13 @@ struct BattlemasterListEntry uint32 id; // 0 int32 mapid[8]; // 1-8 mapid uint32 type; // 9 (3 - BG, 4 - arena) - uint32 maxplayersperteam; // 10 - //uint32 unk1; // 11 (0 or 1) - char* name[16]; // 12-27 - // 28 string flag, unused - // 29 unused - //uint32 unk2; // 30 new 3.1 - + //uint32 canJoinAsGroup; // 10 (0 or 1) + char* name[16]; // 11-26 + //uint32 nameFlags // 27 string flag, unused + //uint32 maxGroupSize // 28 maxGroupSize, used for checking if queue as group + //uint32 HolidayWorldStateId; // 29 new 3.1 + //uint32 MinLevel; // 30 + //uint32 SomeLevel; // 31, may be max level }; #define MAX_OUTFIT_ITEMS 24 @@ -1434,8 +1434,8 @@ struct SpellEntry int32 EquippedItemInventoryTypeMask; // 70 m_equippedItemInvTypes (mask) uint32 Effect[MAX_SPELL_EFFECTS]; // 71-73 m_effect int32 EffectDieSides[MAX_SPELL_EFFECTS]; // 74-76 m_effectDieSides - int32 EffectBaseDice[MAX_SPELL_EFFECTS]; // 77-79 m_effectBaseDice - float EffectDicePerLevel[MAX_SPELL_EFFECTS]; // 80-82 m_effectDicePerLevel + //int32 EffectBaseDice[MAX_SPELL_EFFECTS]; // 77-79 m_effectBaseDice + //float EffectDicePerLevel[MAX_SPELL_EFFECTS]; // 80-82 m_effectDicePerLevel float EffectRealPointsPerLevel[MAX_SPELL_EFFECTS]; // 83-85 m_effectRealPointsPerLevel int32 EffectBasePoints[MAX_SPELL_EFFECTS]; // 86-88 m_effectBasePoints (don't must be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints) uint32 EffectMechanic[MAX_SPELL_EFFECTS]; // 89-91 m_effectMechanic @@ -1525,7 +1525,7 @@ struct SpellEntry //uint32 spellDescriptionVariableID; // 238 3.2.0 */ // helpers - int32 CalculateSimpleValue(uint8 eff) const { return EffectBasePoints[eff]+int32(EffectBaseDice[eff]); } + int32 CalculateSimpleValue(uint8 eff) const { return EffectBasePoints[eff]+int32(1); } private: // prevent creating custom entries (copy data from original in fact) diff --git a/src/game/DBCfmt.h b/src/game/DBCfmt.h index 104099e83d9..98a71f3bbce 100644 --- a/src/game/DBCfmt.h +++ b/src/game/DBCfmt.h @@ -30,7 +30,7 @@ const char AreaTriggerEntryfmt[]="niffffffff"; const char AuctionHouseEntryfmt[]="niiixxxxxxxxxxxxxxxxx"; const char BankBagSlotPricesEntryfmt[]="ni"; const char BarberShopStyleEntryfmt[]="nixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiii"; -const char BattlemasterListEntryfmt[]="niiiiiiiiiixssssssssssssssssxxx"; +const char BattlemasterListEntryfmt[]="niiiiiiiiixssssssssssssssssxxxxx"; const char CharStartOutfitEntryfmt[]="diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char CharTitlesEntryfmt[]="nxssssssssssssssssxxxxxxxxxxxxxxxxxxi"; const char ChatChannelsEntryfmt[]="iixssssssssssssssssxxxxxxxxxxxxxxxxxx"; @@ -93,7 +93,7 @@ const char SpellDifficultyfmt[]="niiii"; const std::string CustomSpellDifficultyfmt="ppppp"; const std::string CustomSpellDifficultyIndex="id"; const char SpellDurationfmt[]="niii"; -const char SpellEntryfmt[]="niiiiiiiiiiiixixiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifxiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffffffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiifffiiiiiiiiiiiiixssssssssssssssssxssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiixfffxxxiiiiixxxxxxx"; +const char SpellEntryfmt[]="niiiiiiiiiixixixiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifxiiiiiiiiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiifffiiiiiiiiiiiiixssssssssssssssssxssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiixfffxxxiiiiixxxxxxx"; const std::string CustomSpellEntryfmt="pappppppppaaaaaapaaaaaaaaaaapaaapapppppppaaaaapaapaaaaaaaaaaaaaaaaaappppppppppppppppppppppppppppppppppppppppppaaaaaapppppppppaaapppppppppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaappppppppapppaaaaappaaaaaaa"; const std::string CustomSpellEntryIndex = "Id"; const char SpellFocusObjectfmt[]="nxxxxxxxxxxxxxxxxx"; diff --git a/src/game/Item.cpp b/src/game/Item.cpp index 76f1e3363c0..8a20fa91973 100644 --- a/src/game/Item.cpp +++ b/src/game/Item.cpp @@ -330,8 +330,8 @@ void Item::SaveToDB() }break; case ITEM_REMOVED: { - if (GetUInt32Value(ITEM_FIELD_ITEM_TEXT_ID) > 0) - CharacterDatabase.PExecute("DELETE FROM item_text WHERE id = '%u'", GetUInt32Value(ITEM_FIELD_ITEM_TEXT_ID)); + //if (GetUInt32Value(ITEM_FIELD_ITEM_TEXT_ID) > 0) + // CharacterDatabase.PExecute("DELETE FROM item_text WHERE id = '%u'", GetUInt32Value(ITEM_FIELD_ITEM_TEXT_ID)); CharacterDatabase.PExecute("DELETE FROM item_instance WHERE guid = '%u'", guid); if (HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPED)) CharacterDatabase.PExecute("DELETE FROM character_gifts WHERE item_guid = '%u'", GetGUIDLow()); diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp index 580da280a2a..448a90cd582 100644 --- a/src/game/Mail.cpp +++ b/src/game/Mail.cpp @@ -717,7 +717,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data) return; } - bodyItem->SetUInt32Value(ITEM_FIELD_ITEM_TEXT_ID , itemTextId); + //bodyItem->SetUInt32Value(ITEM_FIELD_ITEM_TEXT_ID , itemTextId); bodyItem->SetUInt32Value(ITEM_FIELD_CREATOR, m->sender); sLog.outDetail("HandleMailCreateTextItem mailid=%u",mailId); diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index 1e8e0e7ea3b..a6d4452df32 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -1443,13 +1443,20 @@ void WorldSession::HandleTimeSyncResp(WorldPacket & recv_data) { sLog.outDebug("CMSG_TIME_SYNC_RESP"); - uint32 counter, time_; - recv_data >> counter >> time_; - - // time_ seems always more than getMSTime() - uint32 diff = getMSTimeDiff(getMSTime(),time_); - - sLog.outDebug("response sent: counter %u, time %u (HEX: %X), ms. time %u, diff %u", counter, time_, time_, getMSTime(), diff); + uint32 counter, clientTicks; + recv_data >> counter >> clientTicks; + + if (counter != _player->m_timeSyncCounter - 1) + sLog.outDebug("Wrong time sync counter from player %s (cheater?)", _player->GetName()); + + sLog.outDebug("Time sync received: counter %u, client ticks %u, time since last sync %u", counter, clientTicks, clientTicks - _player->m_timeSyncClient); + + uint32 ourTicks = clientTicks + (getMSTime() - _player->m_timeSyncServer); + + // diff should be small + sLog.outDebug("Our ticks: %u, diff %u, latency %u", ourTicks, ourTicks - clientTicks, GetLatency()); + + _player->m_timeSyncClient = clientTicks; } void WorldSession::HandleResetInstancesOpcode(WorldPacket & /*recv_data*/) diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index 32949eb4731..99817661b91 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -1322,8 +1322,26 @@ enum Opcodes UMSG_UNKNOWN_1283 = 0x503, UMSG_UNKNOWN_1284 = 0x504, UMSG_UNKNOWN_1285 = 0x505, - UMSG_UNKNOWN_1286 = 0x506, - NUM_MSG_TYPES = 0x507 + SMSG_UNKNOWN_1286 = 0x506, // ERR_CORPSE_IS_NOT_IN_INSTANCE = 0x1A8, + UMSG_UNKNOWN_1287 = 0x507, // not found + CMSG_UNKNOWN_1288 = 0x508, // lua: SetAllowLowLevelRaid + CMSG_UNKNOWN_1289 = 0x509, // lua: SetAllowLowLevelRaid + SMSG_UNKNOWN_1290 = 0x50A, // camera shake? + SMSG_UNKNOWN_1291 = 0x50B, // some item update packet? + UMSG_UNKNOWN_1292 = 0x50C, // not found + UMSG_UNKNOWN_1293 = 0x50D, // not found - disconnect + CMSG_UNKNOWN_1294 = 0x50E, // something with networking + UMSG_UNKNOWN_1295 = 0x50F, // not found - disconnect + CMSG_UNKNOWN_1296 = 0x510, // something with networking + UMSG_UNKNOWN_1297 = 0x511, // not found - crash + CMSG_UNKNOWN_1298 = 0x512, // something with networking + UMSG_UNKNOWN_1299 = 0x513, // not found + SMSG_UNKNOWN_1300 = 0x514, // SMSG + SMSG_UNKNOWN_1301 = 0x515, // event 0x204 (opens dungeon finder, probably for outdoor bosses) + SMSG_UNKNOWN_1302 = 0x516, // something with player movement (move event 58?) + CMSG_UNKNOWN_1303 = 0x517, // something with player movement (move event 58?) + SMSG_UNKNOWN_1304 = 0x518, // something with player movement (move event 58?), speed packet + NUM_MSG_TYPES = 0x519 }; /// Player state diff --git a/src/game/Player.cpp b/src/game/Player.cpp index a8d719b25da..b092a2b6a20 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -1607,8 +1607,18 @@ bool Player::BuildEnumData(QueryResult_AutoPtr result, WorldPacket * p_data) *p_data << uint8(proto->InventoryType); *p_data << uint32(enchant ? enchant->aura_id : 0); } - *p_data << uint32(0); // first bag display id - *p_data << uint8(0); // first bag inventory type + + *p_data << uint32(0); // bag 1 display id + *p_data << uint8(0); // bag 1 inventory type + *p_data << uint32(0); // enchant? + *p_data << uint32(0); // bag 2 display id + *p_data << uint8(0); // bag 2 inventory type + *p_data << uint32(0); // enchant? + *p_data << uint32(0); // bag 3 display id + *p_data << uint8(0); // bag 3 inventory type + *p_data << uint32(0); // enchant? + *p_data << uint32(0); // bag 4 display id + *p_data << uint8(0); // bag 4 inventory type *p_data << uint32(0); // enchant? return true; @@ -23343,18 +23353,21 @@ void Player::ActivateSpec(uint8 spec) void Player::ResetTimeSync() { - m_timeSyncCount = 0; + m_timeSyncCounter = 0; m_timeSyncTimer = 0; + m_timeSyncClient = 0; + m_timeSyncServer = getMSTime(); } void Player::SendTimeSync() { WorldPacket data(SMSG_TIME_SYNC_REQ, 4); - data << uint32(m_timeSyncCount++); + data << uint32(m_timeSyncCounter++); GetSession()->SendPacket(&data); - // Send another opcode in 10s again - m_timeSyncTimer = 10000; + // Schedule next sync in 10 sec + m_timeSyncTimer = 10000; + m_timeSyncServer = getMSTime(); } void Player::SetReputation(uint32 factionentry, uint32 value) diff --git a/src/game/Player.h b/src/game/Player.h index 4e92c6e0774..93574049bad 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -2618,8 +2618,10 @@ class Player : public Unit, public GridObject<Player> uint32 m_ChampioningFaction; - uint32 m_timeSyncCount; - uint32 m_timeSyncTimer; + uint32 m_timeSyncCounter; + uint32 m_timeSyncTimer; + uint32 m_timeSyncClient; + uint32 m_timeSyncServer; }; void AddItemsSetItem(Player*player,Item *item); diff --git a/src/game/PlayerDump.cpp b/src/game/PlayerDump.cpp index 2ec23b6bd05..e28f96c1267 100644 --- a/src/game/PlayerDump.cpp +++ b/src/game/PlayerDump.cpp @@ -312,8 +312,8 @@ void PlayerDumpWriter::DumpTable(std::string& dump, uint32 guid, char const*tabl { case DTT_INVENTORY: StoreGUID(result,3,items); break; // item guid collection - case DTT_ITEM: - StoreGUID(result,0,ITEM_FIELD_ITEM_TEXT_ID,texts); break; + //case DTT_ITEM: + //StoreGUID(result,0,ITEM_FIELD_ITEM_TEXT_ID,texts); break; // item text id collection case DTT_PET: StoreGUID(result,0,pets); break; // pet guid collection diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index ef4d0994b70..4b57fcbb76e 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -12240,14 +12240,14 @@ int32 Unit::CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_inde level -= int32(spellProto->spellLevel); float basePointsPerLevel = spellProto->EffectRealPointsPerLevel[effect_index]; - float randomPointsPerLevel = spellProto->EffectDicePerLevel[effect_index]; + float randomPointsPerLevel = 1; int32 basePoints = int32(effBasePoints + level * basePointsPerLevel); int32 randomPoints = int32(spellProto->EffectDieSides[effect_index] + level * randomPointsPerLevel); // range can have possitive and negative values, so order its for irand - int32 randvalue = int32(spellProto->EffectBaseDice[effect_index]) >= randomPoints - ? irand(randomPoints, int32(spellProto->EffectBaseDice[effect_index])) - : irand(int32(spellProto->EffectBaseDice[effect_index]), randomPoints); + int32 randvalue = int32(1) >= randomPoints + ? irand(randomPoints, int32(1)) + : irand(int32(1), randomPoints); int32 value = basePoints + randvalue; //random damage |
