Example #1
0
        public void QueryGlobalMapPath(Iocp.TcpConnect connect, UInt16 serialId, ulong planesId, ulong mapSourceId, ulong roleId, SlimDX.Vector3 from, SlimDX.Vector3 to, bool bClear)
        {
            PFPlanes planes;

            if (PlanesDic.TryGetValue(planesId, out planes) == false)
            {
                planes          = new PFPlanes();
                planes.PlanesId = planesId;
                PlanesDic.Add(planesId, planes);

                var thread = SelectPFThread();
                thread.PushPlanes(planes);
            }

            PFMap map = planes.GetMap(mapSourceId);

            PFUnit unit = map.GetUnit(roleId);

            PFQuery query = new PFQuery();

            query.FromPt   = from;
            query.ToPt     = to;
            query.Connect  = connect;
            query.SerialId = serialId;
            unit.AddQuery(query, bClear);
        }
Example #2
0
        public PFUnit GetUnit(ulong roleId)
        {
            lock (this)
            {
                PFUnit unit;
                if (Units.TryGetValue(roleId, out unit) == true)
                {
                    return(unit);
                }
                foreach (var i in PushingUnit)
                {
                    if (i.RoleId == roleId)
                    {
                        return(i);
                    }
                }

                unit        = new PFUnit();
                unit.RoleId = roleId;
                PushingUnit.Add(unit);
                return(unit);
            }
        }