示例#1
0
文件: ArenaInfo.cs 项目: abel/sinan
        /// <summary>
        /// 行走坐标中转
        /// </summary>
        /// <param name="note"></param>
        public static void ArenaWalk(UserNote note)
        {
            string petid = note.GetString(0);
            Int64 point = note.GetInt64(1);

            ArenaBase model;
            if (!ArenaBusiness.ArenaList.TryGetValue(note.Player.SoleID, out model))
                return;
            //开始坐标
            Point begin = new Point();
            begin.X = Convert.ToInt32(point >> 24);
            begin.Y = Convert.ToInt32(point >> 16 & 0xff);

            //结束坐标
            Point end = new Point();
            end.X = Convert.ToInt32(point >> 8 & 0xff);
            end.Y = Convert.ToInt32(point & 0xff);
            Pet p;
            if (model.Pets.TryGetValue(petid, out p))
            {
                p.StartTime = DateTime.UtcNow;
                p.BeginPoint = model.SceneSession.ToScreen(begin);
                p.EndPoint = model.SceneSession.ToScreen(end);
                p.RangePet = note.GetString(2);
                p.PetStatus = note.GetInt32(3);
            }
            if (p != null)
            {
                if (p.PetStatus != 0)
                {
                    model.CallAll(ArenaCommand.ArenaWalkR, true, petid, point);
                }
            }
        }