5186 【测试】【1.3.100起】减少战斗广播量
| | |
| | |
|
| | | sendPack.HurtCount = len(sendPack.HurtList)
|
| | |
|
| | | PlayerControl.PyNotifyAll(curPlayer, sendPack, notifySelf=True, notifyCnt=0)
|
| | | PlayerControl.PyNotifyAll(curPlayer, sendPack, notifySelf=True, notifyCnt=-1)
|
| | |
|
| | |
|
| | | # py重现View_UseSkillPos效果,对地通知,只用于玩家
|
| | |
| | | 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):
|
| | |
| | | # 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)
|
| | |
| | |
|
| | | #是否需要通知客户端
|
| | | 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的循环记录
|
| | |
| | | DoAddBuffOver(curObj, curSkill, addBuff, buffOwner, tick)
|
| | |
|
| | | # 通知客户端
|
| | | buffState.Sync_AddBuffEx()
|
| | | #buffState.Sync_AddBuffEx()
|
| | | PYSync_RefreshBuff(curObj, addBuff, SkillCommon.GetBuffType(curSkill), notifyAll=False)
|
| | |
|
| | | #检查是否属于刷新BUFF
|
| | | #===========================================================================
|
| | |
| | |
|
| | | 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();
|
| | |
| | | sendPack.Value1 = curBuff.GetValue1();
|
| | | sendPack.Value2 = curBuff.GetValue2();
|
| | | sendPack.Layer = curBuff.GetLayer();
|
| | | if notifyAll or gameObj.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
| | | gameObj.NotifyAll(sendPack.GetBuffer(), sendPack.GetLength());
|
| | | |
| | | else:
|
| | | PlayerControl.PyNotifyAll(gameObj, sendPack, notifySelf=True, notifyCnt=-1)
|
| | |
|
| | | |