MapServer.PlayerObject.BroadcastBuffer C# (CSharp) 메소드

BroadcastBuffer() 공개 메소드

public BroadcastBuffer ( byte data, bool isThis = false ) : void
data byte
isThis bool
리턴 void
        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());
                }

            }
        }