public void BroadcastBuffer(byte[] data, bool isThis = false/*是否也发给自己*/)
{
// this.RefreshVisibleObject();
foreach (RefreshObject o in GetVisibleList().Values)
{
BaseObject obj = o.obj;
if (obj.type == OBJECTTYPE.PLAYER && obj.GetGameSession() != null)
{
NetMsg.BaseMsg msg = new NetMsg.BaseMsg();
msg.Create(data, obj.GetGamePackKeyEx());
obj.SendData(msg.GetBuffer());
}
}
if (isThis)
{
if (this.GetGameSession() != null)
{
NetMsg.BaseMsg msg = new NetMsg.BaseMsg();
msg.Create(data, this.GetGamePackKeyEx());
this.SendData(msg.GetBuffer());
}
}
}