From fcb20c084df8e7f61e01c5b9920875d669aa87ce Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 03 十二月 2018 16:00:12 +0800
Subject: [PATCH] 5186 【测试】【1.3.100起】减少战斗广播量

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py      |   14 ++++++++------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py    |    2 +-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py      |    2 +-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py |    2 +-
 4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py
index 5eece2f..82323c4 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py
@@ -2600,7 +2600,7 @@
         
     sendPack.HurtCount = len(sendPack.HurtList)
 
-    PlayerControl.PyNotifyAll(curPlayer, sendPack, notifySelf=True, notifyCnt=0)
+    PlayerControl.PyNotifyAll(curPlayer, sendPack, notifySelf=True, notifyCnt=-1)
 
 
 # py重现View_UseSkillPos效果,对地通知,只用于玩家
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
index 853f5b2..32cc61d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -5652,7 +5652,7 @@
     sendPack.Speed = curPlayer.GetSpeed()
     sendPack.MoveType = moveType
     # NotifyAll 做过滤或者数量处理
-    PlayerControl.PyNotifyAll(curPlayer, sendPack, False, -1)
+    PlayerControl.PyNotifyAll(curPlayer, sendPack, False, 0)
     return
 
 def GetDownloadAward(curPlayer, dataEx):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
index 8a76e92..c2a52b5 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -162,7 +162,7 @@
 # notifyCnt 代表广播周围玩家的数量,0为全部广播 -1为指定列表随机, 其他数字为指定指
 def PyNotifyAll(curPlayer, sendPack, notifySelf=True, notifyCnt=0):
     if notifyCnt == -1:
-        notifyCnt = random.choice((10, 10, 15, 15, 20, 25, 30, 50))
+        notifyCnt = random.choice((6, 6, 10, 10, 20))
     #GameWorld.DebugLog("PyNotifyAll %s"%notifyCnt)
 
     curPlayer.NotifyAll(sendPack.GetBuffer(), sendPack.GetLength(), notifySelf, notifyCnt)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py
index 004abbd..36ee986 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/BuffSkill.py
@@ -310,7 +310,7 @@
 
     #是否需要通知客户端
     isNotify = True if curSkill.GetClientEffectType() != 0 else False
-    addBuff = buffState.AddBuffEx(skillID, tick, isNotify)
+    addBuff = buffState.AddBuff(skillID, tick, False)
     buffIndex = buffState.GetBuffCount()    # buff在管理器中的索引
     if updProcessInterval > 0:
         # 继承上一个buff的循环记录
@@ -370,7 +370,8 @@
     DoAddBuffOver(curObj, curSkill, addBuff, buffOwner, tick)
         
     # 通知客户端
-    buffState.Sync_AddBuffEx()
+    #buffState.Sync_AddBuffEx()
+    PYSync_RefreshBuff(curObj, addBuff, SkillCommon.GetBuffType(curSkill), notifyAll=False)
 
     #检查是否属于刷新BUFF
     #===========================================================================
@@ -907,9 +908,8 @@
     
     return DelBuffBySkillID(curObj, skillID, tick)
 
-def PYSync_RefreshBuff(gameObj, curBuff, buffType):
+def PYSync_RefreshBuff(gameObj, curBuff, buffType, notifyAll=True):
     sendPack = ChNetSendPack.tagObjAddBuff()
-    sendPack
 
     sendPack.ObjType = gameObj.GetGameObjType()
     sendPack.ObjID = gameObj.GetID();
@@ -920,7 +920,9 @@
     sendPack.Value1 = curBuff.GetValue1();
     sendPack.Value2 = curBuff.GetValue2();
     sendPack.Layer = curBuff.GetLayer();
-    gameObj.NotifyAll(sendPack.GetBuffer(), sendPack.GetLength());
-    
+    if notifyAll or gameObj.GetGameObjType() != IPY_GameWorld.gotPlayer:
+        gameObj.NotifyAll(sendPack.GetBuffer(), sendPack.GetLength());
+    else:
+        PlayerControl.PyNotifyAll(gameObj, sendPack, notifySelf=True, notifyCnt=-1)
     
     
\ No newline at end of file

--
Gitblit v1.8.0