当前位置:首页>>魔兽单机>>正文
模拟器:防止无限刷副本BUG的修改代码-参考
2013-07-05 17:20:27 作者:网络 来源: 浏览次数:0
摘要:防止无限刷副本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);
+}
 


相关报道:

[关闭] [返回顶部]


  返回首页 | 最新资讯 | 资源下载 | 魔兽图片 | 单机文档 | 技术攻略 | 玩家视频
备案号:蜀ICP备2024062380号-1
免责声明:本网站为热爱怀旧WOW的玩家们建立的魔兽世界资料网站,仅供交流和学习使用,非盈利和商用.如有侵权之处,请联系我们,我们会在24小时内确认删除侵权内容,谢谢合作。
Copyright © 2024 - 2024 WOWAII.COM Corporation, All Rights Reserved

机器人国度