吾爱尚玩资源基地
标题:
魔兽私服模拟器:防止无限刷副本BUG的修改代码-参考
[打印本页]
作者:
admin
时间:
2016-4-18 22:34
标题:
魔兽私服模拟器:防止无限刷副本BUG的修改代码-参考
Index: MiscHandler.cpp===================================================================
--- MiscHandler.cpp (revision 573)
+++ MiscHandler.cpp (working copy)
@@ -1442,12 +1442,35 @@
{
sLog.outDebug("WORLD: CMSG_RESET_INSTANCES");
- if(Group *pGroup = _player->GetGroup())
+ Map *map = _player->GetMap();
+ Group *pGroup = _player->GetGroup(); //防止无限刷副本BUG Fiver
+ if(pGroup)
{
if(pGroup->IsLeader(_player->GetGUID()))
{
- pGroup->ResetInstances(INSTANCE_RESET_ALL, false, _player);
- pGroup->ResetInstances(INSTANCE_RESET_ALL, true,_player);
+ for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
+ { //防止无限刷副本BUG Fiver
+ Player* pGroupGuy = itr->getSource();
+ if(!pGroupGuy)
+ continue;
+
+ if(!pGroupGuy->IsInMap(pGroupGuy))
+ break;
+
+ map = pGroupGuy->GetMap();
+ if(map && map->IsRaidOrHeroicDungeon() )
+ {
+ sLog.outError("WorldSession::HandleSetDungeonDifficultyOpcode:MgCore_1: player %d tried to reset the instance while inside!", _player->GetGUIDLow());
+ //KickPlayer();
+ break;
+ }
+ else
+ {
+ sLog.outError("Still reset ?? strange_3");
+ pGroup->ResetInstances(INSTANCE_RESET_ALL, false, _player);
+ pGroup->ResetInstances(INSTANCE_RESET_ALL, true,_player);
+ }
+ }
}
}
else
@@ -1484,14 +1507,37 @@
if(_player->getLevel() < LEVELREQUIREMENT_HEROIC)
return;
- if(Group *pGroup = _player->GetGroup())
+ Group *pGroup = _player->GetGroup(); //防止无限刷副本BUG Fiver
+ if(pGroup)
{
if(pGroup->IsLeader(_player->GetGUID()))
{
- // the difficulty is set even if the instances can't be reset
- //_player->SendDungeonDifficulty(true);
- pGroup->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, false, _player);
- pGroup->SetDungeonDifficulty(Difficulty(mode));
+ for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
+ { //防止无限刷副本BUG Fiver
+ Player* pGroupGuy = itr->getSource();
+ if(!pGroupGuy)
+ continue;
+
+ if(!pGroupGuy->IsInMap(pGroupGuy))
+ break;
+
+ map = pGroupGuy->GetMap();
+ if(map && map->IsRaidOrHeroicDungeon() )
+ {
+ sLog.outError("WorldSession::HandleSetDungeonDifficultyOpcode:MgCore: player %d tried to reset the instance while inside!", _player->GetGUIDLow());
+ //KickPlayer();
+ break;
+ }
+ else if (!map->IsRaidOrHeroicDungeon())
+ {
+ sLog.outError("Still reset ?? strange_2");
+ // the difficulty is set even if the instances can't be reset
+ //_player->SendDungeonDifficulty(true);
+ pGroup->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, false, _player);
+ pGroup->SetDungeonDifficulty(Difficulty(mode));
+ break;
+ }
+ } //防止无限刷副本BUG Fiver
}
}
else
@@ -1528,14 +1574,38 @@
if(_player->getLevel() < LEVELREQUIREMENT_HEROIC)
return;
- if(Group *pGroup = _player->GetGroup())
+ Group *pGroup = _player->GetGroup();
+ if(pGroup) //防止无限刷副本BUG Fiver
{
if(pGroup->IsLeader(_player->GetGUID()))
{
- // the difficulty is set even if the instances can't be reset
- //_player->SendDungeonDifficulty(true);
- pGroup->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, true, _player);
- pGroup->SetRaidDifficulty(Difficulty(mode));
+ for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
+ { //防止无限刷副本BUG Fiver
+ Player* pGroupGuy = itr->getSource();
+ if(!pGroupGuy)
+ continue;
+
+ if(!pGroupGuy->IsInMap(pGroupGuy))
+ break;
+
+ map = pGroupGuy->GetMap();
+ if( map && map->IsRaidOrHeroicDungeon() )
+ {
+ sLog.outError("WorldSession::HandleSetDungeonDifficultyOpcode::MgCore_2: player %d tried to reset the instance while inside!", _player->GetGUIDLow());
+ //KickPlayer();
+ break;
+ }
+ else if (!map->IsRaidOrHeroicDungeon())
+ {
+ sLog.outError("Still reset ?? straing");
+ // the difficulty is set even if the instances can't be reset
+ //_player->SendDungeonDifficulty(true);
+ pGroup->ResetInstances(INSTANCE_RESET_CHANGE_DIFFICULTY, true, _player);
+ pGroup->SetRaidDifficulty(Difficulty(mode));
+ break;
+ }
+ } //防止无限刷副本BUG Fiver
+
}
}
else
@@ -1579,9 +1649,10 @@
recv_data.read_skip<uint32>(); // unk
MovementInfo movementInfo;
+ movementInfo.guid = guid;
ReadMovementInfo(recv_data, &movementInfo);
- recv_data.read_skip<uint32>(); // unk2
+ recv_data.read_skip<float>(); // unk2
_player->m_movementInfo.SetMovementFlags(movementInfo.GetMovementFlags());
}
@@ -1621,3 +1692,11 @@
data << uint32(time(NULL));
SendPacket(&data);
}
+
+void WorldSession::HandleReadyForAccountDataTimes(WorldPacket& recv_data)
+{
+ // empty opcode
+ sLog.outDebug("WORLD: CMSG_READY_FOR_ACCOUNT_DATA_TIMES");
+
+ SendAccountDataTimes(GLOBAL_CACHE_MASK);
+}
欢迎光临 吾爱尚玩资源基地 (http://bbs.523play.com/)
Powered by Discuz! X3.4