Esempio n. 1
0
        public void Update()
        {
            var ids = new List <Guid>();

            foreach (var e in _Exists)
            {
                if (e.Value.IsAlive == false)
                {
                    ids.Add(e.Key);
                }
            }

            foreach (var id in ids)
            {
                /*var args = new Dictionary<byte, byte[]>();
                 * args[0] = id.ToByteArray();*/


                _Exists.Remove(id);


                if (_Requester != null)
                {
                    var data = new PackageRelease();
                    data.EntityId = id;
                    _Requester.Request(ClientToServerOpCode.Release, data.ToBuffer(_Serializer));
                }
            }
        }
Esempio n. 2
0
        public void Update()
        {
            List <long> ids = new List <long>();

            foreach (KeyValuePair <long, WeakReference <IGhost> > e in _Exists)
            {
                IGhost target = null;


                if (!e.Value.TryGetTarget(out target))
                {
                    ids.Add(e.Key);
                }
            }

            foreach (long id in ids)
            {
                _Exists.Remove(id);


                if (_Requester != null)
                {
                    PackageRelease data = new PackageRelease();
                    data.EntityId = id;
                    _Requester.Request(ClientToServerOpCode.Release, data.ToBuffer(_Serializer));
                }
            }
        }